3 var __create = Object.create;
4 var __defProp = Object.defineProperty;
5 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6 var __getOwnPropNames = Object.getOwnPropertyNames;
7 var __getProtoOf = Object.getPrototypeOf;
8 var __hasOwnProp = Object.prototype.hasOwnProperty;
9 var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10 var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
11 get: (a2, b3) => (typeof require !== "undefined" ? require : a2)[b3]
12 }) : x2)(function(x2) {
13 if (typeof require !== "undefined") return require.apply(this, arguments);
14 throw Error('Dynamic require of "' + x2 + '" is not supported');
16 var __glob = (map2) => (path) => {
19 throw new Error("Module not found in bundle: " + path);
21 var __esm = (fn, res) => function __init() {
22 return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
24 var __commonJS = (cb, mod) => function __require2() {
25 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
27 var __export = (target, all) => {
29 __defProp(target, name, { get: all[name], enumerable: true });
31 var __copyProps = (to, from, except, desc) => {
32 if (from && typeof from === "object" || typeof from === "function") {
33 for (let key of __getOwnPropNames(from))
34 if (!__hasOwnProp.call(to, key) && key !== except)
35 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
39 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
40 // If the importer is in node compatibility mode or this is not an ESM
41 // file that has been converted to a CommonJS file using a Babel-
42 // compatible transform (i.e. "__esModule" has not been set), then set
43 // "default" to the CommonJS "module.exports" for node compatibility.
44 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
47 var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
49 // node_modules/whatwg-fetch/fetch.js
50 function isDataView(obj) {
51 return obj && DataView.prototype.isPrototypeOf(obj);
53 function normalizeName(name) {
54 if (typeof name !== "string") {
57 if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === "") {
58 throw new TypeError('Invalid character in header field name: "' + name + '"');
60 return name.toLowerCase();
62 function normalizeValue(value) {
63 if (typeof value !== "string") {
64 value = String(value);
68 function iteratorFor(items) {
71 var value = items.shift();
72 return { done: value === void 0, value };
75 if (support.iterable) {
76 iterator[Symbol.iterator] = function() {
82 function Headers(headers) {
84 if (headers instanceof Headers) {
85 headers.forEach(function(value, name) {
86 this.append(name, value);
88 } else if (Array.isArray(headers)) {
89 headers.forEach(function(header) {
90 if (header.length != 2) {
91 throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + header.length);
93 this.append(header[0], header[1]);
96 Object.getOwnPropertyNames(headers).forEach(function(name) {
97 this.append(name, headers[name]);
101 function consumed(body) {
102 if (body._noBody) return;
104 return Promise.reject(new TypeError("Already read"));
106 body.bodyUsed = true;
108 function fileReaderReady(reader) {
109 return new Promise(function(resolve, reject) {
110 reader.onload = function() {
111 resolve(reader.result);
113 reader.onerror = function() {
114 reject(reader.error);
118 function readBlobAsArrayBuffer(blob) {
119 var reader = new FileReader();
120 var promise = fileReaderReady(reader);
121 reader.readAsArrayBuffer(blob);
124 function readBlobAsText(blob) {
125 var reader = new FileReader();
126 var promise = fileReaderReady(reader);
127 var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
128 var encoding = match ? match[1] : "utf-8";
129 reader.readAsText(blob, encoding);
132 function readArrayBufferAsText(buf) {
133 var view = new Uint8Array(buf);
134 var chars = new Array(view.length);
135 for (var i3 = 0; i3 < view.length; i3++) {
136 chars[i3] = String.fromCharCode(view[i3]);
138 return chars.join("");
140 function bufferClone(buf) {
144 var view = new Uint8Array(buf.byteLength);
145 view.set(new Uint8Array(buf));
150 this.bodyUsed = false;
151 this._initBody = function(body) {
152 this.bodyUsed = this.bodyUsed;
153 this._bodyInit = body;
157 } else if (typeof body === "string") {
158 this._bodyText = body;
159 } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
160 this._bodyBlob = body;
161 } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
162 this._bodyFormData = body;
163 } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
164 this._bodyText = body.toString();
165 } else if (support.arrayBuffer && support.blob && isDataView(body)) {
166 this._bodyArrayBuffer = bufferClone(body.buffer);
167 this._bodyInit = new Blob([this._bodyArrayBuffer]);
168 } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
169 this._bodyArrayBuffer = bufferClone(body);
171 this._bodyText = body = Object.prototype.toString.call(body);
173 if (!this.headers.get("content-type")) {
174 if (typeof body === "string") {
175 this.headers.set("content-type", "text/plain;charset=UTF-8");
176 } else if (this._bodyBlob && this._bodyBlob.type) {
177 this.headers.set("content-type", this._bodyBlob.type);
178 } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
179 this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8");
184 this.blob = function() {
185 var rejected = consumed(this);
189 if (this._bodyBlob) {
190 return Promise.resolve(this._bodyBlob);
191 } else if (this._bodyArrayBuffer) {
192 return Promise.resolve(new Blob([this._bodyArrayBuffer]));
193 } else if (this._bodyFormData) {
194 throw new Error("could not read FormData body as blob");
196 return Promise.resolve(new Blob([this._bodyText]));
200 this.arrayBuffer = function() {
201 if (this._bodyArrayBuffer) {
202 var isConsumed = consumed(this);
205 } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
206 return Promise.resolve(
207 this._bodyArrayBuffer.buffer.slice(
208 this._bodyArrayBuffer.byteOffset,
209 this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
213 return Promise.resolve(this._bodyArrayBuffer);
215 } else if (support.blob) {
216 return this.blob().then(readBlobAsArrayBuffer);
218 throw new Error("could not read as ArrayBuffer");
221 this.text = function() {
222 var rejected = consumed(this);
226 if (this._bodyBlob) {
227 return readBlobAsText(this._bodyBlob);
228 } else if (this._bodyArrayBuffer) {
229 return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
230 } else if (this._bodyFormData) {
231 throw new Error("could not read FormData body as text");
233 return Promise.resolve(this._bodyText);
236 if (support.formData) {
237 this.formData = function() {
238 return this.text().then(decode);
241 this.json = function() {
242 return this.text().then(JSON.parse);
246 function normalizeMethod(method) {
247 var upcased = method.toUpperCase();
248 return methods.indexOf(upcased) > -1 ? upcased : method;
250 function Request(input, options) {
251 if (!(this instanceof Request)) {
252 throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
254 options = options || {};
255 var body = options.body;
256 if (input instanceof Request) {
257 if (input.bodyUsed) {
258 throw new TypeError("Already read");
260 this.url = input.url;
261 this.credentials = input.credentials;
262 if (!options.headers) {
263 this.headers = new Headers(input.headers);
265 this.method = input.method;
266 this.mode = input.mode;
267 this.signal = input.signal;
268 if (!body && input._bodyInit != null) {
269 body = input._bodyInit;
270 input.bodyUsed = true;
273 this.url = String(input);
275 this.credentials = options.credentials || this.credentials || "same-origin";
276 if (options.headers || !this.headers) {
277 this.headers = new Headers(options.headers);
279 this.method = normalizeMethod(options.method || this.method || "GET");
280 this.mode = options.mode || this.mode || null;
281 this.signal = options.signal || this.signal || (function() {
282 if ("AbortController" in g) {
283 var ctrl = new AbortController();
287 this.referrer = null;
288 if ((this.method === "GET" || this.method === "HEAD") && body) {
289 throw new TypeError("Body not allowed for GET or HEAD requests");
291 this._initBody(body);
292 if (this.method === "GET" || this.method === "HEAD") {
293 if (options.cache === "no-store" || options.cache === "no-cache") {
294 var reParamSearch = /([?&])_=[^&]*/;
295 if (reParamSearch.test(this.url)) {
296 this.url = this.url.replace(reParamSearch, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
298 var reQueryString = /\?/;
299 this.url += (reQueryString.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
304 function decode(body) {
305 var form = new FormData();
306 body.trim().split("&").forEach(function(bytes) {
308 var split = bytes.split("=");
309 var name = split.shift().replace(/\+/g, " ");
310 var value = split.join("=").replace(/\+/g, " ");
311 form.append(decodeURIComponent(name), decodeURIComponent(value));
316 function parseHeaders(rawHeaders) {
317 var headers = new Headers();
318 var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " ");
319 preProcessedHeaders.split("\r").map(function(header) {
320 return header.indexOf("\n") === 0 ? header.substr(1, header.length) : header;
321 }).forEach(function(line) {
322 var parts = line.split(":");
323 var key = parts.shift().trim();
325 var value = parts.join(":").trim();
327 headers.append(key, value);
329 console.warn("Response " + error.message);
335 function Response(bodyInit, options) {
336 if (!(this instanceof Response)) {
337 throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
342 this.type = "default";
343 this.status = options.status === void 0 ? 200 : options.status;
344 if (this.status < 200 || this.status > 599) {
345 throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");
347 this.ok = this.status >= 200 && this.status < 300;
348 this.statusText = options.statusText === void 0 ? "" : "" + options.statusText;
349 this.headers = new Headers(options.headers);
350 this.url = options.url || "";
351 this._initBody(bodyInit);
353 function fetch2(input, init2) {
354 return new Promise(function(resolve, reject) {
355 var request3 = new Request(input, init2);
356 if (request3.signal && request3.signal.aborted) {
357 return reject(new DOMException2("Aborted", "AbortError"));
359 var xhr = new XMLHttpRequest();
360 function abortXhr() {
363 xhr.onload = function() {
365 statusText: xhr.statusText,
366 headers: parseHeaders(xhr.getAllResponseHeaders() || "")
368 if (request3.url.indexOf("file://") === 0 && (xhr.status < 200 || xhr.status > 599)) {
369 options.status = 200;
371 options.status = xhr.status;
373 options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL");
374 var body = "response" in xhr ? xhr.response : xhr.responseText;
375 setTimeout(function() {
376 resolve(new Response(body, options));
379 xhr.onerror = function() {
380 setTimeout(function() {
381 reject(new TypeError("Network request failed"));
384 xhr.ontimeout = function() {
385 setTimeout(function() {
386 reject(new TypeError("Network request timed out"));
389 xhr.onabort = function() {
390 setTimeout(function() {
391 reject(new DOMException2("Aborted", "AbortError"));
394 function fixUrl(url) {
396 return url === "" && g.location.href ? g.location.href : url;
401 xhr.open(request3.method, fixUrl(request3.url), true);
402 if (request3.credentials === "include") {
403 xhr.withCredentials = true;
404 } else if (request3.credentials === "omit") {
405 xhr.withCredentials = false;
407 if ("responseType" in xhr) {
409 xhr.responseType = "blob";
410 } else if (support.arrayBuffer) {
411 xhr.responseType = "arraybuffer";
414 if (init2 && typeof init2.headers === "object" && !(init2.headers instanceof Headers || g.Headers && init2.headers instanceof g.Headers)) {
416 Object.getOwnPropertyNames(init2.headers).forEach(function(name) {
417 names.push(normalizeName(name));
418 xhr.setRequestHeader(name, normalizeValue(init2.headers[name]));
420 request3.headers.forEach(function(value, name) {
421 if (names.indexOf(name) === -1) {
422 xhr.setRequestHeader(name, value);
426 request3.headers.forEach(function(value, name) {
427 xhr.setRequestHeader(name, value);
430 if (request3.signal) {
431 request3.signal.addEventListener("abort", abortXhr);
432 xhr.onreadystatechange = function() {
433 if (xhr.readyState === 4) {
434 request3.signal.removeEventListener("abort", abortXhr);
438 xhr.send(typeof request3._bodyInit === "undefined" ? null : request3._bodyInit);
441 var g, support, viewClasses, isArrayBufferView, methods, redirectStatuses, DOMException2;
442 var init_fetch = __esm({
443 "node_modules/whatwg-fetch/fetch.js"() {
444 g = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || // eslint-disable-next-line no-undef
445 typeof global !== "undefined" && global || {};
447 searchParams: "URLSearchParams" in g,
448 iterable: "Symbol" in g && "iterator" in Symbol,
449 blob: "FileReader" in g && "Blob" in g && (function() {
457 formData: "FormData" in g,
458 arrayBuffer: "ArrayBuffer" in g
460 if (support.arrayBuffer) {
462 "[object Int8Array]",
463 "[object Uint8Array]",
464 "[object Uint8ClampedArray]",
465 "[object Int16Array]",
466 "[object Uint16Array]",
467 "[object Int32Array]",
468 "[object Uint32Array]",
469 "[object Float32Array]",
470 "[object Float64Array]"
472 isArrayBufferView = ArrayBuffer.isView || function(obj) {
473 return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
476 Headers.prototype.append = function(name, value) {
477 name = normalizeName(name);
478 value = normalizeValue(value);
479 var oldValue = this.map[name];
480 this.map[name] = oldValue ? oldValue + ", " + value : value;
482 Headers.prototype["delete"] = function(name) {
483 delete this.map[normalizeName(name)];
485 Headers.prototype.get = function(name) {
486 name = normalizeName(name);
487 return this.has(name) ? this.map[name] : null;
489 Headers.prototype.has = function(name) {
490 return this.map.hasOwnProperty(normalizeName(name));
492 Headers.prototype.set = function(name, value) {
493 this.map[normalizeName(name)] = normalizeValue(value);
495 Headers.prototype.forEach = function(callback, thisArg) {
496 for (var name in this.map) {
497 if (this.map.hasOwnProperty(name)) {
498 callback.call(thisArg, this.map[name], name, this);
502 Headers.prototype.keys = function() {
504 this.forEach(function(value, name) {
507 return iteratorFor(items);
509 Headers.prototype.values = function() {
511 this.forEach(function(value) {
514 return iteratorFor(items);
516 Headers.prototype.entries = function() {
518 this.forEach(function(value, name) {
519 items.push([name, value]);
521 return iteratorFor(items);
523 if (support.iterable) {
524 Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
526 methods = ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"];
527 Request.prototype.clone = function() {
528 return new Request(this, { body: this._bodyInit });
530 Body.call(Request.prototype);
531 Body.call(Response.prototype);
532 Response.prototype.clone = function() {
533 return new Response(this._bodyInit, {
535 statusText: this.statusText,
536 headers: new Headers(this.headers),
540 Response.error = function() {
541 var response = new Response(null, { status: 200, statusText: "" });
544 response.type = "error";
547 redirectStatuses = [301, 302, 303, 307, 308];
548 Response.redirect = function(url, status) {
549 if (redirectStatuses.indexOf(status) === -1) {
550 throw new RangeError("Invalid status code");
552 return new Response(null, { status, headers: { location: url } });
554 DOMException2 = g.DOMException;
558 DOMException2 = function(message, name) {
559 this.message = message;
561 var error = Error(message);
562 this.stack = error.stack;
564 DOMException2.prototype = Object.create(Error.prototype);
565 DOMException2.prototype.constructor = DOMException2;
567 fetch2.polyfill = true;
572 g.Response = Response;
577 // node_modules/abortcontroller-polyfill/dist/polyfill-patch-fetch.js
578 var init_polyfill_patch_fetch = __esm({
579 "node_modules/abortcontroller-polyfill/dist/polyfill-patch-fetch.js"() {
581 typeof define === "function" && define.amd ? define(factory) : factory();
584 function _arrayLikeToArray(r2, a2) {
585 (null == a2 || a2 > r2.length) && (a2 = r2.length);
586 for (var e3 = 0, n3 = Array(a2); e3 < a2; e3++) n3[e3] = r2[e3];
589 function _assertThisInitialized(e3) {
590 if (void 0 === e3) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
593 function _callSuper(t2, o2, e3) {
594 return o2 = _getPrototypeOf(o2), _possibleConstructorReturn(t2, _isNativeReflectConstruct() ? Reflect.construct(o2, e3 || [], _getPrototypeOf(t2).constructor) : o2.apply(t2, e3));
596 function _classCallCheck(a2, n3) {
597 if (!(a2 instanceof n3)) throw new TypeError("Cannot call a class as a function");
599 function _defineProperties(e3, r2) {
600 for (var t2 = 0; t2 < r2.length; t2++) {
602 o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e3, _toPropertyKey(o2.key), o2);
605 function _createClass(e3, r2, t2) {
606 return r2 && _defineProperties(e3.prototype, r2), t2 && _defineProperties(e3, t2), Object.defineProperty(e3, "prototype", {
610 function _createForOfIteratorHelper(r2, e3) {
611 var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
613 if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray(r2)) || e3 && r2 && "number" == typeof r2.length) {
615 var n3 = 0, F3 = function() {
620 return n3 >= r2.length ? {
633 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
635 var o2, a2 = true, u2 = false;
642 return a2 = r3.done, r3;
649 a2 || null == t2.return || t2.return();
657 return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e3, t2, r2) {
658 var p2 = _superPropBase(e3, t2);
660 var n3 = Object.getOwnPropertyDescriptor(p2, t2);
661 return n3.get ? n3.get.call(arguments.length < 3 ? e3 : r2) : n3.value;
663 }, _get.apply(null, arguments);
665 function _getPrototypeOf(t2) {
666 return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
667 return t3.__proto__ || Object.getPrototypeOf(t3);
668 }, _getPrototypeOf(t2);
670 function _inherits(t2, e3) {
671 if ("function" != typeof e3 && null !== e3) throw new TypeError("Super expression must either be null or a function");
672 t2.prototype = Object.create(e3 && e3.prototype, {
678 }), Object.defineProperty(t2, "prototype", {
680 }), e3 && _setPrototypeOf(t2, e3);
682 function _isNativeReflectConstruct() {
684 var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
688 return (_isNativeReflectConstruct = function() {
692 function _possibleConstructorReturn(t2, e3) {
693 if (e3 && ("object" == typeof e3 || "function" == typeof e3)) return e3;
694 if (void 0 !== e3) throw new TypeError("Derived constructors may only return object or undefined");
695 return _assertThisInitialized(t2);
697 function _setPrototypeOf(t2, e3) {
698 return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e4) {
699 return t3.__proto__ = e4, t3;
700 }, _setPrototypeOf(t2, e3);
702 function _superPropBase(t2, o2) {
703 for (; !{}.hasOwnProperty.call(t2, o2) && null !== (t2 = _getPrototypeOf(t2)); ) ;
706 function _superPropGet(t2, o2, e3, r2) {
707 var p2 = _get(_getPrototypeOf(1 & r2 ? t2.prototype : t2), o2, e3);
708 return 2 & r2 && "function" == typeof p2 ? function(t3) {
709 return p2.apply(e3, t3);
712 function _toPrimitive(t2, r2) {
713 if ("object" != typeof t2 || !t2) return t2;
714 var e3 = t2[Symbol.toPrimitive];
716 var i3 = e3.call(t2, r2 || "default");
717 if ("object" != typeof i3) return i3;
718 throw new TypeError("@@toPrimitive must return a primitive value.");
720 return ("string" === r2 ? String : Number)(t2);
722 function _toPropertyKey(t2) {
723 var i3 = _toPrimitive(t2, "string");
724 return "symbol" == typeof i3 ? i3 : i3 + "";
726 function _unsupportedIterableToArray(r2, a2) {
728 if ("string" == typeof r2) return _arrayLikeToArray(r2, a2);
729 var t2 = {}.toString.call(r2).slice(8, -1);
730 return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r2, a2) : void 0;
735 NativeAbortSignal: self2.AbortSignal,
736 NativeAbortController: self2.AbortController
738 })(typeof self !== "undefined" ? self : global);
739 function createAbortEvent(reason) {
742 event = new Event("abort");
744 if (typeof document !== "undefined") {
745 if (!document.createEvent) {
746 event = document.createEventObject();
747 event.type = "abort";
749 event = document.createEvent("Event");
750 event.initEvent("abort", false, false);
760 event.reason = reason;
763 function normalizeAbortReason(reason) {
764 if (reason === void 0) {
765 if (typeof document === "undefined") {
766 reason = new Error("This operation was aborted");
767 reason.name = "AbortError";
770 reason = new DOMException("signal is aborted without reason");
771 Object.defineProperty(reason, "name", {
775 reason = new Error("This operation was aborted");
776 reason.name = "AbortError";
782 var Emitter = /* @__PURE__ */ (function() {
783 function Emitter2() {
784 _classCallCheck(this, Emitter2);
785 Object.defineProperty(this, "listeners", {
791 return _createClass(Emitter2, [{
792 key: "addEventListener",
793 value: function addEventListener(type2, callback, options) {
794 if (!(type2 in this.listeners)) {
795 this.listeners[type2] = [];
797 this.listeners[type2].push({
803 key: "removeEventListener",
804 value: function removeEventListener(type2, callback) {
805 if (!(type2 in this.listeners)) {
808 var stack = this.listeners[type2];
809 for (var i3 = 0, l4 = stack.length; i3 < l4; i3++) {
810 if (stack[i3].callback === callback) {
817 key: "dispatchEvent",
818 value: function dispatchEvent2(event) {
820 if (!(event.type in this.listeners)) {
823 var stack = this.listeners[event.type];
824 var stackToCall = stack.slice();
825 var _loop = function _loop2() {
826 var listener = stackToCall[i3];
828 listener.callback.call(_this, event);
830 Promise.resolve().then(function() {
834 if (listener.options && listener.options.once) {
835 _this.removeEventListener(event.type, listener.callback);
838 for (var i3 = 0, l4 = stackToCall.length; i3 < l4; i3++) {
841 return !event.defaultPrevented;
845 var AbortSignal = /* @__PURE__ */ (function(_Emitter) {
846 function AbortSignal2() {
848 _classCallCheck(this, AbortSignal2);
849 _this2 = _callSuper(this, AbortSignal2);
850 if (!_this2.listeners) {
851 Emitter.call(_this2);
853 Object.defineProperty(_this2, "aborted", {
858 Object.defineProperty(_this2, "onabort", {
863 Object.defineProperty(_this2, "reason", {
870 _inherits(AbortSignal2, _Emitter);
871 return _createClass(AbortSignal2, [{
873 value: function toString2() {
874 return "[object AbortSignal]";
877 key: "dispatchEvent",
878 value: function dispatchEvent2(event) {
879 if (event.type === "abort") {
881 if (typeof this.onabort === "function") {
882 this.onabort.call(this, event);
885 _superPropGet(AbortSignal2, "dispatchEvent", this, 3)([event]);
888 * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/AbortSignal/throwIfAborted}
891 key: "throwIfAborted",
892 value: function throwIfAborted() {
893 var aborted = this.aborted, _this$reason = this.reason, reason = _this$reason === void 0 ? "Aborted" : _this$reason;
894 if (!aborted) return;
898 * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/AbortSignal/timeout_static}
899 * @param {number} time The "active" time in milliseconds before the returned {@link AbortSignal} will abort.
900 * The value must be within range of 0 and {@link Number.MAX_SAFE_INTEGER}.
901 * @returns {AbortSignal} The signal will abort with its {@link AbortSignal.reason} property set to a `TimeoutError` {@link DOMException} on timeout,
902 * or an `AbortError` {@link DOMException} if the operation was user-triggered.
906 value: function timeout2(time) {
907 var controller = new AbortController2();
908 setTimeout(function() {
909 return controller.abort(new DOMException("This signal is timeout in ".concat(time, "ms"), "TimeoutError"));
911 return controller.signal;
914 * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static}
915 * @param {Iterable<AbortSignal>} iterable An {@link Iterable} (such as an {@link Array}) of abort signals.
916 * @returns {AbortSignal} - **Already aborted**, if any of the abort signals given is already aborted.
917 * The returned {@link AbortSignal}'s reason will be already set to the `reason` of the first abort signal that was already aborted.
918 * - **Asynchronously aborted**, when any abort signal in `iterable` aborts.
919 * The `reason` will be set to the reason of the first abort signal that is aborted.
923 value: function any(iterable) {
924 var controller = new AbortController2();
926 controller.abort(this.reason);
930 var _iterator = _createForOfIteratorHelper(iterable), _step;
932 for (_iterator.s(); !(_step = _iterator.n()).done; ) {
933 var signal2 = _step.value;
934 signal2.removeEventListener("abort", abort);
942 var _iterator2 = _createForOfIteratorHelper(iterable), _step2;
944 for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
945 var signal = _step2.value;
946 if (signal.aborted) {
947 controller.abort(signal.reason);
949 } else signal.addEventListener("abort", abort);
956 return controller.signal;
960 var AbortController2 = /* @__PURE__ */ (function() {
961 function AbortController3() {
962 _classCallCheck(this, AbortController3);
963 Object.defineProperty(this, "signal", {
964 value: new AbortSignal(),
969 return _createClass(AbortController3, [{
971 value: function abort(reason) {
972 var signalReason = normalizeAbortReason(reason);
973 var event = createAbortEvent(signalReason);
974 this.signal.reason = signalReason;
975 this.signal.dispatchEvent(event);
979 value: function toString2() {
980 return "[object AbortController]";
984 if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
985 AbortController2.prototype[Symbol.toStringTag] = "AbortController";
986 AbortSignal.prototype[Symbol.toStringTag] = "AbortSignal";
988 function polyfillNeeded(self2) {
989 if (self2.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL) {
990 console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill");
993 return typeof self2.Request === "function" && !self2.Request.prototype.hasOwnProperty("signal") || !self2.AbortController;
995 function abortableFetchDecorator(patchTargets) {
996 if ("function" === typeof patchTargets) {
1001 var _patchTargets = patchTargets, fetch3 = _patchTargets.fetch, _patchTargets$Request = _patchTargets.Request, NativeRequest = _patchTargets$Request === void 0 ? fetch3.Request : _patchTargets$Request, NativeAbortController = _patchTargets.AbortController, _patchTargets$__FORCE = _patchTargets.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL, __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL = _patchTargets$__FORCE === void 0 ? false : _patchTargets$__FORCE;
1002 if (!polyfillNeeded({
1004 Request: NativeRequest,
1005 AbortController: NativeAbortController,
1006 __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL
1013 var Request2 = NativeRequest;
1014 if (Request2 && !Request2.prototype.hasOwnProperty("signal") || __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL) {
1015 Request2 = function Request3(input, init2) {
1017 if (init2 && init2.signal) {
1018 signal = init2.signal;
1019 delete init2.signal;
1021 var request3 = new NativeRequest(input, init2);
1023 Object.defineProperty(request3, "signal", {
1032 Request2.prototype = NativeRequest.prototype;
1034 var realFetch = fetch3;
1035 var abortableFetch = function abortableFetch2(input, init2) {
1036 var signal = Request2 && Request2.prototype.isPrototypeOf(input) ? input.signal : init2 ? init2.signal : void 0;
1040 abortError = new DOMException("Aborted", "AbortError");
1042 abortError = new Error("Aborted");
1043 abortError.name = "AbortError";
1045 if (signal.aborted) {
1046 return Promise.reject(abortError);
1048 var cancellation = new Promise(function(_3, reject) {
1049 signal.addEventListener("abort", function() {
1050 return reject(abortError);
1055 if (init2 && init2.signal) {
1056 delete init2.signal;
1058 return Promise.race([cancellation, realFetch(input, init2)]);
1060 return realFetch(input, init2);
1063 fetch: abortableFetch,
1068 if (!polyfillNeeded(self2)) {
1072 console.warn("fetch() is not available, cannot install abortcontroller-polyfill");
1075 var _abortableFetch = abortableFetchDecorator(self2), fetch3 = _abortableFetch.fetch, Request2 = _abortableFetch.Request;
1076 self2.fetch = fetch3;
1077 self2.Request = Request2;
1078 Object.defineProperty(self2, "AbortController", {
1082 value: AbortController2
1084 Object.defineProperty(self2, "AbortSignal", {
1090 })(typeof self !== "undefined" ? self : global);
1095 // modules/actions/add_entity.js
1096 var add_entity_exports = {};
1097 __export(add_entity_exports, {
1098 actionAddEntity: () => actionAddEntity
1100 function actionAddEntity(way) {
1101 return function(graph) {
1102 return graph.replace(way);
1105 var init_add_entity = __esm({
1106 "modules/actions/add_entity.js"() {
1111 // node_modules/d3-dispatch/src/dispatch.js
1112 function dispatch() {
1113 for (var i3 = 0, n3 = arguments.length, _3 = {}, t2; i3 < n3; ++i3) {
1114 if (!(t2 = arguments[i3] + "") || t2 in _3 || /[\s.]/.test(t2)) throw new Error("illegal type: " + t2);
1117 return new Dispatch(_3);
1119 function Dispatch(_3) {
1122 function parseTypenames(typenames, types) {
1123 return typenames.trim().split(/^|\s+/).map(function(t2) {
1124 var name = "", i3 = t2.indexOf(".");
1125 if (i3 >= 0) name = t2.slice(i3 + 1), t2 = t2.slice(0, i3);
1126 if (t2 && !types.hasOwnProperty(t2)) throw new Error("unknown type: " + t2);
1127 return { type: t2, name };
1130 function get(type2, name) {
1131 for (var i3 = 0, n3 = type2.length, c2; i3 < n3; ++i3) {
1132 if ((c2 = type2[i3]).name === name) {
1137 function set(type2, name, callback) {
1138 for (var i3 = 0, n3 = type2.length; i3 < n3; ++i3) {
1139 if (type2[i3].name === name) {
1140 type2[i3] = noop, type2 = type2.slice(0, i3).concat(type2.slice(i3 + 1));
1144 if (callback != null) type2.push({ name, value: callback });
1147 var noop, dispatch_default;
1148 var init_dispatch = __esm({
1149 "node_modules/d3-dispatch/src/dispatch.js"() {
1150 noop = { value: () => {
1152 Dispatch.prototype = dispatch.prototype = {
1153 constructor: Dispatch,
1154 on: function(typename, callback) {
1155 var _3 = this._, T2 = parseTypenames(typename + "", _3), t2, i3 = -1, n3 = T2.length;
1156 if (arguments.length < 2) {
1157 while (++i3 < n3) if ((t2 = (typename = T2[i3]).type) && (t2 = get(_3[t2], typename.name))) return t2;
1160 if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
1162 if (t2 = (typename = T2[i3]).type) _3[t2] = set(_3[t2], typename.name, callback);
1163 else if (callback == null) for (t2 in _3) _3[t2] = set(_3[t2], typename.name, null);
1168 var copy2 = {}, _3 = this._;
1169 for (var t2 in _3) copy2[t2] = _3[t2].slice();
1170 return new Dispatch(copy2);
1172 call: function(type2, that) {
1173 if ((n3 = arguments.length - 2) > 0) for (var args = new Array(n3), i3 = 0, n3, t2; i3 < n3; ++i3) args[i3] = arguments[i3 + 2];
1174 if (!this._.hasOwnProperty(type2)) throw new Error("unknown type: " + type2);
1175 for (t2 = this._[type2], i3 = 0, n3 = t2.length; i3 < n3; ++i3) t2[i3].value.apply(that, args);
1177 apply: function(type2, that, args) {
1178 if (!this._.hasOwnProperty(type2)) throw new Error("unknown type: " + type2);
1179 for (var t2 = this._[type2], i3 = 0, n3 = t2.length; i3 < n3; ++i3) t2[i3].value.apply(that, args);
1182 dispatch_default = dispatch;
1186 // node_modules/d3-dispatch/src/index.js
1187 var init_src = __esm({
1188 "node_modules/d3-dispatch/src/index.js"() {
1193 // modules/core/preferences.js
1194 var preferences_exports = {};
1195 __export(preferences_exports, {
1196 prefs: () => corePreferences
1198 function corePreferences(k2, v3) {
1200 if (v3 === void 0) return _storage.getItem(k2);
1201 else if (v3 === null) _storage.removeItem(k2);
1202 else _storage.setItem(k2, v3);
1203 if (_listeners[k2]) {
1204 _listeners[k2].forEach((handler) => handler(v3));
1208 if (typeof console !== "undefined") {
1209 console.error("localStorage quota exceeded");
1214 var _storage, _listeners;
1215 var init_preferences = __esm({
1216 "modules/core/preferences.js"() {
1219 _storage = localStorage;
1222 _storage = _storage || /* @__PURE__ */ (() => {
1225 getItem: (k2) => s2[k2],
1226 setItem: (k2, v3) => s2[k2] = v3,
1227 removeItem: (k2) => delete s2[k2]
1231 corePreferences.onChange = function(k2, handler) {
1232 _listeners[k2] = _listeners[k2] || [];
1233 _listeners[k2].push(handler);
1239 var presetsCdnUrl, ociCdnUrl, wmfSitematrixCdnUrl, nsiCdnUrl, defaultOsmApiConnections, osmApiConnections, taginfoApiUrl, nominatimApiUrl, showDonationMessage;
1240 var init_id = __esm({
1243 presetsCdnUrl = "https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@{presets_version}/";
1244 ociCdnUrl = "https://cdn.jsdelivr.net/npm/osm-community-index@{version}/";
1245 wmfSitematrixCdnUrl = "https://cdn.jsdelivr.net/npm/wmf-sitematrix@{version}/";
1246 nsiCdnUrl = "https://cdn.jsdelivr.net/npm/name-suggestion-index@{version}/";
1247 defaultOsmApiConnections = {
1249 url: "https://www.openstreetmap.org",
1250 apiUrl: "https://api.openstreetmap.org",
1251 client_id: "0tmNTmd0Jo1dQp4AUmMBLtGiD9YpMuXzHefitcuVStc"
1254 url: "https://api06.dev.openstreetmap.org",
1255 client_id: "Ee1wWJ6UlpERbF6BfTNOpwn0R8k_06mvMXdDUkeHMgw"
1258 osmApiConnections = [];
1260 osmApiConnections.push({
1266 osmApiConnections.push(defaultOsmApiConnections[null]);
1268 osmApiConnections.push(defaultOsmApiConnections.live);
1269 osmApiConnections.push(defaultOsmApiConnections.dev);
1271 taginfoApiUrl = "https://taginfo.openstreetmap.org/api/4/";
1272 nominatimApiUrl = "https://nominatim.openstreetmap.org/";
1273 showDonationMessage = true;
1278 var package_default;
1279 var init_package = __esm({
1284 description: "A friendly editor for OpenStreetMap",
1285 main: "dist/iD.min.js",
1286 repository: "github:openstreetmap/iD",
1287 homepage: "https://github.com/openstreetmap/iD",
1288 bugs: "https://github.com/openstreetmap/iD/issues",
1296 all: "run-s clean build dist",
1297 build: "run-s build:css build:data build:js",
1298 "build:css": "node scripts/build_css.js",
1299 "build:data": "shx mkdir -p dist/data && node scripts/build_data.js",
1300 "build:stats": "node config/esbuild.config.js --stats && esbuild-visualizer --metadata dist/esbuild.json --exclude *.png --filename docs/statistics.html && shx rm dist/esbuild.json",
1301 "build:js": "node config/esbuild.config.js",
1302 "build:js:watch": "node config/esbuild.config.js --watch",
1303 clean: "shx rm -f dist/esbuild.json dist/*.js dist/*.map dist/*.css dist/img/*.svg",
1304 dist: "run-p dist:**",
1305 "dist:mapillary": "shx mkdir -p dist/mapillary-js && shx cp -R node_modules/mapillary-js/dist/* dist/mapillary-js/",
1306 "dist:pannellum": "shx mkdir -p dist/pannellum && shx cp -R node_modules/pannellum/build/* dist/pannellum/",
1307 "dist:min": "node config/esbuild.config.min.js",
1308 "dist:svg:iD": 'svg-sprite --symbol --symbol-dest . --shape-id-generator "iD-%s" --symbol-sprite dist/img/iD-sprite.svg "svg/iD-sprite/**/*.svg"',
1309 "dist:svg:community": 'svg-sprite --symbol --symbol-dest . --shape-id-generator "community-%s" --symbol-sprite dist/img/community-sprite.svg node_modules/osm-community-index/dist/img/*.svg',
1310 "dist:svg:fa": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/fa-sprite.svg svg/fontawesome/*.svg",
1311 "dist:svg:maki": 'svg-sprite --symbol --symbol-dest . --shape-id-generator "maki-%s" --symbol-sprite dist/img/maki-sprite.svg node_modules/@mapbox/maki/icons/*.svg',
1312 "dist:svg:mapillary:signs": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/mapillary-sprite.svg node_modules/@rapideditor/mapillary_sprite_source/package_signs/*.svg",
1313 "dist:svg:mapillary:objects": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/mapillary-object-sprite.svg node_modules/@rapideditor/mapillary_sprite_source/package_objects/*.svg",
1314 "dist:svg:roentgen": 'svg-sprite --shape-id-generator "roentgen-%s" --shape-dim-width 16 --shape-dim-height 16 --symbol --symbol-dest . --symbol-sprite dist/img/roentgen-sprite.svg svg/roentgen/*.svg',
1315 "dist:svg:temaki": 'svg-sprite --symbol --symbol-dest . --shape-id-generator "temaki-%s" --symbol-sprite dist/img/temaki-sprite.svg node_modules/@rapideditor/temaki/icons/*.svg',
1316 imagery: "node scripts/update_imagery.js",
1317 lint: "eslint config scripts test/spec modules",
1318 "lint:fix": "eslint scripts test/spec modules --fix",
1319 start: "run-s start:watch",
1320 "start:single-build": "run-p build:js start:server",
1321 "start:watch": "run-p build:js:watch start:server",
1322 "start:server": "node scripts/server.js",
1323 test: "npm-run-all -s lint build test:*",
1324 "test:typecheck": "tsc",
1325 "test:spec": "vitest --no-isolate",
1326 translations: "node scripts/update_locales.js"
1329 "@mapbox/geojson-area": "^0.2.2",
1330 "@mapbox/sexagesimal": "1.2.0",
1331 "@mapbox/vector-tile": "^2.0.4",
1332 "@rapideditor/country-coder": "~5.5.1",
1333 "@rapideditor/location-conflation": "~1.6.0",
1334 "@tmcw/togeojson": "^7.1.2",
1335 "@turf/bbox": "^7.2.0",
1336 "@turf/bbox-clip": "^7.2.0",
1337 "abortcontroller-polyfill": "^1.7.8",
1339 "alif-toolkit": "^1.3.0",
1340 "core-js-bundle": "^3.45.1",
1341 diacritics: "1.3.0",
1343 "fast-deep-equal": "~3.1.1",
1344 "fast-json-stable-stringify": "2.1.0",
1345 "lodash-es": "~4.17.15",
1347 "node-diff3": "~3.1.0",
1348 "osm-auth": "^3.0.0",
1351 "polygon-clipping": "~0.15.7",
1354 "whatwg-fetch": "^3.6.20",
1355 "which-polygon": "2.2.1"
1358 "@actions/github-script": "github:actions/github-script",
1359 "@fortawesome/fontawesome-svg-core": "~7.0.0",
1360 "@fortawesome/free-brands-svg-icons": "^7.0.0",
1361 "@fortawesome/free-regular-svg-icons": "^7.0.0",
1362 "@fortawesome/free-solid-svg-icons": "^7.0.0",
1363 "@mapbox/maki": "^8.2.0",
1364 "@openstreetmap/id-tagging-schema": "^6.12.0",
1365 "@rapideditor/mapillary_sprite_source": "^1.8.0",
1366 "@rapideditor/temaki": "^5.9.0",
1367 "@transifex/api": "^7.1.4",
1368 "@types/chai": "^5.2.2",
1369 "@types/d3": "^7.4.3",
1370 "@types/geojson": "^7946.0.16",
1371 "@types/happen": "^0.3.0",
1372 "@types/lodash-es": "^4.17.12",
1373 "@types/node": "^24.3.0",
1374 "@types/sinon": "^17.0.4",
1375 "@types/sinon-chai": "^4.0.0",
1376 autoprefixer: "^10.4.21",
1377 browserslist: "^4.25.3",
1378 "browserslist-to-esbuild": "^2.1.1",
1380 "cldr-core": "^47.0.0",
1381 "cldr-localenames-full": "^47.0.0",
1382 "concat-files": "^0.1.1",
1385 "editor-layer-index": "github:osmlab/editor-layer-index#gh-pages",
1387 "esbuild-visualizer": "^0.7.0",
1389 "fetch-mock": "^11.1.1",
1393 "js-yaml": "^4.0.0",
1395 "json-stringify-pretty-compact": "^3.0.0",
1396 "mapillary-js": "4.1.2",
1398 "name-suggestion-index": "~6.0",
1399 "netlify-cli": "^23.4.0",
1401 "npm-run-all": "^4.0.0",
1402 "osm-community-index": "5.9.3",
1404 "postcss-prefix-selector": "^2.1.1",
1405 "serve-handler": "^6.1.6",
1409 "sinon-chai": "^4.0.1",
1411 "svg-sprite": "2.0.4",
1412 typescript: "^5.9.2",
1413 "typescript-eslint": "^8.41.0",
1420 "> 0.3%, last 6 major versions, not dead, Firefox ESR, maintained node versions"
1426 // modules/geo/geo.js
1427 var geo_exports = {};
1428 __export(geo_exports, {
1429 geoLatToMeters: () => geoLatToMeters,
1430 geoLonToMeters: () => geoLonToMeters,
1431 geoMetersToLat: () => geoMetersToLat,
1432 geoMetersToLon: () => geoMetersToLon,
1433 geoMetersToOffset: () => geoMetersToOffset,
1434 geoOffsetToMeters: () => geoOffsetToMeters,
1435 geoScaleToZoom: () => geoScaleToZoom,
1436 geoSphericalClosestNode: () => geoSphericalClosestNode,
1437 geoSphericalDistance: () => geoSphericalDistance,
1438 geoZoomToScale: () => geoZoomToScale
1440 function geoLatToMeters(dLat) {
1441 return dLat * (TAU * POLAR_RADIUS / 360);
1443 function geoLonToMeters(dLon, atLat) {
1444 return Math.abs(atLat) >= 90 ? 0 : dLon * (TAU * EQUATORIAL_RADIUS / 360) * Math.abs(Math.cos(atLat * (Math.PI / 180)));
1446 function geoMetersToLat(m3) {
1447 return m3 / (TAU * POLAR_RADIUS / 360);
1449 function geoMetersToLon(m3, atLat) {
1450 return Math.abs(atLat) >= 90 ? 0 : m3 / (TAU * EQUATORIAL_RADIUS / 360) / Math.abs(Math.cos(atLat * (Math.PI / 180)));
1452 function geoMetersToOffset(meters, tileSize) {
1453 tileSize = tileSize || 256;
1455 meters[0] * tileSize / (TAU * EQUATORIAL_RADIUS),
1456 -meters[1] * tileSize / (TAU * POLAR_RADIUS)
1459 function geoOffsetToMeters(offset, tileSize) {
1460 tileSize = tileSize || 256;
1462 offset[0] * TAU * EQUATORIAL_RADIUS / tileSize,
1463 -offset[1] * TAU * POLAR_RADIUS / tileSize
1466 function geoSphericalDistance(a2, b3) {
1467 var x2 = geoLonToMeters(a2[0] - b3[0], (a2[1] + b3[1]) / 2);
1468 var y3 = geoLatToMeters(a2[1] - b3[1]);
1469 return Math.sqrt(x2 * x2 + y3 * y3);
1471 function geoScaleToZoom(k2, tileSize) {
1472 tileSize = tileSize || 256;
1473 var log2ts = Math.log(tileSize) * Math.LOG2E;
1474 return Math.log(k2 * TAU) / Math.LN2 - log2ts;
1476 function geoZoomToScale(z3, tileSize) {
1477 tileSize = tileSize || 256;
1478 return tileSize * Math.pow(2, z3) / TAU;
1480 function geoSphericalClosestNode(nodes, point) {
1481 var minDistance = Infinity, distance;
1483 for (var i3 in nodes) {
1484 distance = geoSphericalDistance(nodes[i3].loc, point);
1485 if (distance < minDistance) {
1486 minDistance = distance;
1490 if (indexOfMin !== void 0) {
1491 return { index: indexOfMin, distance: minDistance, node: nodes[indexOfMin] };
1496 var TAU, EQUATORIAL_RADIUS, POLAR_RADIUS;
1497 var init_geo = __esm({
1498 "modules/geo/geo.js"() {
1501 EQUATORIAL_RADIUS = 6378137;
1502 POLAR_RADIUS = 63567523e-1;
1506 // modules/geo/extent.js
1507 var extent_exports = {};
1508 __export(extent_exports, {
1509 geoExtent: () => geoExtent
1511 function geoExtent(min3, max3) {
1512 if (!(this instanceof geoExtent)) {
1513 return new geoExtent(min3, max3);
1514 } else if (min3 instanceof geoExtent) {
1516 } else if (min3 && min3.length === 2 && min3[0].length === 2 && min3[1].length === 2) {
1520 this[0] = min3 || [Infinity, Infinity];
1521 this[1] = max3 || min3 || [-Infinity, -Infinity];
1524 var init_extent = __esm({
1525 "modules/geo/extent.js"() {
1528 geoExtent.prototype = new Array(2);
1529 Object.assign(geoExtent.prototype, {
1530 equals: function(obj) {
1531 return this[0][0] === obj[0][0] && this[0][1] === obj[0][1] && this[1][0] === obj[1][0] && this[1][1] === obj[1][1];
1533 extend: function(obj) {
1534 if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
1536 [Math.min(obj[0][0], this[0][0]), Math.min(obj[0][1], this[0][1])],
1537 [Math.max(obj[1][0], this[1][0]), Math.max(obj[1][1], this[1][1])]
1540 _extend: function(extent) {
1541 this[0][0] = Math.min(extent[0][0], this[0][0]);
1542 this[0][1] = Math.min(extent[0][1], this[0][1]);
1543 this[1][0] = Math.max(extent[1][0], this[1][0]);
1544 this[1][1] = Math.max(extent[1][1], this[1][1]);
1547 return Math.abs((this[1][0] - this[0][0]) * (this[1][1] - this[0][1]));
1549 center: function() {
1550 return [(this[0][0] + this[1][0]) / 2, (this[0][1] + this[1][1]) / 2];
1552 rectangle: function() {
1553 return [this[0][0], this[0][1], this[1][0], this[1][1]];
1556 return { minX: this[0][0], minY: this[0][1], maxX: this[1][0], maxY: this[1][1] };
1558 polygon: function() {
1560 [this[0][0], this[0][1]],
1561 [this[0][0], this[1][1]],
1562 [this[1][0], this[1][1]],
1563 [this[1][0], this[0][1]],
1564 [this[0][0], this[0][1]]
1567 contains: function(obj) {
1568 if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
1569 return obj[0][0] >= this[0][0] && obj[0][1] >= this[0][1] && obj[1][0] <= this[1][0] && obj[1][1] <= this[1][1];
1571 intersects: function(obj) {
1572 if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
1573 return obj[0][0] <= this[1][0] && obj[0][1] <= this[1][1] && obj[1][0] >= this[0][0] && obj[1][1] >= this[0][1];
1575 intersection: function(obj) {
1576 if (!this.intersects(obj)) return new geoExtent();
1577 return new geoExtent(
1578 [Math.max(obj[0][0], this[0][0]), Math.max(obj[0][1], this[0][1])],
1579 [Math.min(obj[1][0], this[1][0]), Math.min(obj[1][1], this[1][1])]
1582 percentContainedIn: function(obj) {
1583 if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
1584 var a1 = this.intersection(obj).area();
1585 var a2 = this.area();
1586 if (a1 === Infinity || a2 === Infinity) {
1588 } else if (a1 === 0 || a2 === 0) {
1589 if (obj.contains(this)) {
1597 padByMeters: function(meters) {
1598 var dLat = geoMetersToLat(meters);
1599 var dLon = geoMetersToLon(meters, this.center()[1]);
1601 [this[0][0] - dLon, this[0][1] - dLat],
1602 [this[1][0] + dLon, this[1][1] + dLat]
1605 toParam: function() {
1606 return this.rectangle().join(",");
1609 const center = this.center();
1611 geoExtent(this[0], center),
1612 geoExtent([center[0], this[0][1]], [this[1][0], center[1]]),
1613 geoExtent(center, this[1]),
1614 geoExtent([this[0][0], center[1]], [center[0], this[1][1]])
1621 // node_modules/d3-polygon/src/area.js
1622 function area_default(polygon2) {
1623 var i3 = -1, n3 = polygon2.length, a2, b3 = polygon2[n3 - 1], area = 0;
1627 area += a2[1] * b3[0] - a2[0] * b3[1];
1631 var init_area = __esm({
1632 "node_modules/d3-polygon/src/area.js"() {
1636 // node_modules/d3-polygon/src/centroid.js
1637 function centroid_default(polygon2) {
1638 var i3 = -1, n3 = polygon2.length, x2 = 0, y3 = 0, a2, b3 = polygon2[n3 - 1], c2, k2 = 0;
1642 k2 += c2 = a2[0] * b3[1] - b3[0] * a2[1];
1643 x2 += (a2[0] + b3[0]) * c2;
1644 y3 += (a2[1] + b3[1]) * c2;
1646 return k2 *= 3, [x2 / k2, y3 / k2];
1648 var init_centroid = __esm({
1649 "node_modules/d3-polygon/src/centroid.js"() {
1653 // node_modules/d3-polygon/src/cross.js
1654 function cross_default(a2, b3, c2) {
1655 return (b3[0] - a2[0]) * (c2[1] - a2[1]) - (b3[1] - a2[1]) * (c2[0] - a2[0]);
1657 var init_cross = __esm({
1658 "node_modules/d3-polygon/src/cross.js"() {
1662 // node_modules/d3-polygon/src/hull.js
1663 function lexicographicOrder(a2, b3) {
1664 return a2[0] - b3[0] || a2[1] - b3[1];
1666 function computeUpperHullIndexes(points) {
1667 const n3 = points.length, indexes = [0, 1];
1669 for (i3 = 2; i3 < n3; ++i3) {
1670 while (size > 1 && cross_default(points[indexes[size - 2]], points[indexes[size - 1]], points[i3]) <= 0) --size;
1671 indexes[size++] = i3;
1673 return indexes.slice(0, size);
1675 function hull_default(points) {
1676 if ((n3 = points.length) < 3) return null;
1677 var i3, n3, sortedPoints = new Array(n3), flippedPoints = new Array(n3);
1678 for (i3 = 0; i3 < n3; ++i3) sortedPoints[i3] = [+points[i3][0], +points[i3][1], i3];
1679 sortedPoints.sort(lexicographicOrder);
1680 for (i3 = 0; i3 < n3; ++i3) flippedPoints[i3] = [sortedPoints[i3][0], -sortedPoints[i3][1]];
1681 var upperIndexes = computeUpperHullIndexes(sortedPoints), lowerIndexes = computeUpperHullIndexes(flippedPoints);
1682 var skipLeft = lowerIndexes[0] === upperIndexes[0], skipRight = lowerIndexes[lowerIndexes.length - 1] === upperIndexes[upperIndexes.length - 1], hull = [];
1683 for (i3 = upperIndexes.length - 1; i3 >= 0; --i3) hull.push(points[sortedPoints[upperIndexes[i3]][2]]);
1684 for (i3 = +skipLeft; i3 < lowerIndexes.length - skipRight; ++i3) hull.push(points[sortedPoints[lowerIndexes[i3]][2]]);
1687 var init_hull = __esm({
1688 "node_modules/d3-polygon/src/hull.js"() {
1693 // node_modules/d3-polygon/src/index.js
1694 var init_src2 = __esm({
1695 "node_modules/d3-polygon/src/index.js"() {
1702 // modules/geo/vector.js
1703 var vector_exports = {};
1704 __export(vector_exports, {
1705 geoVecAdd: () => geoVecAdd,
1706 geoVecAngle: () => geoVecAngle,
1707 geoVecCross: () => geoVecCross,
1708 geoVecDot: () => geoVecDot,
1709 geoVecEqual: () => geoVecEqual,
1710 geoVecFloor: () => geoVecFloor,
1711 geoVecInterp: () => geoVecInterp,
1712 geoVecLength: () => geoVecLength,
1713 geoVecLengthSquare: () => geoVecLengthSquare,
1714 geoVecNormalize: () => geoVecNormalize,
1715 geoVecNormalizedDot: () => geoVecNormalizedDot,
1716 geoVecProject: () => geoVecProject,
1717 geoVecScale: () => geoVecScale,
1718 geoVecSubtract: () => geoVecSubtract
1720 function geoVecEqual(a2, b3, epsilon3) {
1722 return Math.abs(a2[0] - b3[0]) <= epsilon3 && Math.abs(a2[1] - b3[1]) <= epsilon3;
1724 return a2[0] === b3[0] && a2[1] === b3[1];
1727 function geoVecAdd(a2, b3) {
1728 return [a2[0] + b3[0], a2[1] + b3[1]];
1730 function geoVecSubtract(a2, b3) {
1731 return [a2[0] - b3[0], a2[1] - b3[1]];
1733 function geoVecScale(a2, mag) {
1734 return [a2[0] * mag, a2[1] * mag];
1736 function geoVecFloor(a2) {
1737 return [Math.floor(a2[0]), Math.floor(a2[1])];
1739 function geoVecInterp(a2, b3, t2) {
1741 a2[0] + (b3[0] - a2[0]) * t2,
1742 a2[1] + (b3[1] - a2[1]) * t2
1745 function geoVecLength(a2, b3) {
1746 return Math.sqrt(geoVecLengthSquare(a2, b3));
1748 function geoVecLengthSquare(a2, b3) {
1750 var x2 = a2[0] - b3[0];
1751 var y3 = a2[1] - b3[1];
1752 return x2 * x2 + y3 * y3;
1754 function geoVecNormalize(a2) {
1755 var length2 = Math.sqrt(a2[0] * a2[0] + a2[1] * a2[1]);
1756 if (length2 !== 0) {
1757 return geoVecScale(a2, 1 / length2);
1761 function geoVecAngle(a2, b3) {
1762 return Math.atan2(b3[1] - a2[1], b3[0] - a2[0]);
1764 function geoVecDot(a2, b3, origin) {
1765 origin = origin || [0, 0];
1766 var p2 = geoVecSubtract(a2, origin);
1767 var q3 = geoVecSubtract(b3, origin);
1768 return p2[0] * q3[0] + p2[1] * q3[1];
1770 function geoVecNormalizedDot(a2, b3, origin) {
1771 origin = origin || [0, 0];
1772 var p2 = geoVecNormalize(geoVecSubtract(a2, origin));
1773 var q3 = geoVecNormalize(geoVecSubtract(b3, origin));
1774 return geoVecDot(p2, q3);
1776 function geoVecCross(a2, b3, origin) {
1777 origin = origin || [0, 0];
1778 var p2 = geoVecSubtract(a2, origin);
1779 var q3 = geoVecSubtract(b3, origin);
1780 return p2[0] * q3[1] - p2[1] * q3[0];
1782 function geoVecProject(a2, points) {
1783 var min3 = Infinity;
1786 for (var i3 = 0; i3 < points.length - 1; i3++) {
1787 var o2 = points[i3];
1788 var s2 = geoVecSubtract(points[i3 + 1], o2);
1789 var v3 = geoVecSubtract(a2, o2);
1790 var proj = geoVecDot(v3, s2) / geoVecDot(s2, s2);
1794 } else if (proj > 1) {
1795 p2 = points[i3 + 1];
1797 p2 = [o2[0] + proj * s2[0], o2[1] + proj * s2[1]];
1799 var dist = geoVecLength(p2, a2);
1806 if (idx !== void 0) {
1807 return { index: idx, distance: min3, target };
1812 var init_vector = __esm({
1813 "modules/geo/vector.js"() {
1818 // modules/geo/geom.js
1819 var geom_exports = {};
1820 __export(geom_exports, {
1821 geoAngle: () => geoAngle,
1822 geoChooseEdge: () => geoChooseEdge,
1823 geoEdgeEqual: () => geoEdgeEqual,
1824 geoGetSmallestSurroundingRectangle: () => geoGetSmallestSurroundingRectangle,
1825 geoHasLineIntersections: () => geoHasLineIntersections,
1826 geoHasSelfIntersections: () => geoHasSelfIntersections,
1827 geoLineIntersection: () => geoLineIntersection,
1828 geoPathHasIntersections: () => geoPathHasIntersections,
1829 geoPathIntersections: () => geoPathIntersections,
1830 geoPathLength: () => geoPathLength,
1831 geoPointInPolygon: () => geoPointInPolygon,
1832 geoPolygonContainsPolygon: () => geoPolygonContainsPolygon,
1833 geoPolygonIntersectsPolygon: () => geoPolygonIntersectsPolygon,
1834 geoRotate: () => geoRotate,
1835 geoViewportEdge: () => geoViewportEdge
1837 function geoAngle(a2, b3, projection2) {
1838 return geoVecAngle(projection2(a2.loc), projection2(b3.loc));
1840 function geoEdgeEqual(a2, b3) {
1841 return a2[0] === b3[0] && a2[1] === b3[1] || a2[0] === b3[1] && a2[1] === b3[0];
1843 function geoRotate(points, angle2, around) {
1844 return points.map(function(point) {
1845 var radial = geoVecSubtract(point, around);
1847 radial[0] * Math.cos(angle2) - radial[1] * Math.sin(angle2) + around[0],
1848 radial[0] * Math.sin(angle2) + radial[1] * Math.cos(angle2) + around[1]
1852 function geoChooseEdge(nodes, point, projection2, activeID) {
1853 var dist = geoVecLength;
1854 var points = nodes.map(function(n3) {
1855 return projection2(n3.loc);
1857 var ids = nodes.map(function(n3) {
1860 var min3 = Infinity;
1863 for (var i3 = 0; i3 < points.length - 1; i3++) {
1864 if (ids[i3] === activeID || ids[i3 + 1] === activeID) continue;
1865 var o2 = points[i3];
1866 var s2 = geoVecSubtract(points[i3 + 1], o2);
1867 var v3 = geoVecSubtract(point, o2);
1868 var proj = geoVecDot(v3, s2) / geoVecDot(s2, s2);
1872 } else if (proj > 1) {
1873 p2 = points[i3 + 1];
1875 p2 = [o2[0] + proj * s2[0], o2[1] + proj * s2[1]];
1877 var d4 = dist(p2, point);
1881 loc = projection2.invert(p2);
1884 if (idx !== void 0) {
1885 return { index: idx, distance: min3, loc };
1890 function geoHasLineIntersections(activeNodes, inactiveNodes, activeID) {
1893 var j3, k2, n1, n22, segment;
1894 for (j3 = 0; j3 < activeNodes.length - 1; j3++) {
1895 n1 = activeNodes[j3];
1896 n22 = activeNodes[j3 + 1];
1897 segment = [n1.loc, n22.loc];
1898 if (n1.id === activeID || n22.id === activeID) {
1899 actives.push(segment);
1902 for (j3 = 0; j3 < inactiveNodes.length - 1; j3++) {
1903 n1 = inactiveNodes[j3];
1904 n22 = inactiveNodes[j3 + 1];
1905 segment = [n1.loc, n22.loc];
1906 inactives.push(segment);
1908 for (j3 = 0; j3 < actives.length; j3++) {
1909 for (k2 = 0; k2 < inactives.length; k2++) {
1910 var p2 = actives[j3];
1911 var q3 = inactives[k2];
1912 var hit = geoLineIntersection(p2, q3);
1920 function geoHasSelfIntersections(nodes, activeID) {
1924 for (j3 = 0; j3 < nodes.length - 1; j3++) {
1926 var n22 = nodes[j3 + 1];
1927 var segment = [n1.loc, n22.loc];
1928 if (n1.id === activeID || n22.id === activeID) {
1929 actives.push(segment);
1931 inactives.push(segment);
1934 for (j3 = 0; j3 < actives.length; j3++) {
1935 for (k2 = 0; k2 < inactives.length; k2++) {
1936 var p2 = actives[j3];
1937 var q3 = inactives[k2];
1938 if (geoVecEqual(p2[1], q3[0]) || geoVecEqual(p2[0], q3[1]) || geoVecEqual(p2[0], q3[0]) || geoVecEqual(p2[1], q3[1])) {
1941 var hit = geoLineIntersection(p2, q3);
1943 var epsilon3 = 1e-8;
1944 if (geoVecEqual(p2[1], hit, epsilon3) || geoVecEqual(p2[0], hit, epsilon3) || geoVecEqual(q3[1], hit, epsilon3) || geoVecEqual(q3[0], hit, epsilon3)) {
1954 function geoLineIntersection(a2, b3) {
1955 var p2 = [a2[0][0], a2[0][1]];
1956 var p22 = [a2[1][0], a2[1][1]];
1957 var q3 = [b3[0][0], b3[0][1]];
1958 var q22 = [b3[1][0], b3[1][1]];
1959 var r2 = geoVecSubtract(p22, p2);
1960 var s2 = geoVecSubtract(q22, q3);
1961 var uNumerator = geoVecCross(geoVecSubtract(q3, p2), r2);
1962 var denominator = geoVecCross(r2, s2);
1963 if (uNumerator && denominator) {
1964 var u2 = uNumerator / denominator;
1965 var t2 = geoVecCross(geoVecSubtract(q3, p2), s2) / denominator;
1966 if (t2 >= 0 && t2 <= 1 && u2 >= 0 && u2 <= 1) {
1967 return geoVecInterp(p2, p22, t2);
1972 function geoPathIntersections(path1, path2) {
1973 var intersections = [];
1974 for (var i3 = 0; i3 < path1.length - 1; i3++) {
1975 for (var j3 = 0; j3 < path2.length - 1; j3++) {
1976 var a2 = [path1[i3], path1[i3 + 1]];
1977 var b3 = [path2[j3], path2[j3 + 1]];
1978 var hit = geoLineIntersection(a2, b3);
1980 intersections.push(hit);
1984 return intersections;
1986 function geoPathHasIntersections(path1, path2) {
1987 for (var i3 = 0; i3 < path1.length - 1; i3++) {
1988 for (var j3 = 0; j3 < path2.length - 1; j3++) {
1989 var a2 = [path1[i3], path1[i3 + 1]];
1990 var b3 = [path2[j3], path2[j3 + 1]];
1991 var hit = geoLineIntersection(a2, b3);
1999 function geoPointInPolygon(point, polygon2) {
2003 for (var i3 = 0, j3 = polygon2.length - 1; i3 < polygon2.length; j3 = i3++) {
2004 var xi = polygon2[i3][0];
2005 var yi = polygon2[i3][1];
2006 var xj = polygon2[j3][0];
2007 var yj = polygon2[j3][1];
2008 var intersect2 = yi > y3 !== yj > y3 && x2 < (xj - xi) * (y3 - yi) / (yj - yi) + xi;
2009 if (intersect2) inside = !inside;
2013 function geoPolygonContainsPolygon(outer, inner) {
2014 return inner.every(function(point) {
2015 return geoPointInPolygon(point, outer);
2018 function geoPolygonIntersectsPolygon(outer, inner, checkSegments) {
2019 function testPoints(outer2, inner2) {
2020 return inner2.some(function(point) {
2021 return geoPointInPolygon(point, outer2);
2024 return testPoints(outer, inner) || !!checkSegments && geoPathHasIntersections(outer, inner);
2026 function geoGetSmallestSurroundingRectangle(points) {
2027 var hull = hull_default(points);
2028 var centroid = centroid_default(hull);
2029 var minArea = Infinity;
2033 for (var i3 = 0; i3 <= hull.length - 1; i3++) {
2034 var c2 = i3 === hull.length - 1 ? hull[0] : hull[i3 + 1];
2035 var angle2 = Math.atan2(c2[1] - c1[1], c2[0] - c1[0]);
2036 var poly = geoRotate(hull, -angle2, centroid);
2037 var extent = poly.reduce(function(extent2, point) {
2038 return extent2.extend(geoExtent(point));
2040 var area = extent.area();
2041 if (area < minArea) {
2049 poly: geoRotate(ssrExtent.polygon(), ssrAngle, centroid),
2053 function geoPathLength(path) {
2055 for (var i3 = 0; i3 < path.length - 1; i3++) {
2056 length2 += geoVecLength(path[i3], path[i3 + 1]);
2060 function geoViewportEdge(point, dimensions) {
2061 var pad3 = [80, 20, 50, 20];
2064 if (point[0] > dimensions[0] - pad3[1]) {
2067 if (point[0] < pad3[3]) {
2070 if (point[1] > dimensions[1] - pad3[2]) {
2073 if (point[1] < pad3[0]) {
2082 var init_geom = __esm({
2083 "modules/geo/geom.js"() {
2091 // node_modules/d3-array/src/ascending.js
2092 function ascending(a2, b3) {
2093 return a2 == null || b3 == null ? NaN : a2 < b3 ? -1 : a2 > b3 ? 1 : a2 >= b3 ? 0 : NaN;
2095 var init_ascending = __esm({
2096 "node_modules/d3-array/src/ascending.js"() {
2100 // node_modules/d3-array/src/descending.js
2101 function descending(a2, b3) {
2102 return a2 == null || b3 == null ? NaN : b3 < a2 ? -1 : b3 > a2 ? 1 : b3 >= a2 ? 0 : NaN;
2104 var init_descending = __esm({
2105 "node_modules/d3-array/src/descending.js"() {
2109 // node_modules/d3-array/src/bisector.js
2110 function bisector(f2) {
2111 let compare1, compare2, delta;
2112 if (f2.length !== 2) {
2113 compare1 = ascending;
2114 compare2 = (d4, x2) => ascending(f2(d4), x2);
2115 delta = (d4, x2) => f2(d4) - x2;
2117 compare1 = f2 === ascending || f2 === descending ? f2 : zero;
2121 function left(a2, x2, lo = 0, hi = a2.length) {
2123 if (compare1(x2, x2) !== 0) return hi;
2125 const mid = lo + hi >>> 1;
2126 if (compare2(a2[mid], x2) < 0) lo = mid + 1;
2132 function right(a2, x2, lo = 0, hi = a2.length) {
2134 if (compare1(x2, x2) !== 0) return hi;
2136 const mid = lo + hi >>> 1;
2137 if (compare2(a2[mid], x2) <= 0) lo = mid + 1;
2143 function center(a2, x2, lo = 0, hi = a2.length) {
2144 const i3 = left(a2, x2, lo, hi - 1);
2145 return i3 > lo && delta(a2[i3 - 1], x2) > -delta(a2[i3], x2) ? i3 - 1 : i3;
2147 return { left, center, right };
2152 var init_bisector = __esm({
2153 "node_modules/d3-array/src/bisector.js"() {
2159 // node_modules/d3-array/src/number.js
2160 function number(x2) {
2161 return x2 === null ? NaN : +x2;
2163 function* numbers(values, valueof) {
2164 if (valueof === void 0) {
2165 for (let value of values) {
2166 if (value != null && (value = +value) >= value) {
2172 for (let value of values) {
2173 if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
2179 var init_number = __esm({
2180 "node_modules/d3-array/src/number.js"() {
2184 // node_modules/d3-array/src/bisect.js
2185 var ascendingBisect, bisectRight, bisectLeft, bisectCenter, bisect_default;
2186 var init_bisect = __esm({
2187 "node_modules/d3-array/src/bisect.js"() {
2191 ascendingBisect = bisector(ascending);
2192 bisectRight = ascendingBisect.right;
2193 bisectLeft = ascendingBisect.left;
2194 bisectCenter = bisector(number).center;
2195 bisect_default = bisectRight;
2199 // node_modules/d3-array/src/fsum.js
2201 var init_fsum = __esm({
2202 "node_modules/d3-array/src/fsum.js"() {
2205 this._partials = new Float64Array(32);
2209 const p2 = this._partials;
2211 for (let j3 = 0; j3 < this._n && j3 < 32; j3++) {
2212 const y3 = p2[j3], hi = x2 + y3, lo = Math.abs(x2) < Math.abs(y3) ? x2 - (hi - y3) : y3 - (hi - x2);
2213 if (lo) p2[i3++] = lo;
2221 const p2 = this._partials;
2222 let n3 = this._n, x2, y3, lo, hi = 0;
2229 lo = y3 - (hi - x2);
2232 if (n3 > 0 && (lo < 0 && p2[n3 - 1] < 0 || lo > 0 && p2[n3 - 1] > 0)) {
2235 if (y3 == x2 - hi) hi = x2;
2244 // node_modules/d3-array/src/sort.js
2245 function compareDefined(compare2 = ascending) {
2246 if (compare2 === ascending) return ascendingDefined;
2247 if (typeof compare2 !== "function") throw new TypeError("compare is not a function");
2248 return (a2, b3) => {
2249 const x2 = compare2(a2, b3);
2250 if (x2 || x2 === 0) return x2;
2251 return (compare2(b3, b3) === 0) - (compare2(a2, a2) === 0);
2254 function ascendingDefined(a2, b3) {
2255 return (a2 == null || !(a2 >= a2)) - (b3 == null || !(b3 >= b3)) || (a2 < b3 ? -1 : a2 > b3 ? 1 : 0);
2257 var init_sort = __esm({
2258 "node_modules/d3-array/src/sort.js"() {
2263 // node_modules/d3-array/src/ticks.js
2264 function tickSpec(start2, stop, count) {
2265 const step = (stop - start2) / Math.max(0, count), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
2268 inc = Math.pow(10, -power) / factor;
2269 i1 = Math.round(start2 * inc);
2270 i22 = Math.round(stop * inc);
2271 if (i1 / inc < start2) ++i1;
2272 if (i22 / inc > stop) --i22;
2275 inc = Math.pow(10, power) * factor;
2276 i1 = Math.round(start2 / inc);
2277 i22 = Math.round(stop / inc);
2278 if (i1 * inc < start2) ++i1;
2279 if (i22 * inc > stop) --i22;
2281 if (i22 < i1 && 0.5 <= count && count < 2) return tickSpec(start2, stop, count * 2);
2282 return [i1, i22, inc];
2284 function ticks(start2, stop, count) {
2285 stop = +stop, start2 = +start2, count = +count;
2286 if (!(count > 0)) return [];
2287 if (start2 === stop) return [start2];
2288 const reverse = stop < start2, [i1, i22, inc] = reverse ? tickSpec(stop, start2, count) : tickSpec(start2, stop, count);
2289 if (!(i22 >= i1)) return [];
2290 const n3 = i22 - i1 + 1, ticks2 = new Array(n3);
2292 if (inc < 0) for (let i3 = 0; i3 < n3; ++i3) ticks2[i3] = (i22 - i3) / -inc;
2293 else for (let i3 = 0; i3 < n3; ++i3) ticks2[i3] = (i22 - i3) * inc;
2295 if (inc < 0) for (let i3 = 0; i3 < n3; ++i3) ticks2[i3] = (i1 + i3) / -inc;
2296 else for (let i3 = 0; i3 < n3; ++i3) ticks2[i3] = (i1 + i3) * inc;
2300 function tickIncrement(start2, stop, count) {
2301 stop = +stop, start2 = +start2, count = +count;
2302 return tickSpec(start2, stop, count)[2];
2304 function tickStep(start2, stop, count) {
2305 stop = +stop, start2 = +start2, count = +count;
2306 const reverse = stop < start2, inc = reverse ? tickIncrement(stop, start2, count) : tickIncrement(start2, stop, count);
2307 return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
2310 var init_ticks = __esm({
2311 "node_modules/d3-array/src/ticks.js"() {
2312 e10 = Math.sqrt(50);
2318 // node_modules/d3-array/src/max.js
2319 function max(values, valueof) {
2321 if (valueof === void 0) {
2322 for (const value of values) {
2323 if (value != null && (max3 < value || max3 === void 0 && value >= value)) {
2329 for (let value of values) {
2330 if ((value = valueof(value, ++index, values)) != null && (max3 < value || max3 === void 0 && value >= value)) {
2337 var init_max = __esm({
2338 "node_modules/d3-array/src/max.js"() {
2342 // node_modules/d3-array/src/min.js
2343 function min(values, valueof) {
2345 if (valueof === void 0) {
2346 for (const value of values) {
2347 if (value != null && (min3 > value || min3 === void 0 && value >= value)) {
2353 for (let value of values) {
2354 if ((value = valueof(value, ++index, values)) != null && (min3 > value || min3 === void 0 && value >= value)) {
2361 var init_min = __esm({
2362 "node_modules/d3-array/src/min.js"() {
2366 // node_modules/d3-array/src/quickselect.js
2367 function quickselect(array2, k2, left = 0, right = Infinity, compare2) {
2368 k2 = Math.floor(k2);
2369 left = Math.floor(Math.max(0, left));
2370 right = Math.floor(Math.min(array2.length - 1, right));
2371 if (!(left <= k2 && k2 <= right)) return array2;
2372 compare2 = compare2 === void 0 ? ascendingDefined : compareDefined(compare2);
2373 while (right > left) {
2374 if (right - left > 600) {
2375 const n3 = right - left + 1;
2376 const m3 = k2 - left + 1;
2377 const z3 = Math.log(n3);
2378 const s2 = 0.5 * Math.exp(2 * z3 / 3);
2379 const sd = 0.5 * Math.sqrt(z3 * s2 * (n3 - s2) / n3) * (m3 - n3 / 2 < 0 ? -1 : 1);
2380 const newLeft = Math.max(left, Math.floor(k2 - m3 * s2 / n3 + sd));
2381 const newRight = Math.min(right, Math.floor(k2 + (n3 - m3) * s2 / n3 + sd));
2382 quickselect(array2, k2, newLeft, newRight, compare2);
2384 const t2 = array2[k2];
2387 swap(array2, left, k2);
2388 if (compare2(array2[right], t2) > 0) swap(array2, left, right);
2390 swap(array2, i3, j3), ++i3, --j3;
2391 while (compare2(array2[i3], t2) < 0) ++i3;
2392 while (compare2(array2[j3], t2) > 0) --j3;
2394 if (compare2(array2[left], t2) === 0) swap(array2, left, j3);
2395 else ++j3, swap(array2, j3, right);
2396 if (j3 <= k2) left = j3 + 1;
2397 if (k2 <= j3) right = j3 - 1;
2401 function swap(array2, i3, j3) {
2402 const t2 = array2[i3];
2403 array2[i3] = array2[j3];
2406 var init_quickselect = __esm({
2407 "node_modules/d3-array/src/quickselect.js"() {
2412 // node_modules/d3-array/src/quantile.js
2413 function quantile(values, p2, valueof) {
2414 values = Float64Array.from(numbers(values, valueof));
2415 if (!(n3 = values.length) || isNaN(p2 = +p2)) return;
2416 if (p2 <= 0 || n3 < 2) return min(values);
2417 if (p2 >= 1) return max(values);
2418 var n3, i3 = (n3 - 1) * p2, i0 = Math.floor(i3), value0 = max(quickselect(values, i0).subarray(0, i0 + 1)), value1 = min(values.subarray(i0 + 1));
2419 return value0 + (value1 - value0) * (i3 - i0);
2421 var init_quantile = __esm({
2422 "node_modules/d3-array/src/quantile.js"() {
2430 // node_modules/d3-array/src/median.js
2431 function median(values, valueof) {
2432 return quantile(values, 0.5, valueof);
2434 var init_median = __esm({
2435 "node_modules/d3-array/src/median.js"() {
2440 // node_modules/d3-array/src/merge.js
2441 function* flatten(arrays) {
2442 for (const array2 of arrays) {
2446 function merge(arrays) {
2447 return Array.from(flatten(arrays));
2449 var init_merge = __esm({
2450 "node_modules/d3-array/src/merge.js"() {
2454 // node_modules/d3-array/src/pairs.js
2455 function pairs(values, pairof = pair) {
2459 for (const value of values) {
2460 if (first) pairs2.push(pairof(previous, value));
2466 function pair(a2, b3) {
2469 var init_pairs = __esm({
2470 "node_modules/d3-array/src/pairs.js"() {
2474 // node_modules/d3-array/src/range.js
2475 function range(start2, stop, step) {
2476 start2 = +start2, stop = +stop, step = (n3 = arguments.length) < 2 ? (stop = start2, start2 = 0, 1) : n3 < 3 ? 1 : +step;
2477 var i3 = -1, n3 = Math.max(0, Math.ceil((stop - start2) / step)) | 0, range3 = new Array(n3);
2479 range3[i3] = start2 + i3 * step;
2483 var init_range = __esm({
2484 "node_modules/d3-array/src/range.js"() {
2488 // node_modules/d3-array/src/index.js
2489 var init_src3 = __esm({
2490 "node_modules/d3-array/src/index.js"() {
2504 // node_modules/d3-geo/src/math.js
2506 return x2 > 1 ? 0 : x2 < -1 ? pi : Math.acos(x2);
2509 return x2 > 1 ? halfPi : x2 < -1 ? -halfPi : Math.asin(x2);
2511 var epsilon, epsilon2, pi, halfPi, quarterPi, tau, degrees, radians, abs, atan, atan2, cos, exp, log, sin, sign, sqrt, tan;
2512 var init_math = __esm({
2513 "node_modules/d3-geo/src/math.js"() {
2529 sign = Math.sign || function(x2) {
2530 return x2 > 0 ? 1 : x2 < 0 ? -1 : 0;
2537 // node_modules/d3-geo/src/noop.js
2540 var init_noop = __esm({
2541 "node_modules/d3-geo/src/noop.js"() {
2545 // node_modules/d3-geo/src/stream.js
2546 function streamGeometry(geometry, stream) {
2547 if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {
2548 streamGeometryType[geometry.type](geometry, stream);
2551 function streamLine(coordinates, stream, closed) {
2552 var i3 = -1, n3 = coordinates.length - closed, coordinate;
2554 while (++i3 < n3) coordinate = coordinates[i3], stream.point(coordinate[0], coordinate[1], coordinate[2]);
2557 function streamPolygon(coordinates, stream) {
2558 var i3 = -1, n3 = coordinates.length;
2559 stream.polygonStart();
2560 while (++i3 < n3) streamLine(coordinates[i3], stream, 1);
2561 stream.polygonEnd();
2563 function stream_default(object, stream) {
2564 if (object && streamObjectType.hasOwnProperty(object.type)) {
2565 streamObjectType[object.type](object, stream);
2567 streamGeometry(object, stream);
2570 var streamObjectType, streamGeometryType;
2571 var init_stream = __esm({
2572 "node_modules/d3-geo/src/stream.js"() {
2573 streamObjectType = {
2574 Feature: function(object, stream) {
2575 streamGeometry(object.geometry, stream);
2577 FeatureCollection: function(object, stream) {
2578 var features = object.features, i3 = -1, n3 = features.length;
2579 while (++i3 < n3) streamGeometry(features[i3].geometry, stream);
2582 streamGeometryType = {
2583 Sphere: function(object, stream) {
2586 Point: function(object, stream) {
2587 object = object.coordinates;
2588 stream.point(object[0], object[1], object[2]);
2590 MultiPoint: function(object, stream) {
2591 var coordinates = object.coordinates, i3 = -1, n3 = coordinates.length;
2592 while (++i3 < n3) object = coordinates[i3], stream.point(object[0], object[1], object[2]);
2594 LineString: function(object, stream) {
2595 streamLine(object.coordinates, stream, 0);
2597 MultiLineString: function(object, stream) {
2598 var coordinates = object.coordinates, i3 = -1, n3 = coordinates.length;
2599 while (++i3 < n3) streamLine(coordinates[i3], stream, 0);
2601 Polygon: function(object, stream) {
2602 streamPolygon(object.coordinates, stream);
2604 MultiPolygon: function(object, stream) {
2605 var coordinates = object.coordinates, i3 = -1, n3 = coordinates.length;
2606 while (++i3 < n3) streamPolygon(coordinates[i3], stream);
2608 GeometryCollection: function(object, stream) {
2609 var geometries = object.geometries, i3 = -1, n3 = geometries.length;
2610 while (++i3 < n3) streamGeometry(geometries[i3], stream);
2616 // node_modules/d3-geo/src/area.js
2617 function areaRingStart() {
2618 areaStream.point = areaPointFirst;
2620 function areaRingEnd() {
2621 areaPoint(lambda00, phi00);
2623 function areaPointFirst(lambda, phi) {
2624 areaStream.point = areaPoint;
2625 lambda00 = lambda, phi00 = phi;
2626 lambda *= radians, phi *= radians;
2627 lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);
2629 function areaPoint(lambda, phi) {
2630 lambda *= radians, phi *= radians;
2631 phi = phi / 2 + quarterPi;
2632 var dLambda = lambda - lambda0, sdLambda = dLambda >= 0 ? 1 : -1, adLambda = sdLambda * dLambda, cosPhi = cos(phi), sinPhi = sin(phi), k2 = sinPhi0 * sinPhi, u2 = cosPhi0 * cosPhi + k2 * cos(adLambda), v3 = k2 * sdLambda * sin(adLambda);
2633 areaRingSum.add(atan2(v3, u2));
2634 lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;
2636 function area_default2(object) {
2637 areaSum = new Adder();
2638 stream_default(object, areaStream);
2641 var areaRingSum, areaSum, lambda00, phi00, lambda0, cosPhi0, sinPhi0, areaStream;
2642 var init_area2 = __esm({
2643 "node_modules/d3-geo/src/area.js"() {
2648 areaRingSum = new Adder();
2649 areaSum = new Adder();
2654 polygonStart: function() {
2655 areaRingSum = new Adder();
2656 areaStream.lineStart = areaRingStart;
2657 areaStream.lineEnd = areaRingEnd;
2659 polygonEnd: function() {
2660 var areaRing = +areaRingSum;
2661 areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);
2662 this.lineStart = this.lineEnd = this.point = noop2;
2664 sphere: function() {
2671 // node_modules/d3-geo/src/cartesian.js
2672 function spherical(cartesian2) {
2673 return [atan2(cartesian2[1], cartesian2[0]), asin(cartesian2[2])];
2675 function cartesian(spherical2) {
2676 var lambda = spherical2[0], phi = spherical2[1], cosPhi = cos(phi);
2677 return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];
2679 function cartesianDot(a2, b3) {
2680 return a2[0] * b3[0] + a2[1] * b3[1] + a2[2] * b3[2];
2682 function cartesianCross(a2, b3) {
2683 return [a2[1] * b3[2] - a2[2] * b3[1], a2[2] * b3[0] - a2[0] * b3[2], a2[0] * b3[1] - a2[1] * b3[0]];
2685 function cartesianAddInPlace(a2, b3) {
2686 a2[0] += b3[0], a2[1] += b3[1], a2[2] += b3[2];
2688 function cartesianScale(vector, k2) {
2689 return [vector[0] * k2, vector[1] * k2, vector[2] * k2];
2691 function cartesianNormalizeInPlace(d4) {
2692 var l4 = sqrt(d4[0] * d4[0] + d4[1] * d4[1] + d4[2] * d4[2]);
2693 d4[0] /= l4, d4[1] /= l4, d4[2] /= l4;
2695 var init_cartesian = __esm({
2696 "node_modules/d3-geo/src/cartesian.js"() {
2701 // node_modules/d3-geo/src/bounds.js
2702 function boundsPoint(lambda, phi) {
2703 ranges.push(range2 = [lambda02 = lambda, lambda1 = lambda]);
2704 if (phi < phi0) phi0 = phi;
2705 if (phi > phi1) phi1 = phi;
2707 function linePoint(lambda, phi) {
2708 var p2 = cartesian([lambda * radians, phi * radians]);
2710 var normal = cartesianCross(p0, p2), equatorial = [normal[1], -normal[0], 0], inflection = cartesianCross(equatorial, normal);
2711 cartesianNormalizeInPlace(inflection);
2712 inflection = spherical(inflection);
2713 var delta = lambda - lambda2, sign2 = delta > 0 ? 1 : -1, lambdai = inflection[0] * degrees * sign2, phii, antimeridian = abs(delta) > 180;
2714 if (antimeridian ^ (sign2 * lambda2 < lambdai && lambdai < sign2 * lambda)) {
2715 phii = inflection[1] * degrees;
2716 if (phii > phi1) phi1 = phii;
2717 } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign2 * lambda2 < lambdai && lambdai < sign2 * lambda)) {
2718 phii = -inflection[1] * degrees;
2719 if (phii < phi0) phi0 = phii;
2721 if (phi < phi0) phi0 = phi;
2722 if (phi > phi1) phi1 = phi;
2725 if (lambda < lambda2) {
2726 if (angle(lambda02, lambda) > angle(lambda02, lambda1)) lambda1 = lambda;
2728 if (angle(lambda, lambda1) > angle(lambda02, lambda1)) lambda02 = lambda;
2731 if (lambda1 >= lambda02) {
2732 if (lambda < lambda02) lambda02 = lambda;
2733 if (lambda > lambda1) lambda1 = lambda;
2735 if (lambda > lambda2) {
2736 if (angle(lambda02, lambda) > angle(lambda02, lambda1)) lambda1 = lambda;
2738 if (angle(lambda, lambda1) > angle(lambda02, lambda1)) lambda02 = lambda;
2743 ranges.push(range2 = [lambda02 = lambda, lambda1 = lambda]);
2745 if (phi < phi0) phi0 = phi;
2746 if (phi > phi1) phi1 = phi;
2747 p0 = p2, lambda2 = lambda;
2749 function boundsLineStart() {
2750 boundsStream.point = linePoint;
2752 function boundsLineEnd() {
2753 range2[0] = lambda02, range2[1] = lambda1;
2754 boundsStream.point = boundsPoint;
2757 function boundsRingPoint(lambda, phi) {
2759 var delta = lambda - lambda2;
2760 deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);
2762 lambda002 = lambda, phi002 = phi;
2764 areaStream.point(lambda, phi);
2765 linePoint(lambda, phi);
2767 function boundsRingStart() {
2768 areaStream.lineStart();
2770 function boundsRingEnd() {
2771 boundsRingPoint(lambda002, phi002);
2772 areaStream.lineEnd();
2773 if (abs(deltaSum) > epsilon) lambda02 = -(lambda1 = 180);
2774 range2[0] = lambda02, range2[1] = lambda1;
2777 function angle(lambda04, lambda12) {
2778 return (lambda12 -= lambda04) < 0 ? lambda12 + 360 : lambda12;
2780 function rangeCompare(a2, b3) {
2781 return a2[0] - b3[0];
2783 function rangeContains(range3, x2) {
2784 return range3[0] <= range3[1] ? range3[0] <= x2 && x2 <= range3[1] : x2 < range3[0] || range3[1] < x2;
2786 function bounds_default(feature3) {
2787 var i3, n3, a2, b3, merged, deltaMax, delta;
2788 phi1 = lambda1 = -(lambda02 = phi0 = Infinity);
2790 stream_default(feature3, boundsStream);
2791 if (n3 = ranges.length) {
2792 ranges.sort(rangeCompare);
2793 for (i3 = 1, a2 = ranges[0], merged = [a2]; i3 < n3; ++i3) {
2795 if (rangeContains(a2, b3[0]) || rangeContains(a2, b3[1])) {
2796 if (angle(a2[0], b3[1]) > angle(a2[0], a2[1])) a2[1] = b3[1];
2797 if (angle(b3[0], a2[1]) > angle(a2[0], a2[1])) a2[0] = b3[0];
2799 merged.push(a2 = b3);
2802 for (deltaMax = -Infinity, n3 = merged.length - 1, i3 = 0, a2 = merged[n3]; i3 <= n3; a2 = b3, ++i3) {
2804 if ((delta = angle(a2[1], b3[0])) > deltaMax) deltaMax = delta, lambda02 = b3[0], lambda1 = a2[1];
2807 ranges = range2 = null;
2808 return lambda02 === Infinity || phi0 === Infinity ? [[NaN, NaN], [NaN, NaN]] : [[lambda02, phi0], [lambda1, phi1]];
2810 var lambda02, phi0, lambda1, phi1, lambda2, lambda002, phi002, p0, deltaSum, ranges, range2, boundsStream;
2811 var init_bounds = __esm({
2812 "node_modules/d3-geo/src/bounds.js"() {
2820 lineStart: boundsLineStart,
2821 lineEnd: boundsLineEnd,
2822 polygonStart: function() {
2823 boundsStream.point = boundsRingPoint;
2824 boundsStream.lineStart = boundsRingStart;
2825 boundsStream.lineEnd = boundsRingEnd;
2826 deltaSum = new Adder();
2827 areaStream.polygonStart();
2829 polygonEnd: function() {
2830 areaStream.polygonEnd();
2831 boundsStream.point = boundsPoint;
2832 boundsStream.lineStart = boundsLineStart;
2833 boundsStream.lineEnd = boundsLineEnd;
2834 if (areaRingSum < 0) lambda02 = -(lambda1 = 180), phi0 = -(phi1 = 90);
2835 else if (deltaSum > epsilon) phi1 = 90;
2836 else if (deltaSum < -epsilon) phi0 = -90;
2837 range2[0] = lambda02, range2[1] = lambda1;
2839 sphere: function() {
2840 lambda02 = -(lambda1 = 180), phi0 = -(phi1 = 90);
2846 // node_modules/d3-geo/src/compose.js
2847 function compose_default(a2, b3) {
2848 function compose(x2, y3) {
2849 return x2 = a2(x2, y3), b3(x2[0], x2[1]);
2851 if (a2.invert && b3.invert) compose.invert = function(x2, y3) {
2852 return x2 = b3.invert(x2, y3), x2 && a2.invert(x2[0], x2[1]);
2856 var init_compose = __esm({
2857 "node_modules/d3-geo/src/compose.js"() {
2861 // node_modules/d3-geo/src/rotation.js
2862 function rotationIdentity(lambda, phi) {
2863 if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;
2864 return [lambda, phi];
2866 function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
2867 return (deltaLambda %= tau) ? deltaPhi || deltaGamma ? compose_default(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) : rotationLambda(deltaLambda) : deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) : rotationIdentity;
2869 function forwardRotationLambda(deltaLambda) {
2870 return function(lambda, phi) {
2871 lambda += deltaLambda;
2872 if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;
2873 return [lambda, phi];
2876 function rotationLambda(deltaLambda) {
2877 var rotation = forwardRotationLambda(deltaLambda);
2878 rotation.invert = forwardRotationLambda(-deltaLambda);
2881 function rotationPhiGamma(deltaPhi, deltaGamma) {
2882 var cosDeltaPhi = cos(deltaPhi), sinDeltaPhi = sin(deltaPhi), cosDeltaGamma = cos(deltaGamma), sinDeltaGamma = sin(deltaGamma);
2883 function rotation(lambda, phi) {
2884 var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y3 = sin(lambda) * cosPhi, z3 = sin(phi), k2 = z3 * cosDeltaPhi + x2 * sinDeltaPhi;
2886 atan2(y3 * cosDeltaGamma - k2 * sinDeltaGamma, x2 * cosDeltaPhi - z3 * sinDeltaPhi),
2887 asin(k2 * cosDeltaGamma + y3 * sinDeltaGamma)
2890 rotation.invert = function(lambda, phi) {
2891 var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y3 = sin(lambda) * cosPhi, z3 = sin(phi), k2 = z3 * cosDeltaGamma - y3 * sinDeltaGamma;
2893 atan2(y3 * cosDeltaGamma + z3 * sinDeltaGamma, x2 * cosDeltaPhi + k2 * sinDeltaPhi),
2894 asin(k2 * cosDeltaPhi - x2 * sinDeltaPhi)
2899 function rotation_default(rotate) {
2900 rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);
2901 function forward(coordinates) {
2902 coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);
2903 return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
2905 forward.invert = function(coordinates) {
2906 coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);
2907 return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
2911 var init_rotation = __esm({
2912 "node_modules/d3-geo/src/rotation.js"() {
2915 rotationIdentity.invert = rotationIdentity;
2919 // node_modules/d3-geo/src/circle.js
2920 function circleStream(stream, radius, delta, direction, t02, t12) {
2922 var cosRadius = cos(radius), sinRadius = sin(radius), step = direction * delta;
2924 t02 = radius + direction * tau;
2925 t12 = radius - step / 2;
2927 t02 = circleRadius(cosRadius, t02);
2928 t12 = circleRadius(cosRadius, t12);
2929 if (direction > 0 ? t02 < t12 : t02 > t12) t02 += direction * tau;
2931 for (var point, t2 = t02; direction > 0 ? t2 > t12 : t2 < t12; t2 -= step) {
2932 point = spherical([cosRadius, -sinRadius * cos(t2), -sinRadius * sin(t2)]);
2933 stream.point(point[0], point[1]);
2936 function circleRadius(cosRadius, point) {
2937 point = cartesian(point), point[0] -= cosRadius;
2938 cartesianNormalizeInPlace(point);
2939 var radius = acos(-point[1]);
2940 return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;
2942 var init_circle = __esm({
2943 "node_modules/d3-geo/src/circle.js"() {
2949 // node_modules/d3-geo/src/clip/buffer.js
2950 function buffer_default() {
2951 var lines = [], line;
2953 point: function(x2, y3, m3) {
2954 line.push([x2, y3, m3]);
2956 lineStart: function() {
2957 lines.push(line = []);
2960 rejoin: function() {
2961 if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
2963 result: function() {
2971 var init_buffer = __esm({
2972 "node_modules/d3-geo/src/clip/buffer.js"() {
2977 // node_modules/d3-geo/src/pointEqual.js
2978 function pointEqual_default(a2, b3) {
2979 return abs(a2[0] - b3[0]) < epsilon && abs(a2[1] - b3[1]) < epsilon;
2981 var init_pointEqual = __esm({
2982 "node_modules/d3-geo/src/pointEqual.js"() {
2987 // node_modules/d3-geo/src/clip/rejoin.js
2988 function Intersection(point, points, other, entry) {
2994 this.n = this.p = null;
2996 function rejoin_default(segments, compareIntersection2, startInside, interpolate, stream) {
2997 var subject = [], clip = [], i3, n3;
2998 segments.forEach(function(segment) {
2999 if ((n4 = segment.length - 1) <= 0) return;
3000 var n4, p02 = segment[0], p1 = segment[n4], x2;
3001 if (pointEqual_default(p02, p1)) {
3002 if (!p02[2] && !p1[2]) {
3004 for (i3 = 0; i3 < n4; ++i3) stream.point((p02 = segment[i3])[0], p02[1]);
3008 p1[0] += 2 * epsilon;
3010 subject.push(x2 = new Intersection(p02, segment, null, true));
3011 clip.push(x2.o = new Intersection(p02, null, x2, false));
3012 subject.push(x2 = new Intersection(p1, segment, null, false));
3013 clip.push(x2.o = new Intersection(p1, null, x2, true));
3015 if (!subject.length) return;
3016 clip.sort(compareIntersection2);
3019 for (i3 = 0, n3 = clip.length; i3 < n3; ++i3) {
3020 clip[i3].e = startInside = !startInside;
3022 var start2 = subject[0], points, point;
3024 var current = start2, isSubject = true;
3025 while (current.v) if ((current = current.n) === start2) return;
3029 current.v = current.o.v = true;
3032 for (i3 = 0, n3 = points.length; i3 < n3; ++i3) stream.point((point = points[i3])[0], point[1]);
3034 interpolate(current.x, current.n.x, 1, stream);
3036 current = current.n;
3039 points = current.p.z;
3040 for (i3 = points.length - 1; i3 >= 0; --i3) stream.point((point = points[i3])[0], point[1]);
3042 interpolate(current.x, current.p.x, -1, stream);
3044 current = current.p;
3046 current = current.o;
3048 isSubject = !isSubject;
3049 } while (!current.v);
3053 function link(array2) {
3054 if (!(n3 = array2.length)) return;
3055 var n3, i3 = 0, a2 = array2[0], b3;
3057 a2.n = b3 = array2[i3];
3061 a2.n = b3 = array2[0];
3064 var init_rejoin = __esm({
3065 "node_modules/d3-geo/src/clip/rejoin.js"() {
3071 // node_modules/d3-geo/src/polygonContains.js
3072 function longitude(point) {
3073 return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);
3075 function polygonContains_default(polygon2, point) {
3076 var lambda = longitude(point), phi = point[1], sinPhi = sin(phi), normal = [sin(lambda), -cos(lambda), 0], angle2 = 0, winding = 0;
3077 var sum = new Adder();
3078 if (sinPhi === 1) phi = halfPi + epsilon;
3079 else if (sinPhi === -1) phi = -halfPi - epsilon;
3080 for (var i3 = 0, n3 = polygon2.length; i3 < n3; ++i3) {
3081 if (!(m3 = (ring = polygon2[i3]).length)) continue;
3082 var ring, m3, point0 = ring[m3 - 1], lambda04 = longitude(point0), phi02 = point0[1] / 2 + quarterPi, sinPhi03 = sin(phi02), cosPhi03 = cos(phi02);
3083 for (var j3 = 0; j3 < m3; ++j3, lambda04 = lambda12, sinPhi03 = sinPhi1, cosPhi03 = cosPhi1, point0 = point1) {
3084 var point1 = ring[j3], lambda12 = longitude(point1), phi12 = point1[1] / 2 + quarterPi, sinPhi1 = sin(phi12), cosPhi1 = cos(phi12), delta = lambda12 - lambda04, sign2 = delta >= 0 ? 1 : -1, absDelta = sign2 * delta, antimeridian = absDelta > pi, k2 = sinPhi03 * sinPhi1;
3085 sum.add(atan2(k2 * sign2 * sin(absDelta), cosPhi03 * cosPhi1 + k2 * cos(absDelta)));
3086 angle2 += antimeridian ? delta + sign2 * tau : delta;
3087 if (antimeridian ^ lambda04 >= lambda ^ lambda12 >= lambda) {
3088 var arc = cartesianCross(cartesian(point0), cartesian(point1));
3089 cartesianNormalizeInPlace(arc);
3090 var intersection2 = cartesianCross(normal, arc);
3091 cartesianNormalizeInPlace(intersection2);
3092 var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection2[2]);
3093 if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {
3094 winding += antimeridian ^ delta >= 0 ? 1 : -1;
3099 return (angle2 < -epsilon || angle2 < epsilon && sum < -epsilon2) ^ winding & 1;
3101 var init_polygonContains = __esm({
3102 "node_modules/d3-geo/src/polygonContains.js"() {
3109 // node_modules/d3-geo/src/clip/index.js
3110 function clip_default(pointVisible, clipLine, interpolate, start2) {
3111 return function(sink) {
3112 var line = clipLine(sink), ringBuffer = buffer_default(), ringSink = clipLine(ringBuffer), polygonStarted = false, polygon2, segments, ring;
3117 polygonStart: function() {
3118 clip.point = pointRing;
3119 clip.lineStart = ringStart;
3120 clip.lineEnd = ringEnd;
3124 polygonEnd: function() {
3126 clip.lineStart = lineStart;
3127 clip.lineEnd = lineEnd;
3128 segments = merge(segments);
3129 var startInside = polygonContains_default(polygon2, start2);
3130 if (segments.length) {
3131 if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
3132 rejoin_default(segments, compareIntersection, startInside, interpolate, sink);
3133 } else if (startInside) {
3134 if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
3136 interpolate(null, null, 1, sink);
3139 if (polygonStarted) sink.polygonEnd(), polygonStarted = false;
3140 segments = polygon2 = null;
3142 sphere: function() {
3143 sink.polygonStart();
3145 interpolate(null, null, 1, sink);
3150 function point(lambda, phi) {
3151 if (pointVisible(lambda, phi)) sink.point(lambda, phi);
3153 function pointLine(lambda, phi) {
3154 line.point(lambda, phi);
3156 function lineStart() {
3157 clip.point = pointLine;
3160 function lineEnd() {
3164 function pointRing(lambda, phi) {
3165 ring.push([lambda, phi]);
3166 ringSink.point(lambda, phi);
3168 function ringStart() {
3169 ringSink.lineStart();
3172 function ringEnd() {
3173 pointRing(ring[0][0], ring[0][1]);
3175 var clean2 = ringSink.clean(), ringSegments = ringBuffer.result(), i3, n3 = ringSegments.length, m3, segment, point2;
3177 polygon2.push(ring);
3181 segment = ringSegments[0];
3182 if ((m3 = segment.length - 1) > 0) {
3183 if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
3185 for (i3 = 0; i3 < m3; ++i3) sink.point((point2 = segment[i3])[0], point2[1]);
3190 if (n3 > 1 && clean2 & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
3191 segments.push(ringSegments.filter(validSegment));
3196 function validSegment(segment) {
3197 return segment.length > 1;
3199 function compareIntersection(a2, b3) {
3200 return ((a2 = a2.x)[0] < 0 ? a2[1] - halfPi - epsilon : halfPi - a2[1]) - ((b3 = b3.x)[0] < 0 ? b3[1] - halfPi - epsilon : halfPi - b3[1]);
3202 var init_clip = __esm({
3203 "node_modules/d3-geo/src/clip/index.js"() {
3207 init_polygonContains();
3212 // node_modules/d3-geo/src/clip/antimeridian.js
3213 function clipAntimeridianLine(stream) {
3214 var lambda04 = NaN, phi02 = NaN, sign0 = NaN, clean2;
3216 lineStart: function() {
3220 point: function(lambda12, phi12) {
3221 var sign1 = lambda12 > 0 ? pi : -pi, delta = abs(lambda12 - lambda04);
3222 if (abs(delta - pi) < epsilon) {
3223 stream.point(lambda04, phi02 = (phi02 + phi12) / 2 > 0 ? halfPi : -halfPi);
3224 stream.point(sign0, phi02);
3227 stream.point(sign1, phi02);
3228 stream.point(lambda12, phi02);
3230 } else if (sign0 !== sign1 && delta >= pi) {
3231 if (abs(lambda04 - sign0) < epsilon) lambda04 -= sign0 * epsilon;
3232 if (abs(lambda12 - sign1) < epsilon) lambda12 -= sign1 * epsilon;
3233 phi02 = clipAntimeridianIntersect(lambda04, phi02, lambda12, phi12);
3234 stream.point(sign0, phi02);
3237 stream.point(sign1, phi02);
3240 stream.point(lambda04 = lambda12, phi02 = phi12);
3243 lineEnd: function() {
3245 lambda04 = phi02 = NaN;
3252 function clipAntimeridianIntersect(lambda04, phi02, lambda12, phi12) {
3253 var cosPhi03, cosPhi1, sinLambda0Lambda1 = sin(lambda04 - lambda12);
3254 return abs(sinLambda0Lambda1) > epsilon ? atan((sin(phi02) * (cosPhi1 = cos(phi12)) * sin(lambda12) - sin(phi12) * (cosPhi03 = cos(phi02)) * sin(lambda04)) / (cosPhi03 * cosPhi1 * sinLambda0Lambda1)) : (phi02 + phi12) / 2;
3256 function clipAntimeridianInterpolate(from, to, direction, stream) {
3259 phi = direction * halfPi;
3260 stream.point(-pi, phi);
3261 stream.point(0, phi);
3262 stream.point(pi, phi);
3263 stream.point(pi, 0);
3264 stream.point(pi, -phi);
3265 stream.point(0, -phi);
3266 stream.point(-pi, -phi);
3267 stream.point(-pi, 0);
3268 stream.point(-pi, phi);
3269 } else if (abs(from[0] - to[0]) > epsilon) {
3270 var lambda = from[0] < to[0] ? pi : -pi;
3271 phi = direction * lambda / 2;
3272 stream.point(-lambda, phi);
3273 stream.point(0, phi);
3274 stream.point(lambda, phi);
3276 stream.point(to[0], to[1]);
3279 var antimeridian_default;
3280 var init_antimeridian = __esm({
3281 "node_modules/d3-geo/src/clip/antimeridian.js"() {
3284 antimeridian_default = clip_default(
3288 clipAntimeridianLine,
3289 clipAntimeridianInterpolate,
3295 // node_modules/d3-geo/src/clip/circle.js
3296 function circle_default(radius) {
3297 var cr = cos(radius), delta = 2 * radians, smallRadius = cr > 0, notHemisphere = abs(cr) > epsilon;
3298 function interpolate(from, to, direction, stream) {
3299 circleStream(stream, radius, delta, direction, from, to);
3301 function visible(lambda, phi) {
3302 return cos(lambda) * cos(phi) > cr;
3304 function clipLine(stream) {
3305 var point0, c0, v0, v00, clean2;
3307 lineStart: function() {
3311 point: function(lambda, phi) {
3312 var point1 = [lambda, phi], point2, v3 = visible(lambda, phi), c2 = smallRadius ? v3 ? 0 : code(lambda, phi) : v3 ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;
3313 if (!point0 && (v00 = v0 = v3)) stream.lineStart();
3315 point2 = intersect2(point0, point1);
3316 if (!point2 || pointEqual_default(point0, point2) || pointEqual_default(point1, point2))
3323 point2 = intersect2(point1, point0);
3324 stream.point(point2[0], point2[1]);
3326 point2 = intersect2(point0, point1);
3327 stream.point(point2[0], point2[1], 2);
3331 } else if (notHemisphere && point0 && smallRadius ^ v3) {
3333 if (!(c2 & c0) && (t2 = intersect2(point1, point0, true))) {
3337 stream.point(t2[0][0], t2[0][1]);
3338 stream.point(t2[1][0], t2[1][1]);
3341 stream.point(t2[1][0], t2[1][1]);
3344 stream.point(t2[0][0], t2[0][1], 3);
3348 if (v3 && (!point0 || !pointEqual_default(point0, point1))) {
3349 stream.point(point1[0], point1[1]);
3351 point0 = point1, v0 = v3, c0 = c2;
3353 lineEnd: function() {
3354 if (v0) stream.lineEnd();
3357 // Rejoin first and last segments if there were intersections and the first
3358 // and last points were visible.
3360 return clean2 | (v00 && v0) << 1;
3364 function intersect2(a2, b3, two) {
3365 var pa = cartesian(a2), pb = cartesian(b3);
3366 var n1 = [1, 0, 0], n22 = cartesianCross(pa, pb), n2n2 = cartesianDot(n22, n22), n1n2 = n22[0], determinant = n2n2 - n1n2 * n1n2;
3367 if (!determinant) return !two && a2;
3368 var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = cartesianCross(n1, n22), A2 = cartesianScale(n1, c1), B3 = cartesianScale(n22, c2);
3369 cartesianAddInPlace(A2, B3);
3370 var u2 = n1xn2, w3 = cartesianDot(A2, u2), uu = cartesianDot(u2, u2), t2 = w3 * w3 - uu * (cartesianDot(A2, A2) - 1);
3372 var t3 = sqrt(t2), q3 = cartesianScale(u2, (-w3 - t3) / uu);
3373 cartesianAddInPlace(q3, A2);
3375 if (!two) return q3;
3376 var lambda04 = a2[0], lambda12 = b3[0], phi02 = a2[1], phi12 = b3[1], z3;
3377 if (lambda12 < lambda04) z3 = lambda04, lambda04 = lambda12, lambda12 = z3;
3378 var delta2 = lambda12 - lambda04, polar = abs(delta2 - pi) < epsilon, meridian = polar || delta2 < epsilon;
3379 if (!polar && phi12 < phi02) z3 = phi02, phi02 = phi12, phi12 = z3;
3380 if (meridian ? polar ? phi02 + phi12 > 0 ^ q3[1] < (abs(q3[0] - lambda04) < epsilon ? phi02 : phi12) : phi02 <= q3[1] && q3[1] <= phi12 : delta2 > pi ^ (lambda04 <= q3[0] && q3[0] <= lambda12)) {
3381 var q1 = cartesianScale(u2, (-w3 + t3) / uu);
3382 cartesianAddInPlace(q1, A2);
3383 return [q3, spherical(q1)];
3386 function code(lambda, phi) {
3387 var r2 = smallRadius ? radius : pi - radius, code2 = 0;
3388 if (lambda < -r2) code2 |= 1;
3389 else if (lambda > r2) code2 |= 2;
3390 if (phi < -r2) code2 |= 4;
3391 else if (phi > r2) code2 |= 8;
3394 return clip_default(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);
3396 var init_circle2 = __esm({
3397 "node_modules/d3-geo/src/clip/circle.js"() {
3406 // node_modules/d3-geo/src/clip/line.js
3407 function line_default(a2, b3, x05, y05, x12, y12) {
3408 var ax = a2[0], ay = a2[1], bx = b3[0], by = b3[1], t02 = 0, t12 = 1, dx = bx - ax, dy = by - ay, r2;
3410 if (!dx && r2 > 0) return;
3413 if (r2 < t02) return;
3414 if (r2 < t12) t12 = r2;
3415 } else if (dx > 0) {
3416 if (r2 > t12) return;
3417 if (r2 > t02) t02 = r2;
3420 if (!dx && r2 < 0) return;
3423 if (r2 > t12) return;
3424 if (r2 > t02) t02 = r2;
3425 } else if (dx > 0) {
3426 if (r2 < t02) return;
3427 if (r2 < t12) t12 = r2;
3430 if (!dy && r2 > 0) return;
3433 if (r2 < t02) return;
3434 if (r2 < t12) t12 = r2;
3435 } else if (dy > 0) {
3436 if (r2 > t12) return;
3437 if (r2 > t02) t02 = r2;
3440 if (!dy && r2 < 0) return;
3443 if (r2 > t12) return;
3444 if (r2 > t02) t02 = r2;
3445 } else if (dy > 0) {
3446 if (r2 < t02) return;
3447 if (r2 < t12) t12 = r2;
3449 if (t02 > 0) a2[0] = ax + t02 * dx, a2[1] = ay + t02 * dy;
3450 if (t12 < 1) b3[0] = ax + t12 * dx, b3[1] = ay + t12 * dy;
3453 var init_line = __esm({
3454 "node_modules/d3-geo/src/clip/line.js"() {
3458 // node_modules/d3-geo/src/clip/rectangle.js
3459 function clipRectangle(x05, y05, x12, y12) {
3460 function visible(x2, y3) {
3461 return x05 <= x2 && x2 <= x12 && y05 <= y3 && y3 <= y12;
3463 function interpolate(from, to, direction, stream) {
3465 if (from == null || (a2 = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoint(from, to) < 0 ^ direction > 0) {
3467 stream.point(a2 === 0 || a2 === 3 ? x05 : x12, a2 > 1 ? y12 : y05);
3468 while ((a2 = (a2 + direction + 4) % 4) !== a1);
3470 stream.point(to[0], to[1]);
3473 function corner(p2, direction) {
3474 return abs(p2[0] - x05) < epsilon ? direction > 0 ? 0 : 3 : abs(p2[0] - x12) < epsilon ? direction > 0 ? 2 : 1 : abs(p2[1] - y05) < epsilon ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
3476 function compareIntersection2(a2, b3) {
3477 return comparePoint(a2.x, b3.x);
3479 function comparePoint(a2, b3) {
3480 var ca = corner(a2, 1), cb = corner(b3, 1);
3481 return ca !== cb ? ca - cb : ca === 0 ? b3[1] - a2[1] : ca === 1 ? a2[0] - b3[0] : ca === 2 ? a2[1] - b3[1] : b3[0] - a2[0];
3483 return function(stream) {
3484 var activeStream = stream, bufferStream = buffer_default(), segments, polygon2, ring, x__, y__, v__, x_, y_, v_, first, clean2;
3492 function point(x2, y3) {
3493 if (visible(x2, y3)) activeStream.point(x2, y3);
3495 function polygonInside() {
3497 for (var i3 = 0, n3 = polygon2.length; i3 < n3; ++i3) {
3498 for (var ring2 = polygon2[i3], j3 = 1, m3 = ring2.length, point2 = ring2[0], a0, a1, b0 = point2[0], b1 = point2[1]; j3 < m3; ++j3) {
3499 a0 = b0, a1 = b1, point2 = ring2[j3], b0 = point2[0], b1 = point2[1];
3501 if (b1 > y12 && (b0 - a0) * (y12 - a1) > (b1 - a1) * (x05 - a0)) ++winding;
3503 if (b1 <= y12 && (b0 - a0) * (y12 - a1) < (b1 - a1) * (x05 - a0)) --winding;
3509 function polygonStart() {
3510 activeStream = bufferStream, segments = [], polygon2 = [], clean2 = true;
3512 function polygonEnd() {
3513 var startInside = polygonInside(), cleanInside = clean2 && startInside, visible2 = (segments = merge(segments)).length;
3514 if (cleanInside || visible2) {
3515 stream.polygonStart();
3518 interpolate(null, null, 1, stream);
3522 rejoin_default(segments, compareIntersection2, startInside, interpolate, stream);
3524 stream.polygonEnd();
3526 activeStream = stream, segments = polygon2 = ring = null;
3528 function lineStart() {
3529 clipStream.point = linePoint2;
3530 if (polygon2) polygon2.push(ring = []);
3535 function lineEnd() {
3537 linePoint2(x__, y__);
3538 if (v__ && v_) bufferStream.rejoin();
3539 segments.push(bufferStream.result());
3541 clipStream.point = point;
3542 if (v_) activeStream.lineEnd();
3544 function linePoint2(x2, y3) {
3545 var v3 = visible(x2, y3);
3546 if (polygon2) ring.push([x2, y3]);
3548 x__ = x2, y__ = y3, v__ = v3;
3551 activeStream.lineStart();
3552 activeStream.point(x2, y3);
3555 if (v3 && v_) activeStream.point(x2, y3);
3557 var a2 = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], b3 = [x2 = Math.max(clipMin, Math.min(clipMax, x2)), y3 = Math.max(clipMin, Math.min(clipMax, y3))];
3558 if (line_default(a2, b3, x05, y05, x12, y12)) {
3560 activeStream.lineStart();
3561 activeStream.point(a2[0], a2[1]);
3563 activeStream.point(b3[0], b3[1]);
3564 if (!v3) activeStream.lineEnd();
3567 activeStream.lineStart();
3568 activeStream.point(x2, y3);
3573 x_ = x2, y_ = y3, v_ = v3;
3578 var clipMax, clipMin;
3579 var init_rectangle = __esm({
3580 "node_modules/d3-geo/src/clip/rectangle.js"() {
3591 // node_modules/d3-geo/src/length.js
3592 function lengthLineStart() {
3593 lengthStream.point = lengthPointFirst;
3594 lengthStream.lineEnd = lengthLineEnd;
3596 function lengthLineEnd() {
3597 lengthStream.point = lengthStream.lineEnd = noop2;
3599 function lengthPointFirst(lambda, phi) {
3600 lambda *= radians, phi *= radians;
3601 lambda03 = lambda, sinPhi02 = sin(phi), cosPhi02 = cos(phi);
3602 lengthStream.point = lengthPoint;
3604 function lengthPoint(lambda, phi) {
3605 lambda *= radians, phi *= radians;
3606 var sinPhi = sin(phi), cosPhi = cos(phi), delta = abs(lambda - lambda03), cosDelta = cos(delta), sinDelta = sin(delta), x2 = cosPhi * sinDelta, y3 = cosPhi02 * sinPhi - sinPhi02 * cosPhi * cosDelta, z3 = sinPhi02 * sinPhi + cosPhi02 * cosPhi * cosDelta;
3607 lengthSum.add(atan2(sqrt(x2 * x2 + y3 * y3), z3));
3608 lambda03 = lambda, sinPhi02 = sinPhi, cosPhi02 = cosPhi;
3610 function length_default(object) {
3611 lengthSum = new Adder();
3612 stream_default(object, lengthStream);
3615 var lengthSum, lambda03, sinPhi02, cosPhi02, lengthStream;
3616 var init_length = __esm({
3617 "node_modules/d3-geo/src/length.js"() {
3625 lineStart: lengthLineStart,
3627 polygonStart: noop2,
3633 // node_modules/d3-geo/src/identity.js
3634 var identity_default;
3635 var init_identity = __esm({
3636 "node_modules/d3-geo/src/identity.js"() {
3637 identity_default = (x2) => x2;
3641 // node_modules/d3-geo/src/path/area.js
3642 function areaRingStart2() {
3643 areaStream2.point = areaPointFirst2;
3645 function areaPointFirst2(x2, y3) {
3646 areaStream2.point = areaPoint2;
3647 x00 = x0 = x2, y00 = y0 = y3;
3649 function areaPoint2(x2, y3) {
3650 areaRingSum2.add(y0 * x2 - x0 * y3);
3653 function areaRingEnd2() {
3654 areaPoint2(x00, y00);
3656 var areaSum2, areaRingSum2, x00, y00, x0, y0, areaStream2, area_default3;
3657 var init_area3 = __esm({
3658 "node_modules/d3-geo/src/path/area.js"() {
3662 areaSum2 = new Adder();
3663 areaRingSum2 = new Adder();
3668 polygonStart: function() {
3669 areaStream2.lineStart = areaRingStart2;
3670 areaStream2.lineEnd = areaRingEnd2;
3672 polygonEnd: function() {
3673 areaStream2.lineStart = areaStream2.lineEnd = areaStream2.point = noop2;
3674 areaSum2.add(abs(areaRingSum2));
3675 areaRingSum2 = new Adder();
3677 result: function() {
3678 var area = areaSum2 / 2;
3679 areaSum2 = new Adder();
3683 area_default3 = areaStream2;
3687 // node_modules/d3-geo/src/path/bounds.js
3688 function boundsPoint2(x2, y3) {
3689 if (x2 < x02) x02 = x2;
3690 if (x2 > x1) x1 = x2;
3691 if (y3 < y02) y02 = y3;
3692 if (y3 > y1) y1 = y3;
3694 var x02, y02, x1, y1, boundsStream2, bounds_default2;
3695 var init_bounds2 = __esm({
3696 "node_modules/d3-geo/src/path/bounds.js"() {
3703 point: boundsPoint2,
3706 polygonStart: noop2,
3708 result: function() {
3709 var bounds = [[x02, y02], [x1, y1]];
3710 x1 = y1 = -(y02 = x02 = Infinity);
3714 bounds_default2 = boundsStream2;
3718 // node_modules/d3-geo/src/path/centroid.js
3719 function centroidPoint(x2, y3) {
3724 function centroidLineStart() {
3725 centroidStream.point = centroidPointFirstLine;
3727 function centroidPointFirstLine(x2, y3) {
3728 centroidStream.point = centroidPointLine;
3729 centroidPoint(x03 = x2, y03 = y3);
3731 function centroidPointLine(x2, y3) {
3732 var dx = x2 - x03, dy = y3 - y03, z3 = sqrt(dx * dx + dy * dy);
3733 X1 += z3 * (x03 + x2) / 2;
3734 Y1 += z3 * (y03 + y3) / 2;
3736 centroidPoint(x03 = x2, y03 = y3);
3738 function centroidLineEnd() {
3739 centroidStream.point = centroidPoint;
3741 function centroidRingStart() {
3742 centroidStream.point = centroidPointFirstRing;
3744 function centroidRingEnd() {
3745 centroidPointRing(x002, y002);
3747 function centroidPointFirstRing(x2, y3) {
3748 centroidStream.point = centroidPointRing;
3749 centroidPoint(x002 = x03 = x2, y002 = y03 = y3);
3751 function centroidPointRing(x2, y3) {
3752 var dx = x2 - x03, dy = y3 - y03, z3 = sqrt(dx * dx + dy * dy);
3753 X1 += z3 * (x03 + x2) / 2;
3754 Y1 += z3 * (y03 + y3) / 2;
3756 z3 = y03 * x2 - x03 * y3;
3757 X2 += z3 * (x03 + x2);
3758 Y2 += z3 * (y03 + y3);
3760 centroidPoint(x03 = x2, y03 = y3);
3762 var X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2, x002, y002, x03, y03, centroidStream, centroid_default2;
3763 var init_centroid2 = __esm({
3764 "node_modules/d3-geo/src/path/centroid.js"() {
3776 point: centroidPoint,
3777 lineStart: centroidLineStart,
3778 lineEnd: centroidLineEnd,
3779 polygonStart: function() {
3780 centroidStream.lineStart = centroidRingStart;
3781 centroidStream.lineEnd = centroidRingEnd;
3783 polygonEnd: function() {
3784 centroidStream.point = centroidPoint;
3785 centroidStream.lineStart = centroidLineStart;
3786 centroidStream.lineEnd = centroidLineEnd;
3788 result: function() {
3789 var centroid = Z2 ? [X2 / Z2, Y2 / Z2] : Z1 ? [X1 / Z1, Y1 / Z1] : Z0 ? [X0 / Z0, Y0 / Z0] : [NaN, NaN];
3790 X0 = Y0 = Z0 = X1 = Y1 = Z1 = X2 = Y2 = Z2 = 0;
3794 centroid_default2 = centroidStream;
3798 // node_modules/d3-geo/src/path/context.js
3799 function PathContext(context) {
3800 this._context = context;
3802 var init_context = __esm({
3803 "node_modules/d3-geo/src/path/context.js"() {
3806 PathContext.prototype = {
3808 pointRadius: function(_3) {
3809 return this._radius = _3, this;
3811 polygonStart: function() {
3814 polygonEnd: function() {
3817 lineStart: function() {
3820 lineEnd: function() {
3821 if (this._line === 0) this._context.closePath();
3824 point: function(x2, y3) {
3825 switch (this._point) {
3827 this._context.moveTo(x2, y3);
3832 this._context.lineTo(x2, y3);
3836 this._context.moveTo(x2 + this._radius, y3);
3837 this._context.arc(x2, y3, this._radius, 0, tau);
3847 // node_modules/d3-geo/src/path/measure.js
3848 function lengthPointFirst2(x2, y3) {
3849 lengthStream2.point = lengthPoint2;
3850 x003 = x04 = x2, y003 = y04 = y3;
3852 function lengthPoint2(x2, y3) {
3853 x04 -= x2, y04 -= y3;
3854 lengthSum2.add(sqrt(x04 * x04 + y04 * y04));
3857 var lengthSum2, lengthRing, x003, y003, x04, y04, lengthStream2, measure_default;
3858 var init_measure = __esm({
3859 "node_modules/d3-geo/src/path/measure.js"() {
3863 lengthSum2 = new Adder();
3866 lineStart: function() {
3867 lengthStream2.point = lengthPointFirst2;
3869 lineEnd: function() {
3870 if (lengthRing) lengthPoint2(x003, y003);
3871 lengthStream2.point = noop2;
3873 polygonStart: function() {
3876 polygonEnd: function() {
3879 result: function() {
3880 var length2 = +lengthSum2;
3881 lengthSum2 = new Adder();
3885 measure_default = lengthStream2;
3889 // node_modules/d3-geo/src/path/string.js
3890 function append(strings) {
3892 this._ += strings[0];
3893 for (const j3 = strings.length; i3 < j3; ++i3) {
3894 this._ += arguments[i3] + strings[i3];
3897 function appendRound(digits) {
3898 const d4 = Math.floor(digits);
3899 if (!(d4 >= 0)) throw new RangeError(`invalid digits: ${digits}`);
3900 if (d4 > 15) return append;
3901 if (d4 !== cacheDigits) {
3902 const k2 = 10 ** d4;
3904 cacheAppend = function append2(strings) {
3906 this._ += strings[0];
3907 for (const j3 = strings.length; i3 < j3; ++i3) {
3908 this._ += Math.round(arguments[i3] * k2) / k2 + strings[i3];
3914 var cacheDigits, cacheAppend, cacheRadius, cacheCircle, PathString;
3915 var init_string = __esm({
3916 "node_modules/d3-geo/src/path/string.js"() {
3917 PathString = class {
3918 constructor(digits) {
3919 this._append = digits == null ? append : appendRound(digits);
3937 if (this._line === 0) this._ += "Z";
3941 switch (this._point) {
3943 this._append`M${x2},${y3}`;
3948 this._append`L${x2},${y3}`;
3952 this._append`M${x2},${y3}`;
3953 if (this._radius !== cacheRadius || this._append !== cacheAppend) {
3954 const r2 = this._radius;
3957 this._append`m0,${r2}a${r2},${r2} 0 1,1 0,${-2 * r2}a${r2},${r2} 0 1,1 0,${2 * r2}z`;
3959 cacheAppend = this._append;
3960 cacheCircle = this._;
3963 this._ += cacheCircle;
3969 const result = this._;
3971 return result.length ? result : null;
3977 // node_modules/d3-geo/src/path/index.js
3978 function path_default(projection2, context) {
3979 let digits = 3, pointRadius = 4.5, projectionStream, contextStream;
3980 function path(object) {
3982 if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
3983 stream_default(object, projectionStream(contextStream));
3985 return contextStream.result();
3987 path.area = function(object) {
3988 stream_default(object, projectionStream(area_default3));
3989 return area_default3.result();
3991 path.measure = function(object) {
3992 stream_default(object, projectionStream(measure_default));
3993 return measure_default.result();
3995 path.bounds = function(object) {
3996 stream_default(object, projectionStream(bounds_default2));
3997 return bounds_default2.result();
3999 path.centroid = function(object) {
4000 stream_default(object, projectionStream(centroid_default2));
4001 return centroid_default2.result();
4003 path.projection = function(_3) {
4004 if (!arguments.length) return projection2;
4005 projectionStream = _3 == null ? (projection2 = null, identity_default) : (projection2 = _3).stream;
4008 path.context = function(_3) {
4009 if (!arguments.length) return context;
4010 contextStream = _3 == null ? (context = null, new PathString(digits)) : new PathContext(context = _3);
4011 if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
4014 path.pointRadius = function(_3) {
4015 if (!arguments.length) return pointRadius;
4016 pointRadius = typeof _3 === "function" ? _3 : (contextStream.pointRadius(+_3), +_3);
4019 path.digits = function(_3) {
4020 if (!arguments.length) return digits;
4021 if (_3 == null) digits = null;
4023 const d4 = Math.floor(_3);
4024 if (!(d4 >= 0)) throw new RangeError(`invalid digits: ${_3}`);
4027 if (context === null) contextStream = new PathString(digits);
4030 return path.projection(projection2).digits(digits).context(context);
4032 var init_path = __esm({
4033 "node_modules/d3-geo/src/path/index.js"() {
4045 // node_modules/d3-geo/src/transform.js
4046 function transform_default(methods2) {
4048 stream: transformer(methods2)
4051 function transformer(methods2) {
4052 return function(stream) {
4053 var s2 = new TransformStream();
4054 for (var key in methods2) s2[key] = methods2[key];
4059 function TransformStream() {
4061 var init_transform = __esm({
4062 "node_modules/d3-geo/src/transform.js"() {
4063 TransformStream.prototype = {
4064 constructor: TransformStream,
4065 point: function(x2, y3) {
4066 this.stream.point(x2, y3);
4068 sphere: function() {
4069 this.stream.sphere();
4071 lineStart: function() {
4072 this.stream.lineStart();
4074 lineEnd: function() {
4075 this.stream.lineEnd();
4077 polygonStart: function() {
4078 this.stream.polygonStart();
4080 polygonEnd: function() {
4081 this.stream.polygonEnd();
4087 // node_modules/d3-geo/src/projection/fit.js
4088 function fit(projection2, fitBounds, object) {
4089 var clip = projection2.clipExtent && projection2.clipExtent();
4090 projection2.scale(150).translate([0, 0]);
4091 if (clip != null) projection2.clipExtent(null);
4092 stream_default(object, projection2.stream(bounds_default2));
4093 fitBounds(bounds_default2.result());
4094 if (clip != null) projection2.clipExtent(clip);
4097 function fitExtent(projection2, extent, object) {
4098 return fit(projection2, function(b3) {
4099 var w3 = extent[1][0] - extent[0][0], h3 = extent[1][1] - extent[0][1], k2 = Math.min(w3 / (b3[1][0] - b3[0][0]), h3 / (b3[1][1] - b3[0][1])), x2 = +extent[0][0] + (w3 - k2 * (b3[1][0] + b3[0][0])) / 2, y3 = +extent[0][1] + (h3 - k2 * (b3[1][1] + b3[0][1])) / 2;
4100 projection2.scale(150 * k2).translate([x2, y3]);
4103 function fitSize(projection2, size, object) {
4104 return fitExtent(projection2, [[0, 0], size], object);
4106 function fitWidth(projection2, width, object) {
4107 return fit(projection2, function(b3) {
4108 var w3 = +width, k2 = w3 / (b3[1][0] - b3[0][0]), x2 = (w3 - k2 * (b3[1][0] + b3[0][0])) / 2, y3 = -k2 * b3[0][1];
4109 projection2.scale(150 * k2).translate([x2, y3]);
4112 function fitHeight(projection2, height, object) {
4113 return fit(projection2, function(b3) {
4114 var h3 = +height, k2 = h3 / (b3[1][1] - b3[0][1]), x2 = -k2 * b3[0][0], y3 = (h3 - k2 * (b3[1][1] + b3[0][1])) / 2;
4115 projection2.scale(150 * k2).translate([x2, y3]);
4118 var init_fit = __esm({
4119 "node_modules/d3-geo/src/projection/fit.js"() {
4125 // node_modules/d3-geo/src/projection/resample.js
4126 function resample_default(project, delta2) {
4127 return +delta2 ? resample(project, delta2) : resampleNone(project);
4129 function resampleNone(project) {
4130 return transformer({
4131 point: function(x2, y3) {
4132 x2 = project(x2, y3);
4133 this.stream.point(x2[0], x2[1]);
4137 function resample(project, delta2) {
4138 function resampleLineTo(x05, y05, lambda04, a0, b0, c0, x12, y12, lambda12, a1, b1, c1, depth, stream) {
4139 var dx = x12 - x05, dy = y12 - y05, d22 = dx * dx + dy * dy;
4140 if (d22 > 4 * delta2 && depth--) {
4141 var a2 = a0 + a1, b3 = b0 + b1, c2 = c0 + c1, m3 = sqrt(a2 * a2 + b3 * b3 + c2 * c2), phi2 = asin(c2 /= m3), lambda22 = abs(abs(c2) - 1) < epsilon || abs(lambda04 - lambda12) < epsilon ? (lambda04 + lambda12) / 2 : atan2(b3, a2), p2 = project(lambda22, phi2), x2 = p2[0], y22 = p2[1], dx2 = x2 - x05, dy2 = y22 - y05, dz = dy * dx2 - dx * dy2;
4142 if (dz * dz / d22 > delta2 || abs((dx * dx2 + dy * dy2) / d22 - 0.5) > 0.3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
4143 resampleLineTo(x05, y05, lambda04, a0, b0, c0, x2, y22, lambda22, a2 /= m3, b3 /= m3, c2, depth, stream);
4144 stream.point(x2, y22);
4145 resampleLineTo(x2, y22, lambda22, a2, b3, c2, x12, y12, lambda12, a1, b1, c1, depth, stream);
4149 return function(stream) {
4150 var lambda003, x004, y004, a00, b00, c00, lambda04, x05, y05, a0, b0, c0;
4151 var resampleStream = {
4155 polygonStart: function() {
4156 stream.polygonStart();
4157 resampleStream.lineStart = ringStart;
4159 polygonEnd: function() {
4160 stream.polygonEnd();
4161 resampleStream.lineStart = lineStart;
4164 function point(x2, y3) {
4165 x2 = project(x2, y3);
4166 stream.point(x2[0], x2[1]);
4168 function lineStart() {
4170 resampleStream.point = linePoint2;
4173 function linePoint2(lambda, phi) {
4174 var c2 = cartesian([lambda, phi]), p2 = project(lambda, phi);
4175 resampleLineTo(x05, y05, lambda04, a0, b0, c0, x05 = p2[0], y05 = p2[1], lambda04 = lambda, a0 = c2[0], b0 = c2[1], c0 = c2[2], maxDepth, stream);
4176 stream.point(x05, y05);
4178 function lineEnd() {
4179 resampleStream.point = point;
4182 function ringStart() {
4184 resampleStream.point = ringPoint;
4185 resampleStream.lineEnd = ringEnd;
4187 function ringPoint(lambda, phi) {
4188 linePoint2(lambda003 = lambda, phi), x004 = x05, y004 = y05, a00 = a0, b00 = b0, c00 = c0;
4189 resampleStream.point = linePoint2;
4191 function ringEnd() {
4192 resampleLineTo(x05, y05, lambda04, a0, b0, c0, x004, y004, lambda003, a00, b00, c00, maxDepth, stream);
4193 resampleStream.lineEnd = lineEnd;
4196 return resampleStream;
4199 var maxDepth, cosMinDistance;
4200 var init_resample = __esm({
4201 "node_modules/d3-geo/src/projection/resample.js"() {
4206 cosMinDistance = cos(30 * radians);
4210 // node_modules/d3-geo/src/projection/index.js
4211 function transformRotate(rotate) {
4212 return transformer({
4213 point: function(x2, y3) {
4214 var r2 = rotate(x2, y3);
4215 return this.stream.point(r2[0], r2[1]);
4219 function scaleTranslate(k2, dx, dy, sx, sy) {
4220 function transform2(x2, y3) {
4223 return [dx + k2 * x2, dy - k2 * y3];
4225 transform2.invert = function(x2, y3) {
4226 return [(x2 - dx) / k2 * sx, (dy - y3) / k2 * sy];
4230 function scaleTranslateRotate(k2, dx, dy, sx, sy, alpha) {
4231 if (!alpha) return scaleTranslate(k2, dx, dy, sx, sy);
4232 var cosAlpha = cos(alpha), sinAlpha = sin(alpha), a2 = cosAlpha * k2, b3 = sinAlpha * k2, ai = cosAlpha / k2, bi = sinAlpha / k2, ci = (sinAlpha * dy - cosAlpha * dx) / k2, fi = (sinAlpha * dx + cosAlpha * dy) / k2;
4233 function transform2(x2, y3) {
4236 return [a2 * x2 - b3 * y3 + dx, dy - b3 * x2 - a2 * y3];
4238 transform2.invert = function(x2, y3) {
4239 return [sx * (ai * x2 - bi * y3 + ci), sy * (fi - bi * x2 - ai * y3)];
4243 function projection(project) {
4244 return projectionMutator(function() {
4248 function projectionMutator(projectAt) {
4249 var project, k2 = 150, x2 = 480, y3 = 250, lambda = 0, phi = 0, deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, alpha = 0, sx = 1, sy = 1, theta = null, preclip = antimeridian_default, x05 = null, y05, x12, y12, postclip = identity_default, delta2 = 0.5, projectResample, projectTransform, projectRotateTransform, cache, cacheStream;
4250 function projection2(point) {
4251 return projectRotateTransform(point[0] * radians, point[1] * radians);
4253 function invert(point) {
4254 point = projectRotateTransform.invert(point[0], point[1]);
4255 return point && [point[0] * degrees, point[1] * degrees];
4257 projection2.stream = function(stream) {
4258 return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));
4260 projection2.preclip = function(_3) {
4261 return arguments.length ? (preclip = _3, theta = void 0, reset()) : preclip;
4263 projection2.postclip = function(_3) {
4264 return arguments.length ? (postclip = _3, x05 = y05 = x12 = y12 = null, reset()) : postclip;
4266 projection2.clipAngle = function(_3) {
4267 return arguments.length ? (preclip = +_3 ? circle_default(theta = _3 * radians) : (theta = null, antimeridian_default), reset()) : theta * degrees;
4269 projection2.clipExtent = function(_3) {
4270 return arguments.length ? (postclip = _3 == null ? (x05 = y05 = x12 = y12 = null, identity_default) : clipRectangle(x05 = +_3[0][0], y05 = +_3[0][1], x12 = +_3[1][0], y12 = +_3[1][1]), reset()) : x05 == null ? null : [[x05, y05], [x12, y12]];
4272 projection2.scale = function(_3) {
4273 return arguments.length ? (k2 = +_3, recenter()) : k2;
4275 projection2.translate = function(_3) {
4276 return arguments.length ? (x2 = +_3[0], y3 = +_3[1], recenter()) : [x2, y3];
4278 projection2.center = function(_3) {
4279 return arguments.length ? (lambda = _3[0] % 360 * radians, phi = _3[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];
4281 projection2.rotate = function(_3) {
4282 return arguments.length ? (deltaLambda = _3[0] % 360 * radians, deltaPhi = _3[1] % 360 * radians, deltaGamma = _3.length > 2 ? _3[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];
4284 projection2.angle = function(_3) {
4285 return arguments.length ? (alpha = _3 % 360 * radians, recenter()) : alpha * degrees;
4287 projection2.reflectX = function(_3) {
4288 return arguments.length ? (sx = _3 ? -1 : 1, recenter()) : sx < 0;
4290 projection2.reflectY = function(_3) {
4291 return arguments.length ? (sy = _3 ? -1 : 1, recenter()) : sy < 0;
4293 projection2.precision = function(_3) {
4294 return arguments.length ? (projectResample = resample_default(projectTransform, delta2 = _3 * _3), reset()) : sqrt(delta2);
4296 projection2.fitExtent = function(extent, object) {
4297 return fitExtent(projection2, extent, object);
4299 projection2.fitSize = function(size, object) {
4300 return fitSize(projection2, size, object);
4302 projection2.fitWidth = function(width, object) {
4303 return fitWidth(projection2, width, object);
4305 projection2.fitHeight = function(height, object) {
4306 return fitHeight(projection2, height, object);
4308 function recenter() {
4309 var center = scaleTranslateRotate(k2, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)), transform2 = scaleTranslateRotate(k2, x2 - center[0], y3 - center[1], sx, sy, alpha);
4310 rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);
4311 projectTransform = compose_default(project, transform2);
4312 projectRotateTransform = compose_default(rotate, projectTransform);
4313 projectResample = resample_default(projectTransform, delta2);
4317 cache = cacheStream = null;
4321 project = projectAt.apply(this, arguments);
4322 projection2.invert = project.invert && invert;
4326 var transformRadians;
4327 var init_projection = __esm({
4328 "node_modules/d3-geo/src/projection/index.js"() {
4329 init_antimeridian();
4339 transformRadians = transformer({
4340 point: function(x2, y3) {
4341 this.stream.point(x2 * radians, y3 * radians);
4347 // node_modules/d3-geo/src/projection/mercator.js
4348 function mercatorRaw(lambda, phi) {
4349 return [lambda, log(tan((halfPi + phi) / 2))];
4351 function mercator_default() {
4352 return mercatorProjection(mercatorRaw).scale(961 / tau);
4354 function mercatorProjection(project) {
4355 var m3 = projection(project), center = m3.center, scale = m3.scale, translate = m3.translate, clipExtent = m3.clipExtent, x05 = null, y05, x12, y12;
4356 m3.scale = function(_3) {
4357 return arguments.length ? (scale(_3), reclip()) : scale();
4359 m3.translate = function(_3) {
4360 return arguments.length ? (translate(_3), reclip()) : translate();
4362 m3.center = function(_3) {
4363 return arguments.length ? (center(_3), reclip()) : center();
4365 m3.clipExtent = function(_3) {
4366 return arguments.length ? (_3 == null ? x05 = y05 = x12 = y12 = null : (x05 = +_3[0][0], y05 = +_3[0][1], x12 = +_3[1][0], y12 = +_3[1][1]), reclip()) : x05 == null ? null : [[x05, y05], [x12, y12]];
4369 var k2 = pi * scale(), t2 = m3(rotation_default(m3.rotate()).invert([0, 0]));
4370 return clipExtent(x05 == null ? [[t2[0] - k2, t2[1] - k2], [t2[0] + k2, t2[1] + k2]] : project === mercatorRaw ? [[Math.max(t2[0] - k2, x05), y05], [Math.min(t2[0] + k2, x12), y12]] : [[x05, Math.max(t2[1] - k2, y05)], [x12, Math.min(t2[1] + k2, y12)]]);
4374 var init_mercator = __esm({
4375 "node_modules/d3-geo/src/projection/mercator.js"() {
4379 mercatorRaw.invert = function(x2, y3) {
4380 return [x2, 2 * atan(exp(y3)) - halfPi];
4385 // node_modules/d3-geo/src/projection/identity.js
4386 function identity_default2() {
4387 var k2 = 1, tx = 0, ty = 0, sx = 1, sy = 1, alpha = 0, ca, sa, x05 = null, y05, x12, y12, kx = 1, ky = 1, transform2 = transformer({
4388 point: function(x2, y3) {
4389 var p2 = projection2([x2, y3]);
4390 this.stream.point(p2[0], p2[1]);
4392 }), postclip = identity_default, cache, cacheStream;
4396 cache = cacheStream = null;
4399 function projection2(p2) {
4400 var x2 = p2[0] * kx, y3 = p2[1] * ky;
4402 var t2 = y3 * ca - x2 * sa;
4403 x2 = x2 * ca + y3 * sa;
4406 return [x2 + tx, y3 + ty];
4408 projection2.invert = function(p2) {
4409 var x2 = p2[0] - tx, y3 = p2[1] - ty;
4411 var t2 = y3 * ca + x2 * sa;
4412 x2 = x2 * ca - y3 * sa;
4415 return [x2 / kx, y3 / ky];
4417 projection2.stream = function(stream) {
4418 return cache && cacheStream === stream ? cache : cache = transform2(postclip(cacheStream = stream));
4420 projection2.postclip = function(_3) {
4421 return arguments.length ? (postclip = _3, x05 = y05 = x12 = y12 = null, reset()) : postclip;
4423 projection2.clipExtent = function(_3) {
4424 return arguments.length ? (postclip = _3 == null ? (x05 = y05 = x12 = y12 = null, identity_default) : clipRectangle(x05 = +_3[0][0], y05 = +_3[0][1], x12 = +_3[1][0], y12 = +_3[1][1]), reset()) : x05 == null ? null : [[x05, y05], [x12, y12]];
4426 projection2.scale = function(_3) {
4427 return arguments.length ? (k2 = +_3, reset()) : k2;
4429 projection2.translate = function(_3) {
4430 return arguments.length ? (tx = +_3[0], ty = +_3[1], reset()) : [tx, ty];
4432 projection2.angle = function(_3) {
4433 return arguments.length ? (alpha = _3 % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees;
4435 projection2.reflectX = function(_3) {
4436 return arguments.length ? (sx = _3 ? -1 : 1, reset()) : sx < 0;
4438 projection2.reflectY = function(_3) {
4439 return arguments.length ? (sy = _3 ? -1 : 1, reset()) : sy < 0;
4441 projection2.fitExtent = function(extent, object) {
4442 return fitExtent(projection2, extent, object);
4444 projection2.fitSize = function(size, object) {
4445 return fitSize(projection2, size, object);
4447 projection2.fitWidth = function(width, object) {
4448 return fitWidth(projection2, width, object);
4450 projection2.fitHeight = function(height, object) {
4451 return fitHeight(projection2, height, object);
4455 var init_identity2 = __esm({
4456 "node_modules/d3-geo/src/projection/identity.js"() {
4465 // node_modules/d3-geo/src/index.js
4466 var init_src4 = __esm({
4467 "node_modules/d3-geo/src/index.js"() {
4480 // node_modules/d3-selection/src/namespaces.js
4481 var xhtml, namespaces_default;
4482 var init_namespaces = __esm({
4483 "node_modules/d3-selection/src/namespaces.js"() {
4484 xhtml = "http://www.w3.org/1999/xhtml";
4485 namespaces_default = {
4486 svg: "http://www.w3.org/2000/svg",
4488 xlink: "http://www.w3.org/1999/xlink",
4489 xml: "http://www.w3.org/XML/1998/namespace",
4490 xmlns: "http://www.w3.org/2000/xmlns/"
4495 // node_modules/d3-selection/src/namespace.js
4496 function namespace_default(name) {
4497 var prefix = name += "", i3 = prefix.indexOf(":");
4498 if (i3 >= 0 && (prefix = name.slice(0, i3)) !== "xmlns") name = name.slice(i3 + 1);
4499 return namespaces_default.hasOwnProperty(prefix) ? { space: namespaces_default[prefix], local: name } : name;
4501 var init_namespace = __esm({
4502 "node_modules/d3-selection/src/namespace.js"() {
4507 // node_modules/d3-selection/src/creator.js
4508 function creatorInherit(name) {
4510 var document2 = this.ownerDocument, uri = this.namespaceURI;
4511 return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
4514 function creatorFixed(fullname) {
4516 return this.ownerDocument.createElementNS(fullname.space, fullname.local);
4519 function creator_default(name) {
4520 var fullname = namespace_default(name);
4521 return (fullname.local ? creatorFixed : creatorInherit)(fullname);
4523 var init_creator = __esm({
4524 "node_modules/d3-selection/src/creator.js"() {
4530 // node_modules/d3-selection/src/selector.js
4533 function selector_default(selector) {
4534 return selector == null ? none : function() {
4535 return this.querySelector(selector);
4538 var init_selector = __esm({
4539 "node_modules/d3-selection/src/selector.js"() {
4543 // node_modules/d3-selection/src/selection/select.js
4544 function select_default(select) {
4545 if (typeof select !== "function") select = selector_default(select);
4546 for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
4547 for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = new Array(n3), node, subnode, i3 = 0; i3 < n3; ++i3) {
4548 if ((node = group[i3]) && (subnode = select.call(node, node.__data__, i3, group))) {
4549 if ("__data__" in node) subnode.__data__ = node.__data__;
4550 subgroup[i3] = subnode;
4554 return new Selection(subgroups, this._parents);
4556 var init_select = __esm({
4557 "node_modules/d3-selection/src/selection/select.js"() {
4563 // node_modules/d3-selection/src/array.js
4564 function array(x2) {
4565 return x2 == null ? [] : Array.isArray(x2) ? x2 : Array.from(x2);
4567 var init_array = __esm({
4568 "node_modules/d3-selection/src/array.js"() {
4572 // node_modules/d3-selection/src/selectorAll.js
4576 function selectorAll_default(selector) {
4577 return selector == null ? empty : function() {
4578 return this.querySelectorAll(selector);
4581 var init_selectorAll = __esm({
4582 "node_modules/d3-selection/src/selectorAll.js"() {
4586 // node_modules/d3-selection/src/selection/selectAll.js
4587 function arrayAll(select) {
4589 return array(select.apply(this, arguments));
4592 function selectAll_default(select) {
4593 if (typeof select === "function") select = arrayAll(select);
4594 else select = selectorAll_default(select);
4595 for (var groups = this._groups, m3 = groups.length, subgroups = [], parents = [], j3 = 0; j3 < m3; ++j3) {
4596 for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
4597 if (node = group[i3]) {
4598 subgroups.push(select.call(node, node.__data__, i3, group));
4603 return new Selection(subgroups, parents);
4605 var init_selectAll = __esm({
4606 "node_modules/d3-selection/src/selection/selectAll.js"() {
4613 // node_modules/d3-selection/src/matcher.js
4614 function matcher_default(selector) {
4616 return this.matches(selector);
4619 function childMatcher(selector) {
4620 return function(node) {
4621 return node.matches(selector);
4624 var init_matcher = __esm({
4625 "node_modules/d3-selection/src/matcher.js"() {
4629 // node_modules/d3-selection/src/selection/selectChild.js
4630 function childFind(match) {
4632 return find.call(this.children, match);
4635 function childFirst() {
4636 return this.firstElementChild;
4638 function selectChild_default(match) {
4639 return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
4642 var init_selectChild = __esm({
4643 "node_modules/d3-selection/src/selection/selectChild.js"() {
4645 find = Array.prototype.find;
4649 // node_modules/d3-selection/src/selection/selectChildren.js
4650 function children() {
4651 return Array.from(this.children);
4653 function childrenFilter(match) {
4655 return filter.call(this.children, match);
4658 function selectChildren_default(match) {
4659 return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
4662 var init_selectChildren = __esm({
4663 "node_modules/d3-selection/src/selection/selectChildren.js"() {
4665 filter = Array.prototype.filter;
4669 // node_modules/d3-selection/src/selection/filter.js
4670 function filter_default(match) {
4671 if (typeof match !== "function") match = matcher_default(match);
4672 for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
4673 for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = [], node, i3 = 0; i3 < n3; ++i3) {
4674 if ((node = group[i3]) && match.call(node, node.__data__, i3, group)) {
4675 subgroup.push(node);
4679 return new Selection(subgroups, this._parents);
4681 var init_filter = __esm({
4682 "node_modules/d3-selection/src/selection/filter.js"() {
4688 // node_modules/d3-selection/src/selection/sparse.js
4689 function sparse_default(update) {
4690 return new Array(update.length);
4692 var init_sparse = __esm({
4693 "node_modules/d3-selection/src/selection/sparse.js"() {
4697 // node_modules/d3-selection/src/selection/enter.js
4698 function enter_default() {
4699 return new Selection(this._enter || this._groups.map(sparse_default), this._parents);
4701 function EnterNode(parent2, datum2) {
4702 this.ownerDocument = parent2.ownerDocument;
4703 this.namespaceURI = parent2.namespaceURI;
4705 this._parent = parent2;
4706 this.__data__ = datum2;
4708 var init_enter = __esm({
4709 "node_modules/d3-selection/src/selection/enter.js"() {
4712 EnterNode.prototype = {
4713 constructor: EnterNode,
4714 appendChild: function(child) {
4715 return this._parent.insertBefore(child, this._next);
4717 insertBefore: function(child, next) {
4718 return this._parent.insertBefore(child, next);
4720 querySelector: function(selector) {
4721 return this._parent.querySelector(selector);
4723 querySelectorAll: function(selector) {
4724 return this._parent.querySelectorAll(selector);
4730 // node_modules/d3-selection/src/constant.js
4731 function constant_default(x2) {
4736 var init_constant = __esm({
4737 "node_modules/d3-selection/src/constant.js"() {
4741 // node_modules/d3-selection/src/selection/data.js
4742 function bindIndex(parent2, group, enter, update, exit, data) {
4743 var i3 = 0, node, groupLength = group.length, dataLength = data.length;
4744 for (; i3 < dataLength; ++i3) {
4745 if (node = group[i3]) {
4746 node.__data__ = data[i3];
4749 enter[i3] = new EnterNode(parent2, data[i3]);
4752 for (; i3 < groupLength; ++i3) {
4753 if (node = group[i3]) {
4758 function bindKey(parent2, group, enter, update, exit, data, key) {
4759 var i3, node, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue;
4760 for (i3 = 0; i3 < groupLength; ++i3) {
4761 if (node = group[i3]) {
4762 keyValues[i3] = keyValue = key.call(node, node.__data__, i3, group) + "";
4763 if (nodeByKeyValue.has(keyValue)) {
4766 nodeByKeyValue.set(keyValue, node);
4770 for (i3 = 0; i3 < dataLength; ++i3) {
4771 keyValue = key.call(parent2, data[i3], i3, data) + "";
4772 if (node = nodeByKeyValue.get(keyValue)) {
4774 node.__data__ = data[i3];
4775 nodeByKeyValue.delete(keyValue);
4777 enter[i3] = new EnterNode(parent2, data[i3]);
4780 for (i3 = 0; i3 < groupLength; ++i3) {
4781 if ((node = group[i3]) && nodeByKeyValue.get(keyValues[i3]) === node) {
4786 function datum(node) {
4787 return node.__data__;
4789 function data_default(value, key) {
4790 if (!arguments.length) return Array.from(this, datum);
4791 var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
4792 if (typeof value !== "function") value = constant_default(value);
4793 for (var m3 = groups.length, update = new Array(m3), enter = new Array(m3), exit = new Array(m3), j3 = 0; j3 < m3; ++j3) {
4794 var parent2 = parents[j3], group = groups[j3], groupLength = group.length, data = arraylike(value.call(parent2, parent2 && parent2.__data__, j3, parents)), dataLength = data.length, enterGroup = enter[j3] = new Array(dataLength), updateGroup = update[j3] = new Array(dataLength), exitGroup = exit[j3] = new Array(groupLength);
4795 bind(parent2, group, enterGroup, updateGroup, exitGroup, data, key);
4796 for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
4797 if (previous = enterGroup[i0]) {
4798 if (i0 >= i1) i1 = i0 + 1;
4799 while (!(next = updateGroup[i1]) && ++i1 < dataLength) ;
4800 previous._next = next || null;
4804 update = new Selection(update, parents);
4805 update._enter = enter;
4806 update._exit = exit;
4809 function arraylike(data) {
4810 return typeof data === "object" && "length" in data ? data : Array.from(data);
4812 var init_data = __esm({
4813 "node_modules/d3-selection/src/selection/data.js"() {
4820 // node_modules/d3-selection/src/selection/exit.js
4821 function exit_default() {
4822 return new Selection(this._exit || this._groups.map(sparse_default), this._parents);
4824 var init_exit = __esm({
4825 "node_modules/d3-selection/src/selection/exit.js"() {
4831 // node_modules/d3-selection/src/selection/join.js
4832 function join_default(onenter, onupdate, onexit) {
4833 var enter = this.enter(), update = this, exit = this.exit();
4834 if (typeof onenter === "function") {
4835 enter = onenter(enter);
4836 if (enter) enter = enter.selection();
4838 enter = enter.append(onenter + "");
4840 if (onupdate != null) {
4841 update = onupdate(update);
4842 if (update) update = update.selection();
4844 if (onexit == null) exit.remove();
4846 return enter && update ? enter.merge(update).order() : update;
4848 var init_join = __esm({
4849 "node_modules/d3-selection/src/selection/join.js"() {
4853 // node_modules/d3-selection/src/selection/merge.js
4854 function merge_default(context) {
4855 var selection2 = context.selection ? context.selection() : context;
4856 for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m3 = Math.min(m0, m1), merges = new Array(m0), j3 = 0; j3 < m3; ++j3) {
4857 for (var group0 = groups0[j3], group1 = groups1[j3], n3 = group0.length, merge3 = merges[j3] = new Array(n3), node, i3 = 0; i3 < n3; ++i3) {
4858 if (node = group0[i3] || group1[i3]) {
4863 for (; j3 < m0; ++j3) {
4864 merges[j3] = groups0[j3];
4866 return new Selection(merges, this._parents);
4868 var init_merge2 = __esm({
4869 "node_modules/d3-selection/src/selection/merge.js"() {
4874 // node_modules/d3-selection/src/selection/order.js
4875 function order_default() {
4876 for (var groups = this._groups, j3 = -1, m3 = groups.length; ++j3 < m3; ) {
4877 for (var group = groups[j3], i3 = group.length - 1, next = group[i3], node; --i3 >= 0; ) {
4878 if (node = group[i3]) {
4879 if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);
4886 var init_order = __esm({
4887 "node_modules/d3-selection/src/selection/order.js"() {
4891 // node_modules/d3-selection/src/selection/sort.js
4892 function sort_default(compare2) {
4893 if (!compare2) compare2 = ascending2;
4894 function compareNode(a2, b3) {
4895 return a2 && b3 ? compare2(a2.__data__, b3.__data__) : !a2 - !b3;
4897 for (var groups = this._groups, m3 = groups.length, sortgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
4898 for (var group = groups[j3], n3 = group.length, sortgroup = sortgroups[j3] = new Array(n3), node, i3 = 0; i3 < n3; ++i3) {
4899 if (node = group[i3]) {
4900 sortgroup[i3] = node;
4903 sortgroup.sort(compareNode);
4905 return new Selection(sortgroups, this._parents).order();
4907 function ascending2(a2, b3) {
4908 return a2 < b3 ? -1 : a2 > b3 ? 1 : a2 >= b3 ? 0 : NaN;
4910 var init_sort2 = __esm({
4911 "node_modules/d3-selection/src/selection/sort.js"() {
4916 // node_modules/d3-selection/src/selection/call.js
4917 function call_default() {
4918 var callback = arguments[0];
4919 arguments[0] = this;
4920 callback.apply(null, arguments);
4923 var init_call = __esm({
4924 "node_modules/d3-selection/src/selection/call.js"() {
4928 // node_modules/d3-selection/src/selection/nodes.js
4929 function nodes_default() {
4930 return Array.from(this);
4932 var init_nodes = __esm({
4933 "node_modules/d3-selection/src/selection/nodes.js"() {
4937 // node_modules/d3-selection/src/selection/node.js
4938 function node_default() {
4939 for (var groups = this._groups, j3 = 0, m3 = groups.length; j3 < m3; ++j3) {
4940 for (var group = groups[j3], i3 = 0, n3 = group.length; i3 < n3; ++i3) {
4941 var node = group[i3];
4942 if (node) return node;
4947 var init_node = __esm({
4948 "node_modules/d3-selection/src/selection/node.js"() {
4952 // node_modules/d3-selection/src/selection/size.js
4953 function size_default() {
4955 for (const node of this) ++size;
4958 var init_size = __esm({
4959 "node_modules/d3-selection/src/selection/size.js"() {
4963 // node_modules/d3-selection/src/selection/empty.js
4964 function empty_default() {
4965 return !this.node();
4967 var init_empty = __esm({
4968 "node_modules/d3-selection/src/selection/empty.js"() {
4972 // node_modules/d3-selection/src/selection/each.js
4973 function each_default(callback) {
4974 for (var groups = this._groups, j3 = 0, m3 = groups.length; j3 < m3; ++j3) {
4975 for (var group = groups[j3], i3 = 0, n3 = group.length, node; i3 < n3; ++i3) {
4976 if (node = group[i3]) callback.call(node, node.__data__, i3, group);
4981 var init_each = __esm({
4982 "node_modules/d3-selection/src/selection/each.js"() {
4986 // node_modules/d3-selection/src/selection/attr.js
4987 function attrRemove(name) {
4989 this.removeAttribute(name);
4992 function attrRemoveNS(fullname) {
4994 this.removeAttributeNS(fullname.space, fullname.local);
4997 function attrConstant(name, value) {
4999 this.setAttribute(name, value);
5002 function attrConstantNS(fullname, value) {
5004 this.setAttributeNS(fullname.space, fullname.local, value);
5007 function attrFunction(name, value) {
5009 var v3 = value.apply(this, arguments);
5010 if (v3 == null) this.removeAttribute(name);
5011 else this.setAttribute(name, v3);
5014 function attrFunctionNS(fullname, value) {
5016 var v3 = value.apply(this, arguments);
5017 if (v3 == null) this.removeAttributeNS(fullname.space, fullname.local);
5018 else this.setAttributeNS(fullname.space, fullname.local, v3);
5021 function attr_default(name, value) {
5022 var fullname = namespace_default(name);
5023 if (arguments.length < 2) {
5024 var node = this.node();
5025 return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname);
5027 return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value));
5029 var init_attr = __esm({
5030 "node_modules/d3-selection/src/selection/attr.js"() {
5035 // node_modules/d3-selection/src/window.js
5036 function window_default(node) {
5037 return node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView;
5039 var init_window = __esm({
5040 "node_modules/d3-selection/src/window.js"() {
5044 // node_modules/d3-selection/src/selection/style.js
5045 function styleRemove(name) {
5047 this.style.removeProperty(name);
5050 function styleConstant(name, value, priority) {
5052 this.style.setProperty(name, value, priority);
5055 function styleFunction(name, value, priority) {
5057 var v3 = value.apply(this, arguments);
5058 if (v3 == null) this.style.removeProperty(name);
5059 else this.style.setProperty(name, v3, priority);
5062 function style_default(name, value, priority) {
5063 return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
5065 function styleValue(node, name) {
5066 return node.style.getPropertyValue(name) || window_default(node).getComputedStyle(node, null).getPropertyValue(name);
5068 var init_style = __esm({
5069 "node_modules/d3-selection/src/selection/style.js"() {
5074 // node_modules/d3-selection/src/selection/property.js
5075 function propertyRemove(name) {
5080 function propertyConstant(name, value) {
5085 function propertyFunction(name, value) {
5087 var v3 = value.apply(this, arguments);
5088 if (v3 == null) delete this[name];
5089 else this[name] = v3;
5092 function property_default(name, value) {
5093 return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
5095 var init_property = __esm({
5096 "node_modules/d3-selection/src/selection/property.js"() {
5100 // node_modules/d3-selection/src/selection/classed.js
5101 function classArray(string) {
5102 return string.trim().split(/^|\s+/);
5104 function classList(node) {
5105 return node.classList || new ClassList(node);
5107 function ClassList(node) {
5109 this._names = classArray(node.getAttribute("class") || "");
5111 function classedAdd(node, names) {
5112 var list = classList(node), i3 = -1, n3 = names.length;
5113 while (++i3 < n3) list.add(names[i3]);
5115 function classedRemove(node, names) {
5116 var list = classList(node), i3 = -1, n3 = names.length;
5117 while (++i3 < n3) list.remove(names[i3]);
5119 function classedTrue(names) {
5121 classedAdd(this, names);
5124 function classedFalse(names) {
5126 classedRemove(this, names);
5129 function classedFunction(names, value) {
5131 (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
5134 function classed_default(name, value) {
5135 var names = classArray(name + "");
5136 if (arguments.length < 2) {
5137 var list = classList(this.node()), i3 = -1, n3 = names.length;
5138 while (++i3 < n3) if (!list.contains(names[i3])) return false;
5141 return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
5143 var init_classed = __esm({
5144 "node_modules/d3-selection/src/selection/classed.js"() {
5145 ClassList.prototype = {
5146 add: function(name) {
5147 var i3 = this._names.indexOf(name);
5149 this._names.push(name);
5150 this._node.setAttribute("class", this._names.join(" "));
5153 remove: function(name) {
5154 var i3 = this._names.indexOf(name);
5156 this._names.splice(i3, 1);
5157 this._node.setAttribute("class", this._names.join(" "));
5160 contains: function(name) {
5161 return this._names.indexOf(name) >= 0;
5167 // node_modules/d3-selection/src/selection/text.js
5168 function textRemove() {
5169 this.textContent = "";
5171 function textConstant(value) {
5173 this.textContent = value;
5176 function textFunction(value) {
5178 var v3 = value.apply(this, arguments);
5179 this.textContent = v3 == null ? "" : v3;
5182 function text_default(value) {
5183 return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent;
5185 var init_text = __esm({
5186 "node_modules/d3-selection/src/selection/text.js"() {
5190 // node_modules/d3-selection/src/selection/html.js
5191 function htmlRemove() {
5192 this.innerHTML = "";
5194 function htmlConstant(value) {
5196 this.innerHTML = value;
5199 function htmlFunction(value) {
5201 var v3 = value.apply(this, arguments);
5202 this.innerHTML = v3 == null ? "" : v3;
5205 function html_default(value) {
5206 return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
5208 var init_html = __esm({
5209 "node_modules/d3-selection/src/selection/html.js"() {
5213 // node_modules/d3-selection/src/selection/raise.js
5215 if (this.nextSibling) this.parentNode.appendChild(this);
5217 function raise_default() {
5218 return this.each(raise);
5220 var init_raise = __esm({
5221 "node_modules/d3-selection/src/selection/raise.js"() {
5225 // node_modules/d3-selection/src/selection/lower.js
5227 if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
5229 function lower_default() {
5230 return this.each(lower);
5232 var init_lower = __esm({
5233 "node_modules/d3-selection/src/selection/lower.js"() {
5237 // node_modules/d3-selection/src/selection/append.js
5238 function append_default(name) {
5239 var create2 = typeof name === "function" ? name : creator_default(name);
5240 return this.select(function() {
5241 return this.appendChild(create2.apply(this, arguments));
5244 var init_append = __esm({
5245 "node_modules/d3-selection/src/selection/append.js"() {
5250 // node_modules/d3-selection/src/selection/insert.js
5251 function constantNull() {
5254 function insert_default(name, before) {
5255 var create2 = typeof name === "function" ? name : creator_default(name), select = before == null ? constantNull : typeof before === "function" ? before : selector_default(before);
5256 return this.select(function() {
5257 return this.insertBefore(create2.apply(this, arguments), select.apply(this, arguments) || null);
5260 var init_insert = __esm({
5261 "node_modules/d3-selection/src/selection/insert.js"() {
5267 // node_modules/d3-selection/src/selection/remove.js
5269 var parent2 = this.parentNode;
5270 if (parent2) parent2.removeChild(this);
5272 function remove_default() {
5273 return this.each(remove);
5275 var init_remove = __esm({
5276 "node_modules/d3-selection/src/selection/remove.js"() {
5280 // node_modules/d3-selection/src/selection/clone.js
5281 function selection_cloneShallow() {
5282 var clone2 = this.cloneNode(false), parent2 = this.parentNode;
5283 return parent2 ? parent2.insertBefore(clone2, this.nextSibling) : clone2;
5285 function selection_cloneDeep() {
5286 var clone2 = this.cloneNode(true), parent2 = this.parentNode;
5287 return parent2 ? parent2.insertBefore(clone2, this.nextSibling) : clone2;
5289 function clone_default(deep) {
5290 return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
5292 var init_clone = __esm({
5293 "node_modules/d3-selection/src/selection/clone.js"() {
5297 // node_modules/d3-selection/src/selection/datum.js
5298 function datum_default(value) {
5299 return arguments.length ? this.property("__data__", value) : this.node().__data__;
5301 var init_datum = __esm({
5302 "node_modules/d3-selection/src/selection/datum.js"() {
5306 // node_modules/d3-selection/src/selection/on.js
5307 function contextListener(listener) {
5308 return function(event) {
5309 listener.call(this, event, this.__data__);
5312 function parseTypenames2(typenames) {
5313 return typenames.trim().split(/^|\s+/).map(function(t2) {
5314 var name = "", i3 = t2.indexOf(".");
5315 if (i3 >= 0) name = t2.slice(i3 + 1), t2 = t2.slice(0, i3);
5316 return { type: t2, name };
5319 function onRemove(typename) {
5323 for (var j3 = 0, i3 = -1, m3 = on.length, o2; j3 < m3; ++j3) {
5324 if (o2 = on[j3], (!typename.type || o2.type === typename.type) && o2.name === typename.name) {
5325 this.removeEventListener(o2.type, o2.listener, o2.options);
5330 if (++i3) on.length = i3;
5331 else delete this.__on;
5334 function onAdd(typename, value, options) {
5336 var on = this.__on, o2, listener = contextListener(value);
5337 if (on) for (var j3 = 0, m3 = on.length; j3 < m3; ++j3) {
5338 if ((o2 = on[j3]).type === typename.type && o2.name === typename.name) {
5339 this.removeEventListener(o2.type, o2.listener, o2.options);
5340 this.addEventListener(o2.type, o2.listener = listener, o2.options = options);
5345 this.addEventListener(typename.type, listener, options);
5346 o2 = { type: typename.type, name: typename.name, value, listener, options };
5347 if (!on) this.__on = [o2];
5351 function on_default(typename, value, options) {
5352 var typenames = parseTypenames2(typename + ""), i3, n3 = typenames.length, t2;
5353 if (arguments.length < 2) {
5354 var on = this.node().__on;
5355 if (on) for (var j3 = 0, m3 = on.length, o2; j3 < m3; ++j3) {
5356 for (i3 = 0, o2 = on[j3]; i3 < n3; ++i3) {
5357 if ((t2 = typenames[i3]).type === o2.type && t2.name === o2.name) {
5364 on = value ? onAdd : onRemove;
5365 for (i3 = 0; i3 < n3; ++i3) this.each(on(typenames[i3], value, options));
5368 var init_on = __esm({
5369 "node_modules/d3-selection/src/selection/on.js"() {
5373 // node_modules/d3-selection/src/selection/dispatch.js
5374 function dispatchEvent(node, type2, params) {
5375 var window2 = window_default(node), event = window2.CustomEvent;
5376 if (typeof event === "function") {
5377 event = new event(type2, params);
5379 event = window2.document.createEvent("Event");
5380 if (params) event.initEvent(type2, params.bubbles, params.cancelable), event.detail = params.detail;
5381 else event.initEvent(type2, false, false);
5383 node.dispatchEvent(event);
5385 function dispatchConstant(type2, params) {
5387 return dispatchEvent(this, type2, params);
5390 function dispatchFunction(type2, params) {
5392 return dispatchEvent(this, type2, params.apply(this, arguments));
5395 function dispatch_default2(type2, params) {
5396 return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type2, params));
5398 var init_dispatch2 = __esm({
5399 "node_modules/d3-selection/src/selection/dispatch.js"() {
5404 // node_modules/d3-selection/src/selection/iterator.js
5405 function* iterator_default() {
5406 for (var groups = this._groups, j3 = 0, m3 = groups.length; j3 < m3; ++j3) {
5407 for (var group = groups[j3], i3 = 0, n3 = group.length, node; i3 < n3; ++i3) {
5408 if (node = group[i3]) yield node;
5412 var init_iterator = __esm({
5413 "node_modules/d3-selection/src/selection/iterator.js"() {
5417 // node_modules/d3-selection/src/selection/index.js
5418 function Selection(groups, parents) {
5419 this._groups = groups;
5420 this._parents = parents;
5422 function selection() {
5423 return new Selection([[document.documentElement]], root);
5425 function selection_selection() {
5428 var root, selection_default;
5429 var init_selection = __esm({
5430 "node_modules/d3-selection/src/selection/index.js"() {
5434 init_selectChildren();
5466 Selection.prototype = selection.prototype = {
5467 constructor: Selection,
5468 select: select_default,
5469 selectAll: selectAll_default,
5470 selectChild: selectChild_default,
5471 selectChildren: selectChildren_default,
5472 filter: filter_default,
5474 enter: enter_default,
5477 merge: merge_default,
5478 selection: selection_selection,
5479 order: order_default,
5482 nodes: nodes_default,
5485 empty: empty_default,
5488 style: style_default,
5489 property: property_default,
5490 classed: classed_default,
5493 raise: raise_default,
5494 lower: lower_default,
5495 append: append_default,
5496 insert: insert_default,
5497 remove: remove_default,
5498 clone: clone_default,
5499 datum: datum_default,
5501 dispatch: dispatch_default2,
5502 [Symbol.iterator]: iterator_default
5504 selection_default = selection;
5508 // node_modules/d3-selection/src/select.js
5509 function select_default2(selector) {
5510 return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root);
5512 var init_select2 = __esm({
5513 "node_modules/d3-selection/src/select.js"() {
5518 // node_modules/d3-selection/src/sourceEvent.js
5519 function sourceEvent_default(event) {
5521 while (sourceEvent = event.sourceEvent) event = sourceEvent;
5524 var init_sourceEvent = __esm({
5525 "node_modules/d3-selection/src/sourceEvent.js"() {
5529 // node_modules/d3-selection/src/pointer.js
5530 function pointer_default(event, node) {
5531 event = sourceEvent_default(event);
5532 if (node === void 0) node = event.currentTarget;
5534 var svg2 = node.ownerSVGElement || node;
5535 if (svg2.createSVGPoint) {
5536 var point = svg2.createSVGPoint();
5537 point.x = event.clientX, point.y = event.clientY;
5538 point = point.matrixTransform(node.getScreenCTM().inverse());
5539 return [point.x, point.y];
5541 if (node.getBoundingClientRect) {
5542 var rect = node.getBoundingClientRect();
5543 return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
5546 return [event.pageX, event.pageY];
5548 var init_pointer = __esm({
5549 "node_modules/d3-selection/src/pointer.js"() {
5554 // node_modules/d3-selection/src/selectAll.js
5555 function selectAll_default2(selector) {
5556 return typeof selector === "string" ? new Selection([document.querySelectorAll(selector)], [document.documentElement]) : new Selection([array(selector)], root);
5558 var init_selectAll2 = __esm({
5559 "node_modules/d3-selection/src/selectAll.js"() {
5565 // node_modules/d3-selection/src/index.js
5566 var init_src5 = __esm({
5567 "node_modules/d3-selection/src/index.js"() {
5580 // node_modules/d3-drag/src/noevent.js
5581 function nopropagation(event) {
5582 event.stopImmediatePropagation();
5584 function noevent_default(event) {
5585 event.preventDefault();
5586 event.stopImmediatePropagation();
5588 var nonpassive, nonpassivecapture;
5589 var init_noevent = __esm({
5590 "node_modules/d3-drag/src/noevent.js"() {
5591 nonpassive = { passive: false };
5592 nonpassivecapture = { capture: true, passive: false };
5596 // node_modules/d3-drag/src/nodrag.js
5597 function nodrag_default(view) {
5598 var root3 = view.document.documentElement, selection2 = select_default2(view).on("dragstart.drag", noevent_default, nonpassivecapture);
5599 if ("onselectstart" in root3) {
5600 selection2.on("selectstart.drag", noevent_default, nonpassivecapture);
5602 root3.__noselect = root3.style.MozUserSelect;
5603 root3.style.MozUserSelect = "none";
5606 function yesdrag(view, noclick) {
5607 var root3 = view.document.documentElement, selection2 = select_default2(view).on("dragstart.drag", null);
5609 selection2.on("click.drag", noevent_default, nonpassivecapture);
5610 setTimeout(function() {
5611 selection2.on("click.drag", null);
5614 if ("onselectstart" in root3) {
5615 selection2.on("selectstart.drag", null);
5617 root3.style.MozUserSelect = root3.__noselect;
5618 delete root3.__noselect;
5621 var init_nodrag = __esm({
5622 "node_modules/d3-drag/src/nodrag.js"() {
5628 // node_modules/d3-drag/src/constant.js
5629 var constant_default2;
5630 var init_constant2 = __esm({
5631 "node_modules/d3-drag/src/constant.js"() {
5632 constant_default2 = (x2) => () => x2;
5636 // node_modules/d3-drag/src/event.js
5637 function DragEvent(type2, {
5647 dispatch: dispatch14
5649 Object.defineProperties(this, {
5650 type: { value: type2, enumerable: true, configurable: true },
5651 sourceEvent: { value: sourceEvent, enumerable: true, configurable: true },
5652 subject: { value: subject, enumerable: true, configurable: true },
5653 target: { value: target, enumerable: true, configurable: true },
5654 identifier: { value: identifier, enumerable: true, configurable: true },
5655 active: { value: active, enumerable: true, configurable: true },
5656 x: { value: x2, enumerable: true, configurable: true },
5657 y: { value: y3, enumerable: true, configurable: true },
5658 dx: { value: dx, enumerable: true, configurable: true },
5659 dy: { value: dy, enumerable: true, configurable: true },
5660 _: { value: dispatch14 }
5663 var init_event = __esm({
5664 "node_modules/d3-drag/src/event.js"() {
5665 DragEvent.prototype.on = function() {
5666 var value = this._.on.apply(this._, arguments);
5667 return value === this._ ? this : value;
5672 // node_modules/d3-drag/src/drag.js
5673 function defaultFilter(event) {
5674 return !event.ctrlKey && !event.button;
5676 function defaultContainer() {
5677 return this.parentNode;
5679 function defaultSubject(event, d4) {
5680 return d4 == null ? { x: event.x, y: event.y } : d4;
5682 function defaultTouchable() {
5683 return navigator.maxTouchPoints || "ontouchstart" in this;
5685 function drag_default() {
5686 var filter2 = defaultFilter, container = defaultContainer, subject = defaultSubject, touchable = defaultTouchable, gestures = {}, listeners = dispatch_default("start", "drag", "end"), active = 0, mousedownx, mousedowny, mousemoving, touchending, clickDistance2 = 0;
5687 function drag(selection2) {
5688 selection2.on("mousedown.drag", mousedowned).filter(touchable).on("touchstart.drag", touchstarted).on("touchmove.drag", touchmoved, nonpassive).on("touchend.drag touchcancel.drag", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
5690 function mousedowned(event, d4) {
5691 if (touchending || !filter2.call(this, event, d4)) return;
5692 var gesture = beforestart(this, container.call(this, event, d4), event, d4, "mouse");
5693 if (!gesture) return;
5694 select_default2(event.view).on("mousemove.drag", mousemoved, nonpassivecapture).on("mouseup.drag", mouseupped, nonpassivecapture);
5695 nodrag_default(event.view);
5696 nopropagation(event);
5697 mousemoving = false;
5698 mousedownx = event.clientX;
5699 mousedowny = event.clientY;
5700 gesture("start", event);
5702 function mousemoved(event) {
5703 noevent_default(event);
5705 var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;
5706 mousemoving = dx * dx + dy * dy > clickDistance2;
5708 gestures.mouse("drag", event);
5710 function mouseupped(event) {
5711 select_default2(event.view).on("mousemove.drag mouseup.drag", null);
5712 yesdrag(event.view, mousemoving);
5713 noevent_default(event);
5714 gestures.mouse("end", event);
5716 function touchstarted(event, d4) {
5717 if (!filter2.call(this, event, d4)) return;
5718 var touches = event.changedTouches, c2 = container.call(this, event, d4), n3 = touches.length, i3, gesture;
5719 for (i3 = 0; i3 < n3; ++i3) {
5720 if (gesture = beforestart(this, c2, event, d4, touches[i3].identifier, touches[i3])) {
5721 nopropagation(event);
5722 gesture("start", event, touches[i3]);
5726 function touchmoved(event) {
5727 var touches = event.changedTouches, n3 = touches.length, i3, gesture;
5728 for (i3 = 0; i3 < n3; ++i3) {
5729 if (gesture = gestures[touches[i3].identifier]) {
5730 noevent_default(event);
5731 gesture("drag", event, touches[i3]);
5735 function touchended(event) {
5736 var touches = event.changedTouches, n3 = touches.length, i3, gesture;
5737 if (touchending) clearTimeout(touchending);
5738 touchending = setTimeout(function() {
5741 for (i3 = 0; i3 < n3; ++i3) {
5742 if (gesture = gestures[touches[i3].identifier]) {
5743 nopropagation(event);
5744 gesture("end", event, touches[i3]);
5748 function beforestart(that, container2, event, d4, identifier, touch) {
5749 var dispatch14 = listeners.copy(), p2 = pointer_default(touch || event, container2), dx, dy, s2;
5750 if ((s2 = subject.call(that, new DragEvent("beforestart", {
5759 dispatch: dispatch14
5760 }), d4)) == null) return;
5761 dx = s2.x - p2[0] || 0;
5762 dy = s2.y - p2[1] || 0;
5763 return function gesture(type2, event2, touch2) {
5767 gestures[identifier] = gesture, n3 = active++;
5770 delete gestures[identifier], --active;
5773 p2 = pointer_default(touch2 || event2, container2), n3 = active;
5779 new DragEvent(type2, {
5780 sourceEvent: event2,
5789 dispatch: dispatch14
5795 drag.filter = function(_3) {
5796 return arguments.length ? (filter2 = typeof _3 === "function" ? _3 : constant_default2(!!_3), drag) : filter2;
5798 drag.container = function(_3) {
5799 return arguments.length ? (container = typeof _3 === "function" ? _3 : constant_default2(_3), drag) : container;
5801 drag.subject = function(_3) {
5802 return arguments.length ? (subject = typeof _3 === "function" ? _3 : constant_default2(_3), drag) : subject;
5804 drag.touchable = function(_3) {
5805 return arguments.length ? (touchable = typeof _3 === "function" ? _3 : constant_default2(!!_3), drag) : touchable;
5807 drag.on = function() {
5808 var value = listeners.on.apply(listeners, arguments);
5809 return value === listeners ? drag : value;
5811 drag.clickDistance = function(_3) {
5812 return arguments.length ? (clickDistance2 = (_3 = +_3) * _3, drag) : Math.sqrt(clickDistance2);
5816 var init_drag = __esm({
5817 "node_modules/d3-drag/src/drag.js"() {
5827 // node_modules/d3-drag/src/index.js
5828 var init_src6 = __esm({
5829 "node_modules/d3-drag/src/index.js"() {
5835 // node_modules/d3-color/src/define.js
5836 function define_default(constructor, factory, prototype4) {
5837 constructor.prototype = factory.prototype = prototype4;
5838 prototype4.constructor = constructor;
5840 function extend(parent2, definition) {
5841 var prototype4 = Object.create(parent2.prototype);
5842 for (var key in definition) prototype4[key] = definition[key];
5845 var init_define = __esm({
5846 "node_modules/d3-color/src/define.js"() {
5850 // node_modules/d3-color/src/color.js
5853 function color_formatHex() {
5854 return this.rgb().formatHex();
5856 function color_formatHex8() {
5857 return this.rgb().formatHex8();
5859 function color_formatHsl() {
5860 return hslConvert(this).formatHsl();
5862 function color_formatRgb() {
5863 return this.rgb().formatRgb();
5865 function color(format2) {
5867 format2 = (format2 + "").trim().toLowerCase();
5868 return (m3 = reHex.exec(format2)) ? (l4 = m3[1].length, m3 = parseInt(m3[1], 16), l4 === 6 ? rgbn(m3) : l4 === 3 ? new Rgb(m3 >> 8 & 15 | m3 >> 4 & 240, m3 >> 4 & 15 | m3 & 240, (m3 & 15) << 4 | m3 & 15, 1) : l4 === 8 ? rgba(m3 >> 24 & 255, m3 >> 16 & 255, m3 >> 8 & 255, (m3 & 255) / 255) : l4 === 4 ? rgba(m3 >> 12 & 15 | m3 >> 8 & 240, m3 >> 8 & 15 | m3 >> 4 & 240, m3 >> 4 & 15 | m3 & 240, ((m3 & 15) << 4 | m3 & 15) / 255) : null) : (m3 = reRgbInteger.exec(format2)) ? new Rgb(m3[1], m3[2], m3[3], 1) : (m3 = reRgbPercent.exec(format2)) ? new Rgb(m3[1] * 255 / 100, m3[2] * 255 / 100, m3[3] * 255 / 100, 1) : (m3 = reRgbaInteger.exec(format2)) ? rgba(m3[1], m3[2], m3[3], m3[4]) : (m3 = reRgbaPercent.exec(format2)) ? rgba(m3[1] * 255 / 100, m3[2] * 255 / 100, m3[3] * 255 / 100, m3[4]) : (m3 = reHslPercent.exec(format2)) ? hsla(m3[1], m3[2] / 100, m3[3] / 100, 1) : (m3 = reHslaPercent.exec(format2)) ? hsla(m3[1], m3[2] / 100, m3[3] / 100, m3[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
5871 return new Rgb(n3 >> 16 & 255, n3 >> 8 & 255, n3 & 255, 1);
5873 function rgba(r2, g3, b3, a2) {
5874 if (a2 <= 0) r2 = g3 = b3 = NaN;
5875 return new Rgb(r2, g3, b3, a2);
5877 function rgbConvert(o2) {
5878 if (!(o2 instanceof Color)) o2 = color(o2);
5879 if (!o2) return new Rgb();
5881 return new Rgb(o2.r, o2.g, o2.b, o2.opacity);
5883 function rgb(r2, g3, b3, opacity) {
5884 return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g3, b3, opacity == null ? 1 : opacity);
5886 function Rgb(r2, g3, b3, opacity) {
5890 this.opacity = +opacity;
5892 function rgb_formatHex() {
5893 return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
5895 function rgb_formatHex8() {
5896 return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
5898 function rgb_formatRgb() {
5899 const a2 = clampa(this.opacity);
5900 return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`;
5902 function clampa(opacity) {
5903 return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
5905 function clampi(value) {
5906 return Math.max(0, Math.min(255, Math.round(value) || 0));
5908 function hex(value) {
5909 value = clampi(value);
5910 return (value < 16 ? "0" : "") + value.toString(16);
5912 function hsla(h3, s2, l4, a2) {
5913 if (a2 <= 0) h3 = s2 = l4 = NaN;
5914 else if (l4 <= 0 || l4 >= 1) h3 = s2 = NaN;
5915 else if (s2 <= 0) h3 = NaN;
5916 return new Hsl(h3, s2, l4, a2);
5918 function hslConvert(o2) {
5919 if (o2 instanceof Hsl) return new Hsl(o2.h, o2.s, o2.l, o2.opacity);
5920 if (!(o2 instanceof Color)) o2 = color(o2);
5921 if (!o2) return new Hsl();
5922 if (o2 instanceof Hsl) return o2;
5924 var r2 = o2.r / 255, g3 = o2.g / 255, b3 = o2.b / 255, min3 = Math.min(r2, g3, b3), max3 = Math.max(r2, g3, b3), h3 = NaN, s2 = max3 - min3, l4 = (max3 + min3) / 2;
5926 if (r2 === max3) h3 = (g3 - b3) / s2 + (g3 < b3) * 6;
5927 else if (g3 === max3) h3 = (b3 - r2) / s2 + 2;
5928 else h3 = (r2 - g3) / s2 + 4;
5929 s2 /= l4 < 0.5 ? max3 + min3 : 2 - max3 - min3;
5932 s2 = l4 > 0 && l4 < 1 ? 0 : h3;
5934 return new Hsl(h3, s2, l4, o2.opacity);
5936 function hsl(h3, s2, l4, opacity) {
5937 return arguments.length === 1 ? hslConvert(h3) : new Hsl(h3, s2, l4, opacity == null ? 1 : opacity);
5939 function Hsl(h3, s2, l4, opacity) {
5943 this.opacity = +opacity;
5945 function clamph(value) {
5946 value = (value || 0) % 360;
5947 return value < 0 ? value + 360 : value;
5949 function clampt(value) {
5950 return Math.max(0, Math.min(1, value || 0));
5952 function hsl2rgb(h3, m1, m22) {
5953 return (h3 < 60 ? m1 + (m22 - m1) * h3 / 60 : h3 < 180 ? m22 : h3 < 240 ? m1 + (m22 - m1) * (240 - h3) / 60 : m1) * 255;
5955 var darker, brighter, reI, reN, reP, reHex, reRgbInteger, reRgbPercent, reRgbaInteger, reRgbaPercent, reHslPercent, reHslaPercent, named;
5956 var init_color = __esm({
5957 "node_modules/d3-color/src/color.js"() {
5960 brighter = 1 / darker;
5961 reI = "\\s*([+-]?\\d+)\\s*";
5962 reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*";
5963 reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
5964 reHex = /^#([0-9a-f]{3,8})$/;
5965 reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`);
5966 reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`);
5967 reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`);
5968 reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`);
5969 reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`);
5970 reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
5972 aliceblue: 15792383,
5973 antiquewhite: 16444375,
5975 aquamarine: 8388564,
5980 blanchedalmond: 16772045,
5982 blueviolet: 9055202,
5984 burlywood: 14596231,
5986 chartreuse: 8388352,
5987 chocolate: 13789470,
5989 cornflowerblue: 6591981,
5995 darkgoldenrod: 12092939,
5999 darkkhaki: 12433259,
6000 darkmagenta: 9109643,
6001 darkolivegreen: 5597999,
6002 darkorange: 16747520,
6003 darkorchid: 10040012,
6005 darksalmon: 15308410,
6006 darkseagreen: 9419919,
6007 darkslateblue: 4734347,
6008 darkslategray: 3100495,
6009 darkslategrey: 3100495,
6010 darkturquoise: 52945,
6011 darkviolet: 9699539,
6016 dodgerblue: 2003199,
6017 firebrick: 11674146,
6018 floralwhite: 16775920,
6019 forestgreen: 2263842,
6021 gainsboro: 14474460,
6022 ghostwhite: 16316671,
6024 goldenrod: 14329120,
6027 greenyellow: 11403055,
6031 indianred: 13458524,
6036 lavenderblush: 16773365,
6038 lemonchiffon: 16775885,
6039 lightblue: 11393254,
6040 lightcoral: 15761536,
6041 lightcyan: 14745599,
6042 lightgoldenrodyellow: 16448210,
6043 lightgray: 13882323,
6044 lightgreen: 9498256,
6045 lightgrey: 13882323,
6046 lightpink: 16758465,
6047 lightsalmon: 16752762,
6048 lightseagreen: 2142890,
6049 lightskyblue: 8900346,
6050 lightslategray: 7833753,
6051 lightslategrey: 7833753,
6052 lightsteelblue: 11584734,
6053 lightyellow: 16777184,
6059 mediumaquamarine: 6737322,
6061 mediumorchid: 12211667,
6062 mediumpurple: 9662683,
6063 mediumseagreen: 3978097,
6064 mediumslateblue: 8087790,
6065 mediumspringgreen: 64154,
6066 mediumturquoise: 4772300,
6067 mediumvioletred: 13047173,
6068 midnightblue: 1644912,
6069 mintcream: 16121850,
6070 mistyrose: 16770273,
6072 navajowhite: 16768685,
6078 orangered: 16729344,
6080 palegoldenrod: 15657130,
6081 palegreen: 10025880,
6082 paleturquoise: 11529966,
6083 palevioletred: 14381203,
6084 papayawhip: 16773077,
6085 peachpuff: 16767673,
6089 powderblue: 11591910,
6091 rebeccapurple: 6697881,
6093 rosybrown: 12357519,
6095 saddlebrown: 9127187,
6097 sandybrown: 16032864,
6117 whitesmoke: 16119285,
6119 yellowgreen: 10145074
6121 define_default(Color, color, {
6123 return Object.assign(new this.constructor(), this, channels);
6126 return this.rgb().displayable();
6128 hex: color_formatHex,
6129 // Deprecated! Use color.formatHex.
6130 formatHex: color_formatHex,
6131 formatHex8: color_formatHex8,
6132 formatHsl: color_formatHsl,
6133 formatRgb: color_formatRgb,
6134 toString: color_formatRgb
6136 define_default(Rgb, rgb, extend(Color, {
6138 k2 = k2 == null ? brighter : Math.pow(brighter, k2);
6139 return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
6142 k2 = k2 == null ? darker : Math.pow(darker, k2);
6143 return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
6149 return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
6152 return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
6155 // Deprecated! Use color.formatHex.
6156 formatHex: rgb_formatHex,
6157 formatHex8: rgb_formatHex8,
6158 formatRgb: rgb_formatRgb,
6159 toString: rgb_formatRgb
6161 define_default(Hsl, hsl, extend(Color, {
6163 k2 = k2 == null ? brighter : Math.pow(brighter, k2);
6164 return new Hsl(this.h, this.s, this.l * k2, this.opacity);
6167 k2 = k2 == null ? darker : Math.pow(darker, k2);
6168 return new Hsl(this.h, this.s, this.l * k2, this.opacity);
6171 var h3 = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h3) || isNaN(this.s) ? 0 : this.s, l4 = this.l, m22 = l4 + (l4 < 0.5 ? l4 : 1 - l4) * s2, m1 = 2 * l4 - m22;
6173 hsl2rgb(h3 >= 240 ? h3 - 240 : h3 + 120, m1, m22),
6174 hsl2rgb(h3, m1, m22),
6175 hsl2rgb(h3 < 120 ? h3 + 240 : h3 - 120, m1, m22),
6180 return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
6183 return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
6186 const a2 = clampa(this.opacity);
6187 return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`;
6193 // node_modules/d3-color/src/index.js
6194 var init_src7 = __esm({
6195 "node_modules/d3-color/src/index.js"() {
6200 // node_modules/d3-interpolate/src/basis.js
6201 function basis(t12, v0, v1, v22, v3) {
6202 var t2 = t12 * t12, t3 = t2 * t12;
6203 return ((1 - 3 * t12 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t12 + 3 * t2 - 3 * t3) * v22 + t3 * v3) / 6;
6205 function basis_default(values) {
6206 var n3 = values.length - 1;
6207 return function(t2) {
6208 var i3 = t2 <= 0 ? t2 = 0 : t2 >= 1 ? (t2 = 1, n3 - 1) : Math.floor(t2 * n3), v1 = values[i3], v22 = values[i3 + 1], v0 = i3 > 0 ? values[i3 - 1] : 2 * v1 - v22, v3 = i3 < n3 - 1 ? values[i3 + 2] : 2 * v22 - v1;
6209 return basis((t2 - i3 / n3) * n3, v0, v1, v22, v3);
6212 var init_basis = __esm({
6213 "node_modules/d3-interpolate/src/basis.js"() {
6217 // node_modules/d3-interpolate/src/basisClosed.js
6218 function basisClosed_default(values) {
6219 var n3 = values.length;
6220 return function(t2) {
6221 var i3 = Math.floor(((t2 %= 1) < 0 ? ++t2 : t2) * n3), v0 = values[(i3 + n3 - 1) % n3], v1 = values[i3 % n3], v22 = values[(i3 + 1) % n3], v3 = values[(i3 + 2) % n3];
6222 return basis((t2 - i3 / n3) * n3, v0, v1, v22, v3);
6225 var init_basisClosed = __esm({
6226 "node_modules/d3-interpolate/src/basisClosed.js"() {
6231 // node_modules/d3-interpolate/src/constant.js
6232 var constant_default3;
6233 var init_constant3 = __esm({
6234 "node_modules/d3-interpolate/src/constant.js"() {
6235 constant_default3 = (x2) => () => x2;
6239 // node_modules/d3-interpolate/src/color.js
6240 function linear(a2, d4) {
6241 return function(t2) {
6242 return a2 + t2 * d4;
6245 function exponential(a2, b3, y3) {
6246 return a2 = Math.pow(a2, y3), b3 = Math.pow(b3, y3) - a2, y3 = 1 / y3, function(t2) {
6247 return Math.pow(a2 + t2 * b3, y3);
6250 function gamma(y3) {
6251 return (y3 = +y3) === 1 ? nogamma : function(a2, b3) {
6252 return b3 - a2 ? exponential(a2, b3, y3) : constant_default3(isNaN(a2) ? b3 : a2);
6255 function nogamma(a2, b3) {
6257 return d4 ? linear(a2, d4) : constant_default3(isNaN(a2) ? b3 : a2);
6259 var init_color2 = __esm({
6260 "node_modules/d3-interpolate/src/color.js"() {
6265 // node_modules/d3-interpolate/src/rgb.js
6266 function rgbSpline(spline) {
6267 return function(colors) {
6268 var n3 = colors.length, r2 = new Array(n3), g3 = new Array(n3), b3 = new Array(n3), i3, color2;
6269 for (i3 = 0; i3 < n3; ++i3) {
6270 color2 = rgb(colors[i3]);
6271 r2[i3] = color2.r || 0;
6272 g3[i3] = color2.g || 0;
6273 b3[i3] = color2.b || 0;
6279 return function(t2) {
6287 var rgb_default, rgbBasis, rgbBasisClosed;
6288 var init_rgb = __esm({
6289 "node_modules/d3-interpolate/src/rgb.js"() {
6294 rgb_default = (function rgbGamma(y3) {
6295 var color2 = gamma(y3);
6296 function rgb2(start2, end) {
6297 var r2 = color2((start2 = rgb(start2)).r, (end = rgb(end)).r), g3 = color2(start2.g, end.g), b3 = color2(start2.b, end.b), opacity = nogamma(start2.opacity, end.opacity);
6298 return function(t2) {
6302 start2.opacity = opacity(t2);
6306 rgb2.gamma = rgbGamma;
6309 rgbBasis = rgbSpline(basis_default);
6310 rgbBasisClosed = rgbSpline(basisClosed_default);
6314 // node_modules/d3-interpolate/src/numberArray.js
6315 function numberArray_default(a2, b3) {
6317 var n3 = a2 ? Math.min(b3.length, a2.length) : 0, c2 = b3.slice(), i3;
6318 return function(t2) {
6319 for (i3 = 0; i3 < n3; ++i3) c2[i3] = a2[i3] * (1 - t2) + b3[i3] * t2;
6323 function isNumberArray(x2) {
6324 return ArrayBuffer.isView(x2) && !(x2 instanceof DataView);
6326 var init_numberArray = __esm({
6327 "node_modules/d3-interpolate/src/numberArray.js"() {
6331 // node_modules/d3-interpolate/src/array.js
6332 function genericArray(a2, b3) {
6333 var nb = b3 ? b3.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x2 = new Array(na), c2 = new Array(nb), i3;
6334 for (i3 = 0; i3 < na; ++i3) x2[i3] = value_default(a2[i3], b3[i3]);
6335 for (; i3 < nb; ++i3) c2[i3] = b3[i3];
6336 return function(t2) {
6337 for (i3 = 0; i3 < na; ++i3) c2[i3] = x2[i3](t2);
6341 var init_array2 = __esm({
6342 "node_modules/d3-interpolate/src/array.js"() {
6347 // node_modules/d3-interpolate/src/date.js
6348 function date_default(a2, b3) {
6349 var d4 = /* @__PURE__ */ new Date();
6350 return a2 = +a2, b3 = +b3, function(t2) {
6351 return d4.setTime(a2 * (1 - t2) + b3 * t2), d4;
6354 var init_date = __esm({
6355 "node_modules/d3-interpolate/src/date.js"() {
6359 // node_modules/d3-interpolate/src/number.js
6360 function number_default(a2, b3) {
6361 return a2 = +a2, b3 = +b3, function(t2) {
6362 return a2 * (1 - t2) + b3 * t2;
6365 var init_number2 = __esm({
6366 "node_modules/d3-interpolate/src/number.js"() {
6370 // node_modules/d3-interpolate/src/object.js
6371 function object_default(a2, b3) {
6372 var i3 = {}, c2 = {}, k2;
6373 if (a2 === null || typeof a2 !== "object") a2 = {};
6374 if (b3 === null || typeof b3 !== "object") b3 = {};
6377 i3[k2] = value_default(a2[k2], b3[k2]);
6382 return function(t2) {
6383 for (k2 in i3) c2[k2] = i3[k2](t2);
6387 var init_object = __esm({
6388 "node_modules/d3-interpolate/src/object.js"() {
6393 // node_modules/d3-interpolate/src/string.js
6394 function zero2(b3) {
6400 return function(t2) {
6404 function string_default(a2, b3) {
6405 var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i3 = -1, s2 = [], q3 = [];
6406 a2 = a2 + "", b3 = b3 + "";
6407 while ((am = reA.exec(a2)) && (bm = reB.exec(b3))) {
6408 if ((bs = bm.index) > bi) {
6409 bs = b3.slice(bi, bs);
6410 if (s2[i3]) s2[i3] += bs;
6413 if ((am = am[0]) === (bm = bm[0])) {
6414 if (s2[i3]) s2[i3] += bm;
6418 q3.push({ i: i3, x: number_default(am, bm) });
6422 if (bi < b3.length) {
6424 if (s2[i3]) s2[i3] += bs;
6427 return s2.length < 2 ? q3[0] ? one(q3[0].x) : zero2(b3) : (b3 = q3.length, function(t2) {
6428 for (var i4 = 0, o2; i4 < b3; ++i4) s2[(o2 = q3[i4]).i] = o2.x(t2);
6433 var init_string2 = __esm({
6434 "node_modules/d3-interpolate/src/string.js"() {
6436 reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
6437 reB = new RegExp(reA.source, "g");
6441 // node_modules/d3-interpolate/src/value.js
6442 function value_default(a2, b3) {
6443 var t2 = typeof b3, c2;
6444 return b3 == null || t2 === "boolean" ? constant_default3(b3) : (t2 === "number" ? number_default : t2 === "string" ? (c2 = color(b3)) ? (b3 = c2, rgb_default) : string_default : b3 instanceof color ? rgb_default : b3 instanceof Date ? date_default : isNumberArray(b3) ? numberArray_default : Array.isArray(b3) ? genericArray : typeof b3.valueOf !== "function" && typeof b3.toString !== "function" || isNaN(b3) ? object_default : number_default)(a2, b3);
6446 var init_value = __esm({
6447 "node_modules/d3-interpolate/src/value.js"() {
6460 // node_modules/d3-interpolate/src/round.js
6461 function round_default(a2, b3) {
6462 return a2 = +a2, b3 = +b3, function(t2) {
6463 return Math.round(a2 * (1 - t2) + b3 * t2);
6466 var init_round = __esm({
6467 "node_modules/d3-interpolate/src/round.js"() {
6471 // node_modules/d3-interpolate/src/transform/decompose.js
6472 function decompose_default(a2, b3, c2, d4, e3, f2) {
6473 var scaleX, scaleY, skewX;
6474 if (scaleX = Math.sqrt(a2 * a2 + b3 * b3)) a2 /= scaleX, b3 /= scaleX;
6475 if (skewX = a2 * c2 + b3 * d4) c2 -= a2 * skewX, d4 -= b3 * skewX;
6476 if (scaleY = Math.sqrt(c2 * c2 + d4 * d4)) c2 /= scaleY, d4 /= scaleY, skewX /= scaleY;
6477 if (a2 * d4 < b3 * c2) a2 = -a2, b3 = -b3, skewX = -skewX, scaleX = -scaleX;
6481 rotate: Math.atan2(b3, a2) * degrees2,
6482 skewX: Math.atan(skewX) * degrees2,
6487 var degrees2, identity;
6488 var init_decompose = __esm({
6489 "node_modules/d3-interpolate/src/transform/decompose.js"() {
6490 degrees2 = 180 / Math.PI;
6502 // node_modules/d3-interpolate/src/transform/parse.js
6503 function parseCss(value) {
6504 const m3 = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
6505 return m3.isIdentity ? identity : decompose_default(m3.a, m3.b, m3.c, m3.d, m3.e, m3.f);
6507 function parseSvg(value) {
6508 if (value == null) return identity;
6509 if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
6510 svgNode.setAttribute("transform", value);
6511 if (!(value = svgNode.transform.baseVal.consolidate())) return identity;
6512 value = value.matrix;
6513 return decompose_default(value.a, value.b, value.c, value.d, value.e, value.f);
6516 var init_parse = __esm({
6517 "node_modules/d3-interpolate/src/transform/parse.js"() {
6522 // node_modules/d3-interpolate/src/transform/index.js
6523 function interpolateTransform(parse, pxComma, pxParen, degParen) {
6525 return s2.length ? s2.pop() + " " : "";
6527 function translate(xa, ya, xb, yb, s2, q3) {
6528 if (xa !== xb || ya !== yb) {
6529 var i3 = s2.push("translate(", null, pxComma, null, pxParen);
6530 q3.push({ i: i3 - 4, x: number_default(xa, xb) }, { i: i3 - 2, x: number_default(ya, yb) });
6531 } else if (xb || yb) {
6532 s2.push("translate(" + xb + pxComma + yb + pxParen);
6535 function rotate(a2, b3, s2, q3) {
6537 if (a2 - b3 > 180) b3 += 360;
6538 else if (b3 - a2 > 180) a2 += 360;
6539 q3.push({ i: s2.push(pop(s2) + "rotate(", null, degParen) - 2, x: number_default(a2, b3) });
6541 s2.push(pop(s2) + "rotate(" + b3 + degParen);
6544 function skewX(a2, b3, s2, q3) {
6546 q3.push({ i: s2.push(pop(s2) + "skewX(", null, degParen) - 2, x: number_default(a2, b3) });
6548 s2.push(pop(s2) + "skewX(" + b3 + degParen);
6551 function scale(xa, ya, xb, yb, s2, q3) {
6552 if (xa !== xb || ya !== yb) {
6553 var i3 = s2.push(pop(s2) + "scale(", null, ",", null, ")");
6554 q3.push({ i: i3 - 4, x: number_default(xa, xb) }, { i: i3 - 2, x: number_default(ya, yb) });
6555 } else if (xb !== 1 || yb !== 1) {
6556 s2.push(pop(s2) + "scale(" + xb + "," + yb + ")");
6559 return function(a2, b3) {
6560 var s2 = [], q3 = [];
6561 a2 = parse(a2), b3 = parse(b3);
6562 translate(a2.translateX, a2.translateY, b3.translateX, b3.translateY, s2, q3);
6563 rotate(a2.rotate, b3.rotate, s2, q3);
6564 skewX(a2.skewX, b3.skewX, s2, q3);
6565 scale(a2.scaleX, a2.scaleY, b3.scaleX, b3.scaleY, s2, q3);
6567 return function(t2) {
6568 var i3 = -1, n3 = q3.length, o2;
6569 while (++i3 < n3) s2[(o2 = q3[i3]).i] = o2.x(t2);
6574 var interpolateTransformCss, interpolateTransformSvg;
6575 var init_transform2 = __esm({
6576 "node_modules/d3-interpolate/src/transform/index.js"() {
6579 interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
6580 interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
6584 // node_modules/d3-interpolate/src/zoom.js
6586 return ((x2 = Math.exp(x2)) + 1 / x2) / 2;
6589 return ((x2 = Math.exp(x2)) - 1 / x2) / 2;
6592 return ((x2 = Math.exp(2 * x2)) - 1) / (x2 + 1);
6594 var epsilon22, zoom_default;
6595 var init_zoom = __esm({
6596 "node_modules/d3-interpolate/src/zoom.js"() {
6598 zoom_default = (function zoomRho(rho, rho2, rho4) {
6599 function zoom(p02, p1) {
6600 var ux0 = p02[0], uy0 = p02[1], w0 = p02[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d22 = dx * dx + dy * dy, i3, S3;
6601 if (d22 < epsilon22) {
6602 S3 = Math.log(w1 / w0) / rho;
6607 w0 * Math.exp(rho * t2 * S3)
6611 var d1 = Math.sqrt(d22), b0 = (w1 * w1 - w0 * w0 + rho4 * d22) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d22) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
6612 S3 = (r1 - r0) / rho;
6614 var s2 = t2 * S3, coshr0 = cosh(r0), u2 = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s2 + r0) - sinh(r0));
6618 w0 * coshr0 / cosh(rho * s2 + r0)
6622 i3.duration = S3 * 1e3 * rho / Math.SQRT2;
6625 zoom.rho = function(_3) {
6626 var _1 = Math.max(1e-3, +_3), _22 = _1 * _1, _4 = _22 * _22;
6627 return zoomRho(_1, _22, _4);
6630 })(Math.SQRT2, 2, 4);
6634 // node_modules/d3-interpolate/src/quantize.js
6635 function quantize_default(interpolator, n3) {
6636 var samples = new Array(n3);
6637 for (var i3 = 0; i3 < n3; ++i3) samples[i3] = interpolator(i3 / (n3 - 1));
6640 var init_quantize = __esm({
6641 "node_modules/d3-interpolate/src/quantize.js"() {
6645 // node_modules/d3-interpolate/src/index.js
6646 var init_src8 = __esm({
6647 "node_modules/d3-interpolate/src/index.js"() {
6659 // node_modules/d3-timer/src/timer.js
6661 return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
6663 function clearNow() {
6667 this._call = this._time = this._next = null;
6669 function timer(callback, delay, time) {
6670 var t2 = new Timer();
6671 t2.restart(callback, delay, time);
6674 function timerFlush() {
6677 var t2 = taskHead, e3;
6679 if ((e3 = clockNow - t2._time) >= 0) t2._call.call(void 0, e3);
6685 clockNow = (clockLast = clock.now()) + clockSkew;
6686 frame = timeout = 0;
6696 var now3 = clock.now(), delay = now3 - clockLast;
6697 if (delay > pokeDelay) clockSkew -= delay, clockLast = now3;
6700 var t02, t12 = taskHead, t2, time = Infinity;
6703 if (time > t12._time) time = t12._time;
6704 t02 = t12, t12 = t12._next;
6706 t2 = t12._next, t12._next = null;
6707 t12 = t02 ? t02._next = t2 : taskHead = t2;
6713 function sleep(time) {
6715 if (timeout) timeout = clearTimeout(timeout);
6716 var delay = time - clockNow;
6718 if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
6719 if (interval) interval = clearInterval(interval);
6721 if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
6722 frame = 1, setFrame(wake);
6725 var frame, timeout, interval, pokeDelay, taskHead, taskTail, clockLast, clockNow, clockSkew, clock, setFrame;
6726 var init_timer = __esm({
6727 "node_modules/d3-timer/src/timer.js"() {
6735 clock = typeof performance === "object" && performance.now ? performance : Date;
6736 setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f2) {
6739 Timer.prototype = timer.prototype = {
6741 restart: function(callback, delay, time) {
6742 if (typeof callback !== "function") throw new TypeError("callback is not a function");
6743 time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
6744 if (!this._next && taskTail !== this) {
6745 if (taskTail) taskTail._next = this;
6746 else taskHead = this;
6749 this._call = callback;
6756 this._time = Infinity;
6764 // node_modules/d3-timer/src/timeout.js
6765 function timeout_default(callback, delay, time) {
6766 var t2 = new Timer();
6767 delay = delay == null ? 0 : +delay;
6768 t2.restart((elapsed) => {
6770 callback(elapsed + delay);
6774 var init_timeout = __esm({
6775 "node_modules/d3-timer/src/timeout.js"() {
6780 // node_modules/d3-timer/src/index.js
6781 var init_src9 = __esm({
6782 "node_modules/d3-timer/src/index.js"() {
6788 // node_modules/d3-transition/src/transition/schedule.js
6789 function schedule_default(node, name, id2, index, group, timing) {
6790 var schedules = node.__transition;
6791 if (!schedules) node.__transition = {};
6792 else if (id2 in schedules) return;
6796 // For context during callback.
6798 // For context during callback.
6802 delay: timing.delay,
6803 duration: timing.duration,
6809 function init(node, id2) {
6810 var schedule = get2(node, id2);
6811 if (schedule.state > CREATED) throw new Error("too late; already scheduled");
6814 function set2(node, id2) {
6815 var schedule = get2(node, id2);
6816 if (schedule.state > STARTED) throw new Error("too late; already running");
6819 function get2(node, id2) {
6820 var schedule = node.__transition;
6821 if (!schedule || !(schedule = schedule[id2])) throw new Error("transition not found");
6824 function create(node, id2, self2) {
6825 var schedules = node.__transition, tween;
6826 schedules[id2] = self2;
6827 self2.timer = timer(schedule, 0, self2.time);
6828 function schedule(elapsed) {
6829 self2.state = SCHEDULED;
6830 self2.timer.restart(start2, self2.delay, self2.time);
6831 if (self2.delay <= elapsed) start2(elapsed - self2.delay);
6833 function start2(elapsed) {
6835 if (self2.state !== SCHEDULED) return stop();
6836 for (i3 in schedules) {
6838 if (o2.name !== self2.name) continue;
6839 if (o2.state === STARTED) return timeout_default(start2);
6840 if (o2.state === RUNNING) {
6843 o2.on.call("interrupt", node, node.__data__, o2.index, o2.group);
6844 delete schedules[i3];
6845 } else if (+i3 < id2) {
6848 o2.on.call("cancel", node, node.__data__, o2.index, o2.group);
6849 delete schedules[i3];
6852 timeout_default(function() {
6853 if (self2.state === STARTED) {
6854 self2.state = RUNNING;
6855 self2.timer.restart(tick, self2.delay, self2.time);
6859 self2.state = STARTING;
6860 self2.on.call("start", node, node.__data__, self2.index, self2.group);
6861 if (self2.state !== STARTING) return;
6862 self2.state = STARTED;
6863 tween = new Array(n3 = self2.tween.length);
6864 for (i3 = 0, j3 = -1; i3 < n3; ++i3) {
6865 if (o2 = self2.tween[i3].value.call(node, node.__data__, self2.index, self2.group)) {
6869 tween.length = j3 + 1;
6871 function tick(elapsed) {
6872 var t2 = elapsed < self2.duration ? self2.ease.call(null, elapsed / self2.duration) : (self2.timer.restart(stop), self2.state = ENDING, 1), i3 = -1, n3 = tween.length;
6874 tween[i3].call(node, t2);
6876 if (self2.state === ENDING) {
6877 self2.on.call("end", node, node.__data__, self2.index, self2.group);
6882 self2.state = ENDED;
6884 delete schedules[id2];
6885 for (var i3 in schedules) return;
6886 delete node.__transition;
6889 var emptyOn, emptyTween, CREATED, SCHEDULED, STARTING, STARTED, RUNNING, ENDING, ENDED;
6890 var init_schedule = __esm({
6891 "node_modules/d3-transition/src/transition/schedule.js"() {
6894 emptyOn = dispatch_default("start", "end", "cancel", "interrupt");
6906 // node_modules/d3-transition/src/interrupt.js
6907 function interrupt_default(node, name) {
6908 var schedules = node.__transition, schedule, active, empty2 = true, i3;
6909 if (!schedules) return;
6910 name = name == null ? null : name + "";
6911 for (i3 in schedules) {
6912 if ((schedule = schedules[i3]).name !== name) {
6916 active = schedule.state > STARTING && schedule.state < ENDING;
6917 schedule.state = ENDED;
6918 schedule.timer.stop();
6919 schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group);
6920 delete schedules[i3];
6922 if (empty2) delete node.__transition;
6924 var init_interrupt = __esm({
6925 "node_modules/d3-transition/src/interrupt.js"() {
6930 // node_modules/d3-transition/src/selection/interrupt.js
6931 function interrupt_default2(name) {
6932 return this.each(function() {
6933 interrupt_default(this, name);
6936 var init_interrupt2 = __esm({
6937 "node_modules/d3-transition/src/selection/interrupt.js"() {
6942 // node_modules/d3-transition/src/transition/tween.js
6943 function tweenRemove(id2, name) {
6946 var schedule = set2(this, id2), tween = schedule.tween;
6947 if (tween !== tween0) {
6948 tween1 = tween0 = tween;
6949 for (var i3 = 0, n3 = tween1.length; i3 < n3; ++i3) {
6950 if (tween1[i3].name === name) {
6951 tween1 = tween1.slice();
6952 tween1.splice(i3, 1);
6957 schedule.tween = tween1;
6960 function tweenFunction(id2, name, value) {
6962 if (typeof value !== "function") throw new Error();
6964 var schedule = set2(this, id2), tween = schedule.tween;
6965 if (tween !== tween0) {
6966 tween1 = (tween0 = tween).slice();
6967 for (var t2 = { name, value }, i3 = 0, n3 = tween1.length; i3 < n3; ++i3) {
6968 if (tween1[i3].name === name) {
6973 if (i3 === n3) tween1.push(t2);
6975 schedule.tween = tween1;
6978 function tween_default(name, value) {
6981 if (arguments.length < 2) {
6982 var tween = get2(this.node(), id2).tween;
6983 for (var i3 = 0, n3 = tween.length, t2; i3 < n3; ++i3) {
6984 if ((t2 = tween[i3]).name === name) {
6990 return this.each((value == null ? tweenRemove : tweenFunction)(id2, name, value));
6992 function tweenValue(transition2, name, value) {
6993 var id2 = transition2._id;
6994 transition2.each(function() {
6995 var schedule = set2(this, id2);
6996 (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
6998 return function(node) {
6999 return get2(node, id2).value[name];
7002 var init_tween = __esm({
7003 "node_modules/d3-transition/src/transition/tween.js"() {
7008 // node_modules/d3-transition/src/transition/interpolate.js
7009 function interpolate_default(a2, b3) {
7011 return (typeof b3 === "number" ? number_default : b3 instanceof color ? rgb_default : (c2 = color(b3)) ? (b3 = c2, rgb_default) : string_default)(a2, b3);
7013 var init_interpolate = __esm({
7014 "node_modules/d3-transition/src/transition/interpolate.js"() {
7020 // node_modules/d3-transition/src/transition/attr.js
7021 function attrRemove2(name) {
7023 this.removeAttribute(name);
7026 function attrRemoveNS2(fullname) {
7028 this.removeAttributeNS(fullname.space, fullname.local);
7031 function attrConstant2(name, interpolate, value1) {
7032 var string00, string1 = value1 + "", interpolate0;
7034 var string0 = this.getAttribute(name);
7035 return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
7038 function attrConstantNS2(fullname, interpolate, value1) {
7039 var string00, string1 = value1 + "", interpolate0;
7041 var string0 = this.getAttributeNS(fullname.space, fullname.local);
7042 return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
7045 function attrFunction2(name, interpolate, value) {
7046 var string00, string10, interpolate0;
7048 var string0, value1 = value(this), string1;
7049 if (value1 == null) return void this.removeAttribute(name);
7050 string0 = this.getAttribute(name);
7051 string1 = value1 + "";
7052 return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
7055 function attrFunctionNS2(fullname, interpolate, value) {
7056 var string00, string10, interpolate0;
7058 var string0, value1 = value(this), string1;
7059 if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
7060 string0 = this.getAttributeNS(fullname.space, fullname.local);
7061 string1 = value1 + "";
7062 return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
7065 function attr_default2(name, value) {
7066 var fullname = namespace_default(name), i3 = fullname === "transform" ? interpolateTransformSvg : interpolate_default;
7067 return this.attrTween(name, typeof value === "function" ? (fullname.local ? attrFunctionNS2 : attrFunction2)(fullname, i3, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attrRemoveNS2 : attrRemove2)(fullname) : (fullname.local ? attrConstantNS2 : attrConstant2)(fullname, i3, value));
7069 var init_attr2 = __esm({
7070 "node_modules/d3-transition/src/transition/attr.js"() {
7078 // node_modules/d3-transition/src/transition/attrTween.js
7079 function attrInterpolate(name, i3) {
7080 return function(t2) {
7081 this.setAttribute(name, i3.call(this, t2));
7084 function attrInterpolateNS(fullname, i3) {
7085 return function(t2) {
7086 this.setAttributeNS(fullname.space, fullname.local, i3.call(this, t2));
7089 function attrTweenNS(fullname, value) {
7092 var i3 = value.apply(this, arguments);
7093 if (i3 !== i0) t02 = (i0 = i3) && attrInterpolateNS(fullname, i3);
7096 tween._value = value;
7099 function attrTween(name, value) {
7102 var i3 = value.apply(this, arguments);
7103 if (i3 !== i0) t02 = (i0 = i3) && attrInterpolate(name, i3);
7106 tween._value = value;
7109 function attrTween_default(name, value) {
7110 var key = "attr." + name;
7111 if (arguments.length < 2) return (key = this.tween(key)) && key._value;
7112 if (value == null) return this.tween(key, null);
7113 if (typeof value !== "function") throw new Error();
7114 var fullname = namespace_default(name);
7115 return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
7117 var init_attrTween = __esm({
7118 "node_modules/d3-transition/src/transition/attrTween.js"() {
7123 // node_modules/d3-transition/src/transition/delay.js
7124 function delayFunction(id2, value) {
7126 init(this, id2).delay = +value.apply(this, arguments);
7129 function delayConstant(id2, value) {
7130 return value = +value, function() {
7131 init(this, id2).delay = value;
7134 function delay_default(value) {
7136 return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id2, value)) : get2(this.node(), id2).delay;
7138 var init_delay = __esm({
7139 "node_modules/d3-transition/src/transition/delay.js"() {
7144 // node_modules/d3-transition/src/transition/duration.js
7145 function durationFunction(id2, value) {
7147 set2(this, id2).duration = +value.apply(this, arguments);
7150 function durationConstant(id2, value) {
7151 return value = +value, function() {
7152 set2(this, id2).duration = value;
7155 function duration_default(value) {
7157 return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id2, value)) : get2(this.node(), id2).duration;
7159 var init_duration = __esm({
7160 "node_modules/d3-transition/src/transition/duration.js"() {
7165 // node_modules/d3-transition/src/transition/ease.js
7166 function easeConstant(id2, value) {
7167 if (typeof value !== "function") throw new Error();
7169 set2(this, id2).ease = value;
7172 function ease_default(value) {
7174 return arguments.length ? this.each(easeConstant(id2, value)) : get2(this.node(), id2).ease;
7176 var init_ease = __esm({
7177 "node_modules/d3-transition/src/transition/ease.js"() {
7182 // node_modules/d3-transition/src/transition/easeVarying.js
7183 function easeVarying(id2, value) {
7185 var v3 = value.apply(this, arguments);
7186 if (typeof v3 !== "function") throw new Error();
7187 set2(this, id2).ease = v3;
7190 function easeVarying_default(value) {
7191 if (typeof value !== "function") throw new Error();
7192 return this.each(easeVarying(this._id, value));
7194 var init_easeVarying = __esm({
7195 "node_modules/d3-transition/src/transition/easeVarying.js"() {
7200 // node_modules/d3-transition/src/transition/filter.js
7201 function filter_default2(match) {
7202 if (typeof match !== "function") match = matcher_default(match);
7203 for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
7204 for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = [], node, i3 = 0; i3 < n3; ++i3) {
7205 if ((node = group[i3]) && match.call(node, node.__data__, i3, group)) {
7206 subgroup.push(node);
7210 return new Transition(subgroups, this._parents, this._name, this._id);
7212 var init_filter2 = __esm({
7213 "node_modules/d3-transition/src/transition/filter.js"() {
7219 // node_modules/d3-transition/src/transition/merge.js
7220 function merge_default2(transition2) {
7221 if (transition2._id !== this._id) throw new Error();
7222 for (var groups0 = this._groups, groups1 = transition2._groups, m0 = groups0.length, m1 = groups1.length, m3 = Math.min(m0, m1), merges = new Array(m0), j3 = 0; j3 < m3; ++j3) {
7223 for (var group0 = groups0[j3], group1 = groups1[j3], n3 = group0.length, merge3 = merges[j3] = new Array(n3), node, i3 = 0; i3 < n3; ++i3) {
7224 if (node = group0[i3] || group1[i3]) {
7229 for (; j3 < m0; ++j3) {
7230 merges[j3] = groups0[j3];
7232 return new Transition(merges, this._parents, this._name, this._id);
7234 var init_merge3 = __esm({
7235 "node_modules/d3-transition/src/transition/merge.js"() {
7240 // node_modules/d3-transition/src/transition/on.js
7241 function start(name) {
7242 return (name + "").trim().split(/^|\s+/).every(function(t2) {
7243 var i3 = t2.indexOf(".");
7244 if (i3 >= 0) t2 = t2.slice(0, i3);
7245 return !t2 || t2 === "start";
7248 function onFunction(id2, name, listener) {
7249 var on0, on1, sit = start(name) ? init : set2;
7251 var schedule = sit(this, id2), on = schedule.on;
7252 if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
7256 function on_default2(name, listener) {
7258 return arguments.length < 2 ? get2(this.node(), id2).on.on(name) : this.each(onFunction(id2, name, listener));
7260 var init_on2 = __esm({
7261 "node_modules/d3-transition/src/transition/on.js"() {
7266 // node_modules/d3-transition/src/transition/remove.js
7267 function removeFunction(id2) {
7269 var parent2 = this.parentNode;
7270 for (var i3 in this.__transition) if (+i3 !== id2) return;
7271 if (parent2) parent2.removeChild(this);
7274 function remove_default2() {
7275 return this.on("end.remove", removeFunction(this._id));
7277 var init_remove2 = __esm({
7278 "node_modules/d3-transition/src/transition/remove.js"() {
7282 // node_modules/d3-transition/src/transition/select.js
7283 function select_default3(select) {
7284 var name = this._name, id2 = this._id;
7285 if (typeof select !== "function") select = selector_default(select);
7286 for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
7287 for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = new Array(n3), node, subnode, i3 = 0; i3 < n3; ++i3) {
7288 if ((node = group[i3]) && (subnode = select.call(node, node.__data__, i3, group))) {
7289 if ("__data__" in node) subnode.__data__ = node.__data__;
7290 subgroup[i3] = subnode;
7291 schedule_default(subgroup[i3], name, id2, i3, subgroup, get2(node, id2));
7295 return new Transition(subgroups, this._parents, name, id2);
7297 var init_select3 = __esm({
7298 "node_modules/d3-transition/src/transition/select.js"() {
7305 // node_modules/d3-transition/src/transition/selectAll.js
7306 function selectAll_default3(select) {
7307 var name = this._name, id2 = this._id;
7308 if (typeof select !== "function") select = selectorAll_default(select);
7309 for (var groups = this._groups, m3 = groups.length, subgroups = [], parents = [], j3 = 0; j3 < m3; ++j3) {
7310 for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
7311 if (node = group[i3]) {
7312 for (var children2 = select.call(node, node.__data__, i3, group), child, inherit2 = get2(node, id2), k2 = 0, l4 = children2.length; k2 < l4; ++k2) {
7313 if (child = children2[k2]) {
7314 schedule_default(child, name, id2, k2, children2, inherit2);
7317 subgroups.push(children2);
7322 return new Transition(subgroups, parents, name, id2);
7324 var init_selectAll3 = __esm({
7325 "node_modules/d3-transition/src/transition/selectAll.js"() {
7332 // node_modules/d3-transition/src/transition/selection.js
7333 function selection_default2() {
7334 return new Selection2(this._groups, this._parents);
7337 var init_selection2 = __esm({
7338 "node_modules/d3-transition/src/transition/selection.js"() {
7340 Selection2 = selection_default.prototype.constructor;
7344 // node_modules/d3-transition/src/transition/style.js
7345 function styleNull(name, interpolate) {
7346 var string00, string10, interpolate0;
7348 var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name));
7349 return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1);
7352 function styleRemove2(name) {
7354 this.style.removeProperty(name);
7357 function styleConstant2(name, interpolate, value1) {
7358 var string00, string1 = value1 + "", interpolate0;
7360 var string0 = styleValue(this, name);
7361 return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
7364 function styleFunction2(name, interpolate, value) {
7365 var string00, string10, interpolate0;
7367 var string0 = styleValue(this, name), value1 = value(this), string1 = value1 + "";
7368 if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
7369 return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
7372 function styleMaybeRemove(id2, name) {
7373 var on0, on1, listener0, key = "style." + name, event = "end." + key, remove2;
7375 var schedule = set2(this, id2), on = schedule.on, listener = schedule.value[key] == null ? remove2 || (remove2 = styleRemove2(name)) : void 0;
7376 if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);
7380 function style_default2(name, value, priority) {
7381 var i3 = (name += "") === "transform" ? interpolateTransformCss : interpolate_default;
7382 return value == null ? this.styleTween(name, styleNull(name, i3)).on("end.style." + name, styleRemove2(name)) : typeof value === "function" ? this.styleTween(name, styleFunction2(name, i3, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant2(name, i3, value), priority).on("end.style." + name, null);
7384 var init_style2 = __esm({
7385 "node_modules/d3-transition/src/transition/style.js"() {
7394 // node_modules/d3-transition/src/transition/styleTween.js
7395 function styleInterpolate(name, i3, priority) {
7396 return function(t2) {
7397 this.style.setProperty(name, i3.call(this, t2), priority);
7400 function styleTween(name, value, priority) {
7403 var i3 = value.apply(this, arguments);
7404 if (i3 !== i0) t2 = (i0 = i3) && styleInterpolate(name, i3, priority);
7407 tween._value = value;
7410 function styleTween_default(name, value, priority) {
7411 var key = "style." + (name += "");
7412 if (arguments.length < 2) return (key = this.tween(key)) && key._value;
7413 if (value == null) return this.tween(key, null);
7414 if (typeof value !== "function") throw new Error();
7415 return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
7417 var init_styleTween = __esm({
7418 "node_modules/d3-transition/src/transition/styleTween.js"() {
7422 // node_modules/d3-transition/src/transition/text.js
7423 function textConstant2(value) {
7425 this.textContent = value;
7428 function textFunction2(value) {
7430 var value1 = value(this);
7431 this.textContent = value1 == null ? "" : value1;
7434 function text_default2(value) {
7435 return this.tween("text", typeof value === "function" ? textFunction2(tweenValue(this, "text", value)) : textConstant2(value == null ? "" : value + ""));
7437 var init_text2 = __esm({
7438 "node_modules/d3-transition/src/transition/text.js"() {
7443 // node_modules/d3-transition/src/transition/textTween.js
7444 function textInterpolate(i3) {
7445 return function(t2) {
7446 this.textContent = i3.call(this, t2);
7449 function textTween(value) {
7452 var i3 = value.apply(this, arguments);
7453 if (i3 !== i0) t02 = (i0 = i3) && textInterpolate(i3);
7456 tween._value = value;
7459 function textTween_default(value) {
7461 if (arguments.length < 1) return (key = this.tween(key)) && key._value;
7462 if (value == null) return this.tween(key, null);
7463 if (typeof value !== "function") throw new Error();
7464 return this.tween(key, textTween(value));
7466 var init_textTween = __esm({
7467 "node_modules/d3-transition/src/transition/textTween.js"() {
7471 // node_modules/d3-transition/src/transition/transition.js
7472 function transition_default() {
7473 var name = this._name, id0 = this._id, id1 = newId();
7474 for (var groups = this._groups, m3 = groups.length, j3 = 0; j3 < m3; ++j3) {
7475 for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
7476 if (node = group[i3]) {
7477 var inherit2 = get2(node, id0);
7478 schedule_default(node, name, id1, i3, group, {
7479 time: inherit2.time + inherit2.delay + inherit2.duration,
7481 duration: inherit2.duration,
7487 return new Transition(groups, this._parents, name, id1);
7489 var init_transition = __esm({
7490 "node_modules/d3-transition/src/transition/transition.js"() {
7496 // node_modules/d3-transition/src/transition/end.js
7497 function end_default() {
7498 var on0, on1, that = this, id2 = that._id, size = that.size();
7499 return new Promise(function(resolve, reject) {
7500 var cancel = { value: reject }, end = { value: function() {
7501 if (--size === 0) resolve();
7503 that.each(function() {
7504 var schedule = set2(this, id2), on = schedule.on;
7506 on1 = (on0 = on).copy();
7507 on1._.cancel.push(cancel);
7508 on1._.interrupt.push(cancel);
7509 on1._.end.push(end);
7513 if (size === 0) resolve();
7516 var init_end = __esm({
7517 "node_modules/d3-transition/src/transition/end.js"() {
7522 // node_modules/d3-transition/src/transition/index.js
7523 function Transition(groups, parents, name, id2) {
7524 this._groups = groups;
7525 this._parents = parents;
7529 function transition(name) {
7530 return selection_default().transition(name);
7535 var id, selection_prototype;
7536 var init_transition2 = __esm({
7537 "node_modules/d3-transition/src/transition/index.js"() {
7560 selection_prototype = selection_default.prototype;
7561 Transition.prototype = transition.prototype = {
7562 constructor: Transition,
7563 select: select_default3,
7564 selectAll: selectAll_default3,
7565 selectChild: selection_prototype.selectChild,
7566 selectChildren: selection_prototype.selectChildren,
7567 filter: filter_default2,
7568 merge: merge_default2,
7569 selection: selection_default2,
7570 transition: transition_default,
7571 call: selection_prototype.call,
7572 nodes: selection_prototype.nodes,
7573 node: selection_prototype.node,
7574 size: selection_prototype.size,
7575 empty: selection_prototype.empty,
7576 each: selection_prototype.each,
7578 attr: attr_default2,
7579 attrTween: attrTween_default,
7580 style: style_default2,
7581 styleTween: styleTween_default,
7582 text: text_default2,
7583 textTween: textTween_default,
7584 remove: remove_default2,
7585 tween: tween_default,
7586 delay: delay_default,
7587 duration: duration_default,
7589 easeVarying: easeVarying_default,
7591 [Symbol.iterator]: selection_prototype[Symbol.iterator]
7596 // node_modules/d3-ease/src/linear.js
7598 var init_linear = __esm({
7599 "node_modules/d3-ease/src/linear.js"() {
7600 linear2 = (t2) => +t2;
7604 // node_modules/d3-ease/src/cubic.js
7605 function cubicInOut(t2) {
7606 return ((t2 *= 2) <= 1 ? t2 * t2 * t2 : (t2 -= 2) * t2 * t2 + 2) / 2;
7608 var init_cubic = __esm({
7609 "node_modules/d3-ease/src/cubic.js"() {
7613 // node_modules/d3-ease/src/index.js
7614 var init_src10 = __esm({
7615 "node_modules/d3-ease/src/index.js"() {
7621 // node_modules/d3-transition/src/selection/transition.js
7622 function inherit(node, id2) {
7624 while (!(timing = node.__transition) || !(timing = timing[id2])) {
7625 if (!(node = node.parentNode)) {
7626 throw new Error(`transition ${id2} not found`);
7631 function transition_default2(name) {
7633 if (name instanceof Transition) {
7634 id2 = name._id, name = name._name;
7636 id2 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
7638 for (var groups = this._groups, m3 = groups.length, j3 = 0; j3 < m3; ++j3) {
7639 for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
7640 if (node = group[i3]) {
7641 schedule_default(node, name, id2, i3, group, timing || inherit(node, id2));
7645 return new Transition(groups, this._parents, name, id2);
7648 var init_transition3 = __esm({
7649 "node_modules/d3-transition/src/selection/transition.js"() {
7664 // node_modules/d3-transition/src/selection/index.js
7665 var init_selection3 = __esm({
7666 "node_modules/d3-transition/src/selection/index.js"() {
7670 selection_default.prototype.interrupt = interrupt_default2;
7671 selection_default.prototype.transition = transition_default2;
7675 // node_modules/d3-transition/src/index.js
7676 var init_src11 = __esm({
7677 "node_modules/d3-transition/src/index.js"() {
7683 // node_modules/d3-zoom/src/constant.js
7684 var constant_default4;
7685 var init_constant4 = __esm({
7686 "node_modules/d3-zoom/src/constant.js"() {
7687 constant_default4 = (x2) => () => x2;
7691 // node_modules/d3-zoom/src/event.js
7692 function ZoomEvent(type2, {
7695 transform: transform2,
7696 dispatch: dispatch14
7698 Object.defineProperties(this, {
7699 type: { value: type2, enumerable: true, configurable: true },
7700 sourceEvent: { value: sourceEvent, enumerable: true, configurable: true },
7701 target: { value: target, enumerable: true, configurable: true },
7702 transform: { value: transform2, enumerable: true, configurable: true },
7703 _: { value: dispatch14 }
7706 var init_event2 = __esm({
7707 "node_modules/d3-zoom/src/event.js"() {
7711 // node_modules/d3-zoom/src/transform.js
7712 function Transform(k2, x2, y3) {
7717 function transform(node) {
7718 while (!node.__zoom) if (!(node = node.parentNode)) return identity2;
7722 var init_transform3 = __esm({
7723 "node_modules/d3-zoom/src/transform.js"() {
7724 Transform.prototype = {
7725 constructor: Transform,
7726 scale: function(k2) {
7727 return k2 === 1 ? this : new Transform(this.k * k2, this.x, this.y);
7729 translate: function(x2, y3) {
7730 return x2 === 0 & y3 === 0 ? this : new Transform(this.k, this.x + this.k * x2, this.y + this.k * y3);
7732 apply: function(point) {
7733 return [point[0] * this.k + this.x, point[1] * this.k + this.y];
7735 applyX: function(x2) {
7736 return x2 * this.k + this.x;
7738 applyY: function(y3) {
7739 return y3 * this.k + this.y;
7741 invert: function(location) {
7742 return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
7744 invertX: function(x2) {
7745 return (x2 - this.x) / this.k;
7747 invertY: function(y3) {
7748 return (y3 - this.y) / this.k;
7750 rescaleX: function(x2) {
7751 return x2.copy().domain(x2.range().map(this.invertX, this).map(x2.invert, x2));
7753 rescaleY: function(y3) {
7754 return y3.copy().domain(y3.range().map(this.invertY, this).map(y3.invert, y3));
7756 toString: function() {
7757 return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
7760 identity2 = new Transform(1, 0, 0);
7761 transform.prototype = Transform.prototype;
7765 // node_modules/d3-zoom/src/noevent.js
7766 function nopropagation2(event) {
7767 event.stopImmediatePropagation();
7769 function noevent_default2(event) {
7770 event.preventDefault();
7771 event.stopImmediatePropagation();
7773 var init_noevent2 = __esm({
7774 "node_modules/d3-zoom/src/noevent.js"() {
7778 // node_modules/d3-zoom/src/zoom.js
7779 function defaultFilter2(event) {
7780 return (!event.ctrlKey || event.type === "wheel") && !event.button;
7782 function defaultExtent() {
7784 if (e3 instanceof SVGElement) {
7785 e3 = e3.ownerSVGElement || e3;
7786 if (e3.hasAttribute("viewBox")) {
7787 e3 = e3.viewBox.baseVal;
7788 return [[e3.x, e3.y], [e3.x + e3.width, e3.y + e3.height]];
7790 return [[0, 0], [e3.width.baseVal.value, e3.height.baseVal.value]];
7792 return [[0, 0], [e3.clientWidth, e3.clientHeight]];
7794 function defaultTransform() {
7795 return this.__zoom || identity2;
7797 function defaultWheelDelta(event) {
7798 return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 2e-3) * (event.ctrlKey ? 10 : 1);
7800 function defaultTouchable2() {
7801 return navigator.maxTouchPoints || "ontouchstart" in this;
7803 function defaultConstrain(transform2, extent, translateExtent) {
7804 var dx0 = transform2.invertX(extent[0][0]) - translateExtent[0][0], dx1 = transform2.invertX(extent[1][0]) - translateExtent[1][0], dy0 = transform2.invertY(extent[0][1]) - translateExtent[0][1], dy1 = transform2.invertY(extent[1][1]) - translateExtent[1][1];
7805 return transform2.translate(
7806 dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
7807 dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
7810 function zoom_default2() {
7811 var filter2 = defaultFilter2, extent = defaultExtent, constrain = defaultConstrain, wheelDelta = defaultWheelDelta, touchable = defaultTouchable2, scaleExtent = [0, Infinity], translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], duration = 250, interpolate = zoom_default, listeners = dispatch_default("start", "zoom", "end"), touchstarting, touchfirst, touchending, touchDelay = 500, wheelDelay = 150, clickDistance2 = 0, tapDistance = 10;
7812 function zoom(selection2) {
7813 selection2.property("__zoom", defaultTransform).on("wheel.zoom", wheeled, { passive: false }).on("mousedown.zoom", mousedowned).on("dblclick.zoom", dblclicked).filter(touchable).on("touchstart.zoom", touchstarted).on("touchmove.zoom", touchmoved).on("touchend.zoom touchcancel.zoom", touchended).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
7815 zoom.transform = function(collection, transform2, point, event) {
7816 var selection2 = collection.selection ? collection.selection() : collection;
7817 selection2.property("__zoom", defaultTransform);
7818 if (collection !== selection2) {
7819 schedule(collection, transform2, point, event);
7821 selection2.interrupt().each(function() {
7822 gesture(this, arguments).event(event).start().zoom(null, typeof transform2 === "function" ? transform2.apply(this, arguments) : transform2).end();
7826 zoom.scaleBy = function(selection2, k2, p2, event) {
7827 zoom.scaleTo(selection2, function() {
7828 var k0 = this.__zoom.k, k1 = typeof k2 === "function" ? k2.apply(this, arguments) : k2;
7832 zoom.scaleTo = function(selection2, k2, p2, event) {
7833 zoom.transform(selection2, function() {
7834 var e3 = extent.apply(this, arguments), t02 = this.__zoom, p02 = p2 == null ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2, p1 = t02.invert(p02), k1 = typeof k2 === "function" ? k2.apply(this, arguments) : k2;
7835 return constrain(translate(scale(t02, k1), p02, p1), e3, translateExtent);
7838 zoom.translateBy = function(selection2, x2, y3, event) {
7839 zoom.transform(selection2, function() {
7840 return constrain(this.__zoom.translate(
7841 typeof x2 === "function" ? x2.apply(this, arguments) : x2,
7842 typeof y3 === "function" ? y3.apply(this, arguments) : y3
7843 ), extent.apply(this, arguments), translateExtent);
7846 zoom.translateTo = function(selection2, x2, y3, p2, event) {
7847 zoom.transform(selection2, function() {
7848 var e3 = extent.apply(this, arguments), t2 = this.__zoom, p02 = p2 == null ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2;
7849 return constrain(identity2.translate(p02[0], p02[1]).scale(t2.k).translate(
7850 typeof x2 === "function" ? -x2.apply(this, arguments) : -x2,
7851 typeof y3 === "function" ? -y3.apply(this, arguments) : -y3
7852 ), e3, translateExtent);
7855 function scale(transform2, k2) {
7856 k2 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k2));
7857 return k2 === transform2.k ? transform2 : new Transform(k2, transform2.x, transform2.y);
7859 function translate(transform2, p02, p1) {
7860 var x2 = p02[0] - p1[0] * transform2.k, y3 = p02[1] - p1[1] * transform2.k;
7861 return x2 === transform2.x && y3 === transform2.y ? transform2 : new Transform(transform2.k, x2, y3);
7863 function centroid(extent2) {
7864 return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
7866 function schedule(transition2, transform2, point, event) {
7867 transition2.on("start.zoom", function() {
7868 gesture(this, arguments).event(event).start();
7869 }).on("interrupt.zoom end.zoom", function() {
7870 gesture(this, arguments).event(event).end();
7871 }).tween("zoom", function() {
7872 var that = this, args = arguments, g3 = gesture(that, args).event(event), e3 = extent.apply(that, args), p2 = point == null ? centroid(e3) : typeof point === "function" ? point.apply(that, args) : point, w3 = Math.max(e3[1][0] - e3[0][0], e3[1][1] - e3[0][1]), a2 = that.__zoom, b3 = typeof transform2 === "function" ? transform2.apply(that, args) : transform2, i3 = interpolate(a2.invert(p2).concat(w3 / a2.k), b3.invert(p2).concat(w3 / b3.k));
7873 return function(t2) {
7874 if (t2 === 1) t2 = b3;
7876 var l4 = i3(t2), k2 = w3 / l4[2];
7877 t2 = new Transform(k2, p2[0] - l4[0] * k2, p2[1] - l4[1] * k2);
7883 function gesture(that, args, clean2) {
7884 return !clean2 && that.__zooming || new Gesture(that, args);
7886 function Gesture(that, args) {
7890 this.sourceEvent = null;
7891 this.extent = extent.apply(that, args);
7894 Gesture.prototype = {
7895 event: function(event) {
7896 if (event) this.sourceEvent = event;
7900 if (++this.active === 1) {
7901 this.that.__zooming = this;
7906 zoom: function(key, transform2) {
7907 if (this.mouse && key !== "mouse") this.mouse[1] = transform2.invert(this.mouse[0]);
7908 if (this.touch0 && key !== "touch") this.touch0[1] = transform2.invert(this.touch0[0]);
7909 if (this.touch1 && key !== "touch") this.touch1[1] = transform2.invert(this.touch1[0]);
7910 this.that.__zoom = transform2;
7915 if (--this.active === 0) {
7916 delete this.that.__zooming;
7921 emit: function(type2) {
7922 var d4 = select_default2(this.that).datum();
7926 new ZoomEvent(type2, {
7927 sourceEvent: this.sourceEvent,
7930 transform: this.that.__zoom,
7937 function wheeled(event, ...args) {
7938 if (!filter2.apply(this, arguments)) return;
7939 var g3 = gesture(this, args).event(event), t2 = this.__zoom, k2 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t2.k * Math.pow(2, wheelDelta.apply(this, arguments)))), p2 = pointer_default(event);
7941 if (g3.mouse[0][0] !== p2[0] || g3.mouse[0][1] !== p2[1]) {
7942 g3.mouse[1] = t2.invert(g3.mouse[0] = p2);
7944 clearTimeout(g3.wheel);
7945 } else if (t2.k === k2) return;
7947 g3.mouse = [p2, t2.invert(p2)];
7948 interrupt_default(this);
7951 noevent_default2(event);
7952 g3.wheel = setTimeout(wheelidled, wheelDelay);
7953 g3.zoom("mouse", constrain(translate(scale(t2, k2), g3.mouse[0], g3.mouse[1]), g3.extent, translateExtent));
7954 function wheelidled() {
7959 function mousedowned(event, ...args) {
7960 if (touchending || !filter2.apply(this, arguments)) return;
7961 var currentTarget = event.currentTarget, g3 = gesture(this, args, true).event(event), v3 = select_default2(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), p2 = pointer_default(event, currentTarget), x05 = event.clientX, y05 = event.clientY;
7962 nodrag_default(event.view);
7963 nopropagation2(event);
7964 g3.mouse = [p2, this.__zoom.invert(p2)];
7965 interrupt_default(this);
7967 function mousemoved(event2) {
7968 noevent_default2(event2);
7970 var dx = event2.clientX - x05, dy = event2.clientY - y05;
7971 g3.moved = dx * dx + dy * dy > clickDistance2;
7973 g3.event(event2).zoom("mouse", constrain(translate(g3.that.__zoom, g3.mouse[0] = pointer_default(event2, currentTarget), g3.mouse[1]), g3.extent, translateExtent));
7975 function mouseupped(event2) {
7976 v3.on("mousemove.zoom mouseup.zoom", null);
7977 yesdrag(event2.view, g3.moved);
7978 noevent_default2(event2);
7979 g3.event(event2).end();
7982 function dblclicked(event, ...args) {
7983 if (!filter2.apply(this, arguments)) return;
7984 var t02 = this.__zoom, p02 = pointer_default(event.changedTouches ? event.changedTouches[0] : event, this), p1 = t02.invert(p02), k1 = t02.k * (event.shiftKey ? 0.5 : 2), t12 = constrain(translate(scale(t02, k1), p02, p1), extent.apply(this, args), translateExtent);
7985 noevent_default2(event);
7986 if (duration > 0) select_default2(this).transition().duration(duration).call(schedule, t12, p02, event);
7987 else select_default2(this).call(zoom.transform, t12, p02, event);
7989 function touchstarted(event, ...args) {
7990 if (!filter2.apply(this, arguments)) return;
7991 var touches = event.touches, n3 = touches.length, g3 = gesture(this, args, event.changedTouches.length === n3).event(event), started, i3, t2, p2;
7992 nopropagation2(event);
7993 for (i3 = 0; i3 < n3; ++i3) {
7994 t2 = touches[i3], p2 = pointer_default(t2, this);
7995 p2 = [p2, this.__zoom.invert(p2), t2.identifier];
7996 if (!g3.touch0) g3.touch0 = p2, started = true, g3.taps = 1 + !!touchstarting;
7997 else if (!g3.touch1 && g3.touch0[2] !== p2[2]) g3.touch1 = p2, g3.taps = 0;
7999 if (touchstarting) touchstarting = clearTimeout(touchstarting);
8001 if (g3.taps < 2) touchfirst = p2[0], touchstarting = setTimeout(function() {
8002 touchstarting = null;
8004 interrupt_default(this);
8008 function touchmoved(event, ...args) {
8009 if (!this.__zooming) return;
8010 var g3 = gesture(this, args).event(event), touches = event.changedTouches, n3 = touches.length, i3, t2, p2, l4;
8011 noevent_default2(event);
8012 for (i3 = 0; i3 < n3; ++i3) {
8013 t2 = touches[i3], p2 = pointer_default(t2, this);
8014 if (g3.touch0 && g3.touch0[2] === t2.identifier) g3.touch0[0] = p2;
8015 else if (g3.touch1 && g3.touch1[2] === t2.identifier) g3.touch1[0] = p2;
8017 t2 = g3.that.__zoom;
8019 var p02 = g3.touch0[0], l0 = g3.touch0[1], p1 = g3.touch1[0], l1 = g3.touch1[1], dp = (dp = p1[0] - p02[0]) * dp + (dp = p1[1] - p02[1]) * dp, dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
8020 t2 = scale(t2, Math.sqrt(dp / dl));
8021 p2 = [(p02[0] + p1[0]) / 2, (p02[1] + p1[1]) / 2];
8022 l4 = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
8023 } else if (g3.touch0) p2 = g3.touch0[0], l4 = g3.touch0[1];
8025 g3.zoom("touch", constrain(translate(t2, p2, l4), g3.extent, translateExtent));
8027 function touchended(event, ...args) {
8028 if (!this.__zooming) return;
8029 var g3 = gesture(this, args).event(event), touches = event.changedTouches, n3 = touches.length, i3, t2;
8030 nopropagation2(event);
8031 if (touchending) clearTimeout(touchending);
8032 touchending = setTimeout(function() {
8035 for (i3 = 0; i3 < n3; ++i3) {
8037 if (g3.touch0 && g3.touch0[2] === t2.identifier) delete g3.touch0;
8038 else if (g3.touch1 && g3.touch1[2] === t2.identifier) delete g3.touch1;
8040 if (g3.touch1 && !g3.touch0) g3.touch0 = g3.touch1, delete g3.touch1;
8041 if (g3.touch0) g3.touch0[1] = this.__zoom.invert(g3.touch0[0]);
8044 if (g3.taps === 2) {
8045 t2 = pointer_default(t2, this);
8046 if (Math.hypot(touchfirst[0] - t2[0], touchfirst[1] - t2[1]) < tapDistance) {
8047 var p2 = select_default2(this).on("dblclick.zoom");
8048 if (p2) p2.apply(this, arguments);
8053 zoom.wheelDelta = function(_3) {
8054 return arguments.length ? (wheelDelta = typeof _3 === "function" ? _3 : constant_default4(+_3), zoom) : wheelDelta;
8056 zoom.filter = function(_3) {
8057 return arguments.length ? (filter2 = typeof _3 === "function" ? _3 : constant_default4(!!_3), zoom) : filter2;
8059 zoom.touchable = function(_3) {
8060 return arguments.length ? (touchable = typeof _3 === "function" ? _3 : constant_default4(!!_3), zoom) : touchable;
8062 zoom.extent = function(_3) {
8063 return arguments.length ? (extent = typeof _3 === "function" ? _3 : constant_default4([[+_3[0][0], +_3[0][1]], [+_3[1][0], +_3[1][1]]]), zoom) : extent;
8065 zoom.scaleExtent = function(_3) {
8066 return arguments.length ? (scaleExtent[0] = +_3[0], scaleExtent[1] = +_3[1], zoom) : [scaleExtent[0], scaleExtent[1]];
8068 zoom.translateExtent = function(_3) {
8069 return arguments.length ? (translateExtent[0][0] = +_3[0][0], translateExtent[1][0] = +_3[1][0], translateExtent[0][1] = +_3[0][1], translateExtent[1][1] = +_3[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];
8071 zoom.constrain = function(_3) {
8072 return arguments.length ? (constrain = _3, zoom) : constrain;
8074 zoom.duration = function(_3) {
8075 return arguments.length ? (duration = +_3, zoom) : duration;
8077 zoom.interpolate = function(_3) {
8078 return arguments.length ? (interpolate = _3, zoom) : interpolate;
8080 zoom.on = function() {
8081 var value = listeners.on.apply(listeners, arguments);
8082 return value === listeners ? zoom : value;
8084 zoom.clickDistance = function(_3) {
8085 return arguments.length ? (clickDistance2 = (_3 = +_3) * _3, zoom) : Math.sqrt(clickDistance2);
8087 zoom.tapDistance = function(_3) {
8088 return arguments.length ? (tapDistance = +_3, zoom) : tapDistance;
8092 var init_zoom2 = __esm({
8093 "node_modules/d3-zoom/src/zoom.js"() {
8106 // node_modules/d3-zoom/src/index.js
8107 var init_src12 = __esm({
8108 "node_modules/d3-zoom/src/index.js"() {
8114 // modules/geo/raw_mercator.js
8115 var raw_mercator_exports = {};
8116 __export(raw_mercator_exports, {
8117 geoRawMercator: () => geoRawMercator
8119 function geoRawMercator() {
8120 const project = mercatorRaw;
8121 let k2 = 512 / Math.PI;
8124 let clipExtent = [[0, 0], [0, 0]];
8125 function projection2(point) {
8126 point = project(point[0] * Math.PI / 180, point[1] * Math.PI / 180);
8127 return [point[0] * k2 + x2, y3 - point[1] * k2];
8129 projection2.invert = function(point) {
8130 point = project.invert((point[0] - x2) / k2, (y3 - point[1]) / k2);
8131 return point && [point[0] * 180 / Math.PI, point[1] * 180 / Math.PI];
8133 projection2.scale = function(_3) {
8134 if (!arguments.length) return k2;
8138 projection2.translate = function(_3) {
8139 if (!arguments.length) return [x2, y3];
8144 projection2.clipExtent = function(_3) {
8145 if (!arguments.length) return clipExtent;
8149 projection2.transform = function(obj) {
8150 if (!arguments.length) return identity2.translate(x2, y3).scale(k2);
8156 projection2.stream = transform_default({
8157 point: function(x3, y4) {
8158 const vec = projection2([x3, y4]);
8159 this.stream.point(vec[0], vec[1]);
8164 var init_raw_mercator = __esm({
8165 "modules/geo/raw_mercator.js"() {
8172 // modules/geo/ortho.js
8173 var ortho_exports = {};
8174 __export(ortho_exports, {
8175 geoOrthoCalcScore: () => geoOrthoCalcScore,
8176 geoOrthoCanOrthogonalize: () => geoOrthoCanOrthogonalize,
8177 geoOrthoMaxOffsetAngle: () => geoOrthoMaxOffsetAngle,
8178 geoOrthoNormalizedDotProduct: () => geoOrthoNormalizedDotProduct
8180 function geoOrthoNormalizedDotProduct(a2, b3, origin) {
8181 if (geoVecEqual(origin, a2) || geoVecEqual(origin, b3)) {
8184 return geoVecNormalizedDot(a2, b3, origin);
8186 function geoOrthoFilterDotProduct(dotp, epsilon3, lowerThreshold, upperThreshold, allowStraightAngles) {
8187 var val = Math.abs(dotp);
8188 if (val < epsilon3) {
8190 } else if (allowStraightAngles && Math.abs(val - 1) < epsilon3) {
8192 } else if (val < lowerThreshold || val > upperThreshold) {
8198 function geoOrthoCalcScore(points, isClosed, epsilon3, threshold) {
8200 var first = isClosed ? 0 : 1;
8201 var last2 = isClosed ? points.length : points.length - 1;
8202 var coords = points.map(function(p2) {
8205 var lowerThreshold = Math.cos((90 - threshold) * Math.PI / 180);
8206 var upperThreshold = Math.cos(threshold * Math.PI / 180);
8207 for (var i3 = first; i3 < last2; i3++) {
8208 var a2 = coords[(i3 - 1 + coords.length) % coords.length];
8209 var origin = coords[i3];
8210 var b3 = coords[(i3 + 1) % coords.length];
8211 var dotp = geoOrthoFilterDotProduct(geoOrthoNormalizedDotProduct(a2, b3, origin), epsilon3, lowerThreshold, upperThreshold);
8212 if (dotp === null) continue;
8213 score = score + 2 * Math.min(Math.abs(dotp - 1), Math.min(Math.abs(dotp), Math.abs(dotp + 1)));
8217 function geoOrthoMaxOffsetAngle(coords, isClosed, lessThan) {
8218 var max3 = -Infinity;
8219 var first = isClosed ? 0 : 1;
8220 var last2 = isClosed ? coords.length : coords.length - 1;
8221 for (var i3 = first; i3 < last2; i3++) {
8222 var a2 = coords[(i3 - 1 + coords.length) % coords.length];
8223 var origin = coords[i3];
8224 var b3 = coords[(i3 + 1) % coords.length];
8225 var normalizedDotP = geoOrthoNormalizedDotProduct(a2, b3, origin);
8226 var angle2 = Math.acos(Math.abs(normalizedDotP)) * 180 / Math.PI;
8227 if (angle2 > 45) angle2 = 90 - angle2;
8228 if (angle2 >= lessThan) continue;
8229 if (angle2 > max3) max3 = angle2;
8231 if (max3 === -Infinity) return null;
8234 function geoOrthoCanOrthogonalize(coords, isClosed, epsilon3, threshold, allowStraightAngles) {
8236 var first = isClosed ? 0 : 1;
8237 var last2 = isClosed ? coords.length : coords.length - 1;
8238 var lowerThreshold = Math.cos((90 - threshold) * Math.PI / 180);
8239 var upperThreshold = Math.cos(threshold * Math.PI / 180);
8240 for (var i3 = first; i3 < last2; i3++) {
8241 var a2 = coords[(i3 - 1 + coords.length) % coords.length];
8242 var origin = coords[i3];
8243 var b3 = coords[(i3 + 1) % coords.length];
8244 var dotp = geoOrthoFilterDotProduct(geoOrthoNormalizedDotProduct(a2, b3, origin), epsilon3, lowerThreshold, upperThreshold, allowStraightAngles);
8245 if (dotp === null) continue;
8246 if (Math.abs(dotp) > 0) return 1;
8251 var init_ortho = __esm({
8252 "modules/geo/ortho.js"() {
8258 // modules/geo/index.js
8259 var geo_exports2 = {};
8260 __export(geo_exports2, {
8261 geoAngle: () => geoAngle,
8262 geoChooseEdge: () => geoChooseEdge,
8263 geoEdgeEqual: () => geoEdgeEqual,
8264 geoExtent: () => geoExtent,
8265 geoGetSmallestSurroundingRectangle: () => geoGetSmallestSurroundingRectangle,
8266 geoHasLineIntersections: () => geoHasLineIntersections,
8267 geoHasSelfIntersections: () => geoHasSelfIntersections,
8268 geoLatToMeters: () => geoLatToMeters,
8269 geoLineIntersection: () => geoLineIntersection,
8270 geoLonToMeters: () => geoLonToMeters,
8271 geoMetersToLat: () => geoMetersToLat,
8272 geoMetersToLon: () => geoMetersToLon,
8273 geoMetersToOffset: () => geoMetersToOffset,
8274 geoOffsetToMeters: () => geoOffsetToMeters,
8275 geoOrthoCalcScore: () => geoOrthoCalcScore,
8276 geoOrthoCanOrthogonalize: () => geoOrthoCanOrthogonalize,
8277 geoOrthoMaxOffsetAngle: () => geoOrthoMaxOffsetAngle,
8278 geoOrthoNormalizedDotProduct: () => geoOrthoNormalizedDotProduct,
8279 geoPathHasIntersections: () => geoPathHasIntersections,
8280 geoPathIntersections: () => geoPathIntersections,
8281 geoPathLength: () => geoPathLength,
8282 geoPointInPolygon: () => geoPointInPolygon,
8283 geoPolygonContainsPolygon: () => geoPolygonContainsPolygon,
8284 geoPolygonIntersectsPolygon: () => geoPolygonIntersectsPolygon,
8285 geoRawMercator: () => geoRawMercator,
8286 geoRotate: () => geoRotate,
8287 geoScaleToZoom: () => geoScaleToZoom,
8288 geoSphericalClosestNode: () => geoSphericalClosestNode,
8289 geoSphericalDistance: () => geoSphericalDistance,
8290 geoVecAdd: () => geoVecAdd,
8291 geoVecAngle: () => geoVecAngle,
8292 geoVecCross: () => geoVecCross,
8293 geoVecDot: () => geoVecDot,
8294 geoVecEqual: () => geoVecEqual,
8295 geoVecFloor: () => geoVecFloor,
8296 geoVecInterp: () => geoVecInterp,
8297 geoVecLength: () => geoVecLength,
8298 geoVecLengthSquare: () => geoVecLengthSquare,
8299 geoVecNormalize: () => geoVecNormalize,
8300 geoVecNormalizedDot: () => geoVecNormalizedDot,
8301 geoVecProject: () => geoVecProject,
8302 geoVecScale: () => geoVecScale,
8303 geoVecSubtract: () => geoVecSubtract,
8304 geoViewportEdge: () => geoViewportEdge,
8305 geoZoomToScale: () => geoZoomToScale
8307 var init_geo2 = __esm({
8308 "modules/geo/index.js"() {
8336 init_raw_mercator();
8358 // node_modules/aes-js/index.js
8359 var require_aes_js = __commonJS({
8360 "node_modules/aes-js/index.js"(exports2, module2) {
8363 function checkInt(value) {
8364 return parseInt(value) === value;
8366 function checkInts(arrayish) {
8367 if (!checkInt(arrayish.length)) {
8370 for (var i3 = 0; i3 < arrayish.length; i3++) {
8371 if (!checkInt(arrayish[i3]) || arrayish[i3] < 0 || arrayish[i3] > 255) {
8377 function coerceArray(arg, copy2) {
8378 if (arg.buffer && arg.name === "Uint8Array") {
8383 arg = Array.prototype.slice.call(arg);
8388 if (Array.isArray(arg)) {
8389 if (!checkInts(arg)) {
8390 throw new Error("Array contains invalid value: " + arg);
8392 return new Uint8Array(arg);
8394 if (checkInt(arg.length) && checkInts(arg)) {
8395 return new Uint8Array(arg);
8397 throw new Error("unsupported array-like object");
8399 function createArray(length2) {
8400 return new Uint8Array(length2);
8402 function copyArray2(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {
8403 if (sourceStart != null || sourceEnd != null) {
8404 if (sourceArray.slice) {
8405 sourceArray = sourceArray.slice(sourceStart, sourceEnd);
8407 sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);
8410 targetArray.set(sourceArray, targetStart);
8412 var convertUtf8 = /* @__PURE__ */ (function() {
8413 function toBytes(text) {
8414 var result = [], i3 = 0;
8415 text = encodeURI(text);
8416 while (i3 < text.length) {
8417 var c2 = text.charCodeAt(i3++);
8419 result.push(parseInt(text.substr(i3, 2), 16));
8425 return coerceArray(result);
8427 function fromBytes(bytes) {
8428 var result = [], i3 = 0;
8429 while (i3 < bytes.length) {
8432 result.push(String.fromCharCode(c2));
8434 } else if (c2 > 191 && c2 < 224) {
8435 result.push(String.fromCharCode((c2 & 31) << 6 | bytes[i3 + 1] & 63));
8438 result.push(String.fromCharCode((c2 & 15) << 12 | (bytes[i3 + 1] & 63) << 6 | bytes[i3 + 2] & 63));
8442 return result.join("");
8449 var convertHex = /* @__PURE__ */ (function() {
8450 function toBytes(text) {
8452 for (var i3 = 0; i3 < text.length; i3 += 2) {
8453 result.push(parseInt(text.substr(i3, 2), 16));
8457 var Hex = "0123456789abcdef";
8458 function fromBytes(bytes) {
8460 for (var i3 = 0; i3 < bytes.length; i3++) {
8462 result.push(Hex[(v3 & 240) >> 4] + Hex[v3 & 15]);
8464 return result.join("");
8471 var numberOfRounds = { 16: 10, 24: 12, 32: 14 };
8472 var rcon = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145];
8473 var S3 = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22];
8474 var Si = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125];
8475 var T1 = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986];
8476 var T2 = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766];
8477 var T3 = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126];
8478 var T4 = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436];
8479 var T5 = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890];
8480 var T6 = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935];
8481 var T7 = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600];
8482 var T8 = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480];
8483 var U1 = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795];
8484 var U22 = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855];
8485 var U3 = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150];
8486 var U4 = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925];
8487 function convertToInt32(bytes) {
8489 for (var i3 = 0; i3 < bytes.length; i3 += 4) {
8491 bytes[i3] << 24 | bytes[i3 + 1] << 16 | bytes[i3 + 2] << 8 | bytes[i3 + 3]
8496 var AES = function(key) {
8497 if (!(this instanceof AES)) {
8498 throw Error("AES must be instanitated with `new`");
8500 Object.defineProperty(this, "key", {
8501 value: coerceArray(key, true)
8505 AES.prototype._prepare = function() {
8506 var rounds = numberOfRounds[this.key.length];
8507 if (rounds == null) {
8508 throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
8512 for (var i3 = 0; i3 <= rounds; i3++) {
8513 this._Ke.push([0, 0, 0, 0]);
8514 this._Kd.push([0, 0, 0, 0]);
8516 var roundKeyCount = (rounds + 1) * 4;
8517 var KC = this.key.length / 4;
8518 var tk = convertToInt32(this.key);
8520 for (var i3 = 0; i3 < KC; i3++) {
8522 this._Ke[index][i3 % 4] = tk[i3];
8523 this._Kd[rounds - index][i3 % 4] = tk[i3];
8525 var rconpointer = 0;
8527 while (t2 < roundKeyCount) {
8529 tk[0] ^= S3[tt2 >> 16 & 255] << 24 ^ S3[tt2 >> 8 & 255] << 16 ^ S3[tt2 & 255] << 8 ^ S3[tt2 >> 24 & 255] ^ rcon[rconpointer] << 24;
8532 for (var i3 = 1; i3 < KC; i3++) {
8533 tk[i3] ^= tk[i3 - 1];
8536 for (var i3 = 1; i3 < KC / 2; i3++) {
8537 tk[i3] ^= tk[i3 - 1];
8539 tt2 = tk[KC / 2 - 1];
8540 tk[KC / 2] ^= S3[tt2 & 255] ^ S3[tt2 >> 8 & 255] << 8 ^ S3[tt2 >> 16 & 255] << 16 ^ S3[tt2 >> 24 & 255] << 24;
8541 for (var i3 = KC / 2 + 1; i3 < KC; i3++) {
8542 tk[i3] ^= tk[i3 - 1];
8546 while (i3 < KC && t2 < roundKeyCount) {
8549 this._Ke[r2][c2] = tk[i3];
8550 this._Kd[rounds - r2][c2] = tk[i3++];
8554 for (var r2 = 1; r2 < rounds; r2++) {
8555 for (var c2 = 0; c2 < 4; c2++) {
8556 tt2 = this._Kd[r2][c2];
8557 this._Kd[r2][c2] = U1[tt2 >> 24 & 255] ^ U22[tt2 >> 16 & 255] ^ U3[tt2 >> 8 & 255] ^ U4[tt2 & 255];
8561 AES.prototype.encrypt = function(plaintext) {
8562 if (plaintext.length != 16) {
8563 throw new Error("invalid plaintext size (must be 16 bytes)");
8565 var rounds = this._Ke.length - 1;
8566 var a2 = [0, 0, 0, 0];
8567 var t2 = convertToInt32(plaintext);
8568 for (var i3 = 0; i3 < 4; i3++) {
8569 t2[i3] ^= this._Ke[0][i3];
8571 for (var r2 = 1; r2 < rounds; r2++) {
8572 for (var i3 = 0; i3 < 4; i3++) {
8573 a2[i3] = T1[t2[i3] >> 24 & 255] ^ T2[t2[(i3 + 1) % 4] >> 16 & 255] ^ T3[t2[(i3 + 2) % 4] >> 8 & 255] ^ T4[t2[(i3 + 3) % 4] & 255] ^ this._Ke[r2][i3];
8577 var result = createArray(16), tt2;
8578 for (var i3 = 0; i3 < 4; i3++) {
8579 tt2 = this._Ke[rounds][i3];
8580 result[4 * i3] = (S3[t2[i3] >> 24 & 255] ^ tt2 >> 24) & 255;
8581 result[4 * i3 + 1] = (S3[t2[(i3 + 1) % 4] >> 16 & 255] ^ tt2 >> 16) & 255;
8582 result[4 * i3 + 2] = (S3[t2[(i3 + 2) % 4] >> 8 & 255] ^ tt2 >> 8) & 255;
8583 result[4 * i3 + 3] = (S3[t2[(i3 + 3) % 4] & 255] ^ tt2) & 255;
8587 AES.prototype.decrypt = function(ciphertext) {
8588 if (ciphertext.length != 16) {
8589 throw new Error("invalid ciphertext size (must be 16 bytes)");
8591 var rounds = this._Kd.length - 1;
8592 var a2 = [0, 0, 0, 0];
8593 var t2 = convertToInt32(ciphertext);
8594 for (var i3 = 0; i3 < 4; i3++) {
8595 t2[i3] ^= this._Kd[0][i3];
8597 for (var r2 = 1; r2 < rounds; r2++) {
8598 for (var i3 = 0; i3 < 4; i3++) {
8599 a2[i3] = T5[t2[i3] >> 24 & 255] ^ T6[t2[(i3 + 3) % 4] >> 16 & 255] ^ T7[t2[(i3 + 2) % 4] >> 8 & 255] ^ T8[t2[(i3 + 1) % 4] & 255] ^ this._Kd[r2][i3];
8603 var result = createArray(16), tt2;
8604 for (var i3 = 0; i3 < 4; i3++) {
8605 tt2 = this._Kd[rounds][i3];
8606 result[4 * i3] = (Si[t2[i3] >> 24 & 255] ^ tt2 >> 24) & 255;
8607 result[4 * i3 + 1] = (Si[t2[(i3 + 3) % 4] >> 16 & 255] ^ tt2 >> 16) & 255;
8608 result[4 * i3 + 2] = (Si[t2[(i3 + 2) % 4] >> 8 & 255] ^ tt2 >> 8) & 255;
8609 result[4 * i3 + 3] = (Si[t2[(i3 + 1) % 4] & 255] ^ tt2) & 255;
8613 var ModeOfOperationECB = function(key) {
8614 if (!(this instanceof ModeOfOperationECB)) {
8615 throw Error("AES must be instanitated with `new`");
8617 this.description = "Electronic Code Block";
8619 this._aes = new AES(key);
8621 ModeOfOperationECB.prototype.encrypt = function(plaintext) {
8622 plaintext = coerceArray(plaintext);
8623 if (plaintext.length % 16 !== 0) {
8624 throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
8626 var ciphertext = createArray(plaintext.length);
8627 var block = createArray(16);
8628 for (var i3 = 0; i3 < plaintext.length; i3 += 16) {
8629 copyArray2(plaintext, block, 0, i3, i3 + 16);
8630 block = this._aes.encrypt(block);
8631 copyArray2(block, ciphertext, i3);
8635 ModeOfOperationECB.prototype.decrypt = function(ciphertext) {
8636 ciphertext = coerceArray(ciphertext);
8637 if (ciphertext.length % 16 !== 0) {
8638 throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
8640 var plaintext = createArray(ciphertext.length);
8641 var block = createArray(16);
8642 for (var i3 = 0; i3 < ciphertext.length; i3 += 16) {
8643 copyArray2(ciphertext, block, 0, i3, i3 + 16);
8644 block = this._aes.decrypt(block);
8645 copyArray2(block, plaintext, i3);
8649 var ModeOfOperationCBC = function(key, iv) {
8650 if (!(this instanceof ModeOfOperationCBC)) {
8651 throw Error("AES must be instanitated with `new`");
8653 this.description = "Cipher Block Chaining";
8656 iv = createArray(16);
8657 } else if (iv.length != 16) {
8658 throw new Error("invalid initialation vector size (must be 16 bytes)");
8660 this._lastCipherblock = coerceArray(iv, true);
8661 this._aes = new AES(key);
8663 ModeOfOperationCBC.prototype.encrypt = function(plaintext) {
8664 plaintext = coerceArray(plaintext);
8665 if (plaintext.length % 16 !== 0) {
8666 throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
8668 var ciphertext = createArray(plaintext.length);
8669 var block = createArray(16);
8670 for (var i3 = 0; i3 < plaintext.length; i3 += 16) {
8671 copyArray2(plaintext, block, 0, i3, i3 + 16);
8672 for (var j3 = 0; j3 < 16; j3++) {
8673 block[j3] ^= this._lastCipherblock[j3];
8675 this._lastCipherblock = this._aes.encrypt(block);
8676 copyArray2(this._lastCipherblock, ciphertext, i3);
8680 ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {
8681 ciphertext = coerceArray(ciphertext);
8682 if (ciphertext.length % 16 !== 0) {
8683 throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
8685 var plaintext = createArray(ciphertext.length);
8686 var block = createArray(16);
8687 for (var i3 = 0; i3 < ciphertext.length; i3 += 16) {
8688 copyArray2(ciphertext, block, 0, i3, i3 + 16);
8689 block = this._aes.decrypt(block);
8690 for (var j3 = 0; j3 < 16; j3++) {
8691 plaintext[i3 + j3] = block[j3] ^ this._lastCipherblock[j3];
8693 copyArray2(ciphertext, this._lastCipherblock, 0, i3, i3 + 16);
8697 var ModeOfOperationCFB = function(key, iv, segmentSize) {
8698 if (!(this instanceof ModeOfOperationCFB)) {
8699 throw Error("AES must be instanitated with `new`");
8701 this.description = "Cipher Feedback";
8704 iv = createArray(16);
8705 } else if (iv.length != 16) {
8706 throw new Error("invalid initialation vector size (must be 16 size)");
8711 this.segmentSize = segmentSize;
8712 this._shiftRegister = coerceArray(iv, true);
8713 this._aes = new AES(key);
8715 ModeOfOperationCFB.prototype.encrypt = function(plaintext) {
8716 if (plaintext.length % this.segmentSize != 0) {
8717 throw new Error("invalid plaintext size (must be segmentSize bytes)");
8719 var encrypted = coerceArray(plaintext, true);
8721 for (var i3 = 0; i3 < encrypted.length; i3 += this.segmentSize) {
8722 xorSegment = this._aes.encrypt(this._shiftRegister);
8723 for (var j3 = 0; j3 < this.segmentSize; j3++) {
8724 encrypted[i3 + j3] ^= xorSegment[j3];
8726 copyArray2(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);
8727 copyArray2(encrypted, this._shiftRegister, 16 - this.segmentSize, i3, i3 + this.segmentSize);
8731 ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {
8732 if (ciphertext.length % this.segmentSize != 0) {
8733 throw new Error("invalid ciphertext size (must be segmentSize bytes)");
8735 var plaintext = coerceArray(ciphertext, true);
8737 for (var i3 = 0; i3 < plaintext.length; i3 += this.segmentSize) {
8738 xorSegment = this._aes.encrypt(this._shiftRegister);
8739 for (var j3 = 0; j3 < this.segmentSize; j3++) {
8740 plaintext[i3 + j3] ^= xorSegment[j3];
8742 copyArray2(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);
8743 copyArray2(ciphertext, this._shiftRegister, 16 - this.segmentSize, i3, i3 + this.segmentSize);
8747 var ModeOfOperationOFB = function(key, iv) {
8748 if (!(this instanceof ModeOfOperationOFB)) {
8749 throw Error("AES must be instanitated with `new`");
8751 this.description = "Output Feedback";
8754 iv = createArray(16);
8755 } else if (iv.length != 16) {
8756 throw new Error("invalid initialation vector size (must be 16 bytes)");
8758 this._lastPrecipher = coerceArray(iv, true);
8759 this._lastPrecipherIndex = 16;
8760 this._aes = new AES(key);
8762 ModeOfOperationOFB.prototype.encrypt = function(plaintext) {
8763 var encrypted = coerceArray(plaintext, true);
8764 for (var i3 = 0; i3 < encrypted.length; i3++) {
8765 if (this._lastPrecipherIndex === 16) {
8766 this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);
8767 this._lastPrecipherIndex = 0;
8769 encrypted[i3] ^= this._lastPrecipher[this._lastPrecipherIndex++];
8773 ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;
8774 var Counter = function(initialValue) {
8775 if (!(this instanceof Counter)) {
8776 throw Error("Counter must be instanitated with `new`");
8778 if (initialValue !== 0 && !initialValue) {
8781 if (typeof initialValue === "number") {
8782 this._counter = createArray(16);
8783 this.setValue(initialValue);
8785 this.setBytes(initialValue);
8788 Counter.prototype.setValue = function(value) {
8789 if (typeof value !== "number" || parseInt(value) != value) {
8790 throw new Error("invalid counter value (must be an integer)");
8792 if (value > Number.MAX_SAFE_INTEGER) {
8793 throw new Error("integer value out of safe range");
8795 for (var index = 15; index >= 0; --index) {
8796 this._counter[index] = value % 256;
8797 value = parseInt(value / 256);
8800 Counter.prototype.setBytes = function(bytes) {
8801 bytes = coerceArray(bytes, true);
8802 if (bytes.length != 16) {
8803 throw new Error("invalid counter bytes size (must be 16 bytes)");
8805 this._counter = bytes;
8807 Counter.prototype.increment = function() {
8808 for (var i3 = 15; i3 >= 0; i3--) {
8809 if (this._counter[i3] === 255) {
8810 this._counter[i3] = 0;
8812 this._counter[i3]++;
8817 var ModeOfOperationCTR = function(key, counter) {
8818 if (!(this instanceof ModeOfOperationCTR)) {
8819 throw Error("AES must be instanitated with `new`");
8821 this.description = "Counter";
8823 if (!(counter instanceof Counter)) {
8824 counter = new Counter(counter);
8826 this._counter = counter;
8827 this._remainingCounter = null;
8828 this._remainingCounterIndex = 16;
8829 this._aes = new AES(key);
8831 ModeOfOperationCTR.prototype.encrypt = function(plaintext) {
8832 var encrypted = coerceArray(plaintext, true);
8833 for (var i3 = 0; i3 < encrypted.length; i3++) {
8834 if (this._remainingCounterIndex === 16) {
8835 this._remainingCounter = this._aes.encrypt(this._counter._counter);
8836 this._remainingCounterIndex = 0;
8837 this._counter.increment();
8839 encrypted[i3] ^= this._remainingCounter[this._remainingCounterIndex++];
8843 ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;
8844 function pkcs7pad(data) {
8845 data = coerceArray(data, true);
8846 var padder = 16 - data.length % 16;
8847 var result = createArray(data.length + padder);
8848 copyArray2(data, result);
8849 for (var i3 = data.length; i3 < result.length; i3++) {
8850 result[i3] = padder;
8854 function pkcs7strip(data) {
8855 data = coerceArray(data, true);
8856 if (data.length < 16) {
8857 throw new Error("PKCS#7 invalid length");
8859 var padder = data[data.length - 1];
8861 throw new Error("PKCS#7 padding byte out of range");
8863 var length2 = data.length - padder;
8864 for (var i3 = 0; i3 < padder; i3++) {
8865 if (data[length2 + i3] !== padder) {
8866 throw new Error("PKCS#7 invalid padding byte");
8869 var result = createArray(length2);
8870 copyArray2(data, result, 0, 0, length2);
8877 ecb: ModeOfOperationECB,
8878 cbc: ModeOfOperationCBC,
8879 cfb: ModeOfOperationCFB,
8880 ofb: ModeOfOperationOFB,
8881 ctr: ModeOfOperationCTR
8896 copyArray: copyArray2
8899 if (typeof exports2 !== "undefined") {
8900 module2.exports = aesjs2;
8901 } else if (typeof define === "function" && define.amd) {
8902 define([], function() {
8907 aesjs2._aesjs = root3.aesjs;
8909 root3.aesjs = aesjs2;
8915 // modules/util/aes.js
8916 var aes_exports = {};
8917 __export(aes_exports, {
8918 utilAesDecrypt: () => utilAesDecrypt,
8919 utilAesEncrypt: () => utilAesEncrypt
8921 function utilAesEncrypt(text, key) {
8922 key = key || DEFAULT_128;
8923 const textBytes = import_aes_js.default.utils.utf8.toBytes(text);
8924 const aesCtr = new import_aes_js.default.ModeOfOperation.ctr(key);
8925 const encryptedBytes = aesCtr.encrypt(textBytes);
8926 const encryptedHex = import_aes_js.default.utils.hex.fromBytes(encryptedBytes);
8927 return encryptedHex;
8929 function utilAesDecrypt(encryptedHex, key) {
8930 key = key || DEFAULT_128;
8931 const encryptedBytes = import_aes_js.default.utils.hex.toBytes(encryptedHex);
8932 const aesCtr = new import_aes_js.default.ModeOfOperation.ctr(key);
8933 const decryptedBytes = aesCtr.decrypt(encryptedBytes);
8934 const text = import_aes_js.default.utils.utf8.fromBytes(decryptedBytes);
8937 var import_aes_js, DEFAULT_128;
8938 var init_aes = __esm({
8939 "modules/util/aes.js"() {
8941 import_aes_js = __toESM(require_aes_js(), 1);
8942 DEFAULT_128 = [250, 157, 60, 79, 142, 134, 229, 129, 138, 126, 210, 129, 29, 71, 160, 208];
8946 // modules/util/array.js
8947 var array_exports = {};
8948 __export(array_exports, {
8949 utilArrayChunk: () => utilArrayChunk,
8950 utilArrayDifference: () => utilArrayDifference,
8951 utilArrayFlatten: () => utilArrayFlatten,
8952 utilArrayGroupBy: () => utilArrayGroupBy,
8953 utilArrayIdentical: () => utilArrayIdentical,
8954 utilArrayIntersection: () => utilArrayIntersection,
8955 utilArrayUnion: () => utilArrayUnion,
8956 utilArrayUniq: () => utilArrayUniq,
8957 utilArrayUniqBy: () => utilArrayUniqBy
8959 function utilArrayIdentical(a2, b3) {
8960 if (a2 === b3) return true;
8962 if (i3 !== b3.length) return false;
8964 if (a2[i3] !== b3[i3]) return false;
8968 function utilArrayDifference(a2, b3) {
8969 var other = new Set(b3);
8970 return Array.from(new Set(a2)).filter(function(v3) {
8971 return !other.has(v3);
8974 function utilArrayIntersection(a2, b3) {
8975 var other = new Set(b3);
8976 return Array.from(new Set(a2)).filter(function(v3) {
8977 return other.has(v3);
8980 function utilArrayUnion(a2, b3) {
8981 var result = new Set(a2);
8982 b3.forEach(function(v3) {
8985 return Array.from(result);
8987 function utilArrayUniq(a2) {
8988 return Array.from(new Set(a2));
8990 function utilArrayChunk(a2, chunkSize) {
8991 if (!chunkSize || chunkSize < 0) return [a2.slice()];
8992 var result = new Array(Math.ceil(a2.length / chunkSize));
8993 return Array.from(result, function(item, i3) {
8994 return a2.slice(i3 * chunkSize, i3 * chunkSize + chunkSize);
8997 function utilArrayFlatten(a2) {
8998 return a2.reduce(function(acc, val) {
8999 return acc.concat(val);
9002 function utilArrayGroupBy(a2, key) {
9003 return a2.reduce(function(acc, item) {
9004 var group = typeof key === "function" ? key(item) : item[key];
9005 (acc[group] = acc[group] || []).push(item);
9009 function utilArrayUniqBy(a2, key) {
9010 var seen = /* @__PURE__ */ new Set();
9011 return a2.reduce(function(acc, item) {
9012 var val = typeof key === "function" ? key(item) : item[key];
9013 if (val && !seen.has(val)) {
9020 var init_array3 = __esm({
9021 "modules/util/array.js"() {
9026 // node_modules/diacritics/index.js
9027 var require_diacritics = __commonJS({
9028 "node_modules/diacritics/index.js"(exports2) {
9029 exports2.remove = removeDiacritics2;
9030 var replacementList = [
9041 chars: "\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"
9049 chars: "\xC6\u01FC\u01E2"
9061 chars: "\uA738\uA73A"
9069 chars: "\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0181"
9073 chars: "\u24B8\uFF23\uA73E\u1E08\u0106C\u0108\u010A\u010C\xC7\u0187\u023B"
9077 chars: "\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018A\u0189\u1D05\uA779"
9085 chars: "\u01F1\u01C4"
9089 chars: "\u01F2\u01C5"
9093 chars: "\u025B\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E\u1D07"
9097 chars: "\uA77C\u24BB\uFF26\u1E1E\u0191\uA77B"
9101 chars: "\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E\u0262"
9105 chars: "\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"
9109 chars: "\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"
9113 chars: "\u24BF\uFF2A\u0134\u0248\u0237"
9117 chars: "\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"
9121 chars: "\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"
9133 chars: "\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C\u03FB"
9137 chars: "\uA7A4\u0220\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u019D\uA790\u1D0E"
9149 chars: "\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"
9169 chars: "\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"
9173 chars: "\u24C6\uFF31\uA756\uA758\u024A"
9177 chars: "\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"
9181 chars: "\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"
9185 chars: "\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"
9197 chars: "\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"
9201 chars: "\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"
9209 chars: "\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"
9213 chars: "\u24CD\uFF38\u1E8A\u1E8C"
9217 chars: "\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"
9221 chars: "\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"
9225 chars: "\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250\u0251"
9233 chars: "\xE6\u01FD\u01E3"
9245 chars: "\uA739\uA73B"
9253 chars: "\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253\u0182"
9257 chars: "\uFF43\u24D2\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"
9261 chars: "\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\u018B\u13E7\u0501\uA7AA"
9269 chars: "\u01F3\u01C6"
9273 chars: "\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u01DD"
9277 chars: "\u24D5\uFF46\u1E1F\u0192"
9301 chars: "\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\uA77F\u1D79"
9305 chars: "\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"
9313 chars: "\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"
9317 chars: "\u24D9\uFF4A\u0135\u01F0\u0249"
9321 chars: "\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"
9325 chars: "\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747\u026D"
9333 chars: "\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"
9337 chars: "\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u043B\u0509"
9345 chars: "\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\uA74B\uA74D\u0275\u0254\u1D11"
9365 chars: "\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755\u03C1"
9369 chars: "\u24E0\uFF51\u024B\uA757\uA759"
9373 chars: "\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"
9377 chars: "\u24E2\uFF53\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B\u0282"
9385 chars: "\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"
9397 chars: "\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"
9401 chars: "\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"
9409 chars: "\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"
9413 chars: "\u24E7\uFF58\u1E8B\u1E8D"
9417 chars: "\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"
9421 chars: "\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"
9424 var diacriticsMap = {};
9425 for (i3 = 0; i3 < replacementList.length; i3 += 1) {
9426 chars = replacementList[i3].chars;
9427 for (j3 = 0; j3 < chars.length; j3 += 1) {
9428 diacriticsMap[chars[j3]] = replacementList[i3].base;
9434 function removeDiacritics2(str) {
9435 return str.replace(/[^\u0000-\u007e]/g, function(c2) {
9436 return diacriticsMap[c2] || c2;
9439 exports2.replacementList = replacementList;
9440 exports2.diacriticsMap = diacriticsMap;
9444 // node_modules/alif-toolkit/lib/isArabic.js
9445 var require_isArabic = __commonJS({
9446 "node_modules/alif-toolkit/lib/isArabic.js"(exports2) {
9448 Object.defineProperty(exports2, "__esModule", { value: true });
9449 exports2.isArabic = isArabic;
9450 exports2.isMath = isMath;
9451 var arabicBlocks = [
9453 // Arabic https://www.unicode.org/charts/PDF/U0600.pdf
9455 // supplement https://www.unicode.org/charts/PDF/U0750.pdf
9457 // Extended-A https://www.unicode.org/charts/PDF/U08A0.pdf
9459 // Presentation Forms-A https://www.unicode.org/charts/PDF/UFB50.pdf
9461 // Presentation Forms-B https://www.unicode.org/charts/PDF/UFE70.pdf
9463 // Rumi numerals https://www.unicode.org/charts/PDF/U10E60.pdf
9465 // Indic Siyaq numerals https://www.unicode.org/charts/PDF/U1EC70.pdf
9467 // Mathematical Alphabetic symbols https://www.unicode.org/charts/PDF/U1EE00.pdf
9469 function isArabic(char) {
9470 if (char.length > 1) {
9471 throw new Error("isArabic works on only one-character strings");
9473 let code = char.charCodeAt(0);
9474 for (let i3 = 0; i3 < arabicBlocks.length; i3++) {
9475 let block = arabicBlocks[i3];
9476 if (code >= block[0] && code <= block[1]) {
9482 function isMath(char) {
9483 if (char.length > 2) {
9484 throw new Error("isMath works on only one-character strings");
9486 let code = char.charCodeAt(0);
9487 return code >= 1632 && code <= 1644 || code >= 1776 && code <= 1785;
9492 // node_modules/alif-toolkit/lib/unicode-arabic.js
9493 var require_unicode_arabic = __commonJS({
9494 "node_modules/alif-toolkit/lib/unicode-arabic.js"(exports2) {
9496 Object.defineProperty(exports2, "__esModule", { value: true });
9497 var arabicReference = {
9507 "isolated": "\uFE81",
9515 "isolated": "\uFE83",
9523 "isolated": "\uFE87",
9528 "isolated": "\uFB50",
9531 "wavy_hamza_above": [
9534 "wavy_hamza_below": [
9542 "indic_two_above": [
9545 "indic_three_above": [
9553 "isolated": "\uFD3D"
9555 "isolated": "\uFE8D",
9565 "three_dots_horizontally_below": [
9568 "dot_below_three_dots_above": [
9571 "three_dots_pointing_upwards_below": [
9574 "three_dots_pointing_upwards_below_two_dots_above": [
9577 "two_dots_below_dot_above": [
9580 "inverted_small_v_below": [
9592 "small_meem_above": [
9595 "isolated": "\uFE8F",
9597 "initial": "\uFE91",
9604 "isolated": "\uFE93",
9614 "three_dots_above_downwards": [
9617 "small_teh_above": [
9620 "isolated": "\uFE95",
9622 "initial": "\uFE97",
9629 "isolated": "\uFE99",
9631 "initial": "\uFE9B",
9641 "isolated": "\uFE9D",
9643 "initial": "\uFE9F",
9653 "two_dots_vertical_above": [
9656 "three_dots_above": [
9662 "three_dots_pointing_upwards_below": [
9665 "small_tah_below": [
9668 "small_tah_two_dots": [
9671 "small_tah_above": [
9674 "indic_four_below": [
9677 "isolated": "\uFEA1",
9679 "initial": "\uFEA3",
9686 "isolated": "\uFEA5",
9688 "initial": "\uFEA7",
9701 "dot_below_small_tah": [
9704 "three_dots_above_downwards": [
9707 "four_dots_above": [
9713 "two_dots_vertically_below_small_tah": [
9716 "inverted_small_v_below": [
9719 "three_dots_below": [
9722 "isolated": "\uFEA9",
9729 "isolated": "\uFEAB",
9748 "dot_below_dot_above": [
9754 "four_dots_above": [
9763 "two_dots_vertically_above": [
9769 "small_tah_two_dots": [
9775 "small_noon_above": [
9778 "isolated": "\uFEAD",
9785 "inverted_v_above": [
9788 "isolated": "\uFEAF",
9795 "dot_below_dot_above": [
9798 "three_dots_below": [
9801 "three_dots_below_three_dots_above": [
9804 "four_dots_above": [
9807 "two_dots_vertically_above": [
9810 "small_tah_two_dots": [
9813 "indic_four_above": [
9819 "isolated": "\uFEB1",
9821 "initial": "\uFEB3",
9831 "isolated": "\uFEB5",
9833 "initial": "\uFEB7",
9843 "three_dots_above": [
9846 "three_dots_below": [
9849 "isolated": "\uFEB9",
9851 "initial": "\uFEBB",
9861 "isolated": "\uFEBD",
9863 "initial": "\uFEBF",
9870 "three_dots_above": [
9876 "isolated": "\uFEC1",
9878 "initial": "\uFEC3",
9885 "isolated": "\uFEC5",
9887 "initial": "\uFEC7",
9894 "three_dots_above": [
9900 "three_dots_pointing_downwards_above": [
9903 "two_dots_vertically_above": [
9906 "three_dots_below": [
9909 "isolated": "\uFEC9",
9911 "initial": "\uFECB",
9921 "isolated": "\uFECD",
9923 "initial": "\uFECF",
9933 "dot_moved_below": [
9939 "three_dots_below": [
9945 "three_dots_pointing_upwards_below": [
9948 "dot_below_three_dots_above": [
9951 "isolated": "\uFED1",
9953 "initial": "\uFED3",
9966 "three_dots_above": [
9972 "isolated": "\uFED5",
9974 "initial": "\uFED7",
9990 "three_dots_below": [
9999 "isolated": "\uFED9",
10001 "initial": "\uFEDB",
10014 "three_dots_above": [
10017 "three_dots_below": [
10026 "isolated": "\uFEDD",
10028 "initial": "\uFEDF",
10041 "three_dots_above": [
10044 "isolated": "\uFEE1",
10046 "initial": "\uFEE3",
10059 "three_dots_above": [
10062 "two_dots_below": [
10071 "isolated": "\uFEE5",
10073 "initial": "\uFEE7",
10080 "isolated": "\uFEE9",
10082 "initial": "\uFEEB",
10094 "isolated": "\uFE85",
10104 "two_dots_above": [
10110 "indic_two_above": [
10113 "indic_three_above": [
10119 "isolated": "\uFEED",
10130 "initial": "\uFBE8",
10131 "medial": "\uFBE9",
10132 "isolated": "\uFEEF",
10144 "isolated": "\uFE89",
10146 "initial": "\uFE8B",
10149 "two_dots_below_hamza_above": [
10162 "three_dots_below": [
10165 "two_dots_below_dot_above": [
10168 "two_dots_below_small_noon_above": [
10171 "isolated": "\uFEF1",
10173 "initial": "\uFEF3",
10180 "isolated": "\uFB66",
10182 "initial": "\uFB68",
10189 "isolated": "\uFB5E",
10191 "initial": "\uFB60",
10198 "isolated": "\uFB52",
10200 "initial": "\uFB54",
10207 "small_meem_above": [
10210 "isolated": "\uFB56",
10212 "initial": "\uFB58",
10219 "isolated": "\uFB62",
10221 "initial": "\uFB64",
10228 "isolated": "\uFB5A",
10230 "initial": "\uFB5C",
10237 "isolated": "\uFB76",
10239 "initial": "\uFB78",
10246 "isolated": "\uFB72",
10248 "initial": "\uFB74",
10258 "isolated": "\uFB7A",
10260 "initial": "\uFB7C",
10267 "isolated": "\uFB7E",
10269 "initial": "\uFB80",
10276 "isolated": "\uFB88",
10283 "isolated": "\uFB84",
10290 "isolated": "\uFB82",
10298 "isolated": "\uFB86",
10305 "isolated": "\uFB8C",
10312 "isolated": "\uFB8A",
10319 "isolated": "\uFB6A",
10321 "initial": "\uFB6C",
10328 "isolated": "\uFB6E",
10330 "initial": "\uFB70",
10340 "three_dots_above": [
10343 "three_dots_pointing_upwards_below": [
10346 "isolated": "\uFB8E",
10348 "initial": "\uFB90",
10355 "isolated": "\uFBD3",
10357 "initial": "\uFBD5",
10367 "two_dots_below": [
10370 "three_dots_above": [
10373 "inverted_stroke": [
10376 "isolated": "\uFB92",
10378 "initial": "\uFB94",
10385 "isolated": "\uFB9A",
10387 "initial": "\uFB9C",
10394 "isolated": "\uFB96",
10396 "initial": "\uFB98",
10403 "isolated": "\uFB9E",
10410 "isolated": "\uFBA0",
10412 "initial": "\uFBA2",
10415 "heh doachashmee": {
10419 "isolated": "\uFBAA",
10421 "initial": "\uFBAC",
10432 "isolated": "\uFBA6",
10434 "initial": "\uFBA8",
10437 "teh marbuta goal": {
10446 "isolated": "\uFBE0",
10453 "isolated": "\uFBD9",
10465 "isolated": "\uFBDD"
10467 "isolated": "\uFBD7",
10474 "isolated": "\uFBDB",
10481 "isolated": "\uFBE2",
10488 "isolated": "\uFBDE",
10495 "indic_two_above": [
10498 "indic_three_above": [
10501 "indic_four_above": [
10504 "isolated": "\uFBFC",
10506 "initial": "\uFBFE",
10513 "isolated": "\uFBE4",
10515 "initial": "\uFBE6",
10527 "isolated": "\uFBB0",
10530 "indic_two_above": [
10533 "indic_three_above": [
10536 "isolated": "\uFBAE",
10543 "isolated": "\u06D5",
10550 "isolated": "\uFBA4",
10585 exports2.default = arabicReference;
10589 // node_modules/alif-toolkit/lib/unicode-ligatures.js
10590 var require_unicode_ligatures = __commonJS({
10591 "node_modules/alif-toolkit/lib/unicode-ligatures.js"(exports2) {
10593 Object.defineProperty(exports2, "__esModule", { value: true });
10594 var ligatureReference = {
10596 "isolated": "\uFBEA",
10600 "isolated": "\uFBEC",
10604 "isolated": "\uFBEE",
10608 "isolated": "\uFBF0",
10612 "isolated": "\uFBF2",
10616 "isolated": "\uFBF4",
10620 "isolated": "\uFBF6",
10622 "initial": "\uFBF8"
10625 "uighur_kirghiz": {
10626 "isolated": "\uFBF9",
10628 "initial": "\uFBFB"
10630 "isolated": "\uFC03",
10634 "isolated": "\uFC00",
10635 "initial": "\uFC97"
10638 "isolated": "\uFC01",
10639 "initial": "\uFC98"
10642 "isolated": "\uFC02",
10644 "initial": "\uFC9A",
10648 "isolated": "\uFC04",
10652 "isolated": "\uFC05",
10653 "initial": "\uFC9C"
10656 "isolated": "\uFC06",
10657 "initial": "\uFC9D"
10660 "isolated": "\uFC07",
10661 "initial": "\uFC9E"
10664 "isolated": "\uFC08",
10666 "initial": "\uFC9F",
10670 "isolated": "\uFC09",
10674 "isolated": "\uFC0A",
10678 "isolated": "\uFC0B",
10679 "initial": "\uFCA1"
10682 "isolated": "\uFC0C",
10683 "initial": "\uFCA2"
10686 "isolated": "\uFC0D",
10687 "initial": "\uFCA3"
10690 "isolated": "\uFC0E",
10692 "initial": "\uFCA4",
10696 "isolated": "\uFC0F",
10700 "isolated": "\uFC10",
10704 "isolated": "\uFC11"
10707 "isolated": "\uFC12",
10709 "initial": "\uFCA6",
10713 "isolated": "\uFC13",
10717 "isolated": "\uFC14"
10720 "isolated": "\uFC15",
10721 "initial": "\uFCA7"
10724 "isolated": "\uFC16",
10725 "initial": "\uFCA8"
10728 "isolated": "\uFC17",
10729 "initial": "\uFCA9"
10732 "isolated": "\uFC18",
10733 "initial": "\uFCAA"
10736 "isolated": "\uFC19",
10737 "initial": "\uFCAB"
10740 "isolated": "\uFC1A"
10743 "isolated": "\uFC1B",
10744 "initial": "\uFCAC"
10747 "isolated": "\uFC1C",
10748 "initial": "\uFCAD",
10752 "isolated": "\uFC1D",
10753 "initial": "\uFCAE",
10757 "isolated": "\uFC1E",
10758 "initial": "\uFCAF",
10762 "isolated": "\uFC1F",
10763 "initial": "\uFCB0",
10767 "isolated": "\uFC20",
10768 "initial": "\uFCB1"
10771 "isolated": "\uFC21",
10772 "initial": "\uFCB3"
10775 "isolated": "\uFC22",
10776 "initial": "\uFCB4"
10779 "isolated": "\uFC23",
10780 "initial": "\uFCB5"
10783 "isolated": "\uFC24",
10784 "initial": "\uFCB6"
10787 "isolated": "\uFC25",
10788 "initial": "\uFCB7"
10791 "isolated": "\uFC26",
10792 "initial": "\uFCB8"
10795 "isolated": "\uFC27",
10796 "initial": "\uFD33",
10800 "isolated": "\uFC28",
10801 "initial": "\uFCB9",
10805 "isolated": "\uFC29",
10806 "initial": "\uFCBA"
10809 "isolated": "\uFC2A",
10810 "initial": "\uFCBB"
10813 "isolated": "\uFC2B",
10814 "initial": "\uFCBC"
10817 "isolated": "\uFC2C",
10818 "initial": "\uFCBD"
10821 "isolated": "\uFC2D",
10822 "initial": "\uFCBE"
10825 "isolated": "\uFC2E",
10826 "initial": "\uFCBF"
10829 "isolated": "\uFC2F",
10830 "initial": "\uFCC0"
10833 "isolated": "\uFC30",
10834 "initial": "\uFCC1"
10837 "isolated": "\uFC31",
10841 "isolated": "\uFC32",
10845 "isolated": "\uFC33",
10846 "initial": "\uFCC2"
10849 "isolated": "\uFC34",
10850 "initial": "\uFCC3"
10853 "isolated": "\uFC35",
10857 "isolated": "\uFC36",
10861 "isolated": "\uFC37",
10865 "isolated": "\uFC38",
10866 "initial": "\uFCC4"
10869 "isolated": "\uFC39",
10870 "initial": "\uFCC5"
10873 "isolated": "\uFC3A",
10874 "initial": "\uFCC6"
10877 "isolated": "\uFC3B",
10879 "initial": "\uFCC7",
10883 "isolated": "\uFC3C",
10885 "initial": "\uFCC8",
10889 "isolated": "\uFC3D",
10893 "isolated": "\uFC3E",
10897 "isolated": "\uFC3F",
10898 "initial": "\uFCC9"
10901 "isolated": "\uFC40",
10902 "initial": "\uFCCA"
10905 "isolated": "\uFC41",
10906 "initial": "\uFCCB"
10909 "isolated": "\uFC42",
10911 "initial": "\uFCCC",
10915 "isolated": "\uFC43",
10919 "isolated": "\uFC44",
10923 "isolated": "\uFC45",
10924 "initial": "\uFCCE"
10927 "isolated": "\uFC46",
10928 "initial": "\uFCCF"
10931 "isolated": "\uFC47",
10932 "initial": "\uFCD0"
10935 "isolated": "\uFC48",
10937 "initial": "\uFCD1"
10940 "isolated": "\uFC49"
10943 "isolated": "\uFC4A"
10946 "isolated": "\uFC4B",
10947 "initial": "\uFCD2"
10950 "isolated": "\uFC4C",
10951 "initial": "\uFCD3"
10954 "isolated": "\uFC4D",
10955 "initial": "\uFCD4"
10958 "isolated": "\uFC4E",
10960 "initial": "\uFCD5",
10964 "isolated": "\uFC4F",
10968 "isolated": "\uFC50",
10972 "isolated": "\uFC51",
10973 "initial": "\uFCD7"
10976 "isolated": "\uFC52",
10977 "initial": "\uFCD8"
10980 "isolated": "\uFC53"
10983 "isolated": "\uFC54"
10986 "isolated": "\uFC55",
10987 "initial": "\uFCDA"
10990 "isolated": "\uFC56",
10991 "initial": "\uFCDB"
10994 "isolated": "\uFC57",
10995 "initial": "\uFCDC"
10998 "isolated": "\uFC58",
11000 "initial": "\uFCDD",
11004 "isolated": "\uFC59",
11008 "isolated": "\uFC5A",
11012 "isolated": "\uFC5B"
11015 "isolated": "\uFC5C"
11018 "isolated": "\uFC5D",
11022 "isolated": "\uFC5E"
11025 "isolated": "\uFC5F"
11028 "isolated": "\uFC60"
11031 "isolated": "\uFC61"
11034 "isolated": "\uFC62"
11037 "isolated": "\uFC63"
11100 "initial": "\uFC99"
11103 "initial": "\uFC9B",
11107 "initial": "\uFCA0",
11111 "initial": "\uFCA5",
11115 "initial": "\uFCB2"
11118 "initial": "\uFCCD"
11121 "initial": "\uFCD6",
11125 "initial": "\uFCD9"
11128 "initial": "\uFCDE",
11135 "medial": "\uFCE8",
11136 "initial": "\uFD31"
11139 "medial": "\uFCE9",
11140 "isolated": "\uFD0C",
11142 "initial": "\uFD30"
11145 "medial": "\uFCEA",
11146 "initial": "\uFD32"
11148 "\u0640\u064E\u0651": {
11151 "\u0640\u064F\u0651": {
11154 "\u0640\u0650\u0651": {
11158 "isolated": "\uFCF5",
11162 "isolated": "\uFCF6",
11166 "isolated": "\uFCF7",
11170 "isolated": "\uFCF8",
11174 "isolated": "\uFCF9",
11178 "isolated": "\uFCFA",
11182 "isolated": "\uFCFB"
11185 "isolated": "\uFCFC",
11189 "isolated": "\uFCFD",
11193 "isolated": "\uFCFE",
11197 "isolated": "\uFCFF",
11201 "isolated": "\uFD00",
11205 "isolated": "\uFD01",
11209 "isolated": "\uFD02",
11213 "isolated": "\uFD03",
11217 "isolated": "\uFD04",
11221 "isolated": "\uFD05",
11225 "isolated": "\uFD06",
11229 "isolated": "\uFD07",
11233 "isolated": "\uFD08",
11237 "isolated": "\uFD09",
11239 "initial": "\uFD2D",
11243 "isolated": "\uFD0A",
11245 "initial": "\uFD2E",
11249 "isolated": "\uFD0B",
11251 "initial": "\uFD2F",
11255 "isolated": "\uFD0D",
11259 "isolated": "\uFD0E",
11263 "isolated": "\uFD0F",
11267 "isolated": "\uFD10",
11273 "\u062A\u062C\u0645": {
11274 "initial": "\uFD50"
11276 "\u062A\u062D\u062C": {
11278 "initial": "\uFD52"
11280 "\u062A\u062D\u0645": {
11281 "initial": "\uFD53"
11283 "\u062A\u062E\u0645": {
11284 "initial": "\uFD54"
11286 "\u062A\u0645\u062C": {
11287 "initial": "\uFD55"
11289 "\u062A\u0645\u062D": {
11290 "initial": "\uFD56"
11292 "\u062A\u0645\u062E": {
11293 "initial": "\uFD57"
11295 "\u062C\u0645\u062D": {
11297 "initial": "\uFD59"
11299 "\u062D\u0645\u064A": {
11302 "\u062D\u0645\u0649": {
11305 "\u0633\u062D\u062C": {
11306 "initial": "\uFD5C"
11308 "\u0633\u062C\u062D": {
11309 "initial": "\uFD5D"
11311 "\u0633\u062C\u0649": {
11314 "\u0633\u0645\u062D": {
11316 "initial": "\uFD60"
11318 "\u0633\u0645\u062C": {
11319 "initial": "\uFD61"
11321 "\u0633\u0645\u0645": {
11323 "initial": "\uFD63"
11325 "\u0635\u062D\u062D": {
11327 "initial": "\uFD65"
11329 "\u0635\u0645\u0645": {
11331 "initial": "\uFDC5"
11333 "\u0634\u062D\u0645": {
11335 "initial": "\uFD68"
11337 "\u0634\u062C\u064A": {
11340 "\u0634\u0645\u062E": {
11342 "initial": "\uFD6B"
11344 "\u0634\u0645\u0645": {
11346 "initial": "\uFD6D"
11348 "\u0636\u062D\u0649": {
11351 "\u0636\u062E\u0645": {
11353 "initial": "\uFD70"
11355 "\u0636\u0645\u062D": {
11358 "\u0637\u0645\u062D": {
11359 "initial": "\uFD72"
11361 "\u0637\u0645\u0645": {
11362 "initial": "\uFD73"
11364 "\u0637\u0645\u064A": {
11367 "\u0639\u062C\u0645": {
11369 "initial": "\uFDC4"
11371 "\u0639\u0645\u0645": {
11373 "initial": "\uFD77"
11375 "\u0639\u0645\u0649": {
11378 "\u063A\u0645\u0645": {
11381 "\u063A\u0645\u064A": {
11384 "\u063A\u0645\u0649": {
11387 "\u0641\u062E\u0645": {
11389 "initial": "\uFD7D"
11391 "\u0642\u0645\u062D": {
11393 "initial": "\uFDB4"
11395 "\u0642\u0645\u0645": {
11398 "\u0644\u062D\u0645": {
11400 "initial": "\uFDB5"
11402 "\u0644\u062D\u064A": {
11405 "\u0644\u062D\u0649": {
11408 "\u0644\u062C\u062C": {
11409 "initial": "\uFD83",
11412 "\u0644\u062E\u0645": {
11414 "initial": "\uFD86"
11416 "\u0644\u0645\u062D": {
11418 "initial": "\uFD88"
11420 "\u0645\u062D\u062C": {
11421 "initial": "\uFD89"
11423 "\u0645\u062D\u0645": {
11424 "initial": "\uFD8A"
11426 "\u0645\u062D\u064A": {
11429 "\u0645\u062C\u062D": {
11430 "initial": "\uFD8C"
11432 "\u0645\u062C\u0645": {
11433 "initial": "\uFD8D"
11435 "\u0645\u062E\u062C": {
11436 "initial": "\uFD8E"
11438 "\u0645\u062E\u0645": {
11439 "initial": "\uFD8F"
11441 "\u0645\u062C\u062E": {
11442 "initial": "\uFD92"
11444 "\u0647\u0645\u062C": {
11445 "initial": "\uFD93"
11447 "\u0647\u0645\u0645": {
11448 "initial": "\uFD94"
11450 "\u0646\u062D\u0645": {
11451 "initial": "\uFD95"
11453 "\u0646\u062D\u0649": {
11456 "\u0646\u062C\u0645": {
11458 "initial": "\uFD98"
11460 "\u0646\u062C\u0649": {
11463 "\u0646\u0645\u064A": {
11466 "\u0646\u0645\u0649": {
11469 "\u064A\u0645\u0645": {
11471 "initial": "\uFD9D"
11473 "\u0628\u062E\u064A": {
11476 "\u062A\u062C\u064A": {
11479 "\u062A\u062C\u0649": {
11482 "\u062A\u062E\u064A": {
11485 "\u062A\u062E\u0649": {
11488 "\u062A\u0645\u064A": {
11491 "\u062A\u0645\u0649": {
11494 "\u062C\u0645\u064A": {
11497 "\u062C\u062D\u0649": {
11500 "\u062C\u0645\u0649": {
11503 "\u0633\u062E\u0649": {
11506 "\u0635\u062D\u064A": {
11509 "\u0634\u062D\u064A": {
11512 "\u0636\u062D\u064A": {
11515 "\u0644\u062C\u064A": {
11518 "\u0644\u0645\u064A": {
11521 "\u064A\u062D\u064A": {
11524 "\u064A\u062C\u064A": {
11527 "\u064A\u0645\u064A": {
11530 "\u0645\u0645\u064A": {
11533 "\u0642\u0645\u064A": {
11536 "\u0646\u062D\u064A": {
11539 "\u0639\u0645\u064A": {
11542 "\u0643\u0645\u064A": {
11545 "\u0646\u062C\u062D": {
11546 "initial": "\uFDB8",
11549 "\u0645\u062E\u064A": {
11552 "\u0644\u062C\u0645": {
11553 "initial": "\uFDBA",
11556 "\u0643\u0645\u0645": {
11558 "initial": "\uFDC3"
11560 "\u062C\u062D\u064A": {
11563 "\u062D\u062C\u064A": {
11566 "\u0645\u062C\u064A": {
11569 "\u0641\u0645\u064A": {
11572 "\u0628\u062D\u064A": {
11575 "\u0633\u062E\u064A": {
11578 "\u0646\u062C\u064A": {
11582 "isolated": "\uFEF5",
11586 "isolated": "\uFEF7",
11590 "isolated": "\uFEF9",
11594 "isolated": "\uFEFB",
11598 "\u0635\u0644\u06D2": "\uFDF0",
11599 "\u0642\u0644\u06D2": "\uFDF1",
11600 "\u0627\u0644\u0644\u0647": "\uFDF2",
11601 "\u0627\u0643\u0628\u0631": "\uFDF3",
11602 "\u0645\u062D\u0645\u062F": "\uFDF4",
11603 "\u0635\u0644\u0639\u0645": "\uFDF5",
11604 "\u0631\u0633\u0648\u0644": "\uFDF6",
11605 "\u0639\u0644\u064A\u0647": "\uFDF7",
11606 "\u0648\u0633\u0644\u0645": "\uFDF8",
11607 "\u0635\u0644\u0649": "\uFDF9",
11608 "\u0635\u0644\u0649\u0627\u0644\u0644\u0647\u0639\u0644\u064A\u0647\u0648\u0633\u0644\u0645": "\uFDFA",
11609 "\u062C\u0644\u062C\u0644\u0627\u0644\u0647": "\uFDFB",
11610 "\u0631\u06CC\u0627\u0644": "\uFDFC"
11613 exports2.default = ligatureReference;
11617 // node_modules/alif-toolkit/lib/reference.js
11618 var require_reference = __commonJS({
11619 "node_modules/alif-toolkit/lib/reference.js"(exports2) {
11621 Object.defineProperty(exports2, "__esModule", { value: true });
11622 exports2.ligatureWordList = exports2.ligatureList = exports2.letterList = exports2.alefs = exports2.lams = exports2.lineBreakers = exports2.tashkeel = void 0;
11623 var unicode_arabic_1 = require_unicode_arabic();
11624 var unicode_ligatures_1 = require_unicode_ligatures();
11625 var letterList = Object.keys(unicode_arabic_1.default);
11626 exports2.letterList = letterList;
11627 var ligatureList = Object.keys(unicode_ligatures_1.default);
11628 exports2.ligatureList = ligatureList;
11629 var ligatureWordList = Object.keys(unicode_ligatures_1.default.words);
11630 exports2.ligatureWordList = ligatureWordList;
11631 var lams = "\u0644\u06B5\u06B6\u06B7\u06B8";
11632 exports2.lams = lams;
11633 var alefs = "\u0627\u0622\u0623\u0625\u0671\u0672\u0673\u0675\u0773\u0774";
11634 exports2.alefs = alefs;
11635 var tashkeel = "\u0605\u0640\u0670\u0674\u06DF\u06E7\u06E8";
11636 exports2.tashkeel = tashkeel;
11637 function addToTashkeel(start2, finish) {
11638 for (var i3 = start2; i3 <= finish; i3++) {
11639 exports2.tashkeel = tashkeel += String.fromCharCode(i3);
11642 addToTashkeel(1552, 1562);
11643 addToTashkeel(1611, 1631);
11644 addToTashkeel(1750, 1756);
11645 addToTashkeel(1760, 1764);
11646 addToTashkeel(1770, 1773);
11647 addToTashkeel(2259, 2273);
11648 addToTashkeel(2275, 2303);
11649 addToTashkeel(65136, 65151);
11650 var lineBreakers = "\u0627\u0629\u0648\u06C0\u06CF\u06FD\u06FE\u076B\u076C\u0771\u0773\u0774\u0778\u0779\u08E2\u08B1\u08B2\u08B9";
11651 exports2.lineBreakers = lineBreakers;
11652 function addToLineBreakers(start2, finish) {
11653 for (var i3 = start2; i3 <= finish; i3++) {
11654 exports2.lineBreakers = lineBreakers += String.fromCharCode(i3);
11657 addToLineBreakers(1536, 1567);
11658 addToLineBreakers(1569, 1573);
11659 addToLineBreakers(1583, 1586);
11660 addToLineBreakers(1632, 1645);
11661 addToLineBreakers(1649, 1655);
11662 addToLineBreakers(1672, 1689);
11663 addToLineBreakers(1731, 1739);
11664 addToLineBreakers(1746, 1785);
11665 addToLineBreakers(1881, 1883);
11666 addToLineBreakers(2218, 2222);
11667 addToLineBreakers(64336, 65021);
11668 addToLineBreakers(65152, 65276);
11669 addToLineBreakers(69216, 69247);
11670 addToLineBreakers(126064, 126143);
11671 addToLineBreakers(126464, 126719);
11675 // node_modules/alif-toolkit/lib/GlyphSplitter.js
11676 var require_GlyphSplitter = __commonJS({
11677 "node_modules/alif-toolkit/lib/GlyphSplitter.js"(exports2) {
11679 Object.defineProperty(exports2, "__esModule", { value: true });
11680 exports2.GlyphSplitter = GlyphSplitter;
11681 var isArabic_1 = require_isArabic();
11682 var reference_1 = require_reference();
11683 function GlyphSplitter(word) {
11685 let lastLetter = "";
11686 word.split("").forEach((letter) => {
11687 if ((0, isArabic_1.isArabic)(letter)) {
11688 if (reference_1.tashkeel.indexOf(letter) > -1) {
11689 letters[letters.length - 1] += letter;
11690 } else if (lastLetter.length && (reference_1.lams.indexOf(lastLetter) === 0 && reference_1.alefs.indexOf(letter) > -1 || reference_1.lams.indexOf(lastLetter) > 0 && reference_1.alefs.indexOf(letter) === 0)) {
11691 letters[letters.length - 1] += letter;
11693 letters.push(letter);
11696 letters.push(letter);
11698 if (reference_1.tashkeel.indexOf(letter) === -1) {
11699 lastLetter = letter;
11707 // node_modules/alif-toolkit/lib/BaselineSplitter.js
11708 var require_BaselineSplitter = __commonJS({
11709 "node_modules/alif-toolkit/lib/BaselineSplitter.js"(exports2) {
11711 Object.defineProperty(exports2, "__esModule", { value: true });
11712 exports2.BaselineSplitter = BaselineSplitter;
11713 var isArabic_1 = require_isArabic();
11714 var reference_1 = require_reference();
11715 function BaselineSplitter(word) {
11717 let lastLetter = "";
11718 word.split("").forEach((letter) => {
11719 if ((0, isArabic_1.isArabic)(letter) && (0, isArabic_1.isArabic)(lastLetter)) {
11720 if (lastLetter.length && reference_1.tashkeel.indexOf(letter) > -1) {
11721 letters[letters.length - 1] += letter;
11722 } else if (reference_1.lineBreakers.indexOf(lastLetter) > -1) {
11723 letters.push(letter);
11725 letters[letters.length - 1] += letter;
11728 letters.push(letter);
11730 if (reference_1.tashkeel.indexOf(letter) === -1) {
11731 lastLetter = letter;
11739 // node_modules/alif-toolkit/lib/Normalization.js
11740 var require_Normalization = __commonJS({
11741 "node_modules/alif-toolkit/lib/Normalization.js"(exports2) {
11743 Object.defineProperty(exports2, "__esModule", { value: true });
11744 exports2.Normal = Normal;
11745 var unicode_arabic_1 = require_unicode_arabic();
11746 var unicode_ligatures_1 = require_unicode_ligatures();
11747 var isArabic_1 = require_isArabic();
11748 var reference_1 = require_reference();
11749 function Normal(word, breakPresentationForm) {
11750 if (typeof breakPresentationForm === "undefined") {
11751 breakPresentationForm = true;
11753 let returnable = "";
11754 word.split("").forEach((letter) => {
11755 if (!(0, isArabic_1.isArabic)(letter)) {
11756 returnable += letter;
11759 for (let w3 = 0; w3 < reference_1.letterList.length; w3++) {
11760 let letterForms = unicode_arabic_1.default[reference_1.letterList[w3]];
11761 let versions = Object.keys(letterForms);
11762 for (let v3 = 0; v3 < versions.length; v3++) {
11763 let localVersion = letterForms[versions[v3]];
11764 if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
11765 let embeddedForms = Object.keys(localVersion);
11766 for (let ef = 0; ef < embeddedForms.length; ef++) {
11767 let form = localVersion[embeddedForms[ef]];
11768 if (form === letter || typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
11769 if (form === letter) {
11770 if (breakPresentationForm && localVersion["normal"] && ["isolated", "initial", "medial", "final"].indexOf(embeddedForms[ef]) > -1) {
11771 if (typeof localVersion["normal"] === "object") {
11772 returnable += localVersion["normal"][0];
11774 returnable += localVersion["normal"];
11778 returnable += letter;
11780 } else if (typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
11781 returnable += form[0];
11786 } else if (localVersion === letter) {
11787 if (breakPresentationForm && letterForms["normal"] && ["isolated", "initial", "medial", "final"].indexOf(versions[v3]) > -1) {
11788 if (typeof letterForms["normal"] === "object") {
11789 returnable += letterForms["normal"][0];
11791 returnable += letterForms["normal"];
11795 returnable += letter;
11797 } else if (typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
11798 returnable += localVersion[0];
11803 for (let v22 = 0; v22 < reference_1.ligatureList.length; v22++) {
11804 let normalForm = reference_1.ligatureList[v22];
11805 if (normalForm !== "words") {
11806 let ligForms = Object.keys(unicode_ligatures_1.default[normalForm]);
11807 for (let f2 = 0; f2 < ligForms.length; f2++) {
11808 if (unicode_ligatures_1.default[normalForm][ligForms[f2]] === letter) {
11809 returnable += normalForm;
11815 for (let v3 = 0; v3 < reference_1.ligatureWordList.length; v3++) {
11816 let normalForm = reference_1.ligatureWordList[v3];
11817 if (unicode_ligatures_1.default.words[normalForm] === letter) {
11818 returnable += normalForm;
11822 returnable += letter;
11829 // node_modules/alif-toolkit/lib/CharShaper.js
11830 var require_CharShaper = __commonJS({
11831 "node_modules/alif-toolkit/lib/CharShaper.js"(exports2) {
11833 Object.defineProperty(exports2, "__esModule", { value: true });
11834 exports2.CharShaper = CharShaper;
11835 var unicode_arabic_1 = require_unicode_arabic();
11836 var isArabic_1 = require_isArabic();
11837 var reference_1 = require_reference();
11838 function CharShaper(letter, form) {
11839 if (!(0, isArabic_1.isArabic)(letter)) {
11840 throw new Error("Not Arabic");
11842 if (letter === "\u0621") {
11845 for (let w3 = 0; w3 < reference_1.letterList.length; w3++) {
11846 let letterForms = unicode_arabic_1.default[reference_1.letterList[w3]];
11847 let versions = Object.keys(letterForms);
11848 for (let v3 = 0; v3 < versions.length; v3++) {
11849 let localVersion = letterForms[versions[v3]];
11850 if (localVersion === letter || typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
11851 if (versions.indexOf(form) > -1) {
11852 return letterForms[form];
11854 } else if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
11855 let embeddedVersions = Object.keys(localVersion);
11856 for (let ev = 0; ev < embeddedVersions.length; ev++) {
11857 if (localVersion[embeddedVersions[ev]] === letter || typeof localVersion[embeddedVersions[ev]] === "object" && localVersion[embeddedVersions[ev]].indexOf && localVersion[embeddedVersions[ev]].indexOf(letter) > -1) {
11858 if (embeddedVersions.indexOf(form) > -1) {
11859 return localVersion[form];
11870 // node_modules/alif-toolkit/lib/WordShaper.js
11871 var require_WordShaper = __commonJS({
11872 "node_modules/alif-toolkit/lib/WordShaper.js"(exports2) {
11874 Object.defineProperty(exports2, "__esModule", { value: true });
11875 exports2.WordShaper = WordShaper2;
11876 var isArabic_1 = require_isArabic();
11877 var reference_1 = require_reference();
11878 var CharShaper_1 = require_CharShaper();
11879 var unicode_ligatures_1 = require_unicode_ligatures();
11880 function WordShaper2(word) {
11881 let state = "initial";
11883 for (let w3 = 0; w3 < word.length; w3++) {
11884 let nextLetter = " ";
11885 for (let nxw = w3 + 1; nxw < word.length; nxw++) {
11886 if (!(0, isArabic_1.isArabic)(word[nxw])) {
11889 if (reference_1.tashkeel.indexOf(word[nxw]) === -1) {
11890 nextLetter = word[nxw];
11894 if (!(0, isArabic_1.isArabic)(word[w3]) || (0, isArabic_1.isMath)(word[w3])) {
11895 output += word[w3];
11897 } else if (reference_1.tashkeel.indexOf(word[w3]) > -1) {
11898 output += word[w3];
11899 } else if (nextLetter === " " || reference_1.lineBreakers.indexOf(word[w3]) > -1) {
11900 output += (0, CharShaper_1.CharShaper)(word[w3], state === "initial" ? "isolated" : "final");
11902 } else if (reference_1.lams.indexOf(word[w3]) > -1 && reference_1.alefs.indexOf(nextLetter) > -1) {
11903 output += unicode_ligatures_1.default[word[w3] + nextLetter][state === "initial" ? "isolated" : "final"];
11904 while (word[w3] !== nextLetter) {
11909 output += (0, CharShaper_1.CharShaper)(word[w3], state);
11918 // node_modules/alif-toolkit/lib/ParentLetter.js
11919 var require_ParentLetter = __commonJS({
11920 "node_modules/alif-toolkit/lib/ParentLetter.js"(exports2) {
11922 Object.defineProperty(exports2, "__esModule", { value: true });
11923 exports2.ParentLetter = ParentLetter;
11924 exports2.GrandparentLetter = GrandparentLetter;
11925 var unicode_arabic_1 = require_unicode_arabic();
11926 var isArabic_1 = require_isArabic();
11927 var reference_1 = require_reference();
11928 function ParentLetter(letter) {
11929 if (!(0, isArabic_1.isArabic)(letter)) {
11930 throw new Error("Not an Arabic letter");
11932 for (let w3 = 0; w3 < reference_1.letterList.length; w3++) {
11933 let letterForms = unicode_arabic_1.default[reference_1.letterList[w3]];
11934 let versions = Object.keys(letterForms);
11935 for (let v3 = 0; v3 < versions.length; v3++) {
11936 let localVersion = letterForms[versions[v3]];
11937 if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
11938 let embeddedForms = Object.keys(localVersion);
11939 for (let ef = 0; ef < embeddedForms.length; ef++) {
11940 let form = localVersion[embeddedForms[ef]];
11941 if (form === letter || typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
11942 return localVersion;
11945 } else if (localVersion === letter || typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
11946 return letterForms;
11952 function GrandparentLetter(letter) {
11953 if (!(0, isArabic_1.isArabic)(letter)) {
11954 throw new Error("Not an Arabic letter");
11956 for (let w3 = 0; w3 < reference_1.letterList.length; w3++) {
11957 let letterForms = unicode_arabic_1.default[reference_1.letterList[w3]];
11958 let versions = Object.keys(letterForms);
11959 for (let v3 = 0; v3 < versions.length; v3++) {
11960 let localVersion = letterForms[versions[v3]];
11961 if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
11962 let embeddedForms = Object.keys(localVersion);
11963 for (let ef = 0; ef < embeddedForms.length; ef++) {
11964 let form = localVersion[embeddedForms[ef]];
11965 if (form === letter || typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
11966 return letterForms;
11969 } else if (localVersion === letter || typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
11970 return letterForms;
11979 // node_modules/alif-toolkit/lib/index.js
11980 var require_lib = __commonJS({
11981 "node_modules/alif-toolkit/lib/index.js"(exports2) {
11983 Object.defineProperty(exports2, "__esModule", { value: true });
11984 exports2.GrandparentLetter = exports2.ParentLetter = exports2.WordShaper = exports2.CharShaper = exports2.Normal = exports2.BaselineSplitter = exports2.GlyphSplitter = exports2.isArabic = void 0;
11985 var isArabic_1 = require_isArabic();
11986 Object.defineProperty(exports2, "isArabic", { enumerable: true, get: function() {
11987 return isArabic_1.isArabic;
11989 var GlyphSplitter_1 = require_GlyphSplitter();
11990 Object.defineProperty(exports2, "GlyphSplitter", { enumerable: true, get: function() {
11991 return GlyphSplitter_1.GlyphSplitter;
11993 var BaselineSplitter_1 = require_BaselineSplitter();
11994 Object.defineProperty(exports2, "BaselineSplitter", { enumerable: true, get: function() {
11995 return BaselineSplitter_1.BaselineSplitter;
11997 var Normalization_1 = require_Normalization();
11998 Object.defineProperty(exports2, "Normal", { enumerable: true, get: function() {
11999 return Normalization_1.Normal;
12001 var CharShaper_1 = require_CharShaper();
12002 Object.defineProperty(exports2, "CharShaper", { enumerable: true, get: function() {
12003 return CharShaper_1.CharShaper;
12005 var WordShaper_1 = require_WordShaper();
12006 Object.defineProperty(exports2, "WordShaper", { enumerable: true, get: function() {
12007 return WordShaper_1.WordShaper;
12009 var ParentLetter_1 = require_ParentLetter();
12010 Object.defineProperty(exports2, "ParentLetter", { enumerable: true, get: function() {
12011 return ParentLetter_1.ParentLetter;
12013 Object.defineProperty(exports2, "GrandparentLetter", { enumerable: true, get: function() {
12014 return ParentLetter_1.GrandparentLetter;
12019 // modules/util/svg_paths_rtl_fix.js
12020 var svg_paths_rtl_fix_exports = {};
12021 __export(svg_paths_rtl_fix_exports, {
12022 fixRTLTextForSvg: () => fixRTLTextForSvg,
12023 rtlRegex: () => rtlRegex
12025 function fixRTLTextForSvg(inputText) {
12026 var ret = "", rtlBuffer = [];
12027 var arabicRegex = /[\u0600-\u06FF]/g;
12028 var arabicDiacritics = /[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06ED]/g;
12029 var arabicMath = /[\u0660-\u066C\u06F0-\u06F9]+/g;
12030 var thaanaVowel = /[\u07A6-\u07B0]/;
12031 var hebrewSign = /[\u0591-\u05bd\u05bf\u05c1-\u05c5\u05c7]/;
12032 if (arabicRegex.test(inputText)) {
12033 inputText = (0, import_alif_toolkit.WordShaper)(inputText);
12035 for (var n3 = 0; n3 < inputText.length; n3++) {
12036 var c2 = inputText[n3];
12037 if (arabicMath.test(c2)) {
12038 ret += rtlBuffer.reverse().join("");
12041 if (rtlBuffer.length && arabicMath.test(rtlBuffer[rtlBuffer.length - 1])) {
12042 ret += rtlBuffer.reverse().join("");
12045 if ((thaanaVowel.test(c2) || hebrewSign.test(c2) || arabicDiacritics.test(c2)) && rtlBuffer.length) {
12046 rtlBuffer[rtlBuffer.length - 1] += c2;
12047 } else if (rtlRegex.test(c2) || c2.charCodeAt(0) >= 64336 && c2.charCodeAt(0) <= 65023 || c2.charCodeAt(0) >= 65136 && c2.charCodeAt(0) <= 65279) {
12048 rtlBuffer.push(c2);
12049 } else if (c2 === " " && rtlBuffer.length) {
12050 rtlBuffer = [rtlBuffer.reverse().join("") + " "];
12052 ret += rtlBuffer.reverse().join("") + c2;
12057 ret += rtlBuffer.reverse().join("");
12060 var import_alif_toolkit, rtlRegex;
12061 var init_svg_paths_rtl_fix = __esm({
12062 "modules/util/svg_paths_rtl_fix.js"() {
12064 import_alif_toolkit = __toESM(require_lib(), 1);
12065 rtlRegex = /[\u0590-\u05FF\u0600-\u06FF\u0750-\u07BF\u08A0–\u08BF]/;
12069 // node_modules/lodash-es/_freeGlobal.js
12070 var freeGlobal, freeGlobal_default;
12071 var init_freeGlobal = __esm({
12072 "node_modules/lodash-es/_freeGlobal.js"() {
12073 freeGlobal = typeof global == "object" && global && global.Object === Object && global;
12074 freeGlobal_default = freeGlobal;
12078 // node_modules/lodash-es/_root.js
12079 var freeSelf, root2, root_default;
12080 var init_root = __esm({
12081 "node_modules/lodash-es/_root.js"() {
12083 freeSelf = typeof self == "object" && self && self.Object === Object && self;
12084 root2 = freeGlobal_default || freeSelf || Function("return this")();
12085 root_default = root2;
12089 // node_modules/lodash-es/_Symbol.js
12090 var Symbol2, Symbol_default;
12091 var init_Symbol = __esm({
12092 "node_modules/lodash-es/_Symbol.js"() {
12094 Symbol2 = root_default.Symbol;
12095 Symbol_default = Symbol2;
12099 // node_modules/lodash-es/_getRawTag.js
12100 function getRawTag(value) {
12101 var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
12103 value[symToStringTag] = void 0;
12104 var unmasked = true;
12107 var result = nativeObjectToString.call(value);
12110 value[symToStringTag] = tag;
12112 delete value[symToStringTag];
12117 var objectProto, hasOwnProperty, nativeObjectToString, symToStringTag, getRawTag_default;
12118 var init_getRawTag = __esm({
12119 "node_modules/lodash-es/_getRawTag.js"() {
12121 objectProto = Object.prototype;
12122 hasOwnProperty = objectProto.hasOwnProperty;
12123 nativeObjectToString = objectProto.toString;
12124 symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
12125 getRawTag_default = getRawTag;
12129 // node_modules/lodash-es/_objectToString.js
12130 function objectToString(value) {
12131 return nativeObjectToString2.call(value);
12133 var objectProto2, nativeObjectToString2, objectToString_default;
12134 var init_objectToString = __esm({
12135 "node_modules/lodash-es/_objectToString.js"() {
12136 objectProto2 = Object.prototype;
12137 nativeObjectToString2 = objectProto2.toString;
12138 objectToString_default = objectToString;
12142 // node_modules/lodash-es/_baseGetTag.js
12143 function baseGetTag(value) {
12144 if (value == null) {
12145 return value === void 0 ? undefinedTag : nullTag;
12147 return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
12149 var nullTag, undefinedTag, symToStringTag2, baseGetTag_default;
12150 var init_baseGetTag = __esm({
12151 "node_modules/lodash-es/_baseGetTag.js"() {
12154 init_objectToString();
12155 nullTag = "[object Null]";
12156 undefinedTag = "[object Undefined]";
12157 symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
12158 baseGetTag_default = baseGetTag;
12162 // node_modules/lodash-es/isObjectLike.js
12163 function isObjectLike(value) {
12164 return value != null && typeof value == "object";
12166 var isObjectLike_default;
12167 var init_isObjectLike = __esm({
12168 "node_modules/lodash-es/isObjectLike.js"() {
12169 isObjectLike_default = isObjectLike;
12173 // node_modules/lodash-es/isSymbol.js
12174 function isSymbol(value) {
12175 return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
12177 var symbolTag, isSymbol_default;
12178 var init_isSymbol = __esm({
12179 "node_modules/lodash-es/isSymbol.js"() {
12181 init_isObjectLike();
12182 symbolTag = "[object Symbol]";
12183 isSymbol_default = isSymbol;
12187 // node_modules/lodash-es/_arrayMap.js
12188 function arrayMap(array2, iteratee) {
12189 var index = -1, length2 = array2 == null ? 0 : array2.length, result = Array(length2);
12190 while (++index < length2) {
12191 result[index] = iteratee(array2[index], index, array2);
12195 var arrayMap_default;
12196 var init_arrayMap = __esm({
12197 "node_modules/lodash-es/_arrayMap.js"() {
12198 arrayMap_default = arrayMap;
12202 // node_modules/lodash-es/isArray.js
12203 var isArray, isArray_default;
12204 var init_isArray = __esm({
12205 "node_modules/lodash-es/isArray.js"() {
12206 isArray = Array.isArray;
12207 isArray_default = isArray;
12211 // node_modules/lodash-es/_baseToString.js
12212 function baseToString(value) {
12213 if (typeof value == "string") {
12216 if (isArray_default(value)) {
12217 return arrayMap_default(value, baseToString) + "";
12219 if (isSymbol_default(value)) {
12220 return symbolToString ? symbolToString.call(value) : "";
12222 var result = value + "";
12223 return result == "0" && 1 / value == -INFINITY ? "-0" : result;
12225 var INFINITY, symbolProto, symbolToString, baseToString_default;
12226 var init_baseToString = __esm({
12227 "node_modules/lodash-es/_baseToString.js"() {
12233 symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
12234 symbolToString = symbolProto ? symbolProto.toString : void 0;
12235 baseToString_default = baseToString;
12239 // node_modules/lodash-es/_trimmedEndIndex.js
12240 function trimmedEndIndex(string) {
12241 var index = string.length;
12242 while (index-- && reWhitespace.test(string.charAt(index))) {
12246 var reWhitespace, trimmedEndIndex_default;
12247 var init_trimmedEndIndex = __esm({
12248 "node_modules/lodash-es/_trimmedEndIndex.js"() {
12249 reWhitespace = /\s/;
12250 trimmedEndIndex_default = trimmedEndIndex;
12254 // node_modules/lodash-es/_baseTrim.js
12255 function baseTrim(string) {
12256 return string ? string.slice(0, trimmedEndIndex_default(string) + 1).replace(reTrimStart, "") : string;
12258 var reTrimStart, baseTrim_default;
12259 var init_baseTrim = __esm({
12260 "node_modules/lodash-es/_baseTrim.js"() {
12261 init_trimmedEndIndex();
12262 reTrimStart = /^\s+/;
12263 baseTrim_default = baseTrim;
12267 // node_modules/lodash-es/isObject.js
12268 function isObject(value) {
12269 var type2 = typeof value;
12270 return value != null && (type2 == "object" || type2 == "function");
12272 var isObject_default;
12273 var init_isObject = __esm({
12274 "node_modules/lodash-es/isObject.js"() {
12275 isObject_default = isObject;
12279 // node_modules/lodash-es/toNumber.js
12280 function toNumber(value) {
12281 if (typeof value == "number") {
12284 if (isSymbol_default(value)) {
12287 if (isObject_default(value)) {
12288 var other = typeof value.valueOf == "function" ? value.valueOf() : value;
12289 value = isObject_default(other) ? other + "" : other;
12291 if (typeof value != "string") {
12292 return value === 0 ? value : +value;
12294 value = baseTrim_default(value);
12295 var isBinary = reIsBinary.test(value);
12296 return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
12298 var NAN, reIsBadHex, reIsBinary, reIsOctal, freeParseInt, toNumber_default;
12299 var init_toNumber = __esm({
12300 "node_modules/lodash-es/toNumber.js"() {
12305 reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
12306 reIsBinary = /^0b[01]+$/i;
12307 reIsOctal = /^0o[0-7]+$/i;
12308 freeParseInt = parseInt;
12309 toNumber_default = toNumber;
12313 // node_modules/lodash-es/identity.js
12314 function identity3(value) {
12317 var identity_default3;
12318 var init_identity3 = __esm({
12319 "node_modules/lodash-es/identity.js"() {
12320 identity_default3 = identity3;
12324 // node_modules/lodash-es/isFunction.js
12325 function isFunction(value) {
12326 if (!isObject_default(value)) {
12329 var tag = baseGetTag_default(value);
12330 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
12332 var asyncTag, funcTag, genTag, proxyTag, isFunction_default;
12333 var init_isFunction = __esm({
12334 "node_modules/lodash-es/isFunction.js"() {
12337 asyncTag = "[object AsyncFunction]";
12338 funcTag = "[object Function]";
12339 genTag = "[object GeneratorFunction]";
12340 proxyTag = "[object Proxy]";
12341 isFunction_default = isFunction;
12345 // node_modules/lodash-es/_coreJsData.js
12346 var coreJsData, coreJsData_default;
12347 var init_coreJsData = __esm({
12348 "node_modules/lodash-es/_coreJsData.js"() {
12350 coreJsData = root_default["__core-js_shared__"];
12351 coreJsData_default = coreJsData;
12355 // node_modules/lodash-es/_isMasked.js
12356 function isMasked(func) {
12357 return !!maskSrcKey && maskSrcKey in func;
12359 var maskSrcKey, isMasked_default;
12360 var init_isMasked = __esm({
12361 "node_modules/lodash-es/_isMasked.js"() {
12363 maskSrcKey = (function() {
12364 var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
12365 return uid ? "Symbol(src)_1." + uid : "";
12367 isMasked_default = isMasked;
12371 // node_modules/lodash-es/_toSource.js
12372 function toSource(func) {
12373 if (func != null) {
12375 return funcToString.call(func);
12385 var funcProto, funcToString, toSource_default;
12386 var init_toSource = __esm({
12387 "node_modules/lodash-es/_toSource.js"() {
12388 funcProto = Function.prototype;
12389 funcToString = funcProto.toString;
12390 toSource_default = toSource;
12394 // node_modules/lodash-es/_baseIsNative.js
12395 function baseIsNative(value) {
12396 if (!isObject_default(value) || isMasked_default(value)) {
12399 var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
12400 return pattern.test(toSource_default(value));
12402 var reRegExpChar, reIsHostCtor, funcProto2, objectProto3, funcToString2, hasOwnProperty2, reIsNative, baseIsNative_default;
12403 var init_baseIsNative = __esm({
12404 "node_modules/lodash-es/_baseIsNative.js"() {
12409 reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
12410 reIsHostCtor = /^\[object .+?Constructor\]$/;
12411 funcProto2 = Function.prototype;
12412 objectProto3 = Object.prototype;
12413 funcToString2 = funcProto2.toString;
12414 hasOwnProperty2 = objectProto3.hasOwnProperty;
12415 reIsNative = RegExp(
12416 "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
12418 baseIsNative_default = baseIsNative;
12422 // node_modules/lodash-es/_getValue.js
12423 function getValue(object, key) {
12424 return object == null ? void 0 : object[key];
12426 var getValue_default;
12427 var init_getValue = __esm({
12428 "node_modules/lodash-es/_getValue.js"() {
12429 getValue_default = getValue;
12433 // node_modules/lodash-es/_getNative.js
12434 function getNative(object, key) {
12435 var value = getValue_default(object, key);
12436 return baseIsNative_default(value) ? value : void 0;
12438 var getNative_default;
12439 var init_getNative = __esm({
12440 "node_modules/lodash-es/_getNative.js"() {
12441 init_baseIsNative();
12443 getNative_default = getNative;
12447 // node_modules/lodash-es/_WeakMap.js
12448 var WeakMap, WeakMap_default;
12449 var init_WeakMap = __esm({
12450 "node_modules/lodash-es/_WeakMap.js"() {
12453 WeakMap = getNative_default(root_default, "WeakMap");
12454 WeakMap_default = WeakMap;
12458 // node_modules/lodash-es/_baseCreate.js
12459 var objectCreate, baseCreate, baseCreate_default;
12460 var init_baseCreate = __esm({
12461 "node_modules/lodash-es/_baseCreate.js"() {
12463 objectCreate = Object.create;
12464 baseCreate = /* @__PURE__ */ (function() {
12465 function object() {
12467 return function(proto) {
12468 if (!isObject_default(proto)) {
12471 if (objectCreate) {
12472 return objectCreate(proto);
12474 object.prototype = proto;
12475 var result = new object();
12476 object.prototype = void 0;
12480 baseCreate_default = baseCreate;
12484 // node_modules/lodash-es/_apply.js
12485 function apply(func, thisArg, args) {
12486 switch (args.length) {
12488 return func.call(thisArg);
12490 return func.call(thisArg, args[0]);
12492 return func.call(thisArg, args[0], args[1]);
12494 return func.call(thisArg, args[0], args[1], args[2]);
12496 return func.apply(thisArg, args);
12499 var init_apply = __esm({
12500 "node_modules/lodash-es/_apply.js"() {
12501 apply_default = apply;
12505 // node_modules/lodash-es/_copyArray.js
12506 function copyArray(source, array2) {
12507 var index = -1, length2 = source.length;
12508 array2 || (array2 = Array(length2));
12509 while (++index < length2) {
12510 array2[index] = source[index];
12514 var copyArray_default;
12515 var init_copyArray = __esm({
12516 "node_modules/lodash-es/_copyArray.js"() {
12517 copyArray_default = copyArray;
12521 // node_modules/lodash-es/_shortOut.js
12522 function shortOut(func) {
12523 var count = 0, lastCalled = 0;
12524 return function() {
12525 var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
12526 lastCalled = stamp;
12527 if (remaining > 0) {
12528 if (++count >= HOT_COUNT) {
12529 return arguments[0];
12534 return func.apply(void 0, arguments);
12537 var HOT_COUNT, HOT_SPAN, nativeNow, shortOut_default;
12538 var init_shortOut = __esm({
12539 "node_modules/lodash-es/_shortOut.js"() {
12542 nativeNow = Date.now;
12543 shortOut_default = shortOut;
12547 // node_modules/lodash-es/constant.js
12548 function constant(value) {
12549 return function() {
12553 var constant_default5;
12554 var init_constant5 = __esm({
12555 "node_modules/lodash-es/constant.js"() {
12556 constant_default5 = constant;
12560 // node_modules/lodash-es/_defineProperty.js
12561 var defineProperty, defineProperty_default;
12562 var init_defineProperty = __esm({
12563 "node_modules/lodash-es/_defineProperty.js"() {
12565 defineProperty = (function() {
12567 var func = getNative_default(Object, "defineProperty");
12573 defineProperty_default = defineProperty;
12577 // node_modules/lodash-es/_baseSetToString.js
12578 var baseSetToString, baseSetToString_default;
12579 var init_baseSetToString = __esm({
12580 "node_modules/lodash-es/_baseSetToString.js"() {
12582 init_defineProperty();
12584 baseSetToString = !defineProperty_default ? identity_default3 : function(func, string) {
12585 return defineProperty_default(func, "toString", {
12586 "configurable": true,
12587 "enumerable": false,
12588 "value": constant_default5(string),
12592 baseSetToString_default = baseSetToString;
12596 // node_modules/lodash-es/_setToString.js
12597 var setToString, setToString_default;
12598 var init_setToString = __esm({
12599 "node_modules/lodash-es/_setToString.js"() {
12600 init_baseSetToString();
12602 setToString = shortOut_default(baseSetToString_default);
12603 setToString_default = setToString;
12607 // node_modules/lodash-es/_arrayEach.js
12608 function arrayEach(array2, iteratee) {
12609 var index = -1, length2 = array2 == null ? 0 : array2.length;
12610 while (++index < length2) {
12611 if (iteratee(array2[index], index, array2) === false) {
12617 var arrayEach_default;
12618 var init_arrayEach = __esm({
12619 "node_modules/lodash-es/_arrayEach.js"() {
12620 arrayEach_default = arrayEach;
12624 // node_modules/lodash-es/_isIndex.js
12625 function isIndex(value, length2) {
12626 var type2 = typeof value;
12627 length2 = length2 == null ? MAX_SAFE_INTEGER : length2;
12628 return !!length2 && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2);
12630 var MAX_SAFE_INTEGER, reIsUint, isIndex_default;
12631 var init_isIndex = __esm({
12632 "node_modules/lodash-es/_isIndex.js"() {
12633 MAX_SAFE_INTEGER = 9007199254740991;
12634 reIsUint = /^(?:0|[1-9]\d*)$/;
12635 isIndex_default = isIndex;
12639 // node_modules/lodash-es/_baseAssignValue.js
12640 function baseAssignValue(object, key, value) {
12641 if (key == "__proto__" && defineProperty_default) {
12642 defineProperty_default(object, key, {
12643 "configurable": true,
12644 "enumerable": true,
12649 object[key] = value;
12652 var baseAssignValue_default;
12653 var init_baseAssignValue = __esm({
12654 "node_modules/lodash-es/_baseAssignValue.js"() {
12655 init_defineProperty();
12656 baseAssignValue_default = baseAssignValue;
12660 // node_modules/lodash-es/eq.js
12661 function eq(value, other) {
12662 return value === other || value !== value && other !== other;
12665 var init_eq = __esm({
12666 "node_modules/lodash-es/eq.js"() {
12671 // node_modules/lodash-es/_assignValue.js
12672 function assignValue(object, key, value) {
12673 var objValue = object[key];
12674 if (!(hasOwnProperty3.call(object, key) && eq_default(objValue, value)) || value === void 0 && !(key in object)) {
12675 baseAssignValue_default(object, key, value);
12678 var objectProto4, hasOwnProperty3, assignValue_default;
12679 var init_assignValue = __esm({
12680 "node_modules/lodash-es/_assignValue.js"() {
12681 init_baseAssignValue();
12683 objectProto4 = Object.prototype;
12684 hasOwnProperty3 = objectProto4.hasOwnProperty;
12685 assignValue_default = assignValue;
12689 // node_modules/lodash-es/_copyObject.js
12690 function copyObject(source, props, object, customizer) {
12691 var isNew = !object;
12692 object || (object = {});
12693 var index = -1, length2 = props.length;
12694 while (++index < length2) {
12695 var key = props[index];
12696 var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
12697 if (newValue === void 0) {
12698 newValue = source[key];
12701 baseAssignValue_default(object, key, newValue);
12703 assignValue_default(object, key, newValue);
12708 var copyObject_default;
12709 var init_copyObject = __esm({
12710 "node_modules/lodash-es/_copyObject.js"() {
12711 init_assignValue();
12712 init_baseAssignValue();
12713 copyObject_default = copyObject;
12717 // node_modules/lodash-es/_overRest.js
12718 function overRest(func, start2, transform2) {
12719 start2 = nativeMax(start2 === void 0 ? func.length - 1 : start2, 0);
12720 return function() {
12721 var args = arguments, index = -1, length2 = nativeMax(args.length - start2, 0), array2 = Array(length2);
12722 while (++index < length2) {
12723 array2[index] = args[start2 + index];
12726 var otherArgs = Array(start2 + 1);
12727 while (++index < start2) {
12728 otherArgs[index] = args[index];
12730 otherArgs[start2] = transform2(array2);
12731 return apply_default(func, this, otherArgs);
12734 var nativeMax, overRest_default;
12735 var init_overRest = __esm({
12736 "node_modules/lodash-es/_overRest.js"() {
12738 nativeMax = Math.max;
12739 overRest_default = overRest;
12743 // node_modules/lodash-es/_baseRest.js
12744 function baseRest(func, start2) {
12745 return setToString_default(overRest_default(func, start2, identity_default3), func + "");
12747 var baseRest_default;
12748 var init_baseRest = __esm({
12749 "node_modules/lodash-es/_baseRest.js"() {
12752 init_setToString();
12753 baseRest_default = baseRest;
12757 // node_modules/lodash-es/isLength.js
12758 function isLength(value) {
12759 return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
12761 var MAX_SAFE_INTEGER2, isLength_default;
12762 var init_isLength = __esm({
12763 "node_modules/lodash-es/isLength.js"() {
12764 MAX_SAFE_INTEGER2 = 9007199254740991;
12765 isLength_default = isLength;
12769 // node_modules/lodash-es/isArrayLike.js
12770 function isArrayLike(value) {
12771 return value != null && isLength_default(value.length) && !isFunction_default(value);
12773 var isArrayLike_default;
12774 var init_isArrayLike = __esm({
12775 "node_modules/lodash-es/isArrayLike.js"() {
12778 isArrayLike_default = isArrayLike;
12782 // node_modules/lodash-es/_isIterateeCall.js
12783 function isIterateeCall(value, index, object) {
12784 if (!isObject_default(object)) {
12787 var type2 = typeof index;
12788 if (type2 == "number" ? isArrayLike_default(object) && isIndex_default(index, object.length) : type2 == "string" && index in object) {
12789 return eq_default(object[index], value);
12793 var isIterateeCall_default;
12794 var init_isIterateeCall = __esm({
12795 "node_modules/lodash-es/_isIterateeCall.js"() {
12797 init_isArrayLike();
12800 isIterateeCall_default = isIterateeCall;
12804 // node_modules/lodash-es/_createAssigner.js
12805 function createAssigner(assigner) {
12806 return baseRest_default(function(object, sources) {
12807 var index = -1, length2 = sources.length, customizer = length2 > 1 ? sources[length2 - 1] : void 0, guard = length2 > 2 ? sources[2] : void 0;
12808 customizer = assigner.length > 3 && typeof customizer == "function" ? (length2--, customizer) : void 0;
12809 if (guard && isIterateeCall_default(sources[0], sources[1], guard)) {
12810 customizer = length2 < 3 ? void 0 : customizer;
12813 object = Object(object);
12814 while (++index < length2) {
12815 var source = sources[index];
12817 assigner(object, source, index, customizer);
12823 var createAssigner_default;
12824 var init_createAssigner = __esm({
12825 "node_modules/lodash-es/_createAssigner.js"() {
12827 init_isIterateeCall();
12828 createAssigner_default = createAssigner;
12832 // node_modules/lodash-es/_isPrototype.js
12833 function isPrototype(value) {
12834 var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto5;
12835 return value === proto;
12837 var objectProto5, isPrototype_default;
12838 var init_isPrototype = __esm({
12839 "node_modules/lodash-es/_isPrototype.js"() {
12840 objectProto5 = Object.prototype;
12841 isPrototype_default = isPrototype;
12845 // node_modules/lodash-es/_baseTimes.js
12846 function baseTimes(n3, iteratee) {
12847 var index = -1, result = Array(n3);
12848 while (++index < n3) {
12849 result[index] = iteratee(index);
12853 var baseTimes_default;
12854 var init_baseTimes = __esm({
12855 "node_modules/lodash-es/_baseTimes.js"() {
12856 baseTimes_default = baseTimes;
12860 // node_modules/lodash-es/_baseIsArguments.js
12861 function baseIsArguments(value) {
12862 return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
12864 var argsTag, baseIsArguments_default;
12865 var init_baseIsArguments = __esm({
12866 "node_modules/lodash-es/_baseIsArguments.js"() {
12868 init_isObjectLike();
12869 argsTag = "[object Arguments]";
12870 baseIsArguments_default = baseIsArguments;
12874 // node_modules/lodash-es/isArguments.js
12875 var objectProto6, hasOwnProperty4, propertyIsEnumerable, isArguments, isArguments_default;
12876 var init_isArguments = __esm({
12877 "node_modules/lodash-es/isArguments.js"() {
12878 init_baseIsArguments();
12879 init_isObjectLike();
12880 objectProto6 = Object.prototype;
12881 hasOwnProperty4 = objectProto6.hasOwnProperty;
12882 propertyIsEnumerable = objectProto6.propertyIsEnumerable;
12883 isArguments = baseIsArguments_default(/* @__PURE__ */ (function() {
12885 })()) ? baseIsArguments_default : function(value) {
12886 return isObjectLike_default(value) && hasOwnProperty4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
12888 isArguments_default = isArguments;
12892 // node_modules/lodash-es/stubFalse.js
12893 function stubFalse() {
12896 var stubFalse_default;
12897 var init_stubFalse = __esm({
12898 "node_modules/lodash-es/stubFalse.js"() {
12899 stubFalse_default = stubFalse;
12903 // node_modules/lodash-es/isBuffer.js
12904 var freeExports, freeModule, moduleExports, Buffer2, nativeIsBuffer, isBuffer, isBuffer_default;
12905 var init_isBuffer = __esm({
12906 "node_modules/lodash-es/isBuffer.js"() {
12909 freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
12910 freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
12911 moduleExports = freeModule && freeModule.exports === freeExports;
12912 Buffer2 = moduleExports ? root_default.Buffer : void 0;
12913 nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
12914 isBuffer = nativeIsBuffer || stubFalse_default;
12915 isBuffer_default = isBuffer;
12919 // node_modules/lodash-es/_baseIsTypedArray.js
12920 function baseIsTypedArray(value) {
12921 return isObjectLike_default(value) && isLength_default(value.length) && !!typedArrayTags[baseGetTag_default(value)];
12923 var argsTag2, arrayTag, boolTag, dateTag, errorTag, funcTag2, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, weakMapTag, arrayBufferTag, dataViewTag, float32Tag, float64Tag, int8Tag, int16Tag, int32Tag, uint8Tag, uint8ClampedTag, uint16Tag, uint32Tag, typedArrayTags, baseIsTypedArray_default;
12924 var init_baseIsTypedArray = __esm({
12925 "node_modules/lodash-es/_baseIsTypedArray.js"() {
12928 init_isObjectLike();
12929 argsTag2 = "[object Arguments]";
12930 arrayTag = "[object Array]";
12931 boolTag = "[object Boolean]";
12932 dateTag = "[object Date]";
12933 errorTag = "[object Error]";
12934 funcTag2 = "[object Function]";
12935 mapTag = "[object Map]";
12936 numberTag = "[object Number]";
12937 objectTag = "[object Object]";
12938 regexpTag = "[object RegExp]";
12939 setTag = "[object Set]";
12940 stringTag = "[object String]";
12941 weakMapTag = "[object WeakMap]";
12942 arrayBufferTag = "[object ArrayBuffer]";
12943 dataViewTag = "[object DataView]";
12944 float32Tag = "[object Float32Array]";
12945 float64Tag = "[object Float64Array]";
12946 int8Tag = "[object Int8Array]";
12947 int16Tag = "[object Int16Array]";
12948 int32Tag = "[object Int32Array]";
12949 uint8Tag = "[object Uint8Array]";
12950 uint8ClampedTag = "[object Uint8ClampedArray]";
12951 uint16Tag = "[object Uint16Array]";
12952 uint32Tag = "[object Uint32Array]";
12953 typedArrayTags = {};
12954 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
12955 typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
12956 baseIsTypedArray_default = baseIsTypedArray;
12960 // node_modules/lodash-es/_baseUnary.js
12961 function baseUnary(func) {
12962 return function(value) {
12963 return func(value);
12966 var baseUnary_default;
12967 var init_baseUnary = __esm({
12968 "node_modules/lodash-es/_baseUnary.js"() {
12969 baseUnary_default = baseUnary;
12973 // node_modules/lodash-es/_nodeUtil.js
12974 var freeExports2, freeModule2, moduleExports2, freeProcess, nodeUtil, nodeUtil_default;
12975 var init_nodeUtil = __esm({
12976 "node_modules/lodash-es/_nodeUtil.js"() {
12978 freeExports2 = typeof exports == "object" && exports && !exports.nodeType && exports;
12979 freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module;
12980 moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
12981 freeProcess = moduleExports2 && freeGlobal_default.process;
12982 nodeUtil = (function() {
12984 var types = freeModule2 && freeModule2.require && freeModule2.require("util").types;
12988 return freeProcess && freeProcess.binding && freeProcess.binding("util");
12992 nodeUtil_default = nodeUtil;
12996 // node_modules/lodash-es/isTypedArray.js
12997 var nodeIsTypedArray, isTypedArray, isTypedArray_default;
12998 var init_isTypedArray = __esm({
12999 "node_modules/lodash-es/isTypedArray.js"() {
13000 init_baseIsTypedArray();
13003 nodeIsTypedArray = nodeUtil_default && nodeUtil_default.isTypedArray;
13004 isTypedArray = nodeIsTypedArray ? baseUnary_default(nodeIsTypedArray) : baseIsTypedArray_default;
13005 isTypedArray_default = isTypedArray;
13009 // node_modules/lodash-es/_arrayLikeKeys.js
13010 function arrayLikeKeys(value, inherited) {
13011 var isArr = isArray_default(value), isArg = !isArr && isArguments_default(value), isBuff = !isArr && !isArg && isBuffer_default(value), isType = !isArr && !isArg && !isBuff && isTypedArray_default(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes_default(value.length, String) : [], length2 = result.length;
13012 for (var key in value) {
13013 if ((inherited || hasOwnProperty5.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
13014 (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
13015 isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
13016 isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
13017 isIndex_default(key, length2)))) {
13023 var objectProto7, hasOwnProperty5, arrayLikeKeys_default;
13024 var init_arrayLikeKeys = __esm({
13025 "node_modules/lodash-es/_arrayLikeKeys.js"() {
13027 init_isArguments();
13031 init_isTypedArray();
13032 objectProto7 = Object.prototype;
13033 hasOwnProperty5 = objectProto7.hasOwnProperty;
13034 arrayLikeKeys_default = arrayLikeKeys;
13038 // node_modules/lodash-es/_overArg.js
13039 function overArg(func, transform2) {
13040 return function(arg) {
13041 return func(transform2(arg));
13044 var overArg_default;
13045 var init_overArg = __esm({
13046 "node_modules/lodash-es/_overArg.js"() {
13047 overArg_default = overArg;
13051 // node_modules/lodash-es/_nativeKeys.js
13052 var nativeKeys, nativeKeys_default;
13053 var init_nativeKeys = __esm({
13054 "node_modules/lodash-es/_nativeKeys.js"() {
13056 nativeKeys = overArg_default(Object.keys, Object);
13057 nativeKeys_default = nativeKeys;
13061 // node_modules/lodash-es/_baseKeys.js
13062 function baseKeys(object) {
13063 if (!isPrototype_default(object)) {
13064 return nativeKeys_default(object);
13067 for (var key in Object(object)) {
13068 if (hasOwnProperty6.call(object, key) && key != "constructor") {
13074 var objectProto8, hasOwnProperty6, baseKeys_default;
13075 var init_baseKeys = __esm({
13076 "node_modules/lodash-es/_baseKeys.js"() {
13077 init_isPrototype();
13079 objectProto8 = Object.prototype;
13080 hasOwnProperty6 = objectProto8.hasOwnProperty;
13081 baseKeys_default = baseKeys;
13085 // node_modules/lodash-es/keys.js
13086 function keys(object) {
13087 return isArrayLike_default(object) ? arrayLikeKeys_default(object) : baseKeys_default(object);
13090 var init_keys = __esm({
13091 "node_modules/lodash-es/keys.js"() {
13092 init_arrayLikeKeys();
13094 init_isArrayLike();
13095 keys_default = keys;
13099 // node_modules/lodash-es/_nativeKeysIn.js
13100 function nativeKeysIn(object) {
13102 if (object != null) {
13103 for (var key in Object(object)) {
13109 var nativeKeysIn_default;
13110 var init_nativeKeysIn = __esm({
13111 "node_modules/lodash-es/_nativeKeysIn.js"() {
13112 nativeKeysIn_default = nativeKeysIn;
13116 // node_modules/lodash-es/_baseKeysIn.js
13117 function baseKeysIn(object) {
13118 if (!isObject_default(object)) {
13119 return nativeKeysIn_default(object);
13121 var isProto = isPrototype_default(object), result = [];
13122 for (var key in object) {
13123 if (!(key == "constructor" && (isProto || !hasOwnProperty7.call(object, key)))) {
13129 var objectProto9, hasOwnProperty7, baseKeysIn_default;
13130 var init_baseKeysIn = __esm({
13131 "node_modules/lodash-es/_baseKeysIn.js"() {
13133 init_isPrototype();
13134 init_nativeKeysIn();
13135 objectProto9 = Object.prototype;
13136 hasOwnProperty7 = objectProto9.hasOwnProperty;
13137 baseKeysIn_default = baseKeysIn;
13141 // node_modules/lodash-es/keysIn.js
13142 function keysIn(object) {
13143 return isArrayLike_default(object) ? arrayLikeKeys_default(object, true) : baseKeysIn_default(object);
13145 var keysIn_default;
13146 var init_keysIn = __esm({
13147 "node_modules/lodash-es/keysIn.js"() {
13148 init_arrayLikeKeys();
13150 init_isArrayLike();
13151 keysIn_default = keysIn;
13155 // node_modules/lodash-es/_isKey.js
13156 function isKey(value, object) {
13157 if (isArray_default(value)) {
13160 var type2 = typeof value;
13161 if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value == null || isSymbol_default(value)) {
13164 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
13166 var reIsDeepProp, reIsPlainProp, isKey_default;
13167 var init_isKey = __esm({
13168 "node_modules/lodash-es/_isKey.js"() {
13171 reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
13172 reIsPlainProp = /^\w*$/;
13173 isKey_default = isKey;
13177 // node_modules/lodash-es/_nativeCreate.js
13178 var nativeCreate, nativeCreate_default;
13179 var init_nativeCreate = __esm({
13180 "node_modules/lodash-es/_nativeCreate.js"() {
13182 nativeCreate = getNative_default(Object, "create");
13183 nativeCreate_default = nativeCreate;
13187 // node_modules/lodash-es/_hashClear.js
13188 function hashClear() {
13189 this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {};
13192 var hashClear_default;
13193 var init_hashClear = __esm({
13194 "node_modules/lodash-es/_hashClear.js"() {
13195 init_nativeCreate();
13196 hashClear_default = hashClear;
13200 // node_modules/lodash-es/_hashDelete.js
13201 function hashDelete(key) {
13202 var result = this.has(key) && delete this.__data__[key];
13203 this.size -= result ? 1 : 0;
13206 var hashDelete_default;
13207 var init_hashDelete = __esm({
13208 "node_modules/lodash-es/_hashDelete.js"() {
13209 hashDelete_default = hashDelete;
13213 // node_modules/lodash-es/_hashGet.js
13214 function hashGet(key) {
13215 var data = this.__data__;
13216 if (nativeCreate_default) {
13217 var result = data[key];
13218 return result === HASH_UNDEFINED ? void 0 : result;
13220 return hasOwnProperty8.call(data, key) ? data[key] : void 0;
13222 var HASH_UNDEFINED, objectProto10, hasOwnProperty8, hashGet_default;
13223 var init_hashGet = __esm({
13224 "node_modules/lodash-es/_hashGet.js"() {
13225 init_nativeCreate();
13226 HASH_UNDEFINED = "__lodash_hash_undefined__";
13227 objectProto10 = Object.prototype;
13228 hasOwnProperty8 = objectProto10.hasOwnProperty;
13229 hashGet_default = hashGet;
13233 // node_modules/lodash-es/_hashHas.js
13234 function hashHas(key) {
13235 var data = this.__data__;
13236 return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty9.call(data, key);
13238 var objectProto11, hasOwnProperty9, hashHas_default;
13239 var init_hashHas = __esm({
13240 "node_modules/lodash-es/_hashHas.js"() {
13241 init_nativeCreate();
13242 objectProto11 = Object.prototype;
13243 hasOwnProperty9 = objectProto11.hasOwnProperty;
13244 hashHas_default = hashHas;
13248 // node_modules/lodash-es/_hashSet.js
13249 function hashSet(key, value) {
13250 var data = this.__data__;
13251 this.size += this.has(key) ? 0 : 1;
13252 data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value;
13255 var HASH_UNDEFINED2, hashSet_default;
13256 var init_hashSet = __esm({
13257 "node_modules/lodash-es/_hashSet.js"() {
13258 init_nativeCreate();
13259 HASH_UNDEFINED2 = "__lodash_hash_undefined__";
13260 hashSet_default = hashSet;
13264 // node_modules/lodash-es/_Hash.js
13265 function Hash(entries) {
13266 var index = -1, length2 = entries == null ? 0 : entries.length;
13268 while (++index < length2) {
13269 var entry = entries[index];
13270 this.set(entry[0], entry[1]);
13274 var init_Hash = __esm({
13275 "node_modules/lodash-es/_Hash.js"() {
13281 Hash.prototype.clear = hashClear_default;
13282 Hash.prototype["delete"] = hashDelete_default;
13283 Hash.prototype.get = hashGet_default;
13284 Hash.prototype.has = hashHas_default;
13285 Hash.prototype.set = hashSet_default;
13286 Hash_default = Hash;
13290 // node_modules/lodash-es/_listCacheClear.js
13291 function listCacheClear() {
13292 this.__data__ = [];
13295 var listCacheClear_default;
13296 var init_listCacheClear = __esm({
13297 "node_modules/lodash-es/_listCacheClear.js"() {
13298 listCacheClear_default = listCacheClear;
13302 // node_modules/lodash-es/_assocIndexOf.js
13303 function assocIndexOf(array2, key) {
13304 var length2 = array2.length;
13305 while (length2--) {
13306 if (eq_default(array2[length2][0], key)) {
13312 var assocIndexOf_default;
13313 var init_assocIndexOf = __esm({
13314 "node_modules/lodash-es/_assocIndexOf.js"() {
13316 assocIndexOf_default = assocIndexOf;
13320 // node_modules/lodash-es/_listCacheDelete.js
13321 function listCacheDelete(key) {
13322 var data = this.__data__, index = assocIndexOf_default(data, key);
13326 var lastIndex = data.length - 1;
13327 if (index == lastIndex) {
13330 splice.call(data, index, 1);
13335 var arrayProto, splice, listCacheDelete_default;
13336 var init_listCacheDelete = __esm({
13337 "node_modules/lodash-es/_listCacheDelete.js"() {
13338 init_assocIndexOf();
13339 arrayProto = Array.prototype;
13340 splice = arrayProto.splice;
13341 listCacheDelete_default = listCacheDelete;
13345 // node_modules/lodash-es/_listCacheGet.js
13346 function listCacheGet(key) {
13347 var data = this.__data__, index = assocIndexOf_default(data, key);
13348 return index < 0 ? void 0 : data[index][1];
13350 var listCacheGet_default;
13351 var init_listCacheGet = __esm({
13352 "node_modules/lodash-es/_listCacheGet.js"() {
13353 init_assocIndexOf();
13354 listCacheGet_default = listCacheGet;
13358 // node_modules/lodash-es/_listCacheHas.js
13359 function listCacheHas(key) {
13360 return assocIndexOf_default(this.__data__, key) > -1;
13362 var listCacheHas_default;
13363 var init_listCacheHas = __esm({
13364 "node_modules/lodash-es/_listCacheHas.js"() {
13365 init_assocIndexOf();
13366 listCacheHas_default = listCacheHas;
13370 // node_modules/lodash-es/_listCacheSet.js
13371 function listCacheSet(key, value) {
13372 var data = this.__data__, index = assocIndexOf_default(data, key);
13375 data.push([key, value]);
13377 data[index][1] = value;
13381 var listCacheSet_default;
13382 var init_listCacheSet = __esm({
13383 "node_modules/lodash-es/_listCacheSet.js"() {
13384 init_assocIndexOf();
13385 listCacheSet_default = listCacheSet;
13389 // node_modules/lodash-es/_ListCache.js
13390 function ListCache(entries) {
13391 var index = -1, length2 = entries == null ? 0 : entries.length;
13393 while (++index < length2) {
13394 var entry = entries[index];
13395 this.set(entry[0], entry[1]);
13398 var ListCache_default;
13399 var init_ListCache = __esm({
13400 "node_modules/lodash-es/_ListCache.js"() {
13401 init_listCacheClear();
13402 init_listCacheDelete();
13403 init_listCacheGet();
13404 init_listCacheHas();
13405 init_listCacheSet();
13406 ListCache.prototype.clear = listCacheClear_default;
13407 ListCache.prototype["delete"] = listCacheDelete_default;
13408 ListCache.prototype.get = listCacheGet_default;
13409 ListCache.prototype.has = listCacheHas_default;
13410 ListCache.prototype.set = listCacheSet_default;
13411 ListCache_default = ListCache;
13415 // node_modules/lodash-es/_Map.js
13416 var Map2, Map_default;
13417 var init_Map = __esm({
13418 "node_modules/lodash-es/_Map.js"() {
13421 Map2 = getNative_default(root_default, "Map");
13422 Map_default = Map2;
13426 // node_modules/lodash-es/_mapCacheClear.js
13427 function mapCacheClear() {
13430 "hash": new Hash_default(),
13431 "map": new (Map_default || ListCache_default)(),
13432 "string": new Hash_default()
13435 var mapCacheClear_default;
13436 var init_mapCacheClear = __esm({
13437 "node_modules/lodash-es/_mapCacheClear.js"() {
13441 mapCacheClear_default = mapCacheClear;
13445 // node_modules/lodash-es/_isKeyable.js
13446 function isKeyable(value) {
13447 var type2 = typeof value;
13448 return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
13450 var isKeyable_default;
13451 var init_isKeyable = __esm({
13452 "node_modules/lodash-es/_isKeyable.js"() {
13453 isKeyable_default = isKeyable;
13457 // node_modules/lodash-es/_getMapData.js
13458 function getMapData(map2, key) {
13459 var data = map2.__data__;
13460 return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
13462 var getMapData_default;
13463 var init_getMapData = __esm({
13464 "node_modules/lodash-es/_getMapData.js"() {
13466 getMapData_default = getMapData;
13470 // node_modules/lodash-es/_mapCacheDelete.js
13471 function mapCacheDelete(key) {
13472 var result = getMapData_default(this, key)["delete"](key);
13473 this.size -= result ? 1 : 0;
13476 var mapCacheDelete_default;
13477 var init_mapCacheDelete = __esm({
13478 "node_modules/lodash-es/_mapCacheDelete.js"() {
13480 mapCacheDelete_default = mapCacheDelete;
13484 // node_modules/lodash-es/_mapCacheGet.js
13485 function mapCacheGet(key) {
13486 return getMapData_default(this, key).get(key);
13488 var mapCacheGet_default;
13489 var init_mapCacheGet = __esm({
13490 "node_modules/lodash-es/_mapCacheGet.js"() {
13492 mapCacheGet_default = mapCacheGet;
13496 // node_modules/lodash-es/_mapCacheHas.js
13497 function mapCacheHas(key) {
13498 return getMapData_default(this, key).has(key);
13500 var mapCacheHas_default;
13501 var init_mapCacheHas = __esm({
13502 "node_modules/lodash-es/_mapCacheHas.js"() {
13504 mapCacheHas_default = mapCacheHas;
13508 // node_modules/lodash-es/_mapCacheSet.js
13509 function mapCacheSet(key, value) {
13510 var data = getMapData_default(this, key), size = data.size;
13511 data.set(key, value);
13512 this.size += data.size == size ? 0 : 1;
13515 var mapCacheSet_default;
13516 var init_mapCacheSet = __esm({
13517 "node_modules/lodash-es/_mapCacheSet.js"() {
13519 mapCacheSet_default = mapCacheSet;
13523 // node_modules/lodash-es/_MapCache.js
13524 function MapCache(entries) {
13525 var index = -1, length2 = entries == null ? 0 : entries.length;
13527 while (++index < length2) {
13528 var entry = entries[index];
13529 this.set(entry[0], entry[1]);
13532 var MapCache_default;
13533 var init_MapCache = __esm({
13534 "node_modules/lodash-es/_MapCache.js"() {
13535 init_mapCacheClear();
13536 init_mapCacheDelete();
13537 init_mapCacheGet();
13538 init_mapCacheHas();
13539 init_mapCacheSet();
13540 MapCache.prototype.clear = mapCacheClear_default;
13541 MapCache.prototype["delete"] = mapCacheDelete_default;
13542 MapCache.prototype.get = mapCacheGet_default;
13543 MapCache.prototype.has = mapCacheHas_default;
13544 MapCache.prototype.set = mapCacheSet_default;
13545 MapCache_default = MapCache;
13549 // node_modules/lodash-es/memoize.js
13550 function memoize(func, resolver) {
13551 if (typeof func != "function" || resolver != null && typeof resolver != "function") {
13552 throw new TypeError(FUNC_ERROR_TEXT);
13554 var memoized = function() {
13555 var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
13556 if (cache.has(key)) {
13557 return cache.get(key);
13559 var result = func.apply(this, args);
13560 memoized.cache = cache.set(key, result) || cache;
13563 memoized.cache = new (memoize.Cache || MapCache_default)();
13566 var FUNC_ERROR_TEXT, memoize_default;
13567 var init_memoize = __esm({
13568 "node_modules/lodash-es/memoize.js"() {
13570 FUNC_ERROR_TEXT = "Expected a function";
13571 memoize.Cache = MapCache_default;
13572 memoize_default = memoize;
13576 // node_modules/lodash-es/_memoizeCapped.js
13577 function memoizeCapped(func) {
13578 var result = memoize_default(func, function(key) {
13579 if (cache.size === MAX_MEMOIZE_SIZE) {
13584 var cache = result.cache;
13587 var MAX_MEMOIZE_SIZE, memoizeCapped_default;
13588 var init_memoizeCapped = __esm({
13589 "node_modules/lodash-es/_memoizeCapped.js"() {
13591 MAX_MEMOIZE_SIZE = 500;
13592 memoizeCapped_default = memoizeCapped;
13596 // node_modules/lodash-es/_stringToPath.js
13597 var rePropName, reEscapeChar, stringToPath, stringToPath_default;
13598 var init_stringToPath = __esm({
13599 "node_modules/lodash-es/_stringToPath.js"() {
13600 init_memoizeCapped();
13601 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
13602 reEscapeChar = /\\(\\)?/g;
13603 stringToPath = memoizeCapped_default(function(string) {
13605 if (string.charCodeAt(0) === 46) {
13608 string.replace(rePropName, function(match, number3, quote, subString) {
13609 result.push(quote ? subString.replace(reEscapeChar, "$1") : number3 || match);
13613 stringToPath_default = stringToPath;
13617 // node_modules/lodash-es/toString.js
13618 function toString(value) {
13619 return value == null ? "" : baseToString_default(value);
13621 var toString_default;
13622 var init_toString = __esm({
13623 "node_modules/lodash-es/toString.js"() {
13624 init_baseToString();
13625 toString_default = toString;
13629 // node_modules/lodash-es/_castPath.js
13630 function castPath(value, object) {
13631 if (isArray_default(value)) {
13634 return isKey_default(value, object) ? [value] : stringToPath_default(toString_default(value));
13636 var castPath_default;
13637 var init_castPath = __esm({
13638 "node_modules/lodash-es/_castPath.js"() {
13641 init_stringToPath();
13643 castPath_default = castPath;
13647 // node_modules/lodash-es/_toKey.js
13648 function toKey(value) {
13649 if (typeof value == "string" || isSymbol_default(value)) {
13652 var result = value + "";
13653 return result == "0" && 1 / value == -INFINITY2 ? "-0" : result;
13655 var INFINITY2, toKey_default;
13656 var init_toKey = __esm({
13657 "node_modules/lodash-es/_toKey.js"() {
13660 toKey_default = toKey;
13664 // node_modules/lodash-es/_baseGet.js
13665 function baseGet(object, path) {
13666 path = castPath_default(path, object);
13667 var index = 0, length2 = path.length;
13668 while (object != null && index < length2) {
13669 object = object[toKey_default(path[index++])];
13671 return index && index == length2 ? object : void 0;
13673 var baseGet_default;
13674 var init_baseGet = __esm({
13675 "node_modules/lodash-es/_baseGet.js"() {
13678 baseGet_default = baseGet;
13682 // node_modules/lodash-es/_arrayPush.js
13683 function arrayPush(array2, values) {
13684 var index = -1, length2 = values.length, offset = array2.length;
13685 while (++index < length2) {
13686 array2[offset + index] = values[index];
13690 var arrayPush_default;
13691 var init_arrayPush = __esm({
13692 "node_modules/lodash-es/_arrayPush.js"() {
13693 arrayPush_default = arrayPush;
13697 // node_modules/lodash-es/_isFlattenable.js
13698 function isFlattenable(value) {
13699 return isArray_default(value) || isArguments_default(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
13701 var spreadableSymbol, isFlattenable_default;
13702 var init_isFlattenable = __esm({
13703 "node_modules/lodash-es/_isFlattenable.js"() {
13705 init_isArguments();
13707 spreadableSymbol = Symbol_default ? Symbol_default.isConcatSpreadable : void 0;
13708 isFlattenable_default = isFlattenable;
13712 // node_modules/lodash-es/_baseFlatten.js
13713 function baseFlatten(array2, depth, predicate, isStrict, result) {
13714 var index = -1, length2 = array2.length;
13715 predicate || (predicate = isFlattenable_default);
13716 result || (result = []);
13717 while (++index < length2) {
13718 var value = array2[index];
13719 if (depth > 0 && predicate(value)) {
13721 baseFlatten(value, depth - 1, predicate, isStrict, result);
13723 arrayPush_default(result, value);
13725 } else if (!isStrict) {
13726 result[result.length] = value;
13731 var baseFlatten_default;
13732 var init_baseFlatten = __esm({
13733 "node_modules/lodash-es/_baseFlatten.js"() {
13735 init_isFlattenable();
13736 baseFlatten_default = baseFlatten;
13740 // node_modules/lodash-es/flatten.js
13741 function flatten2(array2) {
13742 var length2 = array2 == null ? 0 : array2.length;
13743 return length2 ? baseFlatten_default(array2, 1) : [];
13745 var flatten_default;
13746 var init_flatten = __esm({
13747 "node_modules/lodash-es/flatten.js"() {
13748 init_baseFlatten();
13749 flatten_default = flatten2;
13753 // node_modules/lodash-es/_flatRest.js
13754 function flatRest(func) {
13755 return setToString_default(overRest_default(func, void 0, flatten_default), func + "");
13757 var flatRest_default;
13758 var init_flatRest = __esm({
13759 "node_modules/lodash-es/_flatRest.js"() {
13762 init_setToString();
13763 flatRest_default = flatRest;
13767 // node_modules/lodash-es/_getPrototype.js
13768 var getPrototype, getPrototype_default;
13769 var init_getPrototype = __esm({
13770 "node_modules/lodash-es/_getPrototype.js"() {
13772 getPrototype = overArg_default(Object.getPrototypeOf, Object);
13773 getPrototype_default = getPrototype;
13777 // node_modules/lodash-es/isPlainObject.js
13778 function isPlainObject(value) {
13779 if (!isObjectLike_default(value) || baseGetTag_default(value) != objectTag2) {
13782 var proto = getPrototype_default(value);
13783 if (proto === null) {
13786 var Ctor = hasOwnProperty10.call(proto, "constructor") && proto.constructor;
13787 return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString;
13789 var objectTag2, funcProto3, objectProto12, funcToString3, hasOwnProperty10, objectCtorString, isPlainObject_default;
13790 var init_isPlainObject = __esm({
13791 "node_modules/lodash-es/isPlainObject.js"() {
13793 init_getPrototype();
13794 init_isObjectLike();
13795 objectTag2 = "[object Object]";
13796 funcProto3 = Function.prototype;
13797 objectProto12 = Object.prototype;
13798 funcToString3 = funcProto3.toString;
13799 hasOwnProperty10 = objectProto12.hasOwnProperty;
13800 objectCtorString = funcToString3.call(Object);
13801 isPlainObject_default = isPlainObject;
13805 // node_modules/lodash-es/_baseSlice.js
13806 function baseSlice(array2, start2, end) {
13807 var index = -1, length2 = array2.length;
13809 start2 = -start2 > length2 ? 0 : length2 + start2;
13811 end = end > length2 ? length2 : end;
13815 length2 = start2 > end ? 0 : end - start2 >>> 0;
13817 var result = Array(length2);
13818 while (++index < length2) {
13819 result[index] = array2[index + start2];
13823 var baseSlice_default;
13824 var init_baseSlice = __esm({
13825 "node_modules/lodash-es/_baseSlice.js"() {
13826 baseSlice_default = baseSlice;
13830 // node_modules/lodash-es/_basePropertyOf.js
13831 function basePropertyOf(object) {
13832 return function(key) {
13833 return object == null ? void 0 : object[key];
13836 var basePropertyOf_default;
13837 var init_basePropertyOf = __esm({
13838 "node_modules/lodash-es/_basePropertyOf.js"() {
13839 basePropertyOf_default = basePropertyOf;
13843 // node_modules/lodash-es/_baseClamp.js
13844 function baseClamp(number3, lower2, upper) {
13845 if (number3 === number3) {
13846 if (upper !== void 0) {
13847 number3 = number3 <= upper ? number3 : upper;
13849 if (lower2 !== void 0) {
13850 number3 = number3 >= lower2 ? number3 : lower2;
13855 var baseClamp_default;
13856 var init_baseClamp = __esm({
13857 "node_modules/lodash-es/_baseClamp.js"() {
13858 baseClamp_default = baseClamp;
13862 // node_modules/lodash-es/clamp.js
13863 function clamp(number3, lower2, upper) {
13864 if (upper === void 0) {
13868 if (upper !== void 0) {
13869 upper = toNumber_default(upper);
13870 upper = upper === upper ? upper : 0;
13872 if (lower2 !== void 0) {
13873 lower2 = toNumber_default(lower2);
13874 lower2 = lower2 === lower2 ? lower2 : 0;
13876 return baseClamp_default(toNumber_default(number3), lower2, upper);
13879 var init_clamp = __esm({
13880 "node_modules/lodash-es/clamp.js"() {
13883 clamp_default = clamp;
13887 // node_modules/lodash-es/_stackClear.js
13888 function stackClear() {
13889 this.__data__ = new ListCache_default();
13892 var stackClear_default;
13893 var init_stackClear = __esm({
13894 "node_modules/lodash-es/_stackClear.js"() {
13896 stackClear_default = stackClear;
13900 // node_modules/lodash-es/_stackDelete.js
13901 function stackDelete(key) {
13902 var data = this.__data__, result = data["delete"](key);
13903 this.size = data.size;
13906 var stackDelete_default;
13907 var init_stackDelete = __esm({
13908 "node_modules/lodash-es/_stackDelete.js"() {
13909 stackDelete_default = stackDelete;
13913 // node_modules/lodash-es/_stackGet.js
13914 function stackGet(key) {
13915 return this.__data__.get(key);
13917 var stackGet_default;
13918 var init_stackGet = __esm({
13919 "node_modules/lodash-es/_stackGet.js"() {
13920 stackGet_default = stackGet;
13924 // node_modules/lodash-es/_stackHas.js
13925 function stackHas(key) {
13926 return this.__data__.has(key);
13928 var stackHas_default;
13929 var init_stackHas = __esm({
13930 "node_modules/lodash-es/_stackHas.js"() {
13931 stackHas_default = stackHas;
13935 // node_modules/lodash-es/_stackSet.js
13936 function stackSet(key, value) {
13937 var data = this.__data__;
13938 if (data instanceof ListCache_default) {
13939 var pairs2 = data.__data__;
13940 if (!Map_default || pairs2.length < LARGE_ARRAY_SIZE - 1) {
13941 pairs2.push([key, value]);
13942 this.size = ++data.size;
13945 data = this.__data__ = new MapCache_default(pairs2);
13947 data.set(key, value);
13948 this.size = data.size;
13951 var LARGE_ARRAY_SIZE, stackSet_default;
13952 var init_stackSet = __esm({
13953 "node_modules/lodash-es/_stackSet.js"() {
13957 LARGE_ARRAY_SIZE = 200;
13958 stackSet_default = stackSet;
13962 // node_modules/lodash-es/_Stack.js
13963 function Stack(entries) {
13964 var data = this.__data__ = new ListCache_default(entries);
13965 this.size = data.size;
13968 var init_Stack = __esm({
13969 "node_modules/lodash-es/_Stack.js"() {
13972 init_stackDelete();
13976 Stack.prototype.clear = stackClear_default;
13977 Stack.prototype["delete"] = stackDelete_default;
13978 Stack.prototype.get = stackGet_default;
13979 Stack.prototype.has = stackHas_default;
13980 Stack.prototype.set = stackSet_default;
13981 Stack_default = Stack;
13985 // node_modules/lodash-es/_baseAssign.js
13986 function baseAssign(object, source) {
13987 return object && copyObject_default(source, keys_default(source), object);
13989 var baseAssign_default;
13990 var init_baseAssign = __esm({
13991 "node_modules/lodash-es/_baseAssign.js"() {
13994 baseAssign_default = baseAssign;
13998 // node_modules/lodash-es/_baseAssignIn.js
13999 function baseAssignIn(object, source) {
14000 return object && copyObject_default(source, keysIn_default(source), object);
14002 var baseAssignIn_default;
14003 var init_baseAssignIn = __esm({
14004 "node_modules/lodash-es/_baseAssignIn.js"() {
14007 baseAssignIn_default = baseAssignIn;
14011 // node_modules/lodash-es/_cloneBuffer.js
14012 function cloneBuffer(buffer, isDeep) {
14014 return buffer.slice();
14016 var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2);
14017 buffer.copy(result);
14020 var freeExports3, freeModule3, moduleExports3, Buffer3, allocUnsafe, cloneBuffer_default;
14021 var init_cloneBuffer = __esm({
14022 "node_modules/lodash-es/_cloneBuffer.js"() {
14024 freeExports3 = typeof exports == "object" && exports && !exports.nodeType && exports;
14025 freeModule3 = freeExports3 && typeof module == "object" && module && !module.nodeType && module;
14026 moduleExports3 = freeModule3 && freeModule3.exports === freeExports3;
14027 Buffer3 = moduleExports3 ? root_default.Buffer : void 0;
14028 allocUnsafe = Buffer3 ? Buffer3.allocUnsafe : void 0;
14029 cloneBuffer_default = cloneBuffer;
14033 // node_modules/lodash-es/_arrayFilter.js
14034 function arrayFilter(array2, predicate) {
14035 var index = -1, length2 = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
14036 while (++index < length2) {
14037 var value = array2[index];
14038 if (predicate(value, index, array2)) {
14039 result[resIndex++] = value;
14044 var arrayFilter_default;
14045 var init_arrayFilter = __esm({
14046 "node_modules/lodash-es/_arrayFilter.js"() {
14047 arrayFilter_default = arrayFilter;
14051 // node_modules/lodash-es/stubArray.js
14052 function stubArray() {
14055 var stubArray_default;
14056 var init_stubArray = __esm({
14057 "node_modules/lodash-es/stubArray.js"() {
14058 stubArray_default = stubArray;
14062 // node_modules/lodash-es/_getSymbols.js
14063 var objectProto13, propertyIsEnumerable2, nativeGetSymbols, getSymbols, getSymbols_default;
14064 var init_getSymbols = __esm({
14065 "node_modules/lodash-es/_getSymbols.js"() {
14066 init_arrayFilter();
14068 objectProto13 = Object.prototype;
14069 propertyIsEnumerable2 = objectProto13.propertyIsEnumerable;
14070 nativeGetSymbols = Object.getOwnPropertySymbols;
14071 getSymbols = !nativeGetSymbols ? stubArray_default : function(object) {
14072 if (object == null) {
14075 object = Object(object);
14076 return arrayFilter_default(nativeGetSymbols(object), function(symbol) {
14077 return propertyIsEnumerable2.call(object, symbol);
14080 getSymbols_default = getSymbols;
14084 // node_modules/lodash-es/_copySymbols.js
14085 function copySymbols(source, object) {
14086 return copyObject_default(source, getSymbols_default(source), object);
14088 var copySymbols_default;
14089 var init_copySymbols = __esm({
14090 "node_modules/lodash-es/_copySymbols.js"() {
14093 copySymbols_default = copySymbols;
14097 // node_modules/lodash-es/_getSymbolsIn.js
14098 var nativeGetSymbols2, getSymbolsIn, getSymbolsIn_default;
14099 var init_getSymbolsIn = __esm({
14100 "node_modules/lodash-es/_getSymbolsIn.js"() {
14102 init_getPrototype();
14105 nativeGetSymbols2 = Object.getOwnPropertySymbols;
14106 getSymbolsIn = !nativeGetSymbols2 ? stubArray_default : function(object) {
14109 arrayPush_default(result, getSymbols_default(object));
14110 object = getPrototype_default(object);
14114 getSymbolsIn_default = getSymbolsIn;
14118 // node_modules/lodash-es/_copySymbolsIn.js
14119 function copySymbolsIn(source, object) {
14120 return copyObject_default(source, getSymbolsIn_default(source), object);
14122 var copySymbolsIn_default;
14123 var init_copySymbolsIn = __esm({
14124 "node_modules/lodash-es/_copySymbolsIn.js"() {
14126 init_getSymbolsIn();
14127 copySymbolsIn_default = copySymbolsIn;
14131 // node_modules/lodash-es/_baseGetAllKeys.js
14132 function baseGetAllKeys(object, keysFunc, symbolsFunc) {
14133 var result = keysFunc(object);
14134 return isArray_default(object) ? result : arrayPush_default(result, symbolsFunc(object));
14136 var baseGetAllKeys_default;
14137 var init_baseGetAllKeys = __esm({
14138 "node_modules/lodash-es/_baseGetAllKeys.js"() {
14141 baseGetAllKeys_default = baseGetAllKeys;
14145 // node_modules/lodash-es/_getAllKeys.js
14146 function getAllKeys(object) {
14147 return baseGetAllKeys_default(object, keys_default, getSymbols_default);
14149 var getAllKeys_default;
14150 var init_getAllKeys = __esm({
14151 "node_modules/lodash-es/_getAllKeys.js"() {
14152 init_baseGetAllKeys();
14155 getAllKeys_default = getAllKeys;
14159 // node_modules/lodash-es/_getAllKeysIn.js
14160 function getAllKeysIn(object) {
14161 return baseGetAllKeys_default(object, keysIn_default, getSymbolsIn_default);
14163 var getAllKeysIn_default;
14164 var init_getAllKeysIn = __esm({
14165 "node_modules/lodash-es/_getAllKeysIn.js"() {
14166 init_baseGetAllKeys();
14167 init_getSymbolsIn();
14169 getAllKeysIn_default = getAllKeysIn;
14173 // node_modules/lodash-es/_DataView.js
14174 var DataView2, DataView_default;
14175 var init_DataView = __esm({
14176 "node_modules/lodash-es/_DataView.js"() {
14179 DataView2 = getNative_default(root_default, "DataView");
14180 DataView_default = DataView2;
14184 // node_modules/lodash-es/_Promise.js
14185 var Promise2, Promise_default;
14186 var init_Promise = __esm({
14187 "node_modules/lodash-es/_Promise.js"() {
14190 Promise2 = getNative_default(root_default, "Promise");
14191 Promise_default = Promise2;
14195 // node_modules/lodash-es/_Set.js
14196 var Set2, Set_default;
14197 var init_Set = __esm({
14198 "node_modules/lodash-es/_Set.js"() {
14201 Set2 = getNative_default(root_default, "Set");
14202 Set_default = Set2;
14206 // node_modules/lodash-es/_getTag.js
14207 var mapTag2, objectTag3, promiseTag, setTag2, weakMapTag2, dataViewTag2, dataViewCtorString, mapCtorString, promiseCtorString, setCtorString, weakMapCtorString, getTag, getTag_default;
14208 var init_getTag = __esm({
14209 "node_modules/lodash-es/_getTag.js"() {
14217 mapTag2 = "[object Map]";
14218 objectTag3 = "[object Object]";
14219 promiseTag = "[object Promise]";
14220 setTag2 = "[object Set]";
14221 weakMapTag2 = "[object WeakMap]";
14222 dataViewTag2 = "[object DataView]";
14223 dataViewCtorString = toSource_default(DataView_default);
14224 mapCtorString = toSource_default(Map_default);
14225 promiseCtorString = toSource_default(Promise_default);
14226 setCtorString = toSource_default(Set_default);
14227 weakMapCtorString = toSource_default(WeakMap_default);
14228 getTag = baseGetTag_default;
14229 if (DataView_default && getTag(new DataView_default(new ArrayBuffer(1))) != dataViewTag2 || Map_default && getTag(new Map_default()) != mapTag2 || Promise_default && getTag(Promise_default.resolve()) != promiseTag || Set_default && getTag(new Set_default()) != setTag2 || WeakMap_default && getTag(new WeakMap_default()) != weakMapTag2) {
14230 getTag = function(value) {
14231 var result = baseGetTag_default(value), Ctor = result == objectTag3 ? value.constructor : void 0, ctorString = Ctor ? toSource_default(Ctor) : "";
14233 switch (ctorString) {
14234 case dataViewCtorString:
14235 return dataViewTag2;
14236 case mapCtorString:
14238 case promiseCtorString:
14240 case setCtorString:
14242 case weakMapCtorString:
14243 return weakMapTag2;
14249 getTag_default = getTag;
14253 // node_modules/lodash-es/_initCloneArray.js
14254 function initCloneArray(array2) {
14255 var length2 = array2.length, result = new array2.constructor(length2);
14256 if (length2 && typeof array2[0] == "string" && hasOwnProperty11.call(array2, "index")) {
14257 result.index = array2.index;
14258 result.input = array2.input;
14262 var objectProto14, hasOwnProperty11, initCloneArray_default;
14263 var init_initCloneArray = __esm({
14264 "node_modules/lodash-es/_initCloneArray.js"() {
14265 objectProto14 = Object.prototype;
14266 hasOwnProperty11 = objectProto14.hasOwnProperty;
14267 initCloneArray_default = initCloneArray;
14271 // node_modules/lodash-es/_Uint8Array.js
14272 var Uint8Array2, Uint8Array_default;
14273 var init_Uint8Array = __esm({
14274 "node_modules/lodash-es/_Uint8Array.js"() {
14276 Uint8Array2 = root_default.Uint8Array;
14277 Uint8Array_default = Uint8Array2;
14281 // node_modules/lodash-es/_cloneArrayBuffer.js
14282 function cloneArrayBuffer(arrayBuffer) {
14283 var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
14284 new Uint8Array_default(result).set(new Uint8Array_default(arrayBuffer));
14287 var cloneArrayBuffer_default;
14288 var init_cloneArrayBuffer = __esm({
14289 "node_modules/lodash-es/_cloneArrayBuffer.js"() {
14291 cloneArrayBuffer_default = cloneArrayBuffer;
14295 // node_modules/lodash-es/_cloneDataView.js
14296 function cloneDataView(dataView, isDeep) {
14297 var buffer = isDeep ? cloneArrayBuffer_default(dataView.buffer) : dataView.buffer;
14298 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
14300 var cloneDataView_default;
14301 var init_cloneDataView = __esm({
14302 "node_modules/lodash-es/_cloneDataView.js"() {
14303 init_cloneArrayBuffer();
14304 cloneDataView_default = cloneDataView;
14308 // node_modules/lodash-es/_cloneRegExp.js
14309 function cloneRegExp(regexp) {
14310 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
14311 result.lastIndex = regexp.lastIndex;
14314 var reFlags, cloneRegExp_default;
14315 var init_cloneRegExp = __esm({
14316 "node_modules/lodash-es/_cloneRegExp.js"() {
14318 cloneRegExp_default = cloneRegExp;
14322 // node_modules/lodash-es/_cloneSymbol.js
14323 function cloneSymbol(symbol) {
14324 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
14326 var symbolProto2, symbolValueOf, cloneSymbol_default;
14327 var init_cloneSymbol = __esm({
14328 "node_modules/lodash-es/_cloneSymbol.js"() {
14330 symbolProto2 = Symbol_default ? Symbol_default.prototype : void 0;
14331 symbolValueOf = symbolProto2 ? symbolProto2.valueOf : void 0;
14332 cloneSymbol_default = cloneSymbol;
14336 // node_modules/lodash-es/_cloneTypedArray.js
14337 function cloneTypedArray(typedArray, isDeep) {
14338 var buffer = isDeep ? cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer;
14339 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
14341 var cloneTypedArray_default;
14342 var init_cloneTypedArray = __esm({
14343 "node_modules/lodash-es/_cloneTypedArray.js"() {
14344 init_cloneArrayBuffer();
14345 cloneTypedArray_default = cloneTypedArray;
14349 // node_modules/lodash-es/_initCloneByTag.js
14350 function initCloneByTag(object, tag, isDeep) {
14351 var Ctor = object.constructor;
14353 case arrayBufferTag2:
14354 return cloneArrayBuffer_default(object);
14357 return new Ctor(+object);
14359 return cloneDataView_default(object, isDeep);
14366 case uint8ClampedTag2:
14369 return cloneTypedArray_default(object, isDeep);
14374 return new Ctor(object);
14376 return cloneRegExp_default(object);
14380 return cloneSymbol_default(object);
14383 var boolTag2, dateTag2, mapTag3, numberTag2, regexpTag2, setTag3, stringTag2, symbolTag2, arrayBufferTag2, dataViewTag3, float32Tag2, float64Tag2, int8Tag2, int16Tag2, int32Tag2, uint8Tag2, uint8ClampedTag2, uint16Tag2, uint32Tag2, initCloneByTag_default;
14384 var init_initCloneByTag = __esm({
14385 "node_modules/lodash-es/_initCloneByTag.js"() {
14386 init_cloneArrayBuffer();
14387 init_cloneDataView();
14388 init_cloneRegExp();
14389 init_cloneSymbol();
14390 init_cloneTypedArray();
14391 boolTag2 = "[object Boolean]";
14392 dateTag2 = "[object Date]";
14393 mapTag3 = "[object Map]";
14394 numberTag2 = "[object Number]";
14395 regexpTag2 = "[object RegExp]";
14396 setTag3 = "[object Set]";
14397 stringTag2 = "[object String]";
14398 symbolTag2 = "[object Symbol]";
14399 arrayBufferTag2 = "[object ArrayBuffer]";
14400 dataViewTag3 = "[object DataView]";
14401 float32Tag2 = "[object Float32Array]";
14402 float64Tag2 = "[object Float64Array]";
14403 int8Tag2 = "[object Int8Array]";
14404 int16Tag2 = "[object Int16Array]";
14405 int32Tag2 = "[object Int32Array]";
14406 uint8Tag2 = "[object Uint8Array]";
14407 uint8ClampedTag2 = "[object Uint8ClampedArray]";
14408 uint16Tag2 = "[object Uint16Array]";
14409 uint32Tag2 = "[object Uint32Array]";
14410 initCloneByTag_default = initCloneByTag;
14414 // node_modules/lodash-es/_initCloneObject.js
14415 function initCloneObject(object) {
14416 return typeof object.constructor == "function" && !isPrototype_default(object) ? baseCreate_default(getPrototype_default(object)) : {};
14418 var initCloneObject_default;
14419 var init_initCloneObject = __esm({
14420 "node_modules/lodash-es/_initCloneObject.js"() {
14422 init_getPrototype();
14423 init_isPrototype();
14424 initCloneObject_default = initCloneObject;
14428 // node_modules/lodash-es/_baseIsMap.js
14429 function baseIsMap(value) {
14430 return isObjectLike_default(value) && getTag_default(value) == mapTag4;
14432 var mapTag4, baseIsMap_default;
14433 var init_baseIsMap = __esm({
14434 "node_modules/lodash-es/_baseIsMap.js"() {
14436 init_isObjectLike();
14437 mapTag4 = "[object Map]";
14438 baseIsMap_default = baseIsMap;
14442 // node_modules/lodash-es/isMap.js
14443 var nodeIsMap, isMap, isMap_default;
14444 var init_isMap = __esm({
14445 "node_modules/lodash-es/isMap.js"() {
14449 nodeIsMap = nodeUtil_default && nodeUtil_default.isMap;
14450 isMap = nodeIsMap ? baseUnary_default(nodeIsMap) : baseIsMap_default;
14451 isMap_default = isMap;
14455 // node_modules/lodash-es/_baseIsSet.js
14456 function baseIsSet(value) {
14457 return isObjectLike_default(value) && getTag_default(value) == setTag4;
14459 var setTag4, baseIsSet_default;
14460 var init_baseIsSet = __esm({
14461 "node_modules/lodash-es/_baseIsSet.js"() {
14463 init_isObjectLike();
14464 setTag4 = "[object Set]";
14465 baseIsSet_default = baseIsSet;
14469 // node_modules/lodash-es/isSet.js
14470 var nodeIsSet, isSet, isSet_default;
14471 var init_isSet = __esm({
14472 "node_modules/lodash-es/isSet.js"() {
14476 nodeIsSet = nodeUtil_default && nodeUtil_default.isSet;
14477 isSet = nodeIsSet ? baseUnary_default(nodeIsSet) : baseIsSet_default;
14478 isSet_default = isSet;
14482 // node_modules/lodash-es/_baseClone.js
14483 function baseClone(value, bitmask, customizer, key, object, stack) {
14484 var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
14486 result = object ? customizer(value, key, object, stack) : customizer(value);
14488 if (result !== void 0) {
14491 if (!isObject_default(value)) {
14494 var isArr = isArray_default(value);
14496 result = initCloneArray_default(value);
14498 return copyArray_default(value, result);
14501 var tag = getTag_default(value), isFunc = tag == funcTag3 || tag == genTag2;
14502 if (isBuffer_default(value)) {
14503 return cloneBuffer_default(value, isDeep);
14505 if (tag == objectTag4 || tag == argsTag3 || isFunc && !object) {
14506 result = isFlat || isFunc ? {} : initCloneObject_default(value);
14508 return isFlat ? copySymbolsIn_default(value, baseAssignIn_default(result, value)) : copySymbols_default(value, baseAssign_default(result, value));
14511 if (!cloneableTags[tag]) {
14512 return object ? value : {};
14514 result = initCloneByTag_default(value, tag, isDeep);
14517 stack || (stack = new Stack_default());
14518 var stacked = stack.get(value);
14522 stack.set(value, result);
14523 if (isSet_default(value)) {
14524 value.forEach(function(subValue) {
14525 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
14527 } else if (isMap_default(value)) {
14528 value.forEach(function(subValue, key2) {
14529 result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
14532 var keysFunc = isFull ? isFlat ? getAllKeysIn_default : getAllKeys_default : isFlat ? keysIn_default : keys_default;
14533 var props = isArr ? void 0 : keysFunc(value);
14534 arrayEach_default(props || value, function(subValue, key2) {
14537 subValue = value[key2];
14539 assignValue_default(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
14543 var CLONE_DEEP_FLAG, CLONE_FLAT_FLAG, CLONE_SYMBOLS_FLAG, argsTag3, arrayTag2, boolTag3, dateTag3, errorTag2, funcTag3, genTag2, mapTag5, numberTag3, objectTag4, regexpTag3, setTag5, stringTag3, symbolTag3, weakMapTag3, arrayBufferTag3, dataViewTag4, float32Tag3, float64Tag3, int8Tag3, int16Tag3, int32Tag3, uint8Tag3, uint8ClampedTag3, uint16Tag3, uint32Tag3, cloneableTags, baseClone_default;
14544 var init_baseClone = __esm({
14545 "node_modules/lodash-es/_baseClone.js"() {
14548 init_assignValue();
14550 init_baseAssignIn();
14551 init_cloneBuffer();
14553 init_copySymbols();
14554 init_copySymbolsIn();
14556 init_getAllKeysIn();
14558 init_initCloneArray();
14559 init_initCloneByTag();
14560 init_initCloneObject();
14568 CLONE_DEEP_FLAG = 1;
14569 CLONE_FLAT_FLAG = 2;
14570 CLONE_SYMBOLS_FLAG = 4;
14571 argsTag3 = "[object Arguments]";
14572 arrayTag2 = "[object Array]";
14573 boolTag3 = "[object Boolean]";
14574 dateTag3 = "[object Date]";
14575 errorTag2 = "[object Error]";
14576 funcTag3 = "[object Function]";
14577 genTag2 = "[object GeneratorFunction]";
14578 mapTag5 = "[object Map]";
14579 numberTag3 = "[object Number]";
14580 objectTag4 = "[object Object]";
14581 regexpTag3 = "[object RegExp]";
14582 setTag5 = "[object Set]";
14583 stringTag3 = "[object String]";
14584 symbolTag3 = "[object Symbol]";
14585 weakMapTag3 = "[object WeakMap]";
14586 arrayBufferTag3 = "[object ArrayBuffer]";
14587 dataViewTag4 = "[object DataView]";
14588 float32Tag3 = "[object Float32Array]";
14589 float64Tag3 = "[object Float64Array]";
14590 int8Tag3 = "[object Int8Array]";
14591 int16Tag3 = "[object Int16Array]";
14592 int32Tag3 = "[object Int32Array]";
14593 uint8Tag3 = "[object Uint8Array]";
14594 uint8ClampedTag3 = "[object Uint8ClampedArray]";
14595 uint16Tag3 = "[object Uint16Array]";
14596 uint32Tag3 = "[object Uint32Array]";
14597 cloneableTags = {};
14598 cloneableTags[argsTag3] = cloneableTags[arrayTag2] = cloneableTags[arrayBufferTag3] = cloneableTags[dataViewTag4] = cloneableTags[boolTag3] = cloneableTags[dateTag3] = cloneableTags[float32Tag3] = cloneableTags[float64Tag3] = cloneableTags[int8Tag3] = cloneableTags[int16Tag3] = cloneableTags[int32Tag3] = cloneableTags[mapTag5] = cloneableTags[numberTag3] = cloneableTags[objectTag4] = cloneableTags[regexpTag3] = cloneableTags[setTag5] = cloneableTags[stringTag3] = cloneableTags[symbolTag3] = cloneableTags[uint8Tag3] = cloneableTags[uint8ClampedTag3] = cloneableTags[uint16Tag3] = cloneableTags[uint32Tag3] = true;
14599 cloneableTags[errorTag2] = cloneableTags[funcTag3] = cloneableTags[weakMapTag3] = false;
14600 baseClone_default = baseClone;
14604 // node_modules/lodash-es/_setCacheAdd.js
14605 function setCacheAdd(value) {
14606 this.__data__.set(value, HASH_UNDEFINED3);
14609 var HASH_UNDEFINED3, setCacheAdd_default;
14610 var init_setCacheAdd = __esm({
14611 "node_modules/lodash-es/_setCacheAdd.js"() {
14612 HASH_UNDEFINED3 = "__lodash_hash_undefined__";
14613 setCacheAdd_default = setCacheAdd;
14617 // node_modules/lodash-es/_setCacheHas.js
14618 function setCacheHas(value) {
14619 return this.__data__.has(value);
14621 var setCacheHas_default;
14622 var init_setCacheHas = __esm({
14623 "node_modules/lodash-es/_setCacheHas.js"() {
14624 setCacheHas_default = setCacheHas;
14628 // node_modules/lodash-es/_SetCache.js
14629 function SetCache(values) {
14630 var index = -1, length2 = values == null ? 0 : values.length;
14631 this.__data__ = new MapCache_default();
14632 while (++index < length2) {
14633 this.add(values[index]);
14636 var SetCache_default;
14637 var init_SetCache = __esm({
14638 "node_modules/lodash-es/_SetCache.js"() {
14640 init_setCacheAdd();
14641 init_setCacheHas();
14642 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd_default;
14643 SetCache.prototype.has = setCacheHas_default;
14644 SetCache_default = SetCache;
14648 // node_modules/lodash-es/_arraySome.js
14649 function arraySome(array2, predicate) {
14650 var index = -1, length2 = array2 == null ? 0 : array2.length;
14651 while (++index < length2) {
14652 if (predicate(array2[index], index, array2)) {
14658 var arraySome_default;
14659 var init_arraySome = __esm({
14660 "node_modules/lodash-es/_arraySome.js"() {
14661 arraySome_default = arraySome;
14665 // node_modules/lodash-es/_cacheHas.js
14666 function cacheHas(cache, key) {
14667 return cache.has(key);
14669 var cacheHas_default;
14670 var init_cacheHas = __esm({
14671 "node_modules/lodash-es/_cacheHas.js"() {
14672 cacheHas_default = cacheHas;
14676 // node_modules/lodash-es/_equalArrays.js
14677 function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
14678 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array2.length, othLength = other.length;
14679 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
14682 var arrStacked = stack.get(array2);
14683 var othStacked = stack.get(other);
14684 if (arrStacked && othStacked) {
14685 return arrStacked == other && othStacked == array2;
14687 var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache_default() : void 0;
14688 stack.set(array2, other);
14689 stack.set(other, array2);
14690 while (++index < arrLength) {
14691 var arrValue = array2[index], othValue = other[index];
14693 var compared = isPartial ? customizer(othValue, arrValue, index, other, array2, stack) : customizer(arrValue, othValue, index, array2, other, stack);
14695 if (compared !== void 0) {
14703 if (!arraySome_default(other, function(othValue2, othIndex) {
14704 if (!cacheHas_default(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
14705 return seen.push(othIndex);
14711 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
14716 stack["delete"](array2);
14717 stack["delete"](other);
14720 var COMPARE_PARTIAL_FLAG, COMPARE_UNORDERED_FLAG, equalArrays_default;
14721 var init_equalArrays = __esm({
14722 "node_modules/lodash-es/_equalArrays.js"() {
14726 COMPARE_PARTIAL_FLAG = 1;
14727 COMPARE_UNORDERED_FLAG = 2;
14728 equalArrays_default = equalArrays;
14732 // node_modules/lodash-es/_mapToArray.js
14733 function mapToArray(map2) {
14734 var index = -1, result = Array(map2.size);
14735 map2.forEach(function(value, key) {
14736 result[++index] = [key, value];
14740 var mapToArray_default;
14741 var init_mapToArray = __esm({
14742 "node_modules/lodash-es/_mapToArray.js"() {
14743 mapToArray_default = mapToArray;
14747 // node_modules/lodash-es/_setToArray.js
14748 function setToArray(set4) {
14749 var index = -1, result = Array(set4.size);
14750 set4.forEach(function(value) {
14751 result[++index] = value;
14755 var setToArray_default;
14756 var init_setToArray = __esm({
14757 "node_modules/lodash-es/_setToArray.js"() {
14758 setToArray_default = setToArray;
14762 // node_modules/lodash-es/_equalByTag.js
14763 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
14766 if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
14769 object = object.buffer;
14770 other = other.buffer;
14771 case arrayBufferTag4:
14772 if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array_default(object), new Uint8Array_default(other))) {
14779 return eq_default(+object, +other);
14781 return object.name == other.name && object.message == other.message;
14784 return object == other + "";
14786 var convert = mapToArray_default;
14788 var isPartial = bitmask & COMPARE_PARTIAL_FLAG2;
14789 convert || (convert = setToArray_default);
14790 if (object.size != other.size && !isPartial) {
14793 var stacked = stack.get(object);
14795 return stacked == other;
14797 bitmask |= COMPARE_UNORDERED_FLAG2;
14798 stack.set(object, other);
14799 var result = equalArrays_default(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
14800 stack["delete"](object);
14803 if (symbolValueOf2) {
14804 return symbolValueOf2.call(object) == symbolValueOf2.call(other);
14809 var COMPARE_PARTIAL_FLAG2, COMPARE_UNORDERED_FLAG2, boolTag4, dateTag4, errorTag3, mapTag6, numberTag4, regexpTag4, setTag6, stringTag4, symbolTag4, arrayBufferTag4, dataViewTag5, symbolProto3, symbolValueOf2, equalByTag_default;
14810 var init_equalByTag = __esm({
14811 "node_modules/lodash-es/_equalByTag.js"() {
14815 init_equalArrays();
14818 COMPARE_PARTIAL_FLAG2 = 1;
14819 COMPARE_UNORDERED_FLAG2 = 2;
14820 boolTag4 = "[object Boolean]";
14821 dateTag4 = "[object Date]";
14822 errorTag3 = "[object Error]";
14823 mapTag6 = "[object Map]";
14824 numberTag4 = "[object Number]";
14825 regexpTag4 = "[object RegExp]";
14826 setTag6 = "[object Set]";
14827 stringTag4 = "[object String]";
14828 symbolTag4 = "[object Symbol]";
14829 arrayBufferTag4 = "[object ArrayBuffer]";
14830 dataViewTag5 = "[object DataView]";
14831 symbolProto3 = Symbol_default ? Symbol_default.prototype : void 0;
14832 symbolValueOf2 = symbolProto3 ? symbolProto3.valueOf : void 0;
14833 equalByTag_default = equalByTag;
14837 // node_modules/lodash-es/_equalObjects.js
14838 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
14839 var isPartial = bitmask & COMPARE_PARTIAL_FLAG3, objProps = getAllKeys_default(object), objLength = objProps.length, othProps = getAllKeys_default(other), othLength = othProps.length;
14840 if (objLength != othLength && !isPartial) {
14843 var index = objLength;
14845 var key = objProps[index];
14846 if (!(isPartial ? key in other : hasOwnProperty12.call(other, key))) {
14850 var objStacked = stack.get(object);
14851 var othStacked = stack.get(other);
14852 if (objStacked && othStacked) {
14853 return objStacked == other && othStacked == object;
14856 stack.set(object, other);
14857 stack.set(other, object);
14858 var skipCtor = isPartial;
14859 while (++index < objLength) {
14860 key = objProps[index];
14861 var objValue = object[key], othValue = other[key];
14863 var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
14865 if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
14869 skipCtor || (skipCtor = key == "constructor");
14871 if (result && !skipCtor) {
14872 var objCtor = object.constructor, othCtor = other.constructor;
14873 if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
14877 stack["delete"](object);
14878 stack["delete"](other);
14881 var COMPARE_PARTIAL_FLAG3, objectProto15, hasOwnProperty12, equalObjects_default;
14882 var init_equalObjects = __esm({
14883 "node_modules/lodash-es/_equalObjects.js"() {
14885 COMPARE_PARTIAL_FLAG3 = 1;
14886 objectProto15 = Object.prototype;
14887 hasOwnProperty12 = objectProto15.hasOwnProperty;
14888 equalObjects_default = equalObjects;
14892 // node_modules/lodash-es/_baseIsEqualDeep.js
14893 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
14894 var objIsArr = isArray_default(object), othIsArr = isArray_default(other), objTag = objIsArr ? arrayTag3 : getTag_default(object), othTag = othIsArr ? arrayTag3 : getTag_default(other);
14895 objTag = objTag == argsTag4 ? objectTag5 : objTag;
14896 othTag = othTag == argsTag4 ? objectTag5 : othTag;
14897 var objIsObj = objTag == objectTag5, othIsObj = othTag == objectTag5, isSameTag = objTag == othTag;
14898 if (isSameTag && isBuffer_default(object)) {
14899 if (!isBuffer_default(other)) {
14905 if (isSameTag && !objIsObj) {
14906 stack || (stack = new Stack_default());
14907 return objIsArr || isTypedArray_default(object) ? equalArrays_default(object, other, bitmask, customizer, equalFunc, stack) : equalByTag_default(object, other, objTag, bitmask, customizer, equalFunc, stack);
14909 if (!(bitmask & COMPARE_PARTIAL_FLAG4)) {
14910 var objIsWrapped = objIsObj && hasOwnProperty13.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty13.call(other, "__wrapped__");
14911 if (objIsWrapped || othIsWrapped) {
14912 var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
14913 stack || (stack = new Stack_default());
14914 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
14920 stack || (stack = new Stack_default());
14921 return equalObjects_default(object, other, bitmask, customizer, equalFunc, stack);
14923 var COMPARE_PARTIAL_FLAG4, argsTag4, arrayTag3, objectTag5, objectProto16, hasOwnProperty13, baseIsEqualDeep_default;
14924 var init_baseIsEqualDeep = __esm({
14925 "node_modules/lodash-es/_baseIsEqualDeep.js"() {
14927 init_equalArrays();
14929 init_equalObjects();
14933 init_isTypedArray();
14934 COMPARE_PARTIAL_FLAG4 = 1;
14935 argsTag4 = "[object Arguments]";
14936 arrayTag3 = "[object Array]";
14937 objectTag5 = "[object Object]";
14938 objectProto16 = Object.prototype;
14939 hasOwnProperty13 = objectProto16.hasOwnProperty;
14940 baseIsEqualDeep_default = baseIsEqualDeep;
14944 // node_modules/lodash-es/_baseIsEqual.js
14945 function baseIsEqual(value, other, bitmask, customizer, stack) {
14946 if (value === other) {
14949 if (value == null || other == null || !isObjectLike_default(value) && !isObjectLike_default(other)) {
14950 return value !== value && other !== other;
14952 return baseIsEqualDeep_default(value, other, bitmask, customizer, baseIsEqual, stack);
14954 var baseIsEqual_default;
14955 var init_baseIsEqual = __esm({
14956 "node_modules/lodash-es/_baseIsEqual.js"() {
14957 init_baseIsEqualDeep();
14958 init_isObjectLike();
14959 baseIsEqual_default = baseIsEqual;
14963 // node_modules/lodash-es/_createBaseFor.js
14964 function createBaseFor(fromRight) {
14965 return function(object, iteratee, keysFunc) {
14966 var index = -1, iterable = Object(object), props = keysFunc(object), length2 = props.length;
14967 while (length2--) {
14968 var key = props[fromRight ? length2 : ++index];
14969 if (iteratee(iterable[key], key, iterable) === false) {
14976 var createBaseFor_default;
14977 var init_createBaseFor = __esm({
14978 "node_modules/lodash-es/_createBaseFor.js"() {
14979 createBaseFor_default = createBaseFor;
14983 // node_modules/lodash-es/_baseFor.js
14984 var baseFor, baseFor_default;
14985 var init_baseFor = __esm({
14986 "node_modules/lodash-es/_baseFor.js"() {
14987 init_createBaseFor();
14988 baseFor = createBaseFor_default();
14989 baseFor_default = baseFor;
14993 // node_modules/lodash-es/now.js
14994 var now2, now_default;
14995 var init_now = __esm({
14996 "node_modules/lodash-es/now.js"() {
14998 now2 = function() {
14999 return root_default.Date.now();
15001 now_default = now2;
15005 // node_modules/lodash-es/debounce.js
15006 function debounce(func, wait, options) {
15007 var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
15008 if (typeof func != "function") {
15009 throw new TypeError(FUNC_ERROR_TEXT2);
15011 wait = toNumber_default(wait) || 0;
15012 if (isObject_default(options)) {
15013 leading = !!options.leading;
15014 maxing = "maxWait" in options;
15015 maxWait = maxing ? nativeMax2(toNumber_default(options.maxWait) || 0, wait) : maxWait;
15016 trailing = "trailing" in options ? !!options.trailing : trailing;
15018 function invokeFunc(time) {
15019 var args = lastArgs, thisArg = lastThis;
15020 lastArgs = lastThis = void 0;
15021 lastInvokeTime = time;
15022 result = func.apply(thisArg, args);
15025 function leadingEdge(time) {
15026 lastInvokeTime = time;
15027 timerId = setTimeout(timerExpired, wait);
15028 return leading ? invokeFunc(time) : result;
15030 function remainingWait(time) {
15031 var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
15032 return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
15034 function shouldInvoke(time) {
15035 var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
15036 return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
15038 function timerExpired() {
15039 var time = now_default();
15040 if (shouldInvoke(time)) {
15041 return trailingEdge(time);
15043 timerId = setTimeout(timerExpired, remainingWait(time));
15045 function trailingEdge(time) {
15047 if (trailing && lastArgs) {
15048 return invokeFunc(time);
15050 lastArgs = lastThis = void 0;
15053 function cancel() {
15054 if (timerId !== void 0) {
15055 clearTimeout(timerId);
15057 lastInvokeTime = 0;
15058 lastArgs = lastCallTime = lastThis = timerId = void 0;
15061 return timerId === void 0 ? result : trailingEdge(now_default());
15063 function debounced() {
15064 var time = now_default(), isInvoking = shouldInvoke(time);
15065 lastArgs = arguments;
15067 lastCallTime = time;
15069 if (timerId === void 0) {
15070 return leadingEdge(lastCallTime);
15073 clearTimeout(timerId);
15074 timerId = setTimeout(timerExpired, wait);
15075 return invokeFunc(lastCallTime);
15078 if (timerId === void 0) {
15079 timerId = setTimeout(timerExpired, wait);
15083 debounced.cancel = cancel;
15084 debounced.flush = flush;
15087 var FUNC_ERROR_TEXT2, nativeMax2, nativeMin, debounce_default;
15088 var init_debounce = __esm({
15089 "node_modules/lodash-es/debounce.js"() {
15093 FUNC_ERROR_TEXT2 = "Expected a function";
15094 nativeMax2 = Math.max;
15095 nativeMin = Math.min;
15096 debounce_default = debounce;
15100 // node_modules/lodash-es/_assignMergeValue.js
15101 function assignMergeValue(object, key, value) {
15102 if (value !== void 0 && !eq_default(object[key], value) || value === void 0 && !(key in object)) {
15103 baseAssignValue_default(object, key, value);
15106 var assignMergeValue_default;
15107 var init_assignMergeValue = __esm({
15108 "node_modules/lodash-es/_assignMergeValue.js"() {
15109 init_baseAssignValue();
15111 assignMergeValue_default = assignMergeValue;
15115 // node_modules/lodash-es/isArrayLikeObject.js
15116 function isArrayLikeObject(value) {
15117 return isObjectLike_default(value) && isArrayLike_default(value);
15119 var isArrayLikeObject_default;
15120 var init_isArrayLikeObject = __esm({
15121 "node_modules/lodash-es/isArrayLikeObject.js"() {
15122 init_isArrayLike();
15123 init_isObjectLike();
15124 isArrayLikeObject_default = isArrayLikeObject;
15128 // node_modules/lodash-es/_safeGet.js
15129 function safeGet(object, key) {
15130 if (key === "constructor" && typeof object[key] === "function") {
15133 if (key == "__proto__") {
15136 return object[key];
15138 var safeGet_default;
15139 var init_safeGet = __esm({
15140 "node_modules/lodash-es/_safeGet.js"() {
15141 safeGet_default = safeGet;
15145 // node_modules/lodash-es/toPlainObject.js
15146 function toPlainObject(value) {
15147 return copyObject_default(value, keysIn_default(value));
15149 var toPlainObject_default;
15150 var init_toPlainObject = __esm({
15151 "node_modules/lodash-es/toPlainObject.js"() {
15154 toPlainObject_default = toPlainObject;
15158 // node_modules/lodash-es/_baseMergeDeep.js
15159 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
15160 var objValue = safeGet_default(object, key), srcValue = safeGet_default(source, key), stacked = stack.get(srcValue);
15162 assignMergeValue_default(object, key, stacked);
15165 var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
15166 var isCommon = newValue === void 0;
15168 var isArr = isArray_default(srcValue), isBuff = !isArr && isBuffer_default(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default(srcValue);
15169 newValue = srcValue;
15170 if (isArr || isBuff || isTyped) {
15171 if (isArray_default(objValue)) {
15172 newValue = objValue;
15173 } else if (isArrayLikeObject_default(objValue)) {
15174 newValue = copyArray_default(objValue);
15175 } else if (isBuff) {
15177 newValue = cloneBuffer_default(srcValue, true);
15178 } else if (isTyped) {
15180 newValue = cloneTypedArray_default(srcValue, true);
15184 } else if (isPlainObject_default(srcValue) || isArguments_default(srcValue)) {
15185 newValue = objValue;
15186 if (isArguments_default(objValue)) {
15187 newValue = toPlainObject_default(objValue);
15188 } else if (!isObject_default(objValue) || isFunction_default(objValue)) {
15189 newValue = initCloneObject_default(srcValue);
15196 stack.set(srcValue, newValue);
15197 mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
15198 stack["delete"](srcValue);
15200 assignMergeValue_default(object, key, newValue);
15202 var baseMergeDeep_default;
15203 var init_baseMergeDeep = __esm({
15204 "node_modules/lodash-es/_baseMergeDeep.js"() {
15205 init_assignMergeValue();
15206 init_cloneBuffer();
15207 init_cloneTypedArray();
15209 init_initCloneObject();
15210 init_isArguments();
15212 init_isArrayLikeObject();
15216 init_isPlainObject();
15217 init_isTypedArray();
15219 init_toPlainObject();
15220 baseMergeDeep_default = baseMergeDeep;
15224 // node_modules/lodash-es/_baseMerge.js
15225 function baseMerge(object, source, srcIndex, customizer, stack) {
15226 if (object === source) {
15229 baseFor_default(source, function(srcValue, key) {
15230 stack || (stack = new Stack_default());
15231 if (isObject_default(srcValue)) {
15232 baseMergeDeep_default(object, source, key, srcIndex, baseMerge, customizer, stack);
15234 var newValue = customizer ? customizer(safeGet_default(object, key), srcValue, key + "", object, source, stack) : void 0;
15235 if (newValue === void 0) {
15236 newValue = srcValue;
15238 assignMergeValue_default(object, key, newValue);
15240 }, keysIn_default);
15242 var baseMerge_default;
15243 var init_baseMerge = __esm({
15244 "node_modules/lodash-es/_baseMerge.js"() {
15246 init_assignMergeValue();
15248 init_baseMergeDeep();
15252 baseMerge_default = baseMerge;
15256 // node_modules/lodash-es/last.js
15257 function last(array2) {
15258 var length2 = array2 == null ? 0 : array2.length;
15259 return length2 ? array2[length2 - 1] : void 0;
15262 var init_last = __esm({
15263 "node_modules/lodash-es/last.js"() {
15264 last_default = last;
15268 // node_modules/lodash-es/_escapeHtmlChar.js
15269 var htmlEscapes, escapeHtmlChar, escapeHtmlChar_default;
15270 var init_escapeHtmlChar = __esm({
15271 "node_modules/lodash-es/_escapeHtmlChar.js"() {
15272 init_basePropertyOf();
15280 escapeHtmlChar = basePropertyOf_default(htmlEscapes);
15281 escapeHtmlChar_default = escapeHtmlChar;
15285 // node_modules/lodash-es/escape.js
15286 function escape2(string) {
15287 string = toString_default(string);
15288 return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar_default) : string;
15290 var reUnescapedHtml, reHasUnescapedHtml, escape_default;
15291 var init_escape = __esm({
15292 "node_modules/lodash-es/escape.js"() {
15293 init_escapeHtmlChar();
15295 reUnescapedHtml = /[&<>"']/g;
15296 reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
15297 escape_default = escape2;
15301 // node_modules/lodash-es/_parent.js
15302 function parent(object, path) {
15303 return path.length < 2 ? object : baseGet_default(object, baseSlice_default(path, 0, -1));
15305 var parent_default;
15306 var init_parent = __esm({
15307 "node_modules/lodash-es/_parent.js"() {
15310 parent_default = parent;
15314 // node_modules/lodash-es/isEmpty.js
15315 function isEmpty(value) {
15316 if (value == null) {
15319 if (isArrayLike_default(value) && (isArray_default(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer_default(value) || isTypedArray_default(value) || isArguments_default(value))) {
15320 return !value.length;
15322 var tag = getTag_default(value);
15323 if (tag == mapTag7 || tag == setTag7) {
15324 return !value.size;
15326 if (isPrototype_default(value)) {
15327 return !baseKeys_default(value).length;
15329 for (var key in value) {
15330 if (hasOwnProperty14.call(value, key)) {
15336 var mapTag7, setTag7, objectProto17, hasOwnProperty14, isEmpty_default;
15337 var init_isEmpty = __esm({
15338 "node_modules/lodash-es/isEmpty.js"() {
15341 init_isArguments();
15343 init_isArrayLike();
15345 init_isPrototype();
15346 init_isTypedArray();
15347 mapTag7 = "[object Map]";
15348 setTag7 = "[object Set]";
15349 objectProto17 = Object.prototype;
15350 hasOwnProperty14 = objectProto17.hasOwnProperty;
15351 isEmpty_default = isEmpty;
15355 // node_modules/lodash-es/isEqual.js
15356 function isEqual(value, other) {
15357 return baseIsEqual_default(value, other);
15359 var isEqual_default;
15360 var init_isEqual = __esm({
15361 "node_modules/lodash-es/isEqual.js"() {
15362 init_baseIsEqual();
15363 isEqual_default = isEqual;
15367 // node_modules/lodash-es/isNumber.js
15368 function isNumber(value) {
15369 return typeof value == "number" || isObjectLike_default(value) && baseGetTag_default(value) == numberTag5;
15371 var numberTag5, isNumber_default;
15372 var init_isNumber = __esm({
15373 "node_modules/lodash-es/isNumber.js"() {
15375 init_isObjectLike();
15376 numberTag5 = "[object Number]";
15377 isNumber_default = isNumber;
15381 // node_modules/lodash-es/merge.js
15382 var merge2, merge_default3;
15383 var init_merge4 = __esm({
15384 "node_modules/lodash-es/merge.js"() {
15386 init_createAssigner();
15387 merge2 = createAssigner_default(function(object, source, srcIndex) {
15388 baseMerge_default(object, source, srcIndex);
15390 merge_default3 = merge2;
15394 // node_modules/lodash-es/_baseUnset.js
15395 function baseUnset(object, path) {
15396 path = castPath_default(path, object);
15397 object = parent_default(object, path);
15398 return object == null || delete object[toKey_default(last_default(path))];
15400 var baseUnset_default;
15401 var init_baseUnset = __esm({
15402 "node_modules/lodash-es/_baseUnset.js"() {
15407 baseUnset_default = baseUnset;
15411 // node_modules/lodash-es/_customOmitClone.js
15412 function customOmitClone(value) {
15413 return isPlainObject_default(value) ? void 0 : value;
15415 var customOmitClone_default;
15416 var init_customOmitClone = __esm({
15417 "node_modules/lodash-es/_customOmitClone.js"() {
15418 init_isPlainObject();
15419 customOmitClone_default = customOmitClone;
15423 // node_modules/lodash-es/omit.js
15424 var CLONE_DEEP_FLAG2, CLONE_FLAT_FLAG2, CLONE_SYMBOLS_FLAG2, omit, omit_default;
15425 var init_omit = __esm({
15426 "node_modules/lodash-es/omit.js"() {
15432 init_customOmitClone();
15434 init_getAllKeysIn();
15435 CLONE_DEEP_FLAG2 = 1;
15436 CLONE_FLAT_FLAG2 = 2;
15437 CLONE_SYMBOLS_FLAG2 = 4;
15438 omit = flatRest_default(function(object, paths) {
15440 if (object == null) {
15443 var isDeep = false;
15444 paths = arrayMap_default(paths, function(path) {
15445 path = castPath_default(path, object);
15446 isDeep || (isDeep = path.length > 1);
15449 copyObject_default(object, getAllKeysIn_default(object), result);
15451 result = baseClone_default(result, CLONE_DEEP_FLAG2 | CLONE_FLAT_FLAG2 | CLONE_SYMBOLS_FLAG2, customOmitClone_default);
15453 var length2 = paths.length;
15454 while (length2--) {
15455 baseUnset_default(result, paths[length2]);
15459 omit_default = omit;
15463 // node_modules/lodash-es/throttle.js
15464 function throttle(func, wait, options) {
15465 var leading = true, trailing = true;
15466 if (typeof func != "function") {
15467 throw new TypeError(FUNC_ERROR_TEXT3);
15469 if (isObject_default(options)) {
15470 leading = "leading" in options ? !!options.leading : leading;
15471 trailing = "trailing" in options ? !!options.trailing : trailing;
15473 return debounce_default(func, wait, {
15474 "leading": leading,
15476 "trailing": trailing
15479 var FUNC_ERROR_TEXT3, throttle_default;
15480 var init_throttle = __esm({
15481 "node_modules/lodash-es/throttle.js"() {
15484 FUNC_ERROR_TEXT3 = "Expected a function";
15485 throttle_default = throttle;
15489 // node_modules/lodash-es/_unescapeHtmlChar.js
15490 var htmlUnescapes, unescapeHtmlChar, unescapeHtmlChar_default;
15491 var init_unescapeHtmlChar = __esm({
15492 "node_modules/lodash-es/_unescapeHtmlChar.js"() {
15493 init_basePropertyOf();
15501 unescapeHtmlChar = basePropertyOf_default(htmlUnescapes);
15502 unescapeHtmlChar_default = unescapeHtmlChar;
15506 // node_modules/lodash-es/unescape.js
15507 function unescape(string) {
15508 string = toString_default(string);
15509 return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar_default) : string;
15511 var reEscapedHtml, reHasEscapedHtml, unescape_default;
15512 var init_unescape = __esm({
15513 "node_modules/lodash-es/unescape.js"() {
15515 init_unescapeHtmlChar();
15516 reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g;
15517 reHasEscapedHtml = RegExp(reEscapedHtml.source);
15518 unescape_default = unescape;
15522 // node_modules/lodash-es/lodash.js
15523 var init_lodash = __esm({
15524 "node_modules/lodash-es/lodash.js"() {
15537 // modules/util/detect.js
15538 var detect_exports = {};
15539 __export(detect_exports, {
15540 utilDetect: () => utilDetect
15542 function utilDetect(refresh2) {
15543 if (_detected && !refresh2) return _detected;
15545 const ua = navigator.userAgent;
15547 m3 = ua.match(/(edge)\/?\s*(\.?\d+(\.\d+)*)/i);
15549 _detected.browser = m3[1];
15550 _detected.version = m3[2];
15552 if (!_detected.browser) {
15553 m3 = ua.match(/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/i);
15555 _detected.browser = "msie";
15556 _detected.version = m3[1];
15559 if (!_detected.browser) {
15560 m3 = ua.match(/(opr)\/?\s*(\.?\d+(\.\d+)*)/i);
15562 _detected.browser = "Opera";
15563 _detected.version = m3[2];
15566 if (!_detected.browser) {
15567 m3 = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
15569 _detected.browser = m3[1];
15570 _detected.version = m3[2];
15571 m3 = ua.match(/version\/([\.\d]+)/i);
15572 if (m3 !== null) _detected.version = m3[1];
15575 if (!_detected.browser) {
15576 _detected.browser = navigator.appName;
15577 _detected.version = navigator.appVersion;
15579 _detected.version = _detected.version.split(/\W/).slice(0, 2).join(".");
15580 _detected.opera = _detected.browser.toLowerCase() === "opera" && Number(_detected.version) < 15;
15581 if (_detected.browser.toLowerCase() === "msie") {
15582 _detected.ie = true;
15583 _detected.browser = "Internet Explorer";
15584 _detected.support = false;
15586 _detected.ie = false;
15587 _detected.support = true;
15589 _detected.filedrop = window.FileReader && "ondrop" in window;
15590 if (/Win/.test(ua)) {
15591 _detected.os = "win";
15592 _detected.platform = "Windows";
15593 } else if (/Mac/.test(ua)) {
15594 _detected.os = "mac";
15595 _detected.platform = "Macintosh";
15596 } else if (/X11/.test(ua) || /Linux/.test(ua)) {
15597 _detected.os = "linux";
15598 _detected.platform = "Linux";
15600 _detected.os = "win";
15601 _detected.platform = "Unknown";
15603 _detected.isMobileWebKit = (/\b(iPad|iPhone|iPod)\b/.test(ua) || // HACK: iPadOS 13+ requests desktop sites by default by using a Mac user agent,
15604 // so assume any "mac" with multitouch is actually iOS
15605 navigator.platform === "MacIntel" && "maxTouchPoints" in navigator && navigator.maxTouchPoints > 1) && /WebKit/.test(ua) && !/Edge/.test(ua) && !window.MSStream;
15606 _detected.browserLocales = Array.from(new Set(
15607 // remove duplicates
15608 [navigator.language].concat(navigator.languages || []).concat([
15609 // old property for backwards compatibility
15610 navigator.userLanguage
15615 loc = window.top.location;
15617 loc = window.location;
15619 _detected.host = loc.origin + loc.pathname;
15623 var init_detect = __esm({
15624 "modules/util/detect.js"() {
15629 // modules/core/localizer.js
15630 var localizer_exports = {};
15631 __export(localizer_exports, {
15632 coreLocalizer: () => coreLocalizer,
15633 localizer: () => _mainLocalizer,
15636 function coreLocalizer() {
15637 let localizer = {};
15638 let _dataLanguages = {};
15639 let _dataLocales = {};
15640 let _localeStrings = {};
15641 let _localeCode = "en-US";
15642 let _localeCodes = ["en-US", "en"];
15643 let _languageCode = "en";
15644 let _textDirection = "ltr";
15645 let _usesMetric = false;
15646 let _languageNames = {};
15647 let _scriptNames = {};
15648 localizer.localeCode = () => _localeCode;
15649 localizer.localeCodes = () => _localeCodes;
15650 localizer.languageCode = () => _languageCode;
15651 localizer.textDirection = () => _textDirection;
15652 localizer.usesMetric = () => _usesMetric;
15653 localizer.languageNames = () => _languageNames;
15654 localizer.scriptNames = () => _scriptNames;
15655 let _preferredLocaleCodes = [];
15656 localizer.preferredLocaleCodes = function(codes) {
15657 if (!arguments.length) return _preferredLocaleCodes;
15658 if (typeof codes === "string") {
15659 _preferredLocaleCodes = codes.split(/,|;| /gi).filter(Boolean);
15661 _preferredLocaleCodes = codes;
15666 localizer.ensureLoaded = () => {
15667 if (_loadPromise) return _loadPromise;
15668 let filesToFetch = [
15670 // load the list of languages
15672 // load the list of supported locales
15674 const localeDirs = {
15675 general: "locales",
15676 tagging: presetsCdnUrl + "dist/translations"
15678 let fileMap = _mainFileFetcher.fileMap();
15679 for (let scopeId in localeDirs) {
15680 const key = `locales_index_${scopeId}`;
15681 if (!fileMap[key]) {
15682 fileMap[key] = localeDirs[scopeId] + "/index.min.json";
15684 filesToFetch.push(key);
15686 return _loadPromise = Promise.all(filesToFetch.map((key) => _mainFileFetcher.get(key))).then((results) => {
15687 _dataLanguages = results[0];
15688 _dataLocales = results[1];
15689 let indexes = results.slice(2);
15690 _localeCodes = localizer.localesToUseFrom(_dataLocales);
15691 _localeCode = _localeCodes[0];
15692 let loadStringsPromises = [];
15693 indexes.forEach((index, i3) => {
15694 const fullCoverageIndex = _localeCodes.findIndex(function(locale3) {
15695 return index[locale3] && index[locale3].pct === 1;
15697 _localeCodes.slice(0, fullCoverageIndex + 1).forEach(function(code) {
15698 let scopeId = Object.keys(localeDirs)[i3];
15699 let directory = Object.values(localeDirs)[i3];
15700 if (index[code]) loadStringsPromises.push(localizer.loadLocale(code, scopeId, directory));
15703 return Promise.all(loadStringsPromises);
15705 updateForCurrentLocale();
15706 }).catch((err) => console.error(err));
15708 localizer.localesToUseFrom = (supportedLocales) => {
15709 const requestedLocales = [
15710 ..._preferredLocaleCodes || [],
15711 ...utilDetect().browserLocales,
15712 // List of locales preferred by the browser in priority order.
15714 // fallback to English since it's the only guaranteed complete language
15717 for (const locale3 of requestedLocales) {
15718 if (supportedLocales[locale3]) toUse.push(locale3);
15719 if ("Intl" in window && "Locale" in window.Intl) {
15720 const localeObj = new Intl.Locale(locale3);
15721 const withoutScript = `${localeObj.language}-${localeObj.region}`;
15722 const base = localeObj.language;
15723 if (supportedLocales[withoutScript]) toUse.push(withoutScript);
15724 if (supportedLocales[base]) toUse.push(base);
15725 } else if (locale3.includes("-")) {
15726 let langPart = locale3.split("-")[0];
15727 if (supportedLocales[langPart]) toUse.push(langPart);
15730 return utilArrayUniq(toUse);
15732 function updateForCurrentLocale() {
15733 if (!_localeCode) return;
15734 _languageCode = _localeCode.split("-")[0];
15735 const currentData = _dataLocales[_localeCode] || _dataLocales[_languageCode];
15736 const hash2 = utilStringQs(window.location.hash);
15737 if (hash2.rtl === "true") {
15738 _textDirection = "rtl";
15739 } else if (hash2.rtl === "false") {
15740 _textDirection = "ltr";
15742 _textDirection = currentData && currentData.rtl ? "rtl" : "ltr";
15744 let locale3 = _localeCode;
15745 if (locale3.toLowerCase() === "en-us") locale3 = "en";
15746 _languageNames = _localeStrings.general[locale3].languageNames || _localeStrings.general[_languageCode].languageNames;
15747 _scriptNames = _localeStrings.general[locale3].scriptNames || _localeStrings.general[_languageCode].scriptNames;
15748 _usesMetric = _localeCode.slice(-3).toLowerCase() !== "-us";
15750 localizer.loadLocale = (locale3, scopeId, directory) => {
15751 if (locale3.toLowerCase() === "en-us") locale3 = "en";
15752 if (_localeStrings[scopeId] && _localeStrings[scopeId][locale3]) {
15753 return Promise.resolve(locale3);
15755 let fileMap = _mainFileFetcher.fileMap();
15756 const key = `locale_${scopeId}_${locale3}`;
15757 if (!fileMap[key]) {
15758 fileMap[key] = `${directory}/${locale3}.min.json`;
15760 return _mainFileFetcher.get(key).then((d4) => {
15761 if (!_localeStrings[scopeId]) _localeStrings[scopeId] = {};
15762 _localeStrings[scopeId][locale3] = d4[locale3];
15766 localizer.pluralRule = function(number3) {
15767 return pluralRule(number3, _localeCode);
15769 function pluralRule(number3, localeCode) {
15770 const rules = "Intl" in window && Intl.PluralRules && new Intl.PluralRules(localeCode);
15772 return rules.select(number3);
15774 if (number3 === 1) return "one";
15777 localizer.tInfo = function(origStringId, replacements, locale3) {
15778 let stringId = origStringId.trim();
15779 let scopeId = "general";
15780 if (stringId[0] === "_") {
15781 let split = stringId.split(".");
15782 scopeId = split[0].slice(1);
15783 stringId = split.slice(1).join(".");
15785 locale3 = locale3 || _localeCode;
15786 let path = stringId.split(".").map((s2) => s2.replace(/<TX_DOT>/g, ".")).reverse();
15787 let stringsKey = locale3;
15788 if (stringsKey.toLowerCase() === "en-us") stringsKey = "en";
15789 let result = _localeStrings && _localeStrings[scopeId] && _localeStrings[scopeId][stringsKey];
15790 while (result !== void 0 && path.length) {
15791 result = result[path.pop()];
15793 if (result !== void 0) {
15794 if (replacements) {
15795 if (typeof result === "object" && Object.keys(result).length) {
15796 const number3 = Object.values(replacements).find(function(value) {
15797 return typeof value === "number";
15799 if (number3 !== void 0) {
15800 const rule = pluralRule(number3, locale3);
15801 if (result[rule]) {
15802 result = result[rule];
15804 result = Object.values(result)[0];
15808 if (typeof result === "string") {
15809 for (let key in replacements) {
15810 let value = replacements[key];
15811 if (typeof value === "number") {
15812 if (value.toLocaleString) {
15813 value = value.toLocaleString(locale3, {
15816 minimumFractionDigits: 0
15819 value = value.toString();
15822 const token = `{${key}}`;
15823 const regex = new RegExp(token, "g");
15824 result = result.replace(regex, value);
15828 if (typeof result === "string") {
15835 let index = _localeCodes.indexOf(locale3);
15836 if (index >= 0 && index < _localeCodes.length - 1) {
15837 let fallback = _localeCodes[index + 1];
15838 return localizer.tInfo(origStringId, replacements, fallback);
15840 if (replacements && "default" in replacements) {
15842 text: replacements.default,
15846 const missing = `Missing ${locale3} translation: ${origStringId}`;
15847 if (typeof console !== "undefined") console.error(missing);
15853 localizer.hasTextForStringId = function(stringId) {
15854 return !!localizer.tInfo(stringId, { default: "nothing found" }).locale;
15856 localizer.t = function(stringId, replacements, locale3) {
15857 return localizer.tInfo(stringId, replacements, locale3).text;
15859 localizer.t.html = function(stringId, replacements, locale3) {
15860 replacements = Object.assign({}, replacements);
15861 for (var k2 in replacements) {
15862 if (typeof replacements[k2] === "string") {
15863 replacements[k2] = escape_default(replacements[k2]);
15865 if (typeof replacements[k2] === "object" && typeof replacements[k2].html === "string") {
15866 replacements[k2] = replacements[k2].html;
15869 const info = localizer.tInfo(stringId, replacements, locale3);
15871 return `<span class="localized-text" lang="${info.locale || "und"}">${info.text}</span>`;
15876 localizer.t.append = function(stringId, replacements, locale3) {
15877 const ret = function(selection2) {
15878 const info = localizer.tInfo(stringId, replacements, locale3);
15879 return selection2.append("span").attr("class", "localized-text").attr("lang", info.locale || "und").text((replacements && replacements.prefix || "") + info.text + (replacements && replacements.suffix || ""));
15881 ret.stringId = stringId;
15884 localizer.t.addOrUpdate = function(stringId, replacements, locale3) {
15885 const ret = function(selection2) {
15886 const info = localizer.tInfo(stringId, replacements, locale3);
15887 const span = selection2.selectAll("span.localized-text").data([info]);
15888 const enter = span.enter().append("span").classed("localized-text", true);
15889 span.merge(enter).attr("lang", info.locale || "und").text((replacements && replacements.prefix || "") + info.text + (replacements && replacements.suffix || ""));
15891 ret.stringId = stringId;
15894 localizer.languageName = (code, options) => {
15895 if (_languageNames && _languageNames[code]) {
15896 return _languageNames[code];
15898 if (options && options.localOnly) return null;
15899 const langInfo = _dataLanguages[code];
15901 if (langInfo.nativeName) {
15902 return localizer.t("translate.language_and_code", { language: langInfo.nativeName, code });
15903 } else if (langInfo.base && langInfo.script) {
15904 const base = langInfo.base;
15905 if (_languageNames && _languageNames[base]) {
15906 const scriptCode = langInfo.script;
15907 const script = _scriptNames && _scriptNames[scriptCode] || scriptCode;
15908 return localizer.t("translate.language_and_code", { language: _languageNames[base], code: script });
15909 } else if (_dataLanguages[base] && _dataLanguages[base].nativeName) {
15910 return localizer.t("translate.language_and_code", { language: _dataLanguages[base].nativeName, code });
15916 localizer.floatFormatter = (locale3) => {
15917 if (!("Intl" in window && "NumberFormat" in Intl && "formatToParts" in Intl.NumberFormat.prototype)) {
15918 return (number3, fractionDigits) => {
15919 return fractionDigits === void 0 ? number3.toString() : number3.toFixed(fractionDigits);
15922 return (number3, fractionDigits) => number3.toLocaleString(locale3, {
15923 minimumFractionDigits: fractionDigits,
15924 maximumFractionDigits: fractionDigits === void 0 ? 20 : fractionDigits
15928 localizer.floatParser = (locale3) => {
15929 const polyfill = (string) => +string.trim();
15930 if (!("Intl" in window && "NumberFormat" in Intl)) return polyfill;
15931 const format2 = new Intl.NumberFormat(locale3, { maximumFractionDigits: 20 });
15932 if (!("formatToParts" in format2)) return polyfill;
15933 const parts = format2.formatToParts(-12345.6);
15934 const numerals = Array.from({ length: 10 }).map((_3, i3) => format2.format(i3));
15935 const index = new Map(numerals.map((d4, i3) => [d4, i3]));
15936 const literalPart = parts.find((d4) => d4.type === "literal");
15937 const literal = literalPart && new RegExp(`[${literalPart.value}]`, "g");
15938 const groupPart = parts.find((d4) => d4.type === "group");
15939 const group = groupPart && new RegExp(`[${groupPart.value}]`, "g");
15940 const decimalPart = parts.find((d4) => d4.type === "decimal");
15941 const decimal = decimalPart && new RegExp(`[${decimalPart.value}]`);
15942 const numeral = new RegExp(`[${numerals.join("")}]`, "g");
15943 const getIndex = (d4) => index.get(d4);
15944 return (string) => {
15945 string = string.trim();
15946 if (literal) string = string.replace(literal, "");
15947 if (group) string = string.replace(group, "");
15948 if (decimal) string = string.replace(decimal, ".");
15949 string = string.replace(numeral, getIndex);
15950 return string ? +string : NaN;
15953 localizer.decimalPlaceCounter = (locale3) => {
15954 var literal, group, decimal;
15955 if ("Intl" in window && "NumberFormat" in Intl) {
15956 const format2 = new Intl.NumberFormat(locale3, { maximumFractionDigits: 20 });
15957 if ("formatToParts" in format2) {
15958 const parts = format2.formatToParts(-12345.6);
15959 const literalPart = parts.find((d4) => d4.type === "literal");
15960 literal = literalPart && new RegExp(`[${literalPart.value}]`, "g");
15961 const groupPart = parts.find((d4) => d4.type === "group");
15962 group = groupPart && new RegExp(`[${groupPart.value}]`, "g");
15963 const decimalPart = parts.find((d4) => d4.type === "decimal");
15964 decimal = decimalPart && new RegExp(`[${decimalPart.value}]`);
15967 return (string) => {
15968 string = string.trim();
15969 if (literal) string = string.replace(literal, "");
15970 if (group) string = string.replace(group, "");
15971 const parts = string.split(decimal || ".");
15972 return parts && parts[1] && parts[1].length || 0;
15977 var _mainLocalizer, _t;
15978 var init_localizer = __esm({
15979 "modules/core/localizer.js"() {
15982 init_file_fetcher();
15987 _mainLocalizer = coreLocalizer();
15988 _t = _mainLocalizer.t;
15992 // modules/util/util.js
15993 var util_exports = {};
15994 __export(util_exports, {
15995 utilAsyncMap: () => utilAsyncMap,
15996 utilCleanOsmString: () => utilCleanOsmString,
15997 utilCombinedTags: () => utilCombinedTags,
15998 utilCompareIDs: () => utilCompareIDs,
15999 utilDeepMemberSelector: () => utilDeepMemberSelector,
16000 utilDisplayName: () => utilDisplayName,
16001 utilDisplayNameForPath: () => utilDisplayNameForPath,
16002 utilDisplayType: () => utilDisplayType,
16003 utilEditDistance: () => utilEditDistance,
16004 utilEntityAndDeepMemberIDs: () => utilEntityAndDeepMemberIDs,
16005 utilEntityOrDeepMemberSelector: () => utilEntityOrDeepMemberSelector,
16006 utilEntityOrMemberSelector: () => utilEntityOrMemberSelector,
16007 utilEntityRoot: () => utilEntityRoot,
16008 utilEntitySelector: () => utilEntitySelector,
16009 utilFastMouse: () => utilFastMouse,
16010 utilFunctor: () => utilFunctor,
16011 utilGetAllNodes: () => utilGetAllNodes,
16012 utilHashcode: () => utilHashcode,
16013 utilHighlightEntities: () => utilHighlightEntities,
16014 utilNoAuto: () => utilNoAuto,
16015 utilOldestID: () => utilOldestID,
16016 utilPrefixCSSProperty: () => utilPrefixCSSProperty,
16017 utilPrefixDOMProperty: () => utilPrefixDOMProperty,
16018 utilQsString: () => utilQsString,
16019 utilSafeClassName: () => utilSafeClassName,
16020 utilSetTransform: () => utilSetTransform,
16021 utilStringQs: () => utilStringQs,
16022 utilTagDiff: () => utilTagDiff,
16023 utilTagText: () => utilTagText,
16024 utilTotalExtent: () => utilTotalExtent,
16025 utilUnicodeCharsCount: () => utilUnicodeCharsCount,
16026 utilUnicodeCharsTruncated: () => utilUnicodeCharsTruncated,
16027 utilUniqueDomId: () => utilUniqueDomId,
16028 utilWrap: () => utilWrap
16030 function utilTagText(entity) {
16031 var obj = entity && entity.tags || {};
16032 return Object.keys(obj).map(function(k2) {
16033 return k2 + "=" + obj[k2];
16036 function utilTotalExtent(array2, graph) {
16037 var extent = geoExtent();
16039 for (var i3 = 0; i3 < array2.length; i3++) {
16041 entity = typeof val === "string" ? graph.hasEntity(val) : val;
16043 extent._extend(entity.extent(graph));
16048 function utilTagDiff(oldTags, newTags) {
16050 var keys2 = utilArrayUnion(Object.keys(oldTags), Object.keys(newTags)).sort();
16051 keys2.forEach(function(k2) {
16052 var oldVal = oldTags[k2];
16053 var newVal = newTags[k2];
16054 if ((oldVal || oldVal === "") && (newVal === void 0 || newVal !== oldVal)) {
16060 display: "- " + k2 + "=" + oldVal
16063 if ((newVal || newVal === "") && (oldVal === void 0 || newVal !== oldVal)) {
16069 display: "+ " + k2 + "=" + newVal
16075 function utilEntitySelector(ids) {
16076 return ids.length ? "." + ids.join(",.") : "nothing";
16078 function utilEntityOrMemberSelector(ids, graph) {
16079 var seen = new Set(ids);
16080 ids.forEach(collectShallowDescendants);
16081 return utilEntitySelector(Array.from(seen));
16082 function collectShallowDescendants(id2) {
16083 var entity = graph.hasEntity(id2);
16084 if (!entity || entity.type !== "relation") return;
16085 entity.members.map(function(member) {
16087 }).forEach(function(id3) {
16092 function utilEntityOrDeepMemberSelector(ids, graph) {
16093 return utilEntitySelector(utilEntityAndDeepMemberIDs(ids, graph));
16095 function utilEntityAndDeepMemberIDs(ids, graph) {
16096 var seen = /* @__PURE__ */ new Set();
16097 ids.forEach(collectDeepDescendants);
16098 return Array.from(seen);
16099 function collectDeepDescendants(id2) {
16100 if (seen.has(id2)) return;
16102 var entity = graph.hasEntity(id2);
16103 if (!entity || entity.type !== "relation") return;
16104 entity.members.map(function(member) {
16106 }).forEach(collectDeepDescendants);
16109 function utilDeepMemberSelector(ids, graph, skipMultipolgonMembers) {
16110 var idsSet = new Set(ids);
16111 var seen = /* @__PURE__ */ new Set();
16112 var returners = /* @__PURE__ */ new Set();
16113 ids.forEach(collectDeepDescendants);
16114 return utilEntitySelector(Array.from(returners));
16115 function collectDeepDescendants(id2) {
16116 if (seen.has(id2)) return;
16118 if (!idsSet.has(id2)) {
16119 returners.add(id2);
16121 var entity = graph.hasEntity(id2);
16122 if (!entity || entity.type !== "relation") return;
16123 if (skipMultipolgonMembers && entity.isMultipolygon()) return;
16124 entity.members.map(function(member) {
16126 }).forEach(collectDeepDescendants);
16129 function utilHighlightEntities(ids, highlighted, context) {
16130 context.surface().selectAll(utilEntityOrDeepMemberSelector(ids, context.graph())).classed("highlighted", highlighted);
16132 function utilGetAllNodes(ids, graph) {
16133 var seen = /* @__PURE__ */ new Set();
16134 var nodes = /* @__PURE__ */ new Set();
16135 ids.forEach(collectNodes);
16136 return Array.from(nodes);
16137 function collectNodes(id2) {
16138 if (seen.has(id2)) return;
16140 var entity = graph.hasEntity(id2);
16141 if (!entity) return;
16142 if (entity.type === "node") {
16144 } else if (entity.type === "way") {
16145 entity.nodes.forEach(collectNodes);
16147 entity.members.map(function(member) {
16149 }).forEach(collectNodes);
16153 function utilDisplayName(entity, hideNetwork, isMapLabel) {
16154 var localizedNameKey = "name:" + _mainLocalizer.languageCode().toLowerCase();
16155 var name = entity.tags[localizedNameKey] || entity.tags.name || "";
16157 direction: entity.tags.direction,
16158 from: entity.tags.from,
16160 network: hideNetwork ? void 0 : entity.tags.cycle_network || entity.tags.network,
16161 ref: entity.tags.ref,
16162 to: entity.tags.to,
16163 via: entity.tags.via
16165 if (entity.tags.route && entity.tags.name && entity.tags.name.match(/[→⇒↔⇔]|[-=]>/)) {
16166 return entity.tags.name;
16168 if (!entity.tags.route && name) {
16171 var keyComponents = [];
16172 if (tags.network) {
16173 keyComponents.push("network");
16176 keyComponents.push("ref");
16179 keyComponents.push("name");
16181 if (entity.tags.route) {
16182 if (tags.direction) {
16183 keyComponents.push("direction");
16184 } else if (tags.from && tags.to) {
16185 keyComponents.push("from");
16186 keyComponents.push("to");
16188 keyComponents.push("via");
16192 if (keyComponents.length) {
16193 return _t("inspector.display_name." + keyComponents.join("_"), tags);
16195 const alternativeNameKeys = [
16206 if (entity.tags.highway === "milestone" || entity.tags.railway === "milestone") {
16207 alternativeNameKeys.push("distance", "railway:position");
16209 for (const key of alternativeNameKeys) {
16210 if (key in entity.tags) {
16211 return entity.tags[key];
16214 const unit2 = entity.tags["addr:unit"];
16215 const housenumber = entity.tags["addr:housenumber"];
16216 const streetOrPlace = entity.tags["addr:street"] || entity.tags["addr:place"];
16217 if (!isMapLabel && unit2 && housenumber && streetOrPlace) {
16218 return _t("inspector.display_name_addr_with_unit", {
16224 if (!isMapLabel && housenumber && streetOrPlace) {
16225 return _t("inspector.display_name_addr", {
16230 if (housenumber) return housenumber;
16233 function utilDisplayNameForPath(entity) {
16234 var name = utilDisplayName(entity, void 0, true);
16235 var isFirefox = utilDetect().browser.toLowerCase().indexOf("firefox") > -1;
16236 var isNewChromium = Number(utilDetect().version.split(".")[0]) >= 96;
16237 if (!isFirefox && !isNewChromium && name && rtlRegex.test(name)) {
16238 name = fixRTLTextForSvg(name);
16242 function utilDisplayType(id2) {
16244 n: _t("inspector.node"),
16245 w: _t("inspector.way"),
16246 r: _t("inspector.relation")
16249 function utilEntityRoot(entityType) {
16256 function utilCombinedTags(entityIDs, graph) {
16258 var tagCounts = {};
16259 var allKeys = /* @__PURE__ */ new Set();
16261 var entities = entityIDs.map(function(entityID) {
16262 return graph.hasEntity(entityID);
16263 }).filter(Boolean);
16264 entities.forEach(function(entity) {
16265 var keys2 = Object.keys(entity.tags).filter(Boolean);
16266 keys2.forEach(function(key2) {
16270 entities.forEach(function(entity) {
16271 allTags.push(entity.tags);
16272 allKeys.forEach(function(key2) {
16273 var value = entity.tags[key2];
16274 if (!tags.hasOwnProperty(key2)) {
16275 tags[key2] = value;
16277 if (!Array.isArray(tags[key2])) {
16278 if (tags[key2] !== value) {
16279 tags[key2] = [tags[key2], value];
16282 if (tags[key2].indexOf(value) === -1) {
16283 tags[key2].push(value);
16287 var tagHash = key2 + "=" + value;
16288 if (!tagCounts[tagHash]) tagCounts[tagHash] = 0;
16289 tagCounts[tagHash] += 1;
16292 for (var key in tags) {
16293 if (!Array.isArray(tags[key])) continue;
16294 tags[key] = tags[key].sort(function(val12, val2) {
16296 var count2 = tagCounts[key2 + "=" + val2];
16297 var count1 = tagCounts[key2 + "=" + val12];
16298 if (count2 !== count1) {
16299 return count2 - count1;
16301 if (val2 && val12) {
16302 return val12.localeCompare(val2);
16304 return val12 ? 1 : -1;
16307 tags = Object.defineProperty(tags, Symbol.for("allTags"), { enumerable: false, value: allTags });
16310 function utilStringQs(str) {
16311 str = str.replace(/^[#?]{0,2}/, "");
16312 return Object.fromEntries(new URLSearchParams(str));
16314 function utilQsString(obj, softEncode) {
16315 let str = new URLSearchParams(obj).toString();
16317 str = str.replace(/(%2F|%3A|%2C|%7B|%7D)/g, decodeURIComponent);
16321 function utilPrefixDOMProperty(property) {
16322 var prefixes2 = ["webkit", "ms", "moz", "o"];
16324 var n3 = prefixes2.length;
16325 var s2 = document.body;
16326 if (property in s2) return property;
16327 property = property.slice(0, 1).toUpperCase() + property.slice(1);
16328 while (++i3 < n3) {
16329 if (prefixes2[i3] + property in s2) {
16330 return prefixes2[i3] + property;
16335 function utilPrefixCSSProperty(property) {
16336 var prefixes2 = ["webkit", "ms", "Moz", "O"];
16338 var n3 = prefixes2.length;
16339 var s2 = document.body.style;
16340 if (property.toLowerCase() in s2) {
16341 return property.toLowerCase();
16343 while (++i3 < n3) {
16344 if (prefixes2[i3] + property in s2) {
16345 return "-" + prefixes2[i3].toLowerCase() + property.replace(/([A-Z])/g, "-$1").toLowerCase();
16350 function utilSetTransform(el, x2, y3, scale) {
16351 var prop = transformProperty = transformProperty || utilPrefixCSSProperty("Transform");
16352 var translate = utilDetect().opera ? "translate(" + x2 + "px," + y3 + "px)" : "translate3d(" + x2 + "px," + y3 + "px,0)";
16353 return el.style(prop, translate + (scale ? " scale(" + scale + ")" : ""));
16355 function utilEditDistance(a2, b3) {
16356 a2 = (0, import_diacritics.remove)(a2.toLowerCase());
16357 b3 = (0, import_diacritics.remove)(b3.toLowerCase());
16358 if (a2.length === 0) return b3.length;
16359 if (b3.length === 0) return a2.length;
16362 for (i3 = 0; i3 <= b3.length; i3++) {
16365 for (j3 = 0; j3 <= a2.length; j3++) {
16366 matrix[0][j3] = j3;
16368 for (i3 = 1; i3 <= b3.length; i3++) {
16369 for (j3 = 1; j3 <= a2.length; j3++) {
16370 if (b3.charAt(i3 - 1) === a2.charAt(j3 - 1)) {
16371 matrix[i3][j3] = matrix[i3 - 1][j3 - 1];
16373 matrix[i3][j3] = Math.min(
16374 matrix[i3 - 1][j3 - 1] + 1,
16377 matrix[i3][j3 - 1] + 1,
16379 matrix[i3 - 1][j3] + 1
16385 return matrix[b3.length][a2.length];
16387 function utilFastMouse(container) {
16388 var rect = container.getBoundingClientRect();
16389 var rectLeft = rect.left;
16390 var rectTop = rect.top;
16391 var clientLeft = +container.clientLeft;
16392 var clientTop = +container.clientTop;
16393 return function(e3) {
16395 e3.clientX - rectLeft - clientLeft,
16396 e3.clientY - rectTop - clientTop
16400 function utilAsyncMap(inputs, func, callback) {
16401 var remaining = inputs.length;
16404 inputs.forEach(function(d4, i3) {
16405 func(d4, function done(err, data) {
16407 results[i3] = data;
16409 if (!remaining) callback(errors, results);
16413 function utilWrap(index, length2) {
16415 index += Math.ceil(-index / length2) * length2;
16417 return index % length2;
16419 function utilFunctor(value) {
16420 if (typeof value === "function") return value;
16421 return function() {
16425 function utilNoAuto(selection2) {
16426 var isText = selection2.size() && selection2.node().tagName.toLowerCase() === "textarea";
16427 return selection2.attr("autocomplete", "new-password").attr("autocorrect", "off").attr("autocapitalize", "off").attr("data-1p-ignore", "true").attr("data-bwignore", "true").attr("data-form-type", "other").attr("data-lpignore", "true").attr("spellcheck", isText ? "true" : "false");
16429 function utilHashcode(str) {
16431 if (str.length === 0) {
16434 for (var i3 = 0; i3 < str.length; i3++) {
16435 var char = str.charCodeAt(i3);
16436 hash2 = (hash2 << 5) - hash2 + char;
16437 hash2 = hash2 & hash2;
16441 function utilSafeClassName(str) {
16442 return str.toLowerCase().replace(/[^a-z0-9]+/g, "_");
16444 function utilUniqueDomId(val) {
16445 return "ideditor-" + utilSafeClassName(val.toString()) + "-" + (/* @__PURE__ */ new Date()).getTime().toString();
16447 function utilUnicodeCharsCount(str) {
16448 return Array.from(str).length;
16450 function utilUnicodeCharsTruncated(str, limit) {
16451 return Array.from(str).slice(0, limit).join("");
16453 function toNumericID(id2) {
16454 var match = id2.match(/^[cnwr](-?\d+)$/);
16456 return parseInt(match[1], 10);
16460 function compareNumericIDs(left, right) {
16461 if (isNaN(left) && isNaN(right)) return -1;
16462 if (isNaN(left)) return 1;
16463 if (isNaN(right)) return -1;
16464 if (Math.sign(left) !== Math.sign(right)) return -Math.sign(left);
16465 if (Math.sign(left) < 0) return Math.sign(right - left);
16466 return Math.sign(left - right);
16468 function utilCompareIDs(left, right) {
16469 return compareNumericIDs(toNumericID(left), toNumericID(right));
16471 function utilOldestID(ids) {
16472 if (ids.length === 0) {
16475 var oldestIDIndex = 0;
16476 var oldestID = toNumericID(ids[0]);
16477 for (var i3 = 1; i3 < ids.length; i3++) {
16478 var num = toNumericID(ids[i3]);
16479 if (compareNumericIDs(oldestID, num) === 1) {
16480 oldestIDIndex = i3;
16484 return ids[oldestIDIndex];
16486 function utilCleanOsmString(val, maxChars) {
16487 if (val === void 0 || val === null) {
16490 val = val.toString();
16493 if (val.normalize) val = val.normalize("NFC");
16494 return utilUnicodeCharsTruncated(val, maxChars);
16496 var import_diacritics, transformProperty;
16497 var init_util = __esm({
16498 "modules/util/util.js"() {
16500 import_diacritics = __toESM(require_diacritics(), 1);
16501 init_svg_paths_rtl_fix();
16509 // modules/util/clean_tags.js
16510 var clean_tags_exports = {};
16511 __export(clean_tags_exports, {
16512 utilCleanTags: () => utilCleanTags
16514 function utilCleanTags(tags) {
16516 for (var k2 in tags) {
16519 if (v3 !== void 0) {
16520 out[k2] = cleanValue(k2, v3);
16524 function cleanValue(k3, v4) {
16525 function keepSpaces(k4) {
16526 return /_hours|_times|:conditional$/.test(k4);
16528 function skip(k4) {
16529 return /^(description|note|fixme|inscription)(:.+)?$/.test(k4);
16531 if (skip(k3)) return v4;
16532 var cleaned = v4.split(";").map(function(s2) {
16534 }).join(keepSpaces(k3) ? "; " : ";");
16535 if (k3.indexOf("website") !== -1 || k3.indexOf("email") !== -1 || cleaned.indexOf("http") === 0) {
16536 cleaned = cleaned.replace(/[\u200B-\u200F\uFEFF]/g, "");
16541 var init_clean_tags = __esm({
16542 "modules/util/clean_tags.js"() {
16547 // modules/util/get_set_value.js
16548 var get_set_value_exports = {};
16549 __export(get_set_value_exports, {
16550 utilGetSetValue: () => utilGetSetValue
16552 function utilGetSetValue(selection2, value, shouldUpdate) {
16553 function setValue(value2, shouldUpdate2) {
16554 function valueNull() {
16557 function valueConstant() {
16558 if (shouldUpdate2(this.value, value2)) {
16559 this.value = value2;
16562 function valueFunction() {
16563 var x2 = value2.apply(this, arguments);
16566 } else if (x2 === void 0) {
16568 } else if (shouldUpdate2(this.value, x2)) {
16572 return value2 === null || value2 === void 0 ? valueNull : typeof value2 === "function" ? valueFunction : valueConstant;
16574 if (arguments.length === 1) {
16575 return selection2.property("value");
16577 if (shouldUpdate === void 0) {
16578 shouldUpdate = (a2, b3) => a2 !== b3;
16580 return selection2.each(setValue(value, shouldUpdate));
16582 var init_get_set_value = __esm({
16583 "modules/util/get_set_value.js"() {
16588 // modules/util/keybinding.js
16589 var keybinding_exports = {};
16590 __export(keybinding_exports, {
16591 utilKeybinding: () => utilKeybinding
16593 function utilKeybinding(namespace) {
16594 var _keybindings = {};
16595 function testBindings(d3_event, isCapturing) {
16596 var didMatch = false;
16597 var bindings = Object.keys(_keybindings).map(function(id2) {
16598 return _keybindings[id2];
16600 for (const binding of bindings) {
16601 if (!binding.event.modifiers.shiftKey) continue;
16602 if (!!binding.capture !== isCapturing) continue;
16603 if (matches(d3_event, binding, true)) {
16604 binding.callback(d3_event);
16609 if (didMatch) return;
16610 for (const binding of bindings) {
16611 if (binding.event.modifiers.shiftKey) continue;
16612 if (!!binding.capture !== isCapturing) continue;
16613 if (matches(d3_event, binding, false)) {
16614 binding.callback(d3_event);
16618 function matches(d3_event2, binding, testShift) {
16619 var event = d3_event2;
16620 var isMatch = false;
16621 var tryKeyCode = true;
16622 if (event.key !== void 0) {
16623 tryKeyCode = event.key.charCodeAt(0) > 127;
16625 if (binding.event.key === void 0) {
16627 } else if (Array.isArray(binding.event.key)) {
16628 if (binding.event.key.map(function(s2) {
16629 return s2.toLowerCase();
16630 }).indexOf(event.key.toLowerCase()) === -1) {
16634 if (event.key.toLowerCase() !== binding.event.key.toLowerCase()) {
16639 if (!isMatch && (tryKeyCode || binding.event.modifiers.altKey)) {
16640 isMatch = event.keyCode === binding.event.keyCode;
16642 if (!isMatch) return false;
16643 if (!(event.ctrlKey && event.altKey)) {
16644 if (event.ctrlKey !== binding.event.modifiers.ctrlKey) return false;
16645 if (event.altKey !== binding.event.modifiers.altKey) return false;
16647 if (event.metaKey !== binding.event.modifiers.metaKey) return false;
16648 if (testShift && event.shiftKey !== binding.event.modifiers.shiftKey) return false;
16652 function capture(d3_event) {
16653 testBindings(d3_event, true);
16655 function bubble(d3_event) {
16656 var tagName = select_default2(d3_event.target).node().tagName;
16657 if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
16660 testBindings(d3_event, false);
16662 function keybinding(selection2) {
16663 selection2 = selection2 || select_default2(document);
16664 selection2.on("keydown.capture." + namespace, capture, true);
16665 selection2.on("keydown.bubble." + namespace, bubble, false);
16668 keybinding.unbind = function(selection2) {
16670 selection2 = selection2 || select_default2(document);
16671 selection2.on("keydown.capture." + namespace, null);
16672 selection2.on("keydown.bubble." + namespace, null);
16675 keybinding.clear = function() {
16679 keybinding.off = function(codes, capture2) {
16680 var arr = utilArrayUniq([].concat(codes));
16681 for (var i3 = 0; i3 < arr.length; i3++) {
16682 var id2 = arr[i3] + (capture2 ? "-capture" : "-bubble");
16683 delete _keybindings[id2];
16687 keybinding.on = function(codes, callback, capture2) {
16688 if (typeof callback !== "function") {
16689 return keybinding.off(codes, capture2);
16691 var arr = utilArrayUniq([].concat(codes));
16692 for (var i3 = 0; i3 < arr.length; i3++) {
16693 var id2 = arr[i3] + (capture2 ? "-capture" : "-bubble");
16711 if (_keybindings[id2]) {
16712 console.warn('warning: duplicate keybinding for "' + id2 + '"');
16714 _keybindings[id2] = binding;
16715 var matches = arr[i3].toLowerCase().match(/(?:(?:[^+⇧⌃⌥⌘])+|[⇧⌃⌥⌘]|\+\+|^\+$)/g);
16716 for (var j3 = 0; j3 < matches.length; j3++) {
16717 if (matches[j3] === "++") matches[j3] = "+";
16718 if (matches[j3] in utilKeybinding.modifierCodes) {
16719 var prop = utilKeybinding.modifierProperties[utilKeybinding.modifierCodes[matches[j3]]];
16720 binding.event.modifiers[prop] = true;
16722 binding.event.key = utilKeybinding.keys[matches[j3]] || matches[j3];
16723 if (matches[j3] in utilKeybinding.keyCodes) {
16724 binding.event.keyCode = utilKeybinding.keyCodes[matches[j3]];
16734 var init_keybinding = __esm({
16735 "modules/util/keybinding.js"() {
16739 utilKeybinding.modifierCodes = {
16743 // CTRL key, on Mac: ⌃
16746 // ALT key, on Mac: ⌥ (Alt)
16750 // META, on Mac: ⌘ (CMD), on Windows (Win), on Linux (Super)
16757 utilKeybinding.modifierProperties = {
16763 utilKeybinding.plusKeys = ["plus", "ffplus", "=", "ffequals", "\u2260", "\xB1"];
16764 utilKeybinding.minusKeys = ["_", "-", "ffminus", "dash", "\u2013", "\u2014"];
16765 utilKeybinding.keys = {
16766 // Backspace key, on Mac: ⌫ (Backspace)
16767 "\u232B": "Backspace",
16768 backspace: "Backspace",
16769 // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥
16782 "pause-break": "Pause",
16783 // Caps Lock key, ⇪
16784 "\u21EA": "CapsLock",
16786 "caps-lock": "CapsLock",
16787 // Escape key, on Mac: ⎋, on Windows: Esc
16788 "\u238B": ["Escape", "Esc"],
16789 escape: ["Escape", "Esc"],
16790 esc: ["Escape", "Esc"],
16792 space: [" ", "Spacebar"],
16793 // Page-Up key, or pgup, on Mac: ↖
16794 "\u2196": "PageUp",
16796 "page-up": "PageUp",
16797 // Page-Down key, or pgdown, on Mac: ↘
16798 "\u2198": "PageDown",
16799 pgdown: "PageDown",
16800 "page-down": "PageDown",
16801 // END key, on Mac: ⇟
16804 // HOME key, on Mac: ⇞
16807 // Insert key, or ins
16810 // Delete key, on Mac: ⌦ (Delete)
16811 "\u2326": ["Delete", "Del"],
16812 del: ["Delete", "Del"],
16813 "delete": ["Delete", "Del"],
16814 // Left Arrow Key, or ←
16815 "\u2190": ["ArrowLeft", "Left"],
16816 left: ["ArrowLeft", "Left"],
16817 "arrow-left": ["ArrowLeft", "Left"],
16818 // Up Arrow Key, or ↑
16819 "\u2191": ["ArrowUp", "Up"],
16820 up: ["ArrowUp", "Up"],
16821 "arrow-up": ["ArrowUp", "Up"],
16822 // Right Arrow Key, or →
16823 "\u2192": ["ArrowRight", "Right"],
16824 right: ["ArrowRight", "Right"],
16825 "arrow-right": ["ArrowRight", "Right"],
16826 // Up Arrow Key, or ↓
16827 "\u2193": ["ArrowDown", "Down"],
16828 down: ["ArrowDown", "Down"],
16829 "arrow-down": ["ArrowDown", "Down"],
16830 // odities, stuff for backward compatibility (browsers and code):
16831 // Num-Multiply, or *
16832 "*": ["*", "Multiply"],
16833 star: ["*", "Multiply"],
16834 asterisk: ["*", "Multiply"],
16835 multiply: ["*", "Multiply"],
16838 "plus": ["+", "Add"],
16839 // Num-Subtract, or -
16840 "-": ["-", "Subtract"],
16841 subtract: ["-", "Subtract"],
16842 "dash": ["-", "Subtract"],
16849 // Period, or ., or full-stop
16852 // Slash, or /, or forward-slash
16854 "forward-slash": "/",
16855 // Tick, or `, or back-quote
16858 // Open bracket, or [
16859 "open-bracket": "[",
16860 // Back slash, or \
16861 "back-slash": "\\",
16862 // Close bracket, or ]
16863 "close-bracket": "]",
16864 // Apostrophe, or Quote, or '
16905 utilKeybinding.keyCodes = {
16906 // Backspace key, on Mac: ⌫ (Backspace)
16909 // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥
16923 // Caps Lock key, ⇪
16927 // Escape key, on Mac: ⎋, on Windows: Esc
16933 // Page-Up key, or pgup, on Mac: ↖
16937 // Page-Down key, or pgdown, on Mac: ↘
16941 // END key, on Mac: ⇟
16944 // HOME key, on Mac: ⇞
16947 // Insert key, or ins
16950 // Delete key, on Mac: ⌦ (Delete)
16954 // Left Arrow Key, or ←
16958 // Up Arrow Key, or ↑
16962 // Right Arrow Key, or →
16966 // Up Arrow Key, or ↓
16970 // odities, printing characters that come out wrong:
16973 // Num-Multiply, or *
16981 // Num-Subtract, or -
16984 // Vertical Bar / Pipe
16999 // Dash / Underscore key
17001 // Period, or ., or full-stop
17005 // Slash, or /, or forward-slash
17008 "forward-slash": 191,
17009 // Tick, or `, or back-quote
17013 // Open bracket, or [
17015 "open-bracket": 219,
17016 // Back slash, or \
17019 // Close bracket, or ]
17021 "close-bracket": 221,
17022 // Apostrophe, or Quote, or '
17029 while (++i < 106) {
17030 utilKeybinding.keyCodes["num-" + n] = i;
17036 utilKeybinding.keyCodes[n] = i;
17041 while (++i < 136) {
17042 utilKeybinding.keyCodes["f" + n] = i;
17047 utilKeybinding.keyCodes[String.fromCharCode(i).toLowerCase()] = i;
17052 // modules/util/object.js
17053 var object_exports = {};
17054 __export(object_exports, {
17055 utilCheckTagDictionary: () => utilCheckTagDictionary,
17056 utilObjectOmit: () => utilObjectOmit
17058 function utilObjectOmit(obj, omitKeys) {
17059 return Object.keys(obj).reduce(function(result, key) {
17060 if (omitKeys.indexOf(key) === -1) {
17061 result[key] = obj[key];
17066 function utilCheckTagDictionary(tags, tagDictionary) {
17067 for (const key in tags) {
17068 const value = tags[key];
17069 if (tagDictionary[key] && value in tagDictionary[key]) {
17070 return tagDictionary[key][value];
17075 var init_object2 = __esm({
17076 "modules/util/object.js"() {
17081 // modules/util/rebind.js
17082 var rebind_exports = {};
17083 __export(rebind_exports, {
17084 utilRebind: () => utilRebind
17086 function utilRebind(target, source, ...args) {
17087 for (const method of args) {
17088 target[method] = d3_rebind(target, source, source[method]);
17092 function d3_rebind(target, source, method) {
17093 return function() {
17094 var value = method.apply(source, arguments);
17095 return value === source ? target : value;
17098 var init_rebind = __esm({
17099 "modules/util/rebind.js"() {
17104 // modules/util/session_mutex.js
17105 var session_mutex_exports = {};
17106 __export(session_mutex_exports, {
17107 utilSessionMutex: () => utilSessionMutex
17109 function utilSessionMutex(name) {
17113 if (typeof window === "undefined") return;
17114 var expires = /* @__PURE__ */ new Date();
17115 expires.setSeconds(expires.getSeconds() + 5);
17116 document.cookie = name + "=1; expires=" + expires.toUTCString() + "; sameSite=strict";
17118 mutex.lock = function() {
17119 if (intervalID) return true;
17120 var cookie = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + name + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1");
17121 if (cookie) return false;
17123 intervalID = window.setInterval(renew, 4e3);
17126 mutex.unlock = function() {
17127 if (!intervalID) return;
17128 document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; sameSite=strict";
17129 clearInterval(intervalID);
17132 mutex.locked = function() {
17133 return !!intervalID;
17137 var init_session_mutex = __esm({
17138 "modules/util/session_mutex.js"() {
17143 // modules/util/tiler.js
17144 var tiler_exports = {};
17145 __export(tiler_exports, {
17146 utilTiler: () => utilTiler
17148 function utilTiler() {
17149 var _size = [256, 256];
17151 var _tileSize = 256;
17152 var _zoomExtent = [0, 20];
17153 var _translate = [_size[0] / 2, _size[1] / 2];
17155 var _skipNullIsland = false;
17156 function nearNullIsland(tile) {
17161 var center = Math.pow(2, z3 - 1);
17162 var width = Math.pow(2, z3 - 6);
17163 var min3 = center - width / 2;
17164 var max3 = center + width / 2 - 1;
17165 return x2 >= min3 && x2 <= max3 && y3 >= min3 && y3 <= max3;
17169 function tiler8() {
17170 var z3 = geoScaleToZoom(_scale / (2 * Math.PI), _tileSize);
17171 var z0 = clamp_default(Math.round(z3), _zoomExtent[0], _zoomExtent[1]);
17173 var tileMax = Math.pow(2, z0) - 1;
17174 var log2ts = Math.log(_tileSize) * Math.LOG2E;
17175 var k2 = Math.pow(2, z3 - z0 + log2ts);
17177 (_translate[0] - _scale / 2) / k2,
17178 (_translate[1] - _scale / 2) / k2
17181 clamp_default(Math.floor(-origin[0]) - _margin, tileMin, tileMax + 1),
17182 clamp_default(Math.ceil(_size[0] / k2 - origin[0]) + _margin, tileMin, tileMax + 1)
17185 clamp_default(Math.floor(-origin[1]) - _margin, tileMin, tileMax + 1),
17186 clamp_default(Math.ceil(_size[1] / k2 - origin[1]) + _margin, tileMin, tileMax + 1)
17189 for (var i3 = 0; i3 < rows.length; i3++) {
17191 for (var j3 = 0; j3 < cols.length; j3++) {
17193 if (i3 >= _margin && i3 <= rows.length - _margin && j3 >= _margin && j3 <= cols.length - _margin) {
17194 tiles.unshift([x2, y3, z0]);
17196 tiles.push([x2, y3, z0]);
17200 tiles.translate = origin;
17204 tiler8.getTiles = function(projection2) {
17206 projection2.scale() * Math.PI - projection2.translate()[0],
17207 projection2.scale() * Math.PI - projection2.translate()[1]
17209 this.size(projection2.clipExtent()[1]).scale(projection2.scale() * 2 * Math.PI).translate(projection2.translate());
17210 var tiles = tiler8();
17211 var ts = tiles.scale;
17212 return tiles.map(function(tile) {
17213 if (_skipNullIsland && nearNullIsland(tile)) {
17216 var x2 = tile[0] * ts - origin[0];
17217 var y3 = tile[1] * ts - origin[1];
17219 id: tile.toString(),
17222 projection2.invert([x2, y3 + ts]),
17223 projection2.invert([x2 + ts, y3])
17226 }).filter(Boolean);
17228 tiler8.getGeoJSON = function(projection2) {
17229 var features = tiler8.getTiles(projection2).map(function(tile) {
17238 coordinates: [tile.extent.polygon()]
17243 type: "FeatureCollection",
17247 tiler8.tileSize = function(val) {
17248 if (!arguments.length) return _tileSize;
17252 tiler8.zoomExtent = function(val) {
17253 if (!arguments.length) return _zoomExtent;
17257 tiler8.size = function(val) {
17258 if (!arguments.length) return _size;
17262 tiler8.scale = function(val) {
17263 if (!arguments.length) return _scale;
17267 tiler8.translate = function(val) {
17268 if (!arguments.length) return _translate;
17272 tiler8.margin = function(val) {
17273 if (!arguments.length) return _margin;
17277 tiler8.skipNullIsland = function(val) {
17278 if (!arguments.length) return _skipNullIsland;
17279 _skipNullIsland = val;
17284 var init_tiler = __esm({
17285 "modules/util/tiler.js"() {
17293 // modules/util/trigger_event.js
17294 var trigger_event_exports = {};
17295 __export(trigger_event_exports, {
17296 utilTriggerEvent: () => utilTriggerEvent
17298 function utilTriggerEvent(target, type2, eventProperties) {
17299 target.each(function() {
17300 var evt = document.createEvent("HTMLEvents");
17301 evt.initEvent(type2, true, true);
17302 for (var prop in eventProperties) {
17303 evt[prop] = eventProperties[prop];
17305 this.dispatchEvent(evt);
17308 var init_trigger_event = __esm({
17309 "modules/util/trigger_event.js"() {
17314 // modules/util/units.js
17315 var units_exports = {};
17316 __export(units_exports, {
17317 decimalCoordinatePair: () => decimalCoordinatePair,
17318 displayArea: () => displayArea,
17319 displayLength: () => displayLength,
17320 dmsCoordinatePair: () => dmsCoordinatePair,
17321 dmsMatcher: () => dmsMatcher
17323 function displayLength(m3, isImperial) {
17324 var d4 = m3 * (isImperial ? 3.28084 : 1);
17336 unit2 = "kilometers";
17341 return _t("units." + unit2, {
17342 quantity: d4.toLocaleString(_mainLocalizer.localeCode(), {
17343 maximumSignificantDigits: 4
17347 function displayArea(m22, isImperial) {
17348 var locale3 = _mainLocalizer.localeCode();
17349 var d4 = m22 * (isImperial ? 10.7639111056 : 1);
17354 if (d4 >= 6969600) {
17355 d1 = d4 / 27878400;
17356 unit1 = "square_miles";
17359 unit1 = "square_feet";
17361 if (d4 > 4356 && d4 < 4356e4) {
17368 unit1 = "square_kilometers";
17371 unit1 = "square_meters";
17373 if (d4 > 1e3 && d4 < 1e7) {
17375 unit2 = "hectares";
17378 area = _t("units." + unit1, {
17379 quantity: d1.toLocaleString(locale3, {
17380 maximumSignificantDigits: 4
17384 return _t("units.area_pair", {
17386 area2: _t("units." + unit2, {
17387 quantity: d22.toLocaleString(locale3, {
17388 maximumSignificantDigits: 2
17396 function wrap(x2, min3, max3) {
17397 var d4 = max3 - min3;
17398 return ((x2 - min3) % d4 + d4) % d4 + min3;
17400 function roundToDecimal(target, decimalPlace) {
17401 target = Number(target);
17402 decimalPlace = Number(decimalPlace);
17403 const factor = Math.pow(10, decimalPlace);
17404 return Math.round(target * factor) / factor;
17406 function displayCoordinate(deg, pos, neg) {
17407 var displayCoordinate2;
17408 var locale3 = _mainLocalizer.localeCode();
17409 var degreesFloor = Math.floor(Math.abs(deg));
17410 var min3 = (Math.abs(deg) - degreesFloor) * 60;
17411 var minFloor = Math.floor(min3);
17412 var sec = (min3 - minFloor) * 60;
17413 var fix = roundToDecimal(sec, 8);
17414 var secRounded = roundToDecimal(fix, 0);
17415 if (secRounded === 60) {
17418 if (minFloor === 60) {
17423 displayCoordinate2 = _t("units.arcdegrees", {
17424 quantity: degreesFloor.toLocaleString(locale3)
17425 }) + (minFloor !== 0 || secRounded !== 0 ? _t("units.arcminutes", {
17426 quantity: minFloor.toLocaleString(locale3)
17427 }) : "") + (secRounded !== 0 ? _t("units.arcseconds", {
17428 quantity: secRounded.toLocaleString(locale3)
17431 return displayCoordinate2;
17433 return _t("units.coordinate", {
17434 coordinate: displayCoordinate2,
17435 direction: _t("units." + (deg > 0 ? pos : neg))
17439 function dmsCoordinatePair(coord2) {
17440 return _t("units.coordinate_pair", {
17441 latitude: displayCoordinate(clamp_default(coord2[1], -90, 90), "north", "south"),
17442 longitude: displayCoordinate(wrap(coord2[0], -180, 180), "east", "west")
17445 function decimalCoordinatePair(coord2) {
17446 return _t("units.coordinate_pair", {
17447 latitude: clamp_default(coord2[1], -90, 90).toFixed(OSM_PRECISION),
17448 longitude: wrap(coord2[0], -180, 180).toFixed(OSM_PRECISION)
17451 function dmsMatcher(q3, _localeCode = void 0) {
17453 // D M SS , D M SS ex: 35 11 10.1 , 136 49 53.8
17455 condition: /^\s*(-?)\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*\,\s*(-?)\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*$/,
17456 parser: function(q4) {
17457 const match = this.condition.exec(q4);
17458 const lat = +match[2] + +match[3] / 60 + +match[4] / 3600;
17459 const lng = +match[6] + +match[7] / 60 + +match[8] / 3600;
17460 const isNegLat = match[1] === "-" ? -lat : lat;
17461 const isNegLng = match[5] === "-" ? -lng : lng;
17462 return [isNegLat, isNegLng];
17465 // D MM , D MM ex: 35 11.1683 , 136 49.8966
17467 condition: /^\s*(-?)\s*(\d+)\s+(\d+\.?\d*)\s*\,\s*(-?)\s*(\d+)\s+(\d+\.?\d*)\s*$/,
17468 parser: function(q4) {
17469 const match = this.condition.exec(q4);
17470 const lat = +match[2] + +match[3] / 60;
17471 const lng = +match[5] + +match[6] / 60;
17472 const isNegLat = match[1] === "-" ? -lat : lat;
17473 const isNegLng = match[4] === "-" ? -lng : lng;
17474 return [isNegLat, isNegLng];
17477 // D/D ex: 46.112785/72.921033
17479 condition: /^\s*(-?\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*$/,
17480 parser: function(q4) {
17481 const match = this.condition.exec(q4);
17482 return [+match[1], +match[2]];
17485 // zoom/x/y ex: 2/1.23/34.44
17487 condition: /^\s*(\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*$/,
17488 parser: function(q4) {
17489 const match = this.condition.exec(q4);
17490 const lat = +match[2];
17491 const lng = +match[3];
17492 const zoom = +match[1];
17493 return [lat, lng, zoom];
17496 // x/y , x, y , x y where x and y are localized floats, e.g. in German locale: 49,4109399, 8,7147086
17498 condition: { test: (q4) => !!localizedNumberCoordsParser(q4) },
17499 parser: localizedNumberCoordsParser
17502 function localizedNumberCoordsParser(q4) {
17503 const parseLocaleFloat = _mainLocalizer.floatParser(_localeCode || _mainLocalizer.localeCode());
17504 let parts = q4.split(/,?\s+|\s*[\/\\]\s*/);
17505 if (parts.length !== 2) return false;
17506 const lat = parseLocaleFloat(parts[0]);
17507 const lng = parseLocaleFloat(parts[1]);
17508 if (isNaN(lat) || isNaN(lng)) return false;
17511 for (const matcher of matchers) {
17512 if (matcher.condition.test(q3)) {
17513 return matcher.parser(q3);
17519 var init_units = __esm({
17520 "modules/util/units.js"() {
17528 // modules/util/index.js
17529 var util_exports2 = {};
17530 __export(util_exports2, {
17531 dmsCoordinatePair: () => dmsCoordinatePair,
17532 dmsMatcher: () => dmsMatcher,
17533 utilAesDecrypt: () => utilAesDecrypt,
17534 utilAesEncrypt: () => utilAesEncrypt,
17535 utilArrayChunk: () => utilArrayChunk,
17536 utilArrayDifference: () => utilArrayDifference,
17537 utilArrayFlatten: () => utilArrayFlatten,
17538 utilArrayGroupBy: () => utilArrayGroupBy,
17539 utilArrayIdentical: () => utilArrayIdentical,
17540 utilArrayIntersection: () => utilArrayIntersection,
17541 utilArrayUnion: () => utilArrayUnion,
17542 utilArrayUniq: () => utilArrayUniq,
17543 utilArrayUniqBy: () => utilArrayUniqBy,
17544 utilAsyncMap: () => utilAsyncMap,
17545 utilCheckTagDictionary: () => utilCheckTagDictionary,
17546 utilCleanOsmString: () => utilCleanOsmString,
17547 utilCleanTags: () => utilCleanTags,
17548 utilCombinedTags: () => utilCombinedTags,
17549 utilCompareIDs: () => utilCompareIDs,
17550 utilDeepMemberSelector: () => utilDeepMemberSelector,
17551 utilDetect: () => utilDetect,
17552 utilDisplayName: () => utilDisplayName,
17553 utilDisplayNameForPath: () => utilDisplayNameForPath,
17554 utilDisplayType: () => utilDisplayType,
17555 utilEditDistance: () => utilEditDistance,
17556 utilEntityAndDeepMemberIDs: () => utilEntityAndDeepMemberIDs,
17557 utilEntityOrDeepMemberSelector: () => utilEntityOrDeepMemberSelector,
17558 utilEntityOrMemberSelector: () => utilEntityOrMemberSelector,
17559 utilEntityRoot: () => utilEntityRoot,
17560 utilEntitySelector: () => utilEntitySelector,
17561 utilFastMouse: () => utilFastMouse,
17562 utilFunctor: () => utilFunctor,
17563 utilGetAllNodes: () => utilGetAllNodes,
17564 utilGetSetValue: () => utilGetSetValue,
17565 utilHashcode: () => utilHashcode,
17566 utilHighlightEntities: () => utilHighlightEntities,
17567 utilKeybinding: () => utilKeybinding,
17568 utilNoAuto: () => utilNoAuto,
17569 utilObjectOmit: () => utilObjectOmit,
17570 utilOldestID: () => utilOldestID,
17571 utilPrefixCSSProperty: () => utilPrefixCSSProperty,
17572 utilPrefixDOMProperty: () => utilPrefixDOMProperty,
17573 utilQsString: () => utilQsString,
17574 utilRebind: () => utilRebind,
17575 utilSafeClassName: () => utilSafeClassName,
17576 utilSessionMutex: () => utilSessionMutex,
17577 utilSetTransform: () => utilSetTransform,
17578 utilStringQs: () => utilStringQs,
17579 utilTagDiff: () => utilTagDiff,
17580 utilTagText: () => utilTagText,
17581 utilTiler: () => utilTiler,
17582 utilTotalExtent: () => utilTotalExtent,
17583 utilTriggerEvent: () => utilTriggerEvent,
17584 utilUnicodeCharsCount: () => utilUnicodeCharsCount,
17585 utilUnicodeCharsTruncated: () => utilUnicodeCharsTruncated,
17586 utilUniqueDomId: () => utilUniqueDomId,
17587 utilWrap: () => utilWrap
17589 var init_util2 = __esm({
17590 "modules/util/index.js"() {
17620 init_get_set_value();
17634 init_session_mutex();
17640 init_trigger_event();
17651 // modules/actions/add_midpoint.js
17652 var add_midpoint_exports = {};
17653 __export(add_midpoint_exports, {
17654 actionAddMidpoint: () => actionAddMidpoint
17656 function actionAddMidpoint(midpoint, node) {
17657 return function(graph) {
17658 graph = graph.replace(node.move(midpoint.loc));
17659 var parents = utilArrayIntersection(
17660 graph.parentWays(graph.entity(midpoint.edge[0])),
17661 graph.parentWays(graph.entity(midpoint.edge[1]))
17663 parents.forEach(function(way) {
17664 for (var i3 = 0; i3 < way.nodes.length - 1; i3++) {
17665 if (geoEdgeEqual([way.nodes[i3], way.nodes[i3 + 1]], midpoint.edge)) {
17666 graph = graph.replace(graph.entity(way.id).addNode(node.id, i3 + 1));
17674 var init_add_midpoint = __esm({
17675 "modules/actions/add_midpoint.js"() {
17682 // modules/actions/add_vertex.js
17683 var add_vertex_exports = {};
17684 __export(add_vertex_exports, {
17685 actionAddVertex: () => actionAddVertex
17687 function actionAddVertex(wayId, nodeId, index) {
17688 return function(graph) {
17689 return graph.replace(graph.entity(wayId).addNode(nodeId, index));
17692 var init_add_vertex = __esm({
17693 "modules/actions/add_vertex.js"() {
17698 // modules/actions/change_member.js
17699 var change_member_exports = {};
17700 __export(change_member_exports, {
17701 actionChangeMember: () => actionChangeMember
17703 function actionChangeMember(relationId, member, memberIndex) {
17704 return function(graph) {
17705 return graph.replace(graph.entity(relationId).updateMember(member, memberIndex));
17708 var init_change_member = __esm({
17709 "modules/actions/change_member.js"() {
17714 // modules/actions/change_preset.js
17715 var change_preset_exports = {};
17716 __export(change_preset_exports, {
17717 actionChangePreset: () => actionChangePreset
17719 function actionChangePreset(entityID, oldPreset, newPreset, skipFieldDefaults) {
17720 return function action(graph) {
17721 var entity = graph.entity(entityID);
17722 var geometry = entity.geometry(graph);
17723 var tags = entity.tags;
17724 const loc = entity.extent(graph).center();
17728 if (newPreset.addTags) {
17729 preserveKeys = preserveKeys.concat(Object.keys(newPreset.addTags));
17731 if (oldPreset && !oldPreset.id.startsWith(newPreset.id)) {
17732 newPreset.fields(loc).concat(newPreset.moreFields(loc)).filter((f2) => f2.matchGeometry(geometry)).map((f2) => f2.key).filter(Boolean).forEach((key) => preserveKeys.push(key));
17735 if (oldPreset) tags = oldPreset.unsetTags(tags, geometry, preserveKeys, false, loc);
17736 if (newPreset) tags = newPreset.setTags(tags, geometry, skipFieldDefaults, loc);
17737 return graph.replace(entity.update({ tags }));
17740 var init_change_preset = __esm({
17741 "modules/actions/change_preset.js"() {
17746 // modules/actions/change_tags.js
17747 var change_tags_exports = {};
17748 __export(change_tags_exports, {
17749 actionChangeTags: () => actionChangeTags
17751 function actionChangeTags(entityId, tags) {
17752 return function(graph) {
17753 var entity = graph.entity(entityId);
17754 return graph.replace(entity.update({ tags }));
17757 var init_change_tags = __esm({
17758 "modules/actions/change_tags.js"() {
17763 // modules/osm/tags.js
17764 var tags_exports = {};
17765 __export(tags_exports, {
17766 allowUpperCaseTagValues: () => allowUpperCaseTagValues,
17767 isColourValid: () => isColourValid,
17768 osmAreaKeys: () => osmAreaKeys,
17769 osmAreaKeysExceptions: () => osmAreaKeysExceptions,
17770 osmFlowingWaterwayTagValues: () => osmFlowingWaterwayTagValues,
17771 osmIsInterestingTag: () => osmIsInterestingTag,
17772 osmLanduseTags: () => osmLanduseTags,
17773 osmLifecyclePrefixes: () => osmLifecyclePrefixes,
17774 osmLineTags: () => osmLineTags,
17775 osmMutuallyExclusiveTagPairs: () => osmMutuallyExclusiveTagPairs,
17776 osmNodeGeometriesForTags: () => osmNodeGeometriesForTags,
17777 osmOneWayBackwardTags: () => osmOneWayBackwardTags,
17778 osmOneWayBiDirectionalTags: () => osmOneWayBiDirectionalTags,
17779 osmOneWayForwardTags: () => osmOneWayForwardTags,
17780 osmOneWayTags: () => osmOneWayTags,
17781 osmPathHighwayTagValues: () => osmPathHighwayTagValues,
17782 osmPavedTags: () => osmPavedTags,
17783 osmPointTags: () => osmPointTags,
17784 osmRailwayTrackTagValues: () => osmRailwayTrackTagValues,
17785 osmRemoveLifecyclePrefix: () => osmRemoveLifecyclePrefix,
17786 osmRightSideIsInsideTags: () => osmRightSideIsInsideTags,
17787 osmRoutableAerowayTags: () => osmRoutableAerowayTags,
17788 osmRoutableHighwayTagValues: () => osmRoutableHighwayTagValues,
17789 osmSemipavedTags: () => osmSemipavedTags,
17790 osmSetAreaKeys: () => osmSetAreaKeys,
17791 osmSetLineTags: () => osmSetLineTags,
17792 osmSetPointTags: () => osmSetPointTags,
17793 osmSetVertexTags: () => osmSetVertexTags,
17794 osmShouldRenderDirection: () => osmShouldRenderDirection,
17795 osmSummableTags: () => osmSummableTags,
17796 osmTagSuggestingArea: () => osmTagSuggestingArea,
17797 osmVertexTags: () => osmVertexTags
17799 function osmIsInterestingTag(key) {
17800 if (uninterestingKeys.has(key)) return false;
17801 if (uninterestingKeyRegex.test(key)) return false;
17804 function osmRemoveLifecyclePrefix(key) {
17805 const keySegments = key.split(":");
17806 if (keySegments.length === 1) return key;
17807 if (keySegments[0] in osmLifecyclePrefixes) {
17808 return key.slice(keySegments[0].length + 1);
17812 function osmSetAreaKeys(value) {
17813 osmAreaKeys = value;
17815 function osmTagSuggestingArea(tags) {
17816 if (tags.area === "yes") return { area: "yes" };
17817 if (tags.area === "no") return null;
17818 var returnTags = {};
17819 for (var realKey in tags) {
17820 const key = osmRemoveLifecyclePrefix(realKey);
17821 if (key in osmAreaKeys && !(tags[realKey] in osmAreaKeys[key])) {
17822 returnTags[realKey] = tags[realKey];
17825 if (key in osmAreaKeysExceptions && tags[realKey] in osmAreaKeysExceptions[key]) {
17826 returnTags[realKey] = tags[realKey];
17832 function osmSetLineTags(value) {
17833 osmLineTags = value;
17835 function osmSetPointTags(value) {
17836 osmPointTags = value;
17838 function osmSetVertexTags(value) {
17839 osmVertexTags = value;
17841 function osmNodeGeometriesForTags(nodeTags) {
17842 var geometries = {};
17843 for (var key in nodeTags) {
17844 if (osmPointTags[key] && (osmPointTags[key]["*"] || osmPointTags[key][nodeTags[key]])) {
17845 geometries.point = true;
17847 if (osmVertexTags[key] && (osmVertexTags[key]["*"] || osmVertexTags[key][nodeTags[key]])) {
17848 geometries.vertex = true;
17850 if (geometries.point && geometries.vertex) break;
17854 function isColourValid(value) {
17855 if (!value.match(/^(#([0-9a-fA-F]{3}){1,2}|\w+)$/)) {
17858 if (!CSS.supports("color", value) || ["unset", "inherit", "initial", "revert"].includes(value)) {
17863 function osmShouldRenderDirection(vertexTags, wayTags) {
17864 if (vertexTags.highway || vertexTags.traffic_sign || vertexTags.traffic_calming || vertexTags.barrier) {
17865 return !!(wayTags.highway || wayTags.railway);
17867 if (vertexTags.railway) return !!wayTags.railway;
17868 if (vertexTags.waterway) return !!wayTags.waterway;
17869 if (vertexTags.cycleway === "asl") return !!wayTags.highway;
17872 var uninterestingKeys, uninterestingKeyRegex, osmLifecyclePrefixes, osmAreaKeys, osmAreaKeysExceptions, osmLineTags, osmPointTags, osmVertexTags, osmOneWayForwardTags, osmOneWayBackwardTags, osmOneWayBiDirectionalTags, osmOneWayTags, osmPavedTags, osmSemipavedTags, osmRightSideIsInsideTags, osmRoutableHighwayTagValues, osmRoutableAerowayTags, osmPathHighwayTagValues, osmRailwayTrackTagValues, osmFlowingWaterwayTagValues, osmLanduseTags, allowUpperCaseTagValues, osmMutuallyExclusiveTagPairs, osmSummableTags;
17873 var init_tags = __esm({
17874 "modules/osm/tags.js"() {
17877 uninterestingKeys = /* @__PURE__ */ new Set([
17881 "geobase:datasetName",
17895 uninterestingKeyRegex = /^(source(_ref)?|tiger):/;
17896 osmLifecyclePrefixes = {
17897 // nonexistent, might be built
17900 // under maintenance or between groundbreaking and opening
17901 construction: true,
17902 // existent but not functional
17904 // dilapidated to nonexistent
17907 // nonexistent, still may appear in imagery
17914 // existent occasionally, e.g. stormwater drainage basin
17918 osmAreaKeysExceptions = {
17924 public_transport: {
17934 ventilation_shaft: true
17940 bicycle_parking: true
17945 osmVertexTags = {};
17946 osmOneWayForwardTags = {
17948 "chair_lift": true,
17951 "magic_carpet": true,
17952 "mixed_lift": true,
17969 "goods_conveyor": true,
17970 "piste:halfpipe": true
17981 "two-way_route": true,
17982 "recommended_traffic_lane": true,
17983 "separation_lane": true,
17984 "separation_roundabout": true
17992 "pressurised": true,
17996 "tidal_channel": true
17999 osmOneWayBackwardTags = {
18007 osmOneWayBiDirectionalTags = {
18012 "alternating": true,
18016 osmOneWayTags = merge_default3(
18017 osmOneWayForwardTags,
18018 osmOneWayBackwardTags,
18019 osmOneWayBiDirectionalTags
18027 "concrete:lanes": true,
18028 "concrete:plates": true
18034 osmSemipavedTags = {
18036 "cobblestone": true,
18037 "cobblestone:flattened": true,
18038 "unhewn_cobblestone": true,
18040 "paving_stones": true,
18045 osmRightSideIsInsideTags = {
18048 "coastline": "coastline"
18051 "retaining_wall": true,
18053 "guard_rail": true,
18057 "embankment": true,
18064 osmRoutableHighwayTagValues = {
18071 motorway_link: true,
18073 primary_link: true,
18074 secondary_link: true,
18075 tertiary_link: true,
18076 unclassified: true,
18080 living_street: true,
18081 bus_guideway: true,
18092 osmRoutableAerowayTags = {
18096 osmPathHighwayTagValues = {
18106 osmRailwayTrackTagValues = {
18114 narrow_gauge: true,
18118 osmFlowingWaterwayTagValues = {
18126 tidal_channel: true
18130 "bicycle_parking": true,
18132 "grave_yard": true,
18134 "marketplace": true,
18135 "motorcycle_parking": true,
18137 "place_of_worship": true,
18146 allowUpperCaseTagValues = /network|taxon|genus|species|brand|grape_variety|royal_cypher|listed_status|booth|rating|stars|:output|_hours|_times|_ref|manufacturer|country|target|brewery|cai_scale|traffic_sign/;
18147 osmMutuallyExclusiveTagPairs = [
18148 ["noname", "name"],
18150 ["nohousenumber", "addr:housenumber"],
18151 ["noaddress", "addr:housenumber"],
18152 ["noaddress", "addr:housename"],
18153 ["noaddress", "addr:unit"],
18154 ["addr:nostreet", "addr:street"]
18156 osmSummableTags = /* @__PURE__ */ new Set([
18158 "parking:both:capacity",
18159 "parking:left:capacity",
18160 "parking:left:capacity"
18165 // modules/osm/entity.js
18166 var entity_exports = {};
18167 __export(entity_exports, {
18168 osmEntity: () => osmEntity
18170 function osmEntity(attrs) {
18171 if (this instanceof osmEntity) return;
18172 if (attrs && attrs.type) {
18173 return osmEntity[attrs.type].apply(this, arguments);
18174 } else if (attrs && attrs.id) {
18175 return osmEntity[osmEntity.id.type(attrs.id)].apply(this, arguments);
18177 return new osmEntity().initialize(arguments);
18179 var init_entity = __esm({
18180 "modules/osm/entity.js"() {
18186 osmEntity.id = function(type2) {
18187 return osmEntity.id.fromOSM(type2, osmEntity.id.next[type2]--);
18189 osmEntity.id.next = {
18195 osmEntity.id.fromOSM = function(type2, id2) {
18196 return type2[0] + id2;
18198 osmEntity.id.toOSM = function(id2) {
18199 var match = id2.match(/^[cnwr](-?\d+)$/);
18205 osmEntity.id.type = function(id2) {
18206 return { "c": "changeset", "n": "node", "w": "way", "r": "relation" }[id2[0]];
18208 osmEntity.key = function(entity) {
18209 return entity.id + "v" + (entity.v || 0);
18211 osmEntity.prototype = {
18212 /** @type {Tags} */
18214 /** @type {String} */
18216 initialize: function(sources) {
18217 for (var i3 = 0; i3 < sources.length; ++i3) {
18218 var source = sources[i3];
18219 for (var prop in source) {
18220 if (Object.prototype.hasOwnProperty.call(source, prop)) {
18221 if (source[prop] === void 0) {
18224 this[prop] = source[prop];
18229 if (!this.id && this.type) {
18230 this.id = osmEntity.id(this.type);
18232 if (!this.hasOwnProperty("visible")) {
18233 this.visible = true;
18236 Object.freeze(this);
18237 Object.freeze(this.tags);
18238 if (this.loc) Object.freeze(this.loc);
18239 if (this.nodes) Object.freeze(this.nodes);
18240 if (this.members) Object.freeze(this.members);
18244 copy: function(resolver, copies) {
18245 if (copies[this.id]) return copies[this.id];
18246 var copy2 = osmEntity(this, { id: void 0, user: void 0, version: void 0 });
18247 copies[this.id] = copy2;
18250 osmId: function() {
18251 return osmEntity.id.toOSM(this.id);
18253 isNew: function() {
18254 var osmId = osmEntity.id.toOSM(this.id);
18255 return osmId.length === 0 || osmId[0] === "-";
18257 update: function(attrs) {
18258 return osmEntity(this, attrs, { v: 1 + (this.v || 0) });
18262 * @param {Tags} tags tags to merge into this entity's tags
18263 * @param {Tags} setTags (optional) a set of tags to overwrite in this entity's tags
18264 * @returns {iD.OsmEntity}
18266 mergeTags: function(tags, setTags = {}) {
18267 const merged = Object.assign({}, this.tags);
18268 let changed = false;
18269 for (const k2 in tags) {
18270 if (setTags.hasOwnProperty(k2)) continue;
18271 const t12 = this.tags[k2];
18272 const t2 = tags[k2];
18276 } else if (t12 !== t2) {
18278 merged[k2] = utilUnicodeCharsTruncated(
18279 utilArrayUnion(t12.split(/;\s*/), t2.split(/;\s*/)).join(";"),
18281 // avoid exceeding character limit; see also context.maxCharsForTagValue()
18285 for (const k2 in setTags) {
18286 if (this.tags[k2] !== setTags[k2]) {
18288 merged[k2] = setTags[k2];
18291 return changed ? this.update({ tags: merged }) : this;
18293 intersects: function(extent, resolver) {
18294 return this.extent(resolver).intersects(extent);
18296 hasNonGeometryTags: function() {
18297 return Object.keys(this.tags).some(function(k2) {
18298 return k2 !== "area";
18301 hasParentRelations: function(resolver) {
18302 return resolver.parentRelations(this).length > 0;
18304 hasInterestingTags: function() {
18305 return Object.keys(this.tags).some(osmIsInterestingTag);
18307 isDegenerate: function() {
18314 // modules/osm/node.js
18315 var node_exports = {};
18316 __export(node_exports, {
18317 cardinal: () => cardinal,
18318 osmNode: () => osmNode
18320 function osmNode() {
18321 if (!(this instanceof osmNode)) {
18322 return new osmNode().initialize(arguments);
18323 } else if (arguments.length) {
18324 this.initialize(arguments);
18327 var cardinal, prototype;
18328 var init_node2 = __esm({
18329 "modules/osm/node.js"() {
18338 northnortheast: 22,
18346 eastsoutheast: 112,
18350 southsoutheast: 157,
18354 southsouthwest: 202,
18358 westsouthwest: 247,
18362 westnorthwest: 292,
18366 northnorthwest: 337,
18369 osmEntity.node = osmNode;
18370 osmNode.prototype = Object.create(osmEntity.prototype);
18374 extent: function() {
18375 return new geoExtent(this.loc);
18377 geometry: function(graph) {
18378 return graph.transient(this, "geometry", function() {
18379 return graph.isPoi(this) ? "point" : "vertex";
18382 move: function(loc) {
18383 return this.update({ loc });
18385 isDegenerate: function() {
18386 return !(Array.isArray(this.loc) && this.loc.length === 2 && this.loc[0] >= -180 && this.loc[0] <= 180 && this.loc[1] >= -90 && this.loc[1] <= 90);
18388 // Inspect tags and geometry to determine which direction(s) this node/vertex points
18389 directions: function(resolver, projection2) {
18392 if (this.isHighwayIntersection(resolver) && (this.tags.stop || "").toLowerCase() === "all") {
18395 val = (this.tags.direction || "").toLowerCase();
18396 var re4 = /:direction$/i;
18397 var keys2 = Object.keys(this.tags);
18398 for (i3 = 0; i3 < keys2.length; i3++) {
18399 if (re4.test(keys2[i3])) {
18400 val = this.tags[keys2[i3]].toLowerCase();
18405 if (val === "") return [];
18406 var values = val.split(";");
18408 values.forEach(function(v3) {
18409 if (cardinal[v3] !== void 0) {
18412 if (v3 !== "" && !isNaN(+v3)) {
18416 var lookBackward = this.tags["traffic_sign:backward"] || v3 === "backward" || v3 === "both" || v3 === "all";
18417 var lookForward = this.tags["traffic_sign:forward"] || v3 === "forward" || v3 === "both" || v3 === "all";
18418 if (!lookForward && !lookBackward) return;
18420 resolver.parentWays(this).filter((way) => osmShouldRenderDirection(this.tags, way.tags)).forEach(function(parent2) {
18421 var nodes = parent2.nodes;
18422 for (i3 = 0; i3 < nodes.length; i3++) {
18423 if (nodes[i3] === this.id) {
18424 if (lookForward && i3 > 0) {
18425 nodeIds[nodes[i3 - 1]] = true;
18427 if (lookBackward && i3 < nodes.length - 1) {
18428 nodeIds[nodes[i3 + 1]] = true;
18433 Object.keys(nodeIds).forEach(function(nodeId) {
18435 geoAngle(this, resolver.entity(nodeId), projection2) * (180 / Math.PI) + 90
18439 return utilArrayUniq(results);
18441 isCrossing: function() {
18442 return this.tags.highway === "crossing" || this.tags.railway && this.tags.railway.indexOf("crossing") !== -1;
18444 isEndpoint: function(resolver) {
18445 return resolver.transient(this, "isEndpoint", function() {
18447 return resolver.parentWays(this).filter(function(parent2) {
18448 return !parent2.isClosed() && !!parent2.affix(id2);
18452 isConnected: function(resolver) {
18453 return resolver.transient(this, "isConnected", function() {
18454 var parents = resolver.parentWays(this);
18455 if (parents.length > 1) {
18456 for (var i3 in parents) {
18457 if (parents[i3].geometry(resolver) === "line" && parents[i3].hasInterestingTags()) return true;
18459 } else if (parents.length === 1) {
18460 var way = parents[0];
18461 var nodes = way.nodes.slice();
18462 if (way.isClosed()) {
18465 return nodes.indexOf(this.id) !== nodes.lastIndexOf(this.id);
18470 parentIntersectionWays: function(resolver) {
18471 return resolver.transient(this, "parentIntersectionWays", function() {
18472 return resolver.parentWays(this).filter(function(parent2) {
18473 return (parent2.tags.highway || parent2.tags.waterway || parent2.tags.railway || parent2.tags.aeroway) && parent2.geometry(resolver) === "line";
18477 isIntersection: function(resolver) {
18478 return this.parentIntersectionWays(resolver).length > 1;
18480 isHighwayIntersection: function(resolver) {
18481 return resolver.transient(this, "isHighwayIntersection", function() {
18482 return resolver.parentWays(this).filter(function(parent2) {
18483 return parent2.tags.highway && parent2.geometry(resolver) === "line";
18487 isOnAddressLine: function(resolver) {
18488 return resolver.transient(this, "isOnAddressLine", function() {
18489 return resolver.parentWays(this).filter(function(parent2) {
18490 return parent2.tags.hasOwnProperty("addr:interpolation") && parent2.geometry(resolver) === "line";
18494 asJXON: function(changeset_id) {
18497 "@id": this.osmId(),
18498 "@lon": this.loc[0],
18499 "@lat": this.loc[1],
18500 "@version": this.version || 0,
18501 tag: Object.keys(this.tags).map(function(k2) {
18502 return { keyAttributes: { k: k2, v: this.tags[k2] } };
18506 if (changeset_id) r2.node["@changeset"] = changeset_id;
18509 asGeoJSON: function() {
18512 coordinates: this.loc
18516 Object.assign(osmNode.prototype, prototype);
18520 // modules/actions/circularize.js
18521 var circularize_exports = {};
18522 __export(circularize_exports, {
18523 actionCircularize: () => actionCircularize
18525 function actionCircularize(wayId, projection2, maxAngle) {
18526 maxAngle = (maxAngle || 20) * Math.PI / 180;
18527 var action = function(graph, t2) {
18528 if (t2 === null || !isFinite(t2)) t2 = 1;
18529 t2 = Math.min(Math.max(+t2, 0), 1);
18530 var way = graph.entity(wayId);
18531 var origNodes = {};
18532 graph.childNodes(way).forEach(function(node2) {
18533 if (!origNodes[node2.id]) origNodes[node2.id] = node2;
18535 if (!way.isConvex(graph)) {
18536 graph = action.makeConvex(graph);
18538 var nodes = utilArrayUniq(graph.childNodes(way));
18539 var keyNodes = nodes.filter(function(n3) {
18540 return graph.parentWays(n3).length !== 1;
18542 var points = nodes.map(function(n3) {
18543 return projection2(n3.loc);
18545 var keyPoints = keyNodes.map(function(n3) {
18546 return projection2(n3.loc);
18548 var centroid = points.length === 2 ? geoVecInterp(points[0], points[1], 0.5) : centroid_default(points);
18549 var radius = median(points, function(p2) {
18550 return geoVecLength(centroid, p2);
18552 var sign2 = area_default(points) > 0 ? 1 : -1;
18553 var ids, i3, j3, k2;
18554 if (!keyNodes.length) {
18555 keyNodes = [nodes[0]];
18556 keyPoints = [points[0]];
18558 if (keyNodes.length === 1) {
18559 var index = nodes.indexOf(keyNodes[0]);
18560 var oppositeIndex = Math.floor((index + nodes.length / 2) % nodes.length);
18561 keyNodes.push(nodes[oppositeIndex]);
18562 keyPoints.push(points[oppositeIndex]);
18564 for (i3 = 0; i3 < keyPoints.length; i3++) {
18565 var nextKeyNodeIndex = (i3 + 1) % keyNodes.length;
18566 var startNode = keyNodes[i3];
18567 var endNode = keyNodes[nextKeyNodeIndex];
18568 var startNodeIndex = nodes.indexOf(startNode);
18569 var endNodeIndex = nodes.indexOf(endNode);
18570 var numberNewPoints = -1;
18571 var indexRange = endNodeIndex - startNodeIndex;
18572 var nearNodes = {};
18573 var inBetweenNodes = [];
18574 var startAngle, endAngle, totalAngle, eachAngle;
18575 var angle2, loc, node, origNode;
18576 if (indexRange < 0) {
18577 indexRange += nodes.length;
18579 var distance = geoVecLength(centroid, keyPoints[i3]) || 1e-4;
18581 centroid[0] + (keyPoints[i3][0] - centroid[0]) / distance * radius,
18582 centroid[1] + (keyPoints[i3][1] - centroid[1]) / distance * radius
18584 loc = projection2.invert(keyPoints[i3]);
18585 node = keyNodes[i3];
18586 origNode = origNodes[node.id];
18587 node = node.move(geoVecInterp(origNode.loc, loc, t2));
18588 graph = graph.replace(node);
18589 startAngle = Math.atan2(keyPoints[i3][1] - centroid[1], keyPoints[i3][0] - centroid[0]);
18590 endAngle = Math.atan2(keyPoints[nextKeyNodeIndex][1] - centroid[1], keyPoints[nextKeyNodeIndex][0] - centroid[0]);
18591 totalAngle = endAngle - startAngle;
18592 if (totalAngle * sign2 > 0) {
18593 totalAngle = -sign2 * (2 * Math.PI - Math.abs(totalAngle));
18597 eachAngle = totalAngle / (indexRange + numberNewPoints);
18598 } while (Math.abs(eachAngle) > maxAngle);
18599 for (j3 = 1; j3 < indexRange; j3++) {
18600 angle2 = startAngle + j3 * eachAngle;
18601 loc = projection2.invert([
18602 centroid[0] + Math.cos(angle2) * radius,
18603 centroid[1] + Math.sin(angle2) * radius
18605 node = nodes[(j3 + startNodeIndex) % nodes.length];
18606 origNode = origNodes[node.id];
18607 nearNodes[node.id] = angle2;
18608 node = node.move(geoVecInterp(origNode.loc, loc, t2));
18609 graph = graph.replace(node);
18611 for (j3 = 0; j3 < numberNewPoints; j3++) {
18612 angle2 = startAngle + (indexRange + j3) * eachAngle;
18613 loc = projection2.invert([
18614 centroid[0] + Math.cos(angle2) * radius,
18615 centroid[1] + Math.sin(angle2) * radius
18617 var min3 = Infinity;
18618 for (var nodeId in nearNodes) {
18619 var nearAngle = nearNodes[nodeId];
18620 var dist = Math.abs(nearAngle - angle2);
18623 origNode = origNodes[nodeId];
18626 node = osmNode({ loc: geoVecInterp(origNode.loc, loc, t2) });
18627 graph = graph.replace(node);
18628 nodes.splice(endNodeIndex + j3, 0, node);
18629 inBetweenNodes.push(node.id);
18631 if (indexRange === 1 && inBetweenNodes.length) {
18632 var startIndex1 = way.nodes.lastIndexOf(startNode.id);
18633 var endIndex1 = way.nodes.lastIndexOf(endNode.id);
18634 var wayDirection1 = endIndex1 - startIndex1;
18635 if (wayDirection1 < -1) {
18638 var parentWays = graph.parentWays(keyNodes[i3]);
18639 for (j3 = 0; j3 < parentWays.length; j3++) {
18640 var sharedWay = parentWays[j3];
18641 if (sharedWay === way) continue;
18642 if (sharedWay.areAdjacent(startNode.id, endNode.id)) {
18643 var startIndex2 = sharedWay.nodes.lastIndexOf(startNode.id);
18644 var endIndex2 = sharedWay.nodes.lastIndexOf(endNode.id);
18645 var wayDirection2 = endIndex2 - startIndex2;
18646 var insertAt = endIndex2;
18647 if (wayDirection2 < -1) {
18650 if (wayDirection1 !== wayDirection2) {
18651 inBetweenNodes.reverse();
18652 insertAt = startIndex2;
18654 for (k2 = 0; k2 < inBetweenNodes.length; k2++) {
18655 sharedWay = sharedWay.addNode(inBetweenNodes[k2], insertAt + k2);
18657 graph = graph.replace(sharedWay);
18662 ids = nodes.map(function(n3) {
18666 way = way.update({ nodes: ids });
18667 graph = graph.replace(way);
18670 action.makeConvex = function(graph) {
18671 var way = graph.entity(wayId);
18672 var nodes = utilArrayUniq(graph.childNodes(way));
18673 var points = nodes.map(function(n3) {
18674 return projection2(n3.loc);
18676 var sign2 = area_default(points) > 0 ? 1 : -1;
18677 var hull = hull_default(points);
18679 if (sign2 === -1) {
18683 for (i3 = 0; i3 < hull.length - 1; i3++) {
18684 var startIndex = points.indexOf(hull[i3]);
18685 var endIndex = points.indexOf(hull[i3 + 1]);
18686 var indexRange = endIndex - startIndex;
18687 if (indexRange < 0) {
18688 indexRange += nodes.length;
18690 for (j3 = 1; j3 < indexRange; j3++) {
18691 var point = geoVecInterp(hull[i3], hull[i3 + 1], j3 / indexRange);
18692 var node = nodes[(j3 + startIndex) % nodes.length].move(projection2.invert(point));
18693 graph = graph.replace(node);
18698 action.disabled = function(graph) {
18699 if (!graph.entity(wayId).isClosed()) {
18700 return "not_closed";
18702 var way = graph.entity(wayId);
18703 var nodes = utilArrayUniq(graph.childNodes(way));
18704 var points = nodes.map(function(n3) {
18705 return projection2(n3.loc);
18707 var hull = hull_default(points);
18708 var epsilonAngle = Math.PI / 180;
18709 if (hull.length !== points.length || hull.length < 3) {
18712 var centroid = centroid_default(points);
18713 var radius = geoVecLengthSquare(centroid, points[0]);
18714 var i3, actualPoint;
18715 for (i3 = 0; i3 < hull.length; i3++) {
18716 actualPoint = hull[i3];
18717 var actualDist = geoVecLengthSquare(actualPoint, centroid);
18718 var diff = Math.abs(actualDist - radius);
18719 if (diff > 0.05 * radius) {
18723 for (i3 = 0; i3 < hull.length; i3++) {
18724 actualPoint = hull[i3];
18725 var nextPoint = hull[(i3 + 1) % hull.length];
18726 var startAngle = Math.atan2(actualPoint[1] - centroid[1], actualPoint[0] - centroid[0]);
18727 var endAngle = Math.atan2(nextPoint[1] - centroid[1], nextPoint[0] - centroid[0]);
18728 var angle2 = endAngle - startAngle;
18732 if (angle2 > Math.PI) {
18733 angle2 = 2 * Math.PI - angle2;
18735 if (angle2 > maxAngle + epsilonAngle) {
18739 return "already_circular";
18741 action.transitionable = true;
18744 var init_circularize = __esm({
18745 "modules/actions/circularize.js"() {
18756 // modules/actions/delete_way.js
18757 var delete_way_exports = {};
18758 __export(delete_way_exports, {
18759 actionDeleteWay: () => actionDeleteWay
18761 function actionDeleteWay(wayID) {
18762 function canDeleteNode(node, graph) {
18763 if (graph.parentWays(node).length || graph.parentRelations(node).length) return false;
18764 var geometries = osmNodeGeometriesForTags(node.tags);
18765 if (geometries.point) return false;
18766 if (geometries.vertex) return true;
18767 return !node.hasInterestingTags();
18769 var action = function(graph) {
18770 var way = graph.entity(wayID);
18771 graph.parentRelations(way).forEach(function(parent2) {
18772 parent2 = parent2.removeMembersWithID(wayID);
18773 graph = graph.replace(parent2);
18774 if (parent2.isDegenerate()) {
18775 graph = actionDeleteRelation(parent2.id)(graph);
18778 new Set(way.nodes).forEach(function(nodeID) {
18779 graph = graph.replace(way.removeNode(nodeID));
18780 var node = graph.entity(nodeID);
18781 if (canDeleteNode(node, graph)) {
18782 graph = graph.remove(node);
18785 return graph.remove(way);
18789 var init_delete_way = __esm({
18790 "modules/actions/delete_way.js"() {
18793 init_delete_relation();
18797 // modules/actions/delete_multiple.js
18798 var delete_multiple_exports = {};
18799 __export(delete_multiple_exports, {
18800 actionDeleteMultiple: () => actionDeleteMultiple
18802 function actionDeleteMultiple(ids) {
18804 way: actionDeleteWay,
18805 node: actionDeleteNode,
18806 relation: actionDeleteRelation
18808 var action = function(graph) {
18809 ids.forEach(function(id2) {
18810 if (graph.hasEntity(id2)) {
18811 graph = actions[graph.entity(id2).type](id2)(graph);
18818 var init_delete_multiple = __esm({
18819 "modules/actions/delete_multiple.js"() {
18821 init_delete_node();
18822 init_delete_relation();
18827 // modules/actions/delete_relation.js
18828 var delete_relation_exports = {};
18829 __export(delete_relation_exports, {
18830 actionDeleteRelation: () => actionDeleteRelation
18832 function actionDeleteRelation(relationID, allowUntaggedMembers) {
18833 function canDeleteEntity(entity, graph) {
18834 return !graph.parentWays(entity).length && !graph.parentRelations(entity).length && (!entity.hasInterestingTags() && !allowUntaggedMembers);
18836 var action = function(graph) {
18837 var relation = graph.entity(relationID);
18838 graph.parentRelations(relation).forEach(function(parent2) {
18839 parent2 = parent2.removeMembersWithID(relationID);
18840 graph = graph.replace(parent2);
18841 if (parent2.isDegenerate()) {
18842 graph = actionDeleteRelation(parent2.id)(graph);
18845 var memberIDs = utilArrayUniq(relation.members.map(function(m3) {
18848 memberIDs.forEach(function(memberID) {
18849 graph = graph.replace(relation.removeMembersWithID(memberID));
18850 var entity = graph.entity(memberID);
18851 if (canDeleteEntity(entity, graph)) {
18852 graph = actionDeleteMultiple([memberID])(graph);
18855 return graph.remove(relation);
18859 var init_delete_relation = __esm({
18860 "modules/actions/delete_relation.js"() {
18862 init_delete_multiple();
18867 // modules/actions/delete_node.js
18868 var delete_node_exports = {};
18869 __export(delete_node_exports, {
18870 actionDeleteNode: () => actionDeleteNode
18872 function actionDeleteNode(nodeId) {
18873 var action = function(graph) {
18874 var node = graph.entity(nodeId);
18875 graph.parentWays(node).forEach(function(parent2) {
18876 parent2 = parent2.removeNode(nodeId);
18877 graph = graph.replace(parent2);
18878 if (parent2.isDegenerate()) {
18879 graph = actionDeleteWay(parent2.id)(graph);
18882 graph.parentRelations(node).forEach(function(parent2) {
18883 parent2 = parent2.removeMembersWithID(nodeId);
18884 graph = graph.replace(parent2);
18885 if (parent2.isDegenerate()) {
18886 graph = actionDeleteRelation(parent2.id)(graph);
18889 return graph.remove(node);
18893 var init_delete_node = __esm({
18894 "modules/actions/delete_node.js"() {
18896 init_delete_relation();
18901 // modules/actions/connect.js
18902 var connect_exports = {};
18903 __export(connect_exports, {
18904 actionConnect: () => actionConnect
18906 function actionConnect(nodeIDs) {
18907 var action = function(graph) {
18913 var interestingIDs = [];
18914 for (i3 = 0; i3 < nodeIDs.length; i3++) {
18915 node = graph.entity(nodeIDs[i3]);
18916 if (node.hasInterestingTags()) {
18917 if (!node.isNew()) {
18918 interestingIDs.push(node.id);
18922 survivor = graph.entity(utilOldestID(interestingIDs.length > 0 ? interestingIDs : nodeIDs));
18923 for (i3 = 0; i3 < nodeIDs.length; i3++) {
18924 node = graph.entity(nodeIDs[i3]);
18925 if (node.id === survivor.id) continue;
18926 parents = graph.parentWays(node);
18927 for (j3 = 0; j3 < parents.length; j3++) {
18928 graph = graph.replace(parents[j3].replaceNode(node.id, survivor.id));
18930 parents = graph.parentRelations(node);
18931 for (j3 = 0; j3 < parents.length; j3++) {
18932 graph = graph.replace(parents[j3].replaceMember(node, survivor));
18934 survivor = survivor.mergeTags(node.tags);
18935 graph = actionDeleteNode(node.id)(graph);
18937 graph = graph.replace(survivor);
18938 parents = graph.parentWays(survivor);
18939 for (i3 = 0; i3 < parents.length; i3++) {
18940 if (parents[i3].isDegenerate()) {
18941 graph = actionDeleteWay(parents[i3].id)(graph);
18946 action.disabled = function(graph) {
18948 var restrictionIDs = [];
18951 var relations, relation, role;
18953 survivor = graph.entity(utilOldestID(nodeIDs));
18954 for (i3 = 0; i3 < nodeIDs.length; i3++) {
18955 node = graph.entity(nodeIDs[i3]);
18956 relations = graph.parentRelations(node);
18957 for (j3 = 0; j3 < relations.length; j3++) {
18958 relation = relations[j3];
18959 role = relation.memberById(node.id).role || "";
18960 if (relation.hasFromViaTo()) {
18961 restrictionIDs.push(relation.id);
18963 if (seen[relation.id] !== void 0 && seen[relation.id] !== role) {
18966 seen[relation.id] = role;
18970 for (i3 = 0; i3 < nodeIDs.length; i3++) {
18971 node = graph.entity(nodeIDs[i3]);
18972 var parents = graph.parentWays(node);
18973 for (j3 = 0; j3 < parents.length; j3++) {
18974 var parent2 = parents[j3];
18975 relations = graph.parentRelations(parent2);
18976 for (k2 = 0; k2 < relations.length; k2++) {
18977 relation = relations[k2];
18978 if (relation.hasFromViaTo()) {
18979 restrictionIDs.push(relation.id);
18984 restrictionIDs = utilArrayUniq(restrictionIDs);
18985 for (i3 = 0; i3 < restrictionIDs.length; i3++) {
18986 relation = graph.entity(restrictionIDs[i3]);
18987 if (!relation.isComplete(graph)) continue;
18988 var memberWays = relation.members.filter(function(m3) {
18989 return m3.type === "way";
18990 }).map(function(m3) {
18991 return graph.entity(m3.id);
18993 memberWays = utilArrayUniq(memberWays);
18994 var f2 = relation.memberByRole("from");
18995 var t2 = relation.memberByRole("to");
18996 var isUturn = f2.id === t2.id;
18997 var nodes = { from: [], via: [], to: [], keyfrom: [], keyto: [] };
18998 for (j3 = 0; j3 < relation.members.length; j3++) {
18999 collectNodes(relation.members[j3], nodes);
19001 nodes.keyfrom = utilArrayUniq(nodes.keyfrom.filter(hasDuplicates));
19002 nodes.keyto = utilArrayUniq(nodes.keyto.filter(hasDuplicates));
19003 var filter2 = keyNodeFilter(nodes.keyfrom, nodes.keyto);
19004 nodes.from = nodes.from.filter(filter2);
19005 nodes.via = nodes.via.filter(filter2);
19006 nodes.to = nodes.to.filter(filter2);
19007 var connectFrom = false;
19008 var connectVia = false;
19009 var connectTo = false;
19010 var connectKeyFrom = false;
19011 var connectKeyTo = false;
19012 for (j3 = 0; j3 < nodeIDs.length; j3++) {
19013 var n3 = nodeIDs[j3];
19014 if (nodes.from.indexOf(n3) !== -1) {
19015 connectFrom = true;
19017 if (nodes.via.indexOf(n3) !== -1) {
19020 if (nodes.to.indexOf(n3) !== -1) {
19023 if (nodes.keyfrom.indexOf(n3) !== -1) {
19024 connectKeyFrom = true;
19026 if (nodes.keyto.indexOf(n3) !== -1) {
19027 connectKeyTo = true;
19030 if (connectFrom && connectTo && !isUturn) {
19031 return "restriction";
19033 if (connectFrom && connectVia) {
19034 return "restriction";
19036 if (connectTo && connectVia) {
19037 return "restriction";
19039 if (connectKeyFrom || connectKeyTo) {
19040 if (nodeIDs.length !== 2) {
19041 return "restriction";
19045 for (j3 = 0; j3 < memberWays.length; j3++) {
19046 way = memberWays[j3];
19047 if (way.contains(nodeIDs[0])) {
19050 if (way.contains(nodeIDs[1])) {
19056 for (j3 = 0; j3 < memberWays.length; j3++) {
19057 way = memberWays[j3];
19058 if (way.areAdjacent(n0, n1)) {
19064 return "restriction";
19068 for (j3 = 0; j3 < memberWays.length; j3++) {
19069 way = memberWays[j3].update({});
19070 for (k2 = 0; k2 < nodeIDs.length; k2++) {
19071 if (nodeIDs[k2] === survivor.id) continue;
19072 if (way.areAdjacent(nodeIDs[k2], survivor.id)) {
19073 way = way.removeNode(nodeIDs[k2]);
19075 way = way.replaceNode(nodeIDs[k2], survivor.id);
19078 if (way.isDegenerate()) {
19079 return "restriction";
19084 function hasDuplicates(n4, i4, arr) {
19085 return arr.indexOf(n4) !== arr.lastIndexOf(n4);
19087 function keyNodeFilter(froms, tos) {
19088 return function(n4) {
19089 return froms.indexOf(n4) === -1 && tos.indexOf(n4) === -1;
19092 function collectNodes(member, collection) {
19093 var entity = graph.hasEntity(member.id);
19094 if (!entity) return;
19095 var role2 = member.role || "";
19096 if (!collection[role2]) {
19097 collection[role2] = [];
19099 if (member.type === "node") {
19100 collection[role2].push(member.id);
19101 if (role2 === "via") {
19102 collection.keyfrom.push(member.id);
19103 collection.keyto.push(member.id);
19105 } else if (member.type === "way") {
19106 collection[role2].push.apply(collection[role2], entity.nodes);
19107 if (role2 === "from" || role2 === "via") {
19108 collection.keyfrom.push(entity.first());
19109 collection.keyfrom.push(entity.last());
19111 if (role2 === "to" || role2 === "via") {
19112 collection.keyto.push(entity.first());
19113 collection.keyto.push(entity.last());
19120 var init_connect = __esm({
19121 "modules/actions/connect.js"() {
19123 init_delete_node();
19129 // modules/actions/copy_entities.js
19130 var copy_entities_exports = {};
19131 __export(copy_entities_exports, {
19132 actionCopyEntities: () => actionCopyEntities
19134 function actionCopyEntities(ids, fromGraph) {
19136 var action = function(graph) {
19137 ids.forEach(function(id3) {
19138 fromGraph.entity(id3).copy(fromGraph, _copies);
19140 for (var id2 in _copies) {
19141 graph = graph.replace(_copies[id2]);
19145 action.copies = function() {
19150 var init_copy_entities = __esm({
19151 "modules/actions/copy_entities.js"() {
19156 // modules/actions/delete_member.js
19157 var delete_member_exports = {};
19158 __export(delete_member_exports, {
19159 actionDeleteMember: () => actionDeleteMember
19161 function actionDeleteMember(relationId, memberIndex) {
19162 return function(graph) {
19163 var relation = graph.entity(relationId).removeMember(memberIndex);
19164 graph = graph.replace(relation);
19165 if (relation.isDegenerate()) {
19166 graph = actionDeleteRelation(relation.id)(graph);
19171 var init_delete_member = __esm({
19172 "modules/actions/delete_member.js"() {
19174 init_delete_relation();
19178 // modules/actions/delete_members.js
19179 var delete_members_exports = {};
19180 __export(delete_members_exports, {
19181 actionDeleteMembers: () => actionDeleteMembers
19183 function actionDeleteMembers(relationId, memberIndexes) {
19184 return function(graph) {
19185 memberIndexes.sort((a2, b3) => b3 - a2);
19186 for (var i3 in memberIndexes) {
19187 graph = actionDeleteMember(relationId, memberIndexes[i3])(graph);
19192 var init_delete_members = __esm({
19193 "modules/actions/delete_members.js"() {
19195 init_delete_member();
19199 // modules/actions/discard_tags.js
19200 var discard_tags_exports = {};
19201 __export(discard_tags_exports, {
19202 actionDiscardTags: () => actionDiscardTags
19204 function actionDiscardTags(difference2, discardTags) {
19205 discardTags = discardTags || {};
19206 return (graph) => {
19207 difference2.modified().forEach(checkTags);
19208 difference2.created().forEach(checkTags);
19210 function checkTags(entity) {
19211 const keys2 = Object.keys(entity.tags);
19212 let didDiscard = false;
19214 for (let i3 = 0; i3 < keys2.length; i3++) {
19215 const k2 = keys2[i3];
19216 const v3 = entity.tags[k2];
19217 if (discardTags[k2] === true || typeof discardTags[k2] === "object" && discardTags[k2][v3] || !entity.tags[k2]) {
19220 tags[k2] = entity.tags[k2];
19224 graph = graph.replace(entity.update({ tags }));
19229 var init_discard_tags = __esm({
19230 "modules/actions/discard_tags.js"() {
19235 // modules/actions/disconnect.js
19236 var disconnect_exports = {};
19237 __export(disconnect_exports, {
19238 actionDisconnect: () => actionDisconnect
19240 function actionDisconnect(nodeId, newNodeId) {
19242 var disconnectableRelationTypes = {
19243 "associatedStreet": true,
19244 "enforcement": true,
19247 var action = function(graph) {
19248 var node = graph.entity(nodeId);
19249 var connections = action.connections(graph);
19250 connections.forEach(function(connection) {
19251 var way = graph.entity(connection.wayID);
19252 var newNode = osmNode({ id: newNodeId, loc: node.loc, tags: node.tags });
19253 graph = graph.replace(newNode);
19254 if (connection.index === 0 && way.isArea()) {
19255 graph = graph.replace(way.replaceNode(way.nodes[0], newNode.id));
19256 } else if (way.isClosed() && connection.index === way.nodes.length - 1) {
19257 graph = graph.replace(way.unclose().addNode(newNode.id));
19259 graph = graph.replace(way.updateNode(newNode.id, connection.index));
19264 action.connections = function(graph) {
19265 var candidates = [];
19266 var keeping = false;
19267 var parentWays = graph.parentWays(graph.entity(nodeId));
19269 for (var i3 = 0; i3 < parentWays.length; i3++) {
19270 way = parentWays[i3];
19271 if (wayIds && wayIds.indexOf(way.id) === -1) {
19275 if (way.isArea() && way.nodes[0] === nodeId) {
19276 candidates.push({ wayID: way.id, index: 0 });
19278 for (var j3 = 0; j3 < way.nodes.length; j3++) {
19279 waynode = way.nodes[j3];
19280 if (waynode === nodeId) {
19281 if (way.isClosed() && parentWays.length > 1 && wayIds && wayIds.indexOf(way.id) !== -1 && j3 === way.nodes.length - 1) {
19284 candidates.push({ wayID: way.id, index: j3 });
19289 return keeping ? candidates : candidates.slice(1);
19291 action.disabled = function(graph) {
19292 var connections = action.connections(graph);
19293 if (connections.length === 0) return "not_connected";
19294 var parentWays = graph.parentWays(graph.entity(nodeId));
19295 var seenRelationIds = {};
19296 var sharedRelation;
19297 parentWays.forEach(function(way) {
19298 var relations = graph.parentRelations(way);
19299 relations.filter((relation) => !disconnectableRelationTypes[relation.tags.type]).forEach(function(relation) {
19300 if (relation.id in seenRelationIds) {
19302 if (wayIds.indexOf(way.id) !== -1 || wayIds.indexOf(seenRelationIds[relation.id]) !== -1) {
19303 sharedRelation = relation;
19306 sharedRelation = relation;
19309 seenRelationIds[relation.id] = way.id;
19313 if (sharedRelation) return "relation";
19315 action.limitWays = function(val) {
19316 if (!arguments.length) return wayIds;
19322 var init_disconnect = __esm({
19323 "modules/actions/disconnect.js"() {
19329 // modules/actions/extract.js
19330 var extract_exports = {};
19331 __export(extract_exports, {
19332 actionExtract: () => actionExtract
19334 function actionExtract(entityID, projection2) {
19335 var extractedNodeID;
19336 var action = function(graph, shiftKeyPressed) {
19337 var entity = graph.entity(entityID);
19338 if (entity.type === "node") {
19339 return extractFromNode(entity, graph, shiftKeyPressed);
19341 return extractFromWayOrRelation(entity, graph);
19343 function extractFromNode(node, graph, shiftKeyPressed) {
19344 extractedNodeID = node.id;
19345 var replacement = osmNode({ loc: node.loc });
19346 graph = graph.replace(replacement);
19347 graph = graph.parentWays(node).reduce(function(accGraph, parentWay) {
19348 return accGraph.replace(parentWay.replaceNode(entityID, replacement.id));
19350 if (!shiftKeyPressed) return graph;
19351 return graph.parentRelations(node).reduce(function(accGraph, parentRel) {
19352 return accGraph.replace(parentRel.replaceMember(node, replacement));
19355 function extractFromWayOrRelation(entity, graph) {
19356 var fromGeometry = entity.geometry(graph);
19357 var keysToCopyAndRetain = ["source", "wheelchair"];
19358 var keysToRetain = ["area"];
19359 var buildingKeysToRetain = ["architect", "building", "height", "layer", "nycdoitt:bin", "ref:GB:uprn", "ref:linz:building_id"];
19360 var extractedLoc = path_default(projection2).centroid(entity.asGeoJSON(graph));
19361 extractedLoc = extractedLoc && projection2.invert(extractedLoc);
19362 if (!extractedLoc || !isFinite(extractedLoc[0]) || !isFinite(extractedLoc[1])) {
19363 extractedLoc = entity.extent(graph).center();
19365 var indoorAreaValues = {
19372 var isBuilding = entity.tags.building && entity.tags.building !== "no" || entity.tags["building:part"] && entity.tags["building:part"] !== "no";
19373 var isIndoorArea = fromGeometry === "area" && entity.tags.indoor && indoorAreaValues[entity.tags.indoor];
19374 var entityTags = Object.assign({}, entity.tags);
19375 var pointTags = {};
19376 for (var key in entityTags) {
19377 if (entity.type === "relation" && key === "type") {
19380 if (keysToRetain.indexOf(key) !== -1) {
19384 if (buildingKeysToRetain.indexOf(key) !== -1 || key.match(/^building:.{1,}/) || key.match(/^roof:.{1,}/)) continue;
19386 if (isIndoorArea && key === "indoor") {
19389 pointTags[key] = entityTags[key];
19390 if (keysToCopyAndRetain.indexOf(key) !== -1 || key.match(/^addr:.{1,}/)) {
19392 } else if (isIndoorArea && key === "level") {
19395 delete entityTags[key];
19397 if (!isBuilding && !isIndoorArea && fromGeometry === "area") {
19398 entityTags.area = "yes";
19400 var replacement = osmNode({ loc: extractedLoc, tags: pointTags });
19401 graph = graph.replace(replacement);
19402 extractedNodeID = replacement.id;
19403 return graph.replace(entity.update({ tags: entityTags }));
19405 action.getExtractedNodeID = function() {
19406 return extractedNodeID;
19410 var init_extract = __esm({
19411 "modules/actions/extract.js"() {
19418 // modules/actions/join.js
19419 var join_exports = {};
19420 __export(join_exports, {
19421 actionJoin: () => actionJoin
19423 function actionJoin(ids) {
19424 function groupEntitiesByGeometry(graph) {
19425 var entities = ids.map(function(id2) {
19426 return graph.entity(id2);
19428 return Object.assign(
19430 utilArrayGroupBy(entities, function(entity) {
19431 return entity.geometry(graph);
19435 var action = function(graph) {
19436 var ways = ids.map(graph.entity, graph);
19437 var survivorID = utilOldestID(ways.map((way) => way.id));
19438 ways.sort(function(a2, b3) {
19439 var aSided = a2.isSided();
19440 var bSided = b3.isSided();
19441 return aSided && !bSided ? -1 : bSided && !aSided ? 1 : 0;
19443 var sequences = osmJoinWays(ways, graph);
19444 var joined = sequences[0];
19445 graph = sequences.actions.reduce(function(g3, action2) {
19446 return action2(g3);
19448 var survivor = graph.entity(survivorID);
19449 survivor = survivor.update({ nodes: joined.nodes.map(function(n3) {
19452 graph = graph.replace(survivor);
19453 joined.forEach(function(way) {
19454 if (way.id === survivorID) return;
19455 graph.parentRelations(way).forEach(function(parent2) {
19456 graph = graph.replace(parent2.replaceMember(way, survivor));
19458 const summedTags = {};
19459 for (const key in way.tags) {
19460 if (!canSumTags(key, way.tags, survivor.tags)) continue;
19461 summedTags[key] = (+way.tags[key] + +survivor.tags[key]).toString();
19463 survivor = survivor.mergeTags(way.tags, summedTags);
19464 graph = graph.replace(survivor);
19465 graph = actionDeleteWay(way.id)(graph);
19467 function checkForSimpleMultipolygon() {
19468 if (!survivor.isClosed()) return;
19469 var multipolygons = graph.parentMultipolygons(survivor).filter(function(multipolygon2) {
19470 return multipolygon2.members.length === 1;
19472 if (multipolygons.length !== 1) return;
19473 var multipolygon = multipolygons[0];
19474 for (var key in survivor.tags) {
19475 if (multipolygon.tags[key] && // don't collapse if tags cannot be cleanly merged
19476 multipolygon.tags[key] !== survivor.tags[key]) return;
19478 survivor = survivor.mergeTags(multipolygon.tags);
19479 graph = graph.replace(survivor);
19480 graph = actionDeleteRelation(
19483 /* allow untagged members */
19485 var tags = Object.assign({}, survivor.tags);
19486 if (survivor.geometry(graph) !== "area") {
19490 survivor = survivor.update({ tags });
19491 graph = graph.replace(survivor);
19493 checkForSimpleMultipolygon();
19496 action.resultingWayNodesLength = function(graph) {
19497 return ids.reduce(function(count, id2) {
19498 return count + graph.entity(id2).nodes.length;
19499 }, 0) - ids.length - 1;
19501 action.disabled = function(graph) {
19502 var geometries = groupEntitiesByGeometry(graph);
19503 if (ids.length < 2 || ids.length !== geometries.line.length) {
19504 return "not_eligible";
19506 var joined = osmJoinWays(ids.map(graph.entity, graph), graph);
19507 if (joined.length > 1) {
19508 return "not_adjacent";
19511 var sortedParentRelations = function(id2) {
19512 return graph.parentRelations(graph.entity(id2)).filter((rel) => !rel.isRestriction() && !rel.isConnectivity()).sort((a2, b3) => a2.id.localeCompare(b3.id));
19514 var relsA = sortedParentRelations(ids[0]);
19515 for (i3 = 1; i3 < ids.length; i3++) {
19516 var relsB = sortedParentRelations(ids[i3]);
19517 if (!utilArrayIdentical(relsA, relsB)) {
19518 return "conflicting_relations";
19521 for (i3 = 0; i3 < ids.length - 1; i3++) {
19522 for (var j3 = i3 + 1; j3 < ids.length; j3++) {
19523 var path1 = graph.childNodes(graph.entity(ids[i3])).map(function(e3) {
19526 var path2 = graph.childNodes(graph.entity(ids[j3])).map(function(e3) {
19529 var intersections = geoPathIntersections(path1, path2);
19530 var common = utilArrayIntersection(
19531 joined[0].nodes.map(function(n3) {
19532 return n3.loc.toString();
19534 intersections.map(function(n3) {
19535 return n3.toString();
19538 if (common.length !== intersections.length) {
19539 return "paths_intersect";
19543 var nodeIds = joined[0].nodes.map(function(n3) {
19548 var conflicting = false;
19549 joined[0].forEach(function(way) {
19550 var parents = graph.parentRelations(way);
19551 parents.forEach(function(parent2) {
19552 if ((parent2.isRestriction() || parent2.isConnectivity()) && parent2.members.some(function(m3) {
19553 return nodeIds.indexOf(m3.id) >= 0;
19555 relation = parent2;
19558 for (var k2 in way.tags) {
19559 if (!(k2 in tags)) {
19560 tags[k2] = way.tags[k2];
19561 } else if (canSumTags(k2, tags, way.tags)) {
19562 tags[k2] = (+tags[k2] + +way.tags[k2]).toString();
19563 } else if (tags[k2] && osmIsInterestingTag(k2) && tags[k2] !== way.tags[k2]) {
19564 conflicting = true;
19569 return relation.isRestriction() ? "restriction" : "connectivity";
19572 return "conflicting_tags";
19575 function canSumTags(key, tagsA, tagsB) {
19576 return osmSummableTags.has(key) && isFinite(tagsA[key] && isFinite(tagsB[key]));
19580 var init_join2 = __esm({
19581 "modules/actions/join.js"() {
19583 init_delete_relation();
19586 init_multipolygon();
19592 // modules/actions/merge.js
19593 var merge_exports = {};
19594 __export(merge_exports, {
19595 actionMerge: () => actionMerge
19597 function actionMerge(ids) {
19598 function groupEntitiesByGeometry(graph) {
19599 var entities = ids.map(function(id2) {
19600 return graph.entity(id2);
19602 return Object.assign(
19603 { point: [], area: [], line: [], relation: [] },
19604 utilArrayGroupBy(entities, function(entity) {
19605 return entity.geometry(graph);
19609 var action = function(graph) {
19610 var geometries = groupEntitiesByGeometry(graph);
19611 var target = geometries.area[0] || geometries.line[0];
19612 var points = geometries.point;
19613 points.forEach(function(point) {
19614 target = target.mergeTags(point.tags);
19615 graph = graph.replace(target);
19616 graph.parentRelations(point).forEach(function(parent2) {
19617 graph = graph.replace(parent2.replaceMember(point, target));
19619 var nodes = utilArrayUniq(graph.childNodes(target));
19620 var removeNode = point;
19621 if (!point.isNew()) {
19622 var inserted = false;
19623 var canBeReplaced = function(node2) {
19624 return !(graph.parentWays(node2).length > 1 || graph.parentRelations(node2).length);
19626 var replaceNode = function(node2) {
19627 graph = graph.replace(point.update({ tags: node2.tags, loc: node2.loc }));
19628 target = target.replaceNode(node2.id, point.id);
19629 graph = graph.replace(target);
19630 removeNode = node2;
19635 for (i3 = 0; i3 < nodes.length; i3++) {
19637 if (canBeReplaced(node) && node.isNew()) {
19642 if (!inserted && point.hasInterestingTags()) {
19643 for (i3 = 0; i3 < nodes.length; i3++) {
19645 if (canBeReplaced(node) && !node.hasInterestingTags()) {
19651 for (i3 = 0; i3 < nodes.length; i3++) {
19653 if (canBeReplaced(node) && utilCompareIDs(point.id, node.id) < 0) {
19661 graph = graph.remove(removeNode);
19663 if (target.tags.area === "yes") {
19664 var tags = Object.assign({}, target.tags);
19666 if (osmTagSuggestingArea(tags)) {
19667 target = target.update({ tags });
19668 graph = graph.replace(target);
19673 action.disabled = function(graph) {
19674 var geometries = groupEntitiesByGeometry(graph);
19675 if (geometries.point.length === 0 || geometries.area.length + geometries.line.length !== 1 || geometries.relation.length !== 0) {
19676 return "not_eligible";
19681 var init_merge5 = __esm({
19682 "modules/actions/merge.js"() {
19689 // modules/actions/merge_nodes.js
19690 var merge_nodes_exports = {};
19691 __export(merge_nodes_exports, {
19692 actionMergeNodes: () => actionMergeNodes
19694 function actionMergeNodes(nodeIDs, loc) {
19695 function chooseLoc(graph) {
19696 if (!nodeIDs.length) return null;
19698 var interestingCount = 0;
19699 var interestingLoc;
19700 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
19701 var node = graph.entity(nodeIDs[i3]);
19702 if (node.hasInterestingTags()) {
19703 interestingLoc = ++interestingCount === 1 ? node.loc : null;
19705 sum = geoVecAdd(sum, node.loc);
19707 return interestingLoc || geoVecScale(sum, 1 / nodeIDs.length);
19709 var action = function(graph) {
19710 if (nodeIDs.length < 2) return graph;
19713 toLoc = chooseLoc(graph);
19715 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
19716 var node = graph.entity(nodeIDs[i3]);
19717 if (node.loc !== toLoc) {
19718 graph = graph.replace(node.move(toLoc));
19721 return actionConnect(nodeIDs)(graph);
19723 action.disabled = function(graph) {
19724 if (nodeIDs.length < 2) return "not_eligible";
19725 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
19726 var entity = graph.entity(nodeIDs[i3]);
19727 if (entity.type !== "node") return "not_eligible";
19729 return actionConnect(nodeIDs).disabled(graph);
19733 var init_merge_nodes = __esm({
19734 "modules/actions/merge_nodes.js"() {
19741 // modules/osm/changeset.js
19742 var changeset_exports = {};
19743 __export(changeset_exports, {
19744 osmChangeset: () => osmChangeset
19746 function osmChangeset() {
19747 if (!(this instanceof osmChangeset)) {
19748 return new osmChangeset().initialize(arguments);
19749 } else if (arguments.length) {
19750 this.initialize(arguments);
19753 var init_changeset = __esm({
19754 "modules/osm/changeset.js"() {
19758 osmEntity.changeset = osmChangeset;
19759 osmChangeset.prototype = Object.create(osmEntity.prototype);
19760 Object.assign(osmChangeset.prototype, {
19762 extent: function() {
19763 return new geoExtent();
19765 geometry: function() {
19766 return "changeset";
19768 asJXON: function() {
19772 tag: Object.keys(this.tags).map(function(k2) {
19773 return { "@k": k2, "@v": this.tags[k2] };
19781 // Generate [osmChange](http://wiki.openstreetmap.org/wiki/OsmChange)
19782 // XML. Returns a string.
19783 osmChangeJXON: function(changes) {
19784 var changeset_id = this.id;
19785 function nest(x2, order) {
19787 for (var i3 = 0; i3 < x2.length; i3++) {
19788 var tagName = Object.keys(x2[i3])[0];
19789 if (!groups[tagName]) groups[tagName] = [];
19790 groups[tagName].push(x2[i3][tagName]);
19793 order.forEach(function(o2) {
19794 if (groups[o2]) ordered[o2] = groups[o2];
19798 function sort(changes2) {
19799 function resolve(item) {
19800 return relations.find(function(relation2) {
19801 return item.keyAttributes.type === "relation" && item.keyAttributes.ref === relation2["@id"];
19804 function isNew(item) {
19805 return !sorted[item["@id"]] && !processing.find(function(proc) {
19806 return proc["@id"] === item["@id"];
19809 var processing = [];
19811 var relations = changes2.relation;
19812 if (!relations) return changes2;
19813 for (var i3 = 0; i3 < relations.length; i3++) {
19814 var relation = relations[i3];
19815 if (!sorted[relation["@id"]]) {
19816 processing.push(relation);
19818 while (processing.length > 0) {
19819 var next = processing[0], deps = next.member.map(resolve).filter(Boolean).filter(isNew);
19820 if (deps.length === 0) {
19821 sorted[next["@id"]] = next;
19822 processing.shift();
19824 processing = deps.concat(processing);
19828 changes2.relation = Object.values(sorted);
19831 function rep(entity) {
19832 return entity.asJXON(changeset_id);
19837 "@generator": "iD",
19838 "create": sort(nest(changes.created.map(rep), ["node", "way", "relation"])),
19839 "modify": nest(changes.modified.map(rep), ["node", "way", "relation"]),
19840 "delete": Object.assign(nest(changes.deleted.map(rep), ["relation", "way", "node"]), { "@if-unused": true })
19844 asGeoJSON: function() {
19851 // modules/osm/note.js
19852 var note_exports = {};
19853 __export(note_exports, {
19854 osmNote: () => osmNote
19856 function osmNote() {
19857 if (!(this instanceof osmNote)) {
19858 return new osmNote().initialize(arguments);
19859 } else if (arguments.length) {
19860 this.initialize(arguments);
19863 var init_note = __esm({
19864 "modules/osm/note.js"() {
19867 osmNote.id = function() {
19868 return osmNote.id.next--;
19870 osmNote.id.next = -1;
19871 Object.assign(osmNote.prototype, {
19873 initialize: function(sources) {
19874 for (var i3 = 0; i3 < sources.length; ++i3) {
19875 var source = sources[i3];
19876 for (var prop in source) {
19877 if (Object.prototype.hasOwnProperty.call(source, prop)) {
19878 if (source[prop] === void 0) {
19881 this[prop] = source[prop];
19887 this.id = osmNote.id().toString();
19891 extent: function() {
19892 return new geoExtent(this.loc);
19894 update: function(attrs) {
19895 return osmNote(this, attrs);
19897 isNew: function() {
19898 return this.id < 0;
19900 move: function(loc) {
19901 return this.update({ loc });
19907 // modules/osm/relation.js
19908 var relation_exports = {};
19909 __export(relation_exports, {
19910 osmRelation: () => osmRelation
19912 function osmRelation() {
19913 if (!(this instanceof osmRelation)) {
19914 return new osmRelation().initialize(arguments);
19915 } else if (arguments.length) {
19916 this.initialize(arguments);
19920 var init_relation = __esm({
19921 "modules/osm/relation.js"() {
19925 init_multipolygon();
19927 osmEntity.relation = osmRelation;
19928 osmRelation.prototype = Object.create(osmEntity.prototype);
19929 osmRelation.creationOrder = function(a2, b3) {
19930 var aId = parseInt(osmEntity.id.toOSM(a2.id), 10);
19931 var bId = parseInt(osmEntity.id.toOSM(b3.id), 10);
19932 if (aId < 0 || bId < 0) return aId - bId;
19938 copy: function(resolver, copies) {
19939 if (copies[this.id]) return copies[this.id];
19940 var copy2 = osmEntity.prototype.copy.call(this, resolver, copies);
19941 var members = this.members.map(function(member) {
19942 return Object.assign({}, member, { id: resolver.entity(member.id).copy(resolver, copies).id });
19944 copy2 = copy2.update({ members });
19945 copies[this.id] = copy2;
19948 extent: function(resolver, memo) {
19949 return resolver.transient(this, "extent", function() {
19950 if (memo && memo[this.id]) return geoExtent();
19952 memo[this.id] = true;
19953 var extent = geoExtent();
19954 for (var i3 = 0; i3 < this.members.length; i3++) {
19955 var member = resolver.hasEntity(this.members[i3].id);
19957 extent._extend(member.extent(resolver, memo));
19963 geometry: function(graph) {
19964 return graph.transient(this, "geometry", function() {
19965 return this.isMultipolygon() ? "area" : "relation";
19968 isDegenerate: function() {
19969 return this.members.length === 0;
19971 // Return an array of members, each extended with an 'index' property whose value
19972 // is the member index.
19973 indexedMembers: function() {
19974 var result = new Array(this.members.length);
19975 for (var i3 = 0; i3 < this.members.length; i3++) {
19976 result[i3] = Object.assign({}, this.members[i3], { index: i3 });
19980 // Return the first member with the given role. A copy of the member object
19981 // is returned, extended with an 'index' property whose value is the member index.
19982 memberByRole: function(role) {
19983 for (var i3 = 0; i3 < this.members.length; i3++) {
19984 if (this.members[i3].role === role) {
19985 return Object.assign({}, this.members[i3], { index: i3 });
19989 // Same as memberByRole, but returns all members with the given role
19990 membersByRole: function(role) {
19992 for (var i3 = 0; i3 < this.members.length; i3++) {
19993 if (this.members[i3].role === role) {
19994 result.push(Object.assign({}, this.members[i3], { index: i3 }));
19999 // Return the first member with the given id. A copy of the member object
20000 // is returned, extended with an 'index' property whose value is the member index.
20001 memberById: function(id2) {
20002 for (var i3 = 0; i3 < this.members.length; i3++) {
20003 if (this.members[i3].id === id2) {
20004 return Object.assign({}, this.members[i3], { index: i3 });
20008 // Return the first member with the given id and role. A copy of the member object
20009 // is returned, extended with an 'index' property whose value is the member index.
20010 memberByIdAndRole: function(id2, role) {
20011 for (var i3 = 0; i3 < this.members.length; i3++) {
20012 if (this.members[i3].id === id2 && this.members[i3].role === role) {
20013 return Object.assign({}, this.members[i3], { index: i3 });
20017 addMember: function(member, index) {
20018 var members = this.members.slice();
20019 members.splice(index === void 0 ? members.length : index, 0, member);
20020 return this.update({ members });
20022 updateMember: function(member, index) {
20023 var members = this.members.slice();
20024 members.splice(index, 1, Object.assign({}, members[index], member));
20025 return this.update({ members });
20027 removeMember: function(index) {
20028 var members = this.members.slice();
20029 members.splice(index, 1);
20030 return this.update({ members });
20032 removeMembersWithID: function(id2) {
20033 var members = this.members.filter(function(m3) {
20034 return m3.id !== id2;
20036 return this.update({ members });
20038 moveMember: function(fromIndex, toIndex) {
20039 var members = this.members.slice();
20040 members.splice(toIndex, 0, members.splice(fromIndex, 1)[0]);
20041 return this.update({ members });
20043 // Wherever a member appears with id `needle.id`, replace it with a member
20044 // with id `replacement.id`, type `replacement.type`, and the original role,
20045 // By default, adding a duplicate member (by id and role) is prevented.
20046 // Return an updated relation.
20047 replaceMember: function(needle, replacement, keepDuplicates) {
20048 if (!this.memberById(needle.id)) return this;
20050 for (var i3 = 0; i3 < this.members.length; i3++) {
20051 var member = this.members[i3];
20052 if (member.id !== needle.id) {
20053 members.push(member);
20054 } else if (keepDuplicates || !this.memberByIdAndRole(replacement.id, member.role)) {
20055 members.push({ id: replacement.id, type: replacement.type, role: member.role });
20058 return this.update({ members });
20060 asJXON: function(changeset_id) {
20063 "@id": this.osmId(),
20064 "@version": this.version || 0,
20065 member: this.members.map(function(member) {
20070 ref: osmEntity.id.toOSM(member.id)
20074 tag: Object.keys(this.tags).map(function(k2) {
20075 return { keyAttributes: { k: k2, v: this.tags[k2] } };
20079 if (changeset_id) {
20080 r2.relation["@changeset"] = changeset_id;
20084 asGeoJSON: function(resolver) {
20085 return resolver.transient(this, "GeoJSON", function() {
20086 if (this.isMultipolygon()) {
20088 type: "MultiPolygon",
20089 coordinates: this.multipolygon(resolver)
20093 type: "FeatureCollection",
20094 properties: this.tags,
20095 features: this.members.map(function(member) {
20096 return Object.assign({ role: member.role }, resolver.entity(member.id).asGeoJSON(resolver));
20102 area: function(resolver) {
20103 return resolver.transient(this, "area", function() {
20104 return area_default2(this.asGeoJSON(resolver));
20107 isMultipolygon: function() {
20108 return this.tags.type === "multipolygon";
20110 isComplete: function(resolver) {
20111 for (var i3 = 0; i3 < this.members.length; i3++) {
20112 if (!resolver.hasEntity(this.members[i3].id)) {
20118 hasFromViaTo: function() {
20119 return this.members.some(function(m3) {
20120 return m3.role === "from";
20121 }) && this.members.some(
20122 (m3) => m3.role === "via" || m3.role === "intersection" && this.tags.type === "destination_sign"
20123 ) && this.members.some(function(m3) {
20124 return m3.role === "to";
20127 isRestriction: function() {
20128 return !!(this.tags.type && this.tags.type.match(/^restriction:?/));
20130 isValidRestriction: function() {
20131 if (!this.isRestriction()) return false;
20132 var froms = this.members.filter(function(m3) {
20133 return m3.role === "from";
20135 var vias = this.members.filter(function(m3) {
20136 return m3.role === "via";
20138 var tos = this.members.filter(function(m3) {
20139 return m3.role === "to";
20141 if (froms.length !== 1 && this.tags.restriction !== "no_entry") return false;
20142 if (froms.some(function(m3) {
20143 return m3.type !== "way";
20145 if (tos.length !== 1 && this.tags.restriction !== "no_exit") return false;
20146 if (tos.some(function(m3) {
20147 return m3.type !== "way";
20149 if (vias.length === 0) return false;
20150 if (vias.length > 1 && vias.some(function(m3) {
20151 return m3.type !== "way";
20155 isConnectivity: function() {
20156 return !!(this.tags.type && this.tags.type.match(/^connectivity:?/));
20158 // Returns an array [A0, ... An], each Ai being an array of node arrays [Nds0, ... Ndsm],
20159 // where Nds0 is an outer ring and subsequent Ndsi's (if any i > 0) being inner rings.
20161 // This corresponds to the structure needed for rendering a multipolygon path using a
20162 // `evenodd` fill rule, as well as the structure of a GeoJSON MultiPolygon geometry.
20164 // In the case of invalid geometries, this function will still return a result which
20165 // includes the nodes of all way members, but some Nds may be unclosed and some inner
20166 // rings not matched with the intended outer ring.
20168 multipolygon: function(resolver) {
20169 var outers = this.members.filter(function(m3) {
20170 return "outer" === (m3.role || "outer");
20172 var inners = this.members.filter(function(m3) {
20173 return "inner" === m3.role;
20175 outers = osmJoinWays(outers, resolver);
20176 inners = osmJoinWays(inners, resolver);
20177 var sequenceToLineString = function(sequence) {
20178 if (sequence.nodes.length > 2 && sequence.nodes[0] !== sequence.nodes[sequence.nodes.length - 1]) {
20179 sequence.nodes.push(sequence.nodes[0]);
20181 return sequence.nodes.map(function(node) {
20185 outers = outers.map(sequenceToLineString);
20186 inners = inners.map(sequenceToLineString);
20187 var result = outers.map(function(o3) {
20188 return [area_default2({ type: "Polygon", coordinates: [o3] }) > 2 * Math.PI ? o3.reverse() : o3];
20190 function findOuter(inner2) {
20192 for (o3 = 0; o3 < outers.length; o3++) {
20193 outer = outers[o3];
20194 if (geoPolygonContainsPolygon(outer, inner2)) {
20198 for (o3 = 0; o3 < outers.length; o3++) {
20199 outer = outers[o3];
20200 if (geoPolygonIntersectsPolygon(outer, inner2, false)) {
20205 for (var i3 = 0; i3 < inners.length; i3++) {
20206 var inner = inners[i3];
20207 if (area_default2({ type: "Polygon", coordinates: [inner] }) < 2 * Math.PI) {
20208 inner = inner.reverse();
20210 var o2 = findOuter(inners[i3]);
20211 if (o2 !== void 0) {
20212 result[o2].push(inners[i3]);
20214 result.push([inners[i3]]);
20220 Object.assign(osmRelation.prototype, prototype2);
20224 // modules/osm/lanes.js
20225 var lanes_exports = {};
20226 __export(lanes_exports, {
20227 osmLanes: () => osmLanes
20229 function osmLanes(entity) {
20230 if (entity.type !== "way") return null;
20231 if (!entity.tags.highway) return null;
20232 var tags = entity.tags;
20233 var isOneWay = entity.isOneWay();
20234 var laneCount = getLaneCount(tags, isOneWay);
20235 var maxspeed = parseMaxspeed(tags);
20236 var laneDirections = parseLaneDirections(tags, isOneWay, laneCount);
20237 var forward = laneDirections.forward;
20238 var backward = laneDirections.backward;
20239 var bothways = laneDirections.bothways;
20240 var turnLanes = {};
20241 turnLanes.unspecified = parseTurnLanes(tags["turn:lanes"]);
20242 turnLanes.forward = parseTurnLanes(tags["turn:lanes:forward"]);
20243 turnLanes.backward = parseTurnLanes(tags["turn:lanes:backward"]);
20244 var maxspeedLanes = {};
20245 maxspeedLanes.unspecified = parseMaxspeedLanes(tags["maxspeed:lanes"], maxspeed);
20246 maxspeedLanes.forward = parseMaxspeedLanes(tags["maxspeed:lanes:forward"], maxspeed);
20247 maxspeedLanes.backward = parseMaxspeedLanes(tags["maxspeed:lanes:backward"], maxspeed);
20249 psvLanes.unspecified = parseMiscLanes(tags["psv:lanes"]);
20250 psvLanes.forward = parseMiscLanes(tags["psv:lanes:forward"]);
20251 psvLanes.backward = parseMiscLanes(tags["psv:lanes:backward"]);
20253 busLanes.unspecified = parseMiscLanes(tags["bus:lanes"]);
20254 busLanes.forward = parseMiscLanes(tags["bus:lanes:forward"]);
20255 busLanes.backward = parseMiscLanes(tags["bus:lanes:backward"]);
20256 var taxiLanes = {};
20257 taxiLanes.unspecified = parseMiscLanes(tags["taxi:lanes"]);
20258 taxiLanes.forward = parseMiscLanes(tags["taxi:lanes:forward"]);
20259 taxiLanes.backward = parseMiscLanes(tags["taxi:lanes:backward"]);
20261 hovLanes.unspecified = parseMiscLanes(tags["hov:lanes"]);
20262 hovLanes.forward = parseMiscLanes(tags["hov:lanes:forward"]);
20263 hovLanes.backward = parseMiscLanes(tags["hov:lanes:backward"]);
20265 hgvLanes.unspecified = parseMiscLanes(tags["hgv:lanes"]);
20266 hgvLanes.forward = parseMiscLanes(tags["hgv:lanes:forward"]);
20267 hgvLanes.backward = parseMiscLanes(tags["hgv:lanes:backward"]);
20268 var bicyclewayLanes = {};
20269 bicyclewayLanes.unspecified = parseBicycleWay(tags["bicycleway:lanes"]);
20270 bicyclewayLanes.forward = parseBicycleWay(tags["bicycleway:lanes:forward"]);
20271 bicyclewayLanes.backward = parseBicycleWay(tags["bicycleway:lanes:backward"]);
20277 mapToLanesObj(lanesObj, turnLanes, "turnLane");
20278 mapToLanesObj(lanesObj, maxspeedLanes, "maxspeed");
20279 mapToLanesObj(lanesObj, psvLanes, "psv");
20280 mapToLanesObj(lanesObj, busLanes, "bus");
20281 mapToLanesObj(lanesObj, taxiLanes, "taxi");
20282 mapToLanesObj(lanesObj, hovLanes, "hov");
20283 mapToLanesObj(lanesObj, hgvLanes, "hgv");
20284 mapToLanesObj(lanesObj, bicyclewayLanes, "bicycleway");
20305 function getLaneCount(tags, isOneWay) {
20308 count = parseInt(tags.lanes, 10);
20313 switch (tags.highway) {
20316 count = isOneWay ? 2 : 4;
20319 count = isOneWay ? 1 : 2;
20324 function parseMaxspeed(tags) {
20325 var maxspeed = tags.maxspeed;
20326 if (!maxspeed) return;
20327 var maxspeedRegex = /^([0-9][\.0-9]+?)(?:[ ]?(?:km\/h|kmh|kph|mph|knots))?$/;
20328 if (!maxspeedRegex.test(maxspeed)) return;
20329 return parseInt(maxspeed, 10);
20331 function parseLaneDirections(tags, isOneWay, laneCount) {
20332 var forward = parseInt(tags["lanes:forward"], 10);
20333 var backward = parseInt(tags["lanes:backward"], 10);
20334 var bothways = parseInt(tags["lanes:both_ways"], 10) > 0 ? 1 : 0;
20335 if (parseInt(tags.oneway, 10) === -1) {
20338 backward = laneCount;
20339 } else if (isOneWay) {
20340 forward = laneCount;
20343 } else if (isNaN(forward) && isNaN(backward)) {
20344 backward = Math.floor((laneCount - bothways) / 2);
20345 forward = laneCount - bothways - backward;
20346 } else if (isNaN(forward)) {
20347 if (backward > laneCount - bothways) {
20348 backward = laneCount - bothways;
20350 forward = laneCount - bothways - backward;
20351 } else if (isNaN(backward)) {
20352 if (forward > laneCount - bothways) {
20353 forward = laneCount - bothways;
20355 backward = laneCount - bothways - forward;
20363 function parseTurnLanes(tag) {
20365 var validValues = [
20378 return tag.split("|").map(function(s2) {
20379 if (s2 === "") s2 = "none";
20380 return s2.split(";").map(function(d4) {
20381 return validValues.indexOf(d4) === -1 ? "unknown" : d4;
20385 function parseMaxspeedLanes(tag, maxspeed) {
20387 return tag.split("|").map(function(s2) {
20388 if (s2 === "none") return s2;
20389 var m3 = parseInt(s2, 10);
20390 if (s2 === "" || m3 === maxspeed) return null;
20391 return isNaN(m3) ? "unknown" : m3;
20394 function parseMiscLanes(tag) {
20396 var validValues = [
20401 return tag.split("|").map(function(s2) {
20402 if (s2 === "") s2 = "no";
20403 return validValues.indexOf(s2) === -1 ? "unknown" : s2;
20406 function parseBicycleWay(tag) {
20408 var validValues = [
20414 return tag.split("|").map(function(s2) {
20415 if (s2 === "") s2 = "no";
20416 return validValues.indexOf(s2) === -1 ? "unknown" : s2;
20419 function mapToLanesObj(lanesObj, data, key) {
20420 if (data.forward) {
20421 data.forward.forEach(function(l4, i3) {
20422 if (!lanesObj.forward[i3]) lanesObj.forward[i3] = {};
20423 lanesObj.forward[i3][key] = l4;
20426 if (data.backward) {
20427 data.backward.forEach(function(l4, i3) {
20428 if (!lanesObj.backward[i3]) lanesObj.backward[i3] = {};
20429 lanesObj.backward[i3][key] = l4;
20432 if (data.unspecified) {
20433 data.unspecified.forEach(function(l4, i3) {
20434 if (!lanesObj.unspecified[i3]) lanesObj.unspecified[i3] = {};
20435 lanesObj.unspecified[i3][key] = l4;
20439 var init_lanes = __esm({
20440 "modules/osm/lanes.js"() {
20445 // modules/osm/way.js
20446 var way_exports = {};
20447 __export(way_exports, {
20448 osmWay: () => osmWay
20450 function osmWay() {
20451 if (!(this instanceof osmWay)) {
20452 return new osmWay().initialize(arguments);
20453 } else if (arguments.length) {
20454 this.initialize(arguments);
20457 function noRepeatNodes(node, i3, arr) {
20458 return i3 === 0 || node !== arr[i3 - 1];
20461 var init_way = __esm({
20462 "modules/osm/way.js"() {
20470 osmEntity.way = osmWay;
20471 osmWay.prototype = Object.create(osmEntity.prototype);
20475 copy: function(resolver, copies) {
20476 if (copies[this.id]) return copies[this.id];
20477 var copy2 = osmEntity.prototype.copy.call(this, resolver, copies);
20478 var nodes = this.nodes.map(function(id2) {
20479 return resolver.entity(id2).copy(resolver, copies).id;
20481 copy2 = copy2.update({ nodes });
20482 copies[this.id] = copy2;
20485 extent: function(resolver) {
20486 return resolver.transient(this, "extent", function() {
20487 var extent = geoExtent();
20488 for (var i3 = 0; i3 < this.nodes.length; i3++) {
20489 var node = resolver.hasEntity(this.nodes[i3]);
20491 extent._extend(node.extent());
20497 first: function() {
20498 return this.nodes[0];
20501 return this.nodes[this.nodes.length - 1];
20503 contains: function(node) {
20504 return this.nodes.indexOf(node) >= 0;
20506 affix: function(node) {
20507 if (this.nodes[0] === node) return "prefix";
20508 if (this.nodes[this.nodes.length - 1] === node) return "suffix";
20510 layer: function() {
20511 if (isFinite(this.tags.layer)) {
20512 return Math.max(-10, Math.min(+this.tags.layer, 10));
20514 if (this.tags.covered === "yes") return -1;
20515 if (this.tags.location === "overground") return 1;
20516 if (this.tags.location === "underground") return -1;
20517 if (this.tags.location === "underwater") return -10;
20518 if (this.tags.power === "line") return 10;
20519 if (this.tags.power === "minor_line") return 10;
20520 if (this.tags.aerialway) return 10;
20521 if (this.tags.bridge) return 1;
20522 if (this.tags.cutting) return -1;
20523 if (this.tags.tunnel) return -1;
20524 if (this.tags.waterway) return -1;
20525 if (this.tags.man_made === "pipeline") return -10;
20526 if (this.tags.boundary) return -10;
20529 // the approximate width of the line based on its tags except its `width` tag
20530 impliedLineWidthMeters: function() {
20531 var averageWidths = {
20533 // width is for single lane
20562 // width includes ties and rail bed, not just track gauge
20584 for (var key in averageWidths) {
20585 if (this.tags[key] && averageWidths[key][this.tags[key]]) {
20586 var width = averageWidths[key][this.tags[key]];
20587 if (key === "highway") {
20588 var laneCount = this.tags.lanes && parseInt(this.tags.lanes, 10);
20589 if (!laneCount) laneCount = this.isOneWay() ? 1 : 2;
20590 return width * laneCount;
20597 /** @returns {boolean} for example, if `oneway=yes` */
20598 isOneWayForwards() {
20599 if (this.tags.oneway === "no") return false;
20600 return !!utilCheckTagDictionary(this.tags, osmOneWayForwardTags);
20602 /** @returns {boolean} for example, if `oneway=-1` */
20603 isOneWayBackwards() {
20604 if (this.tags.oneway === "no") return false;
20605 return !!utilCheckTagDictionary(this.tags, osmOneWayBackwardTags);
20607 /** @returns {boolean} for example, if `oneway=alternating` */
20608 isBiDirectional() {
20609 if (this.tags.oneway === "no") return false;
20610 return !!utilCheckTagDictionary(this.tags, osmOneWayBiDirectionalTags);
20612 /** @returns {boolean} */
20614 if (this.tags.oneway === "no") return false;
20615 return !!utilCheckTagDictionary(this.tags, osmOneWayTags);
20617 // Some identifier for tag that implies that this way is "sided",
20618 // i.e. the right side is the 'inside' (e.g. the right side of a
20619 // natural=cliff is lower).
20620 sidednessIdentifier: function() {
20621 for (const realKey in this.tags) {
20622 const value = this.tags[realKey];
20623 const key = osmRemoveLifecyclePrefix(realKey);
20624 if (key in osmRightSideIsInsideTags && value in osmRightSideIsInsideTags[key]) {
20625 if (osmRightSideIsInsideTags[key][value] === true) {
20628 return osmRightSideIsInsideTags[key][value];
20634 isSided: function() {
20635 if (this.tags.two_sided === "yes") {
20638 return this.sidednessIdentifier() !== null;
20640 lanes: function() {
20641 return osmLanes(this);
20643 isClosed: function() {
20644 return this.nodes.length > 1 && this.first() === this.last();
20646 isConvex: function(resolver) {
20647 if (!this.isClosed() || this.isDegenerate()) return null;
20648 var nodes = utilArrayUniq(resolver.childNodes(this));
20649 var coords = nodes.map(function(n3) {
20654 for (var i3 = 0; i3 < coords.length; i3++) {
20655 var o2 = coords[(i3 + 1) % coords.length];
20656 var a2 = coords[i3];
20657 var b3 = coords[(i3 + 2) % coords.length];
20658 var res = geoVecCross(a2, b3, o2);
20659 curr = res > 0 ? 1 : res < 0 ? -1 : 0;
20662 } else if (prev && curr !== prev) {
20669 // returns an object with the tag that implies this is an area, if any
20670 tagSuggestingArea: function() {
20671 return osmTagSuggestingArea(this.tags);
20673 isArea: function() {
20674 if (this.tags.area === "yes") return true;
20675 if (!this.isClosed() || this.tags.area === "no") return false;
20676 return this.tagSuggestingArea() !== null;
20678 isDegenerate: function() {
20679 return new Set(this.nodes).size < (this.isClosed() ? 3 : 2);
20681 areAdjacent: function(n1, n22) {
20682 for (var i3 = 0; i3 < this.nodes.length; i3++) {
20683 if (this.nodes[i3] === n1) {
20684 if (this.nodes[i3 - 1] === n22) return true;
20685 if (this.nodes[i3 + 1] === n22) return true;
20690 geometry: function(graph) {
20691 return graph.transient(this, "geometry", function() {
20692 return this.isArea() ? "area" : "line";
20695 // returns an array of objects representing the segments between the nodes in this way
20696 segments: function(graph) {
20697 function segmentExtent(graph2) {
20698 var n1 = graph2.hasEntity(this.nodes[0]);
20699 var n22 = graph2.hasEntity(this.nodes[1]);
20700 return n1 && n22 && geoExtent([
20702 Math.min(n1.loc[0], n22.loc[0]),
20703 Math.min(n1.loc[1], n22.loc[1])
20706 Math.max(n1.loc[0], n22.loc[0]),
20707 Math.max(n1.loc[1], n22.loc[1])
20711 return graph.transient(this, "segments", function() {
20713 for (var i3 = 0; i3 < this.nodes.length - 1; i3++) {
20715 id: this.id + "-" + i3,
20718 nodes: [this.nodes[i3], this.nodes[i3 + 1]],
20719 extent: segmentExtent
20725 // If this way is not closed, append the beginning node to the end of the nodelist to close it.
20726 close: function() {
20727 if (this.isClosed() || !this.nodes.length) return this;
20728 var nodes = this.nodes.slice();
20729 nodes = nodes.filter(noRepeatNodes);
20730 nodes.push(nodes[0]);
20731 return this.update({ nodes });
20733 // If this way is closed, remove any connector nodes from the end of the nodelist to unclose it.
20734 unclose: function() {
20735 if (!this.isClosed()) return this;
20736 var nodes = this.nodes.slice();
20737 var connector = this.first();
20738 var i3 = nodes.length - 1;
20739 while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
20740 nodes.splice(i3, 1);
20741 i3 = nodes.length - 1;
20743 nodes = nodes.filter(noRepeatNodes);
20744 return this.update({ nodes });
20746 // Adds a node (id) in front of the node which is currently at position index.
20747 // If index is undefined, the node will be added to the end of the way for linear ways,
20748 // or just before the final connecting node for circular ways.
20749 // Consecutive duplicates are eliminated including existing ones.
20750 // Circularity is always preserved when adding a node.
20751 addNode: function(id2, index) {
20752 var nodes = this.nodes.slice();
20753 var isClosed = this.isClosed();
20754 var max3 = isClosed ? nodes.length - 1 : nodes.length;
20755 if (index === void 0) {
20758 if (index < 0 || index > max3) {
20759 throw new RangeError("index " + index + " out of range 0.." + max3);
20762 var connector = this.first();
20764 while (i3 < nodes.length && nodes.length > 2 && nodes[i3] === connector) {
20765 nodes.splice(i3, 1);
20766 if (index > i3) index--;
20768 i3 = nodes.length - 1;
20769 while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
20770 nodes.splice(i3, 1);
20771 if (index > i3) index--;
20772 i3 = nodes.length - 1;
20775 nodes.splice(index, 0, id2);
20776 nodes = nodes.filter(noRepeatNodes);
20777 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
20778 nodes.push(nodes[0]);
20780 return this.update({ nodes });
20782 // Replaces the node which is currently at position index with the given node (id).
20783 // Consecutive duplicates are eliminated including existing ones.
20784 // Circularity is preserved when updating a node.
20785 updateNode: function(id2, index) {
20786 var nodes = this.nodes.slice();
20787 var isClosed = this.isClosed();
20788 var max3 = nodes.length - 1;
20789 if (index === void 0 || index < 0 || index > max3) {
20790 throw new RangeError("index " + index + " out of range 0.." + max3);
20793 var connector = this.first();
20795 while (i3 < nodes.length && nodes.length > 2 && nodes[i3] === connector) {
20796 nodes.splice(i3, 1);
20797 if (index > i3) index--;
20799 i3 = nodes.length - 1;
20800 while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
20801 nodes.splice(i3, 1);
20802 if (index === i3) index = 0;
20803 i3 = nodes.length - 1;
20806 nodes.splice(index, 1, id2);
20807 nodes = nodes.filter(noRepeatNodes);
20808 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
20809 nodes.push(nodes[0]);
20811 return this.update({ nodes });
20813 // Replaces each occurrence of node id needle with replacement.
20814 // Consecutive duplicates are eliminated including existing ones.
20815 // Circularity is preserved.
20816 replaceNode: function(needleID, replacementID) {
20817 var nodes = this.nodes.slice();
20818 var isClosed = this.isClosed();
20819 for (var i3 = 0; i3 < nodes.length; i3++) {
20820 if (nodes[i3] === needleID) {
20821 nodes[i3] = replacementID;
20824 nodes = nodes.filter(noRepeatNodes);
20825 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
20826 nodes.push(nodes[0]);
20828 return this.update({ nodes });
20830 // Removes each occurrence of node id.
20831 // Consecutive duplicates are eliminated including existing ones.
20832 // Circularity is preserved.
20833 removeNode: function(id2) {
20834 var nodes = this.nodes.slice();
20835 var isClosed = this.isClosed();
20836 nodes = nodes.filter(function(node) {
20837 return node !== id2;
20838 }).filter(noRepeatNodes);
20839 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
20840 nodes.push(nodes[0]);
20842 return this.update({ nodes });
20844 asJXON: function(changeset_id) {
20847 "@id": this.osmId(),
20848 "@version": this.version || 0,
20849 nd: this.nodes.map(function(id2) {
20850 return { keyAttributes: { ref: osmEntity.id.toOSM(id2) } };
20852 tag: Object.keys(this.tags).map(function(k2) {
20853 return { keyAttributes: { k: k2, v: this.tags[k2] } };
20857 if (changeset_id) {
20858 r2.way["@changeset"] = changeset_id;
20862 asGeoJSON: function(resolver) {
20863 return resolver.transient(this, "GeoJSON", function() {
20864 var coordinates = resolver.childNodes(this).map(function(n3) {
20867 if (this.isArea() && this.isClosed()) {
20870 coordinates: [coordinates]
20874 type: "LineString",
20880 area: function(resolver) {
20881 return resolver.transient(this, "area", function() {
20882 var nodes = resolver.childNodes(this);
20885 coordinates: [nodes.map(function(n3) {
20889 if (!this.isClosed() && nodes.length) {
20890 json.coordinates[0].push(nodes[0].loc);
20892 var area = area_default2(json);
20893 if (area > 2 * Math.PI) {
20894 json.coordinates[0] = json.coordinates[0].reverse();
20895 area = area_default2(json);
20897 return isNaN(area) ? 0 : area;
20901 Object.assign(osmWay.prototype, prototype3);
20905 // modules/osm/qa_item.js
20906 var qa_item_exports = {};
20907 __export(qa_item_exports, {
20908 QAItem: () => QAItem
20911 var init_qa_item = __esm({
20912 "modules/osm/qa_item.js"() {
20914 QAItem = class _QAItem {
20915 constructor(loc, service, itemType, id2, props) {
20917 this.service = service.title;
20918 this.itemType = itemType;
20919 this.id = id2 ? id2 : `${_QAItem.id()}`;
20920 this.update(props);
20921 if (service && typeof service.getIcon === "function") {
20922 this.icon = service.getIcon(itemType);
20926 const { loc, service, itemType, id: id2 } = this;
20927 Object.keys(props).forEach((prop) => this[prop] = props[prop]);
20929 this.service = service;
20930 this.itemType = itemType;
20934 // Generic handling for newly created QAItems
20936 return this.nextId--;
20939 QAItem.nextId = -1;
20943 // modules/actions/split.js
20944 var split_exports = {};
20945 __export(split_exports, {
20946 actionSplit: () => actionSplit
20948 function actionSplit(nodeIds, newWayIds) {
20949 if (typeof nodeIds === "string") nodeIds = [nodeIds];
20951 var _keepHistoryOn = "longest";
20952 const circularJunctions = ["roundabout", "circular"];
20953 var _createdWayIDs = [];
20954 function dist(graph, nA, nB) {
20955 var locA = graph.entity(nA).loc;
20956 var locB = graph.entity(nB).loc;
20957 var epsilon3 = 1e-6;
20958 return locA && locB ? geoSphericalDistance(locA, locB) : epsilon3;
20960 function splitArea(nodes, idxA, graph) {
20961 var lengths = new Array(nodes.length);
20966 function wrap2(index) {
20967 return utilWrap(index, nodes.length);
20970 for (i3 = wrap2(idxA + 1); i3 !== idxA; i3 = wrap2(i3 + 1)) {
20971 length2 += dist(graph, nodes[i3], nodes[wrap2(i3 - 1)]);
20972 lengths[i3] = length2;
20975 for (i3 = wrap2(idxA - 1); i3 !== idxA; i3 = wrap2(i3 - 1)) {
20976 length2 += dist(graph, nodes[i3], nodes[wrap2(i3 + 1)]);
20977 if (length2 < lengths[i3]) {
20978 lengths[i3] = length2;
20981 for (i3 = 0; i3 < nodes.length; i3++) {
20982 var cost = lengths[i3] / dist(graph, nodes[idxA], nodes[i3]);
20990 function totalLengthBetweenNodes(graph, nodes) {
20991 var totalLength = 0;
20992 for (var i3 = 0; i3 < nodes.length - 1; i3++) {
20993 totalLength += dist(graph, nodes[i3], nodes[i3 + 1]);
20995 return totalLength;
20997 function split(graph, nodeId, wayA, newWayId, otherNodeIds) {
20998 var wayB = osmWay({ id: newWayId, tags: wayA.tags });
21001 var isArea = wayA.isArea();
21002 if (wayA.isClosed()) {
21003 var nodes = wayA.nodes.slice(0, -1);
21004 var idxA = nodes.indexOf(nodeId);
21005 var idxB = otherNodeIds.length > 0 ? nodes.indexOf(otherNodeIds[0]) : splitArea(nodes, idxA, graph);
21007 nodesA = nodes.slice(idxA).concat(nodes.slice(0, idxB + 1));
21008 nodesB = nodes.slice(idxB, idxA + 1);
21010 nodesA = nodes.slice(idxA, idxB + 1);
21011 nodesB = nodes.slice(idxB).concat(nodes.slice(0, idxA + 1));
21014 var idx = wayA.nodes.indexOf(nodeId, 1);
21015 nodesA = wayA.nodes.slice(0, idx + 1);
21016 nodesB = wayA.nodes.slice(idx);
21018 var lengthA = totalLengthBetweenNodes(graph, nodesA);
21019 var lengthB = totalLengthBetweenNodes(graph, nodesB);
21020 if (_keepHistoryOn === "longest" && lengthB > lengthA) {
21021 wayA = wayA.update({ nodes: nodesB });
21022 wayB = wayB.update({ nodes: nodesA });
21023 var temp = lengthA;
21027 wayA = wayA.update({ nodes: nodesA });
21028 wayB = wayB.update({ nodes: nodesB });
21030 for (const key in wayA.tags) {
21031 if (!osmSummableTags.has(key)) continue;
21032 var count = Number(wayA.tags[key]);
21033 if (count && // ensure a number
21034 isFinite(count) && // ensure positive
21035 count > 0 && // ensure integer
21036 Math.round(count) === count) {
21037 var tagsA = Object.assign({}, wayA.tags);
21038 var tagsB = Object.assign({}, wayB.tags);
21039 var ratioA = lengthA / (lengthA + lengthB);
21040 var countA = Math.round(count * ratioA);
21041 tagsA[key] = countA.toString();
21042 tagsB[key] = (count - countA).toString();
21043 wayA = wayA.update({ tags: tagsA });
21044 wayB = wayB.update({ tags: tagsB });
21047 graph = graph.replace(wayA);
21048 graph = graph.replace(wayB);
21049 graph.parentRelations(wayA).forEach(function(relation) {
21050 if (relation.hasFromViaTo()) {
21051 var f2 = relation.memberByRole("from");
21053 ...relation.membersByRole("via"),
21054 ...relation.membersByRole("intersection")
21056 var t2 = relation.memberByRole("to");
21058 if (f2.id === wayA.id || t2.id === wayA.id) {
21060 if (v3.length === 1 && v3[0].type === "node") {
21061 keepB = wayB.contains(v3[0].id);
21063 for (i3 = 0; i3 < v3.length; i3++) {
21064 if (v3[i3].type === "way") {
21065 var wayVia = graph.hasEntity(v3[i3].id);
21066 if (wayVia && utilArrayIntersection(wayB.nodes, wayVia.nodes).length) {
21074 relation = relation.replaceMember(wayA, wayB);
21075 graph = graph.replace(relation);
21078 for (i3 = 0; i3 < v3.length; i3++) {
21079 if (v3[i3].type === "way" && v3[i3].id === wayA.id) {
21080 graph = splitWayMember(graph, relation.id, wayA, wayB);
21085 graph = splitWayMember(graph, relation.id, wayA, wayB);
21089 var multipolygon = osmRelation({
21090 tags: Object.assign({}, wayA.tags, { type: "multipolygon" }),
21092 { id: wayA.id, role: "outer", type: "way" },
21093 { id: wayB.id, role: "outer", type: "way" }
21096 graph = graph.replace(multipolygon);
21097 graph = graph.replace(wayA.update({ tags: {} }));
21098 graph = graph.replace(wayB.update({ tags: {} }));
21100 _createdWayIDs.push(wayB.id);
21103 function splitWayMember(graph, relationId, wayA, wayB) {
21104 function connects(way1, way2) {
21105 if (way1.nodes.length < 2 || way2.nodes.length < 2) return false;
21106 if (circularJunctions.includes(way1.tags.junction) && way1.isClosed()) {
21107 return way1.nodes.some((nodeId) => nodeId === way2.nodes[0] || nodeId === way2.nodes[way2.nodes.length - 1]);
21108 } else if (circularJunctions.includes(way2.tags.junction) && way2.isClosed()) {
21109 return way2.nodes.some((nodeId) => nodeId === way1.nodes[0] || nodeId === way1.nodes[way1.nodes.length - 1]);
21111 if (way1.nodes[0] === way2.nodes[0]) return true;
21112 if (way1.nodes[0] === way2.nodes[way2.nodes.length - 1]) return true;
21113 if (way1.nodes[way1.nodes.length - 1] === way2.nodes[way2.nodes.length - 1]) return true;
21114 if (way1.nodes[way1.nodes.length - 1] === way2.nodes[0]) return true;
21117 let relation = graph.entity(relationId);
21118 const insertMembers = [];
21119 const members = relation.members;
21120 for (let i3 = 0; i3 < members.length; i3++) {
21121 const member = members[i3];
21122 if (member.id === wayA.id) {
21123 let wayAconnectsPrev = false;
21124 let wayAconnectsNext = false;
21125 let wayBconnectsPrev = false;
21126 let wayBconnectsNext = false;
21127 if (i3 > 0 && graph.hasEntity(members[i3 - 1].id)) {
21128 const prevEntity = graph.entity(members[i3 - 1].id);
21129 if (prevEntity.type === "way") {
21130 wayAconnectsPrev = connects(prevEntity, wayA);
21131 wayBconnectsPrev = connects(prevEntity, wayB);
21134 if (i3 < members.length - 1 && graph.hasEntity(members[i3 + 1].id)) {
21135 const nextEntity = graph.entity(members[i3 + 1].id);
21136 if (nextEntity.type === "way") {
21137 wayAconnectsNext = connects(nextEntity, wayA);
21138 wayBconnectsNext = connects(nextEntity, wayB);
21141 if (wayAconnectsPrev && !wayAconnectsNext || !wayBconnectsPrev && wayBconnectsNext && !(!wayAconnectsPrev && wayAconnectsNext)) {
21142 insertMembers.push({ at: i3 + 1, role: member.role });
21145 if (!wayAconnectsPrev && wayAconnectsNext || wayBconnectsPrev && !wayBconnectsNext && !(wayAconnectsPrev && !wayAconnectsNext)) {
21146 insertMembers.push({ at: i3, role: member.role });
21149 if (wayAconnectsPrev && wayBconnectsPrev && wayAconnectsNext && wayBconnectsNext) {
21150 if (i3 > 2 && graph.hasEntity(members[i3 - 2].id)) {
21151 const prev2Entity = graph.entity(members[i3 - 2].id);
21152 if (connects(prev2Entity, wayA) && !connects(prev2Entity, wayB)) {
21153 insertMembers.push({ at: i3, role: member.role });
21156 if (connects(prev2Entity, wayB) && !connects(prev2Entity, wayA)) {
21157 insertMembers.push({ at: i3 + 1, role: member.role });
21161 if (i3 < members.length - 2 && graph.hasEntity(members[i3 + 2].id)) {
21162 const next2Entity = graph.entity(members[i3 + 2].id);
21163 if (connects(next2Entity, wayA) && !connects(next2Entity, wayB)) {
21164 insertMembers.push({ at: i3 + 1, role: member.role });
21167 if (connects(next2Entity, wayB) && !connects(next2Entity, wayA)) {
21168 insertMembers.push({ at: i3, role: member.role });
21173 if (wayA.nodes[wayA.nodes.length - 1] === wayB.nodes[0]) {
21174 insertMembers.push({ at: i3 + 1, role: member.role });
21176 insertMembers.push({ at: i3, role: member.role });
21180 insertMembers.reverse().forEach((item) => {
21181 graph = graph.replace(relation.addMember({
21186 relation = graph.entity(relation.id);
21190 const action = function(graph) {
21191 _createdWayIDs = [];
21192 let newWayIndex = 0;
21193 for (const i3 in nodeIds) {
21194 const nodeId = nodeIds[i3];
21195 const candidates = waysForNodes(nodeIds.slice(i3), graph);
21196 for (const candidate of candidates) {
21197 graph = split(graph, nodeId, candidate, newWayIds && newWayIds[newWayIndex], nodeIds.slice(i3 + 1));
21203 action.getCreatedWayIDs = function() {
21204 return _createdWayIDs;
21206 function waysForNodes(nodeIds2, graph) {
21207 const splittableWays = nodeIds2.map((nodeId) => waysForNode(nodeId, graph)).reduce((cur, acc) => utilArrayIntersection(cur, acc));
21209 const hasLine = splittableWays.some((way) => way.geometry(graph) === "line");
21211 return splittableWays.filter((way) => way.geometry(graph) === "line");
21214 return splittableWays;
21216 function waysForNode(nodeId, graph) {
21217 const node = graph.entity(nodeId);
21218 return graph.parentWays(node).filter(isSplittable);
21219 function isSplittable(way) {
21220 if (_wayIDs && _wayIDs.indexOf(way.id) === -1) return false;
21221 if (way.isClosed()) return true;
21222 for (let i3 = 1; i3 < way.nodes.length - 1; i3++) {
21223 if (way.nodes[i3] === nodeId) return true;
21229 action.ways = function(graph) {
21230 return waysForNodes(nodeIds, graph);
21232 action.disabled = function(graph) {
21233 const candidates = waysForNodes(nodeIds, graph);
21234 if (candidates.length === 0 || _wayIDs && _wayIDs.length !== candidates.length) {
21235 return "not_eligible";
21237 for (const way of candidates) {
21238 const parentRelations = graph.parentRelations(way);
21239 for (const parentRelation of parentRelations) {
21240 if (parentRelation.hasFromViaTo()) {
21242 ...parentRelation.membersByRole("via"),
21243 ...parentRelation.membersByRole("intersection")
21245 if (!vias.every((via) => graph.hasEntity(via.id))) {
21246 return "parent_incomplete";
21249 for (let i3 = 0; i3 < parentRelation.members.length; i3++) {
21250 if (parentRelation.members[i3].id === way.id) {
21251 const memberBeforePresent = i3 > 0 && graph.hasEntity(parentRelation.members[i3 - 1].id);
21252 const memberAfterPresent = i3 < parentRelation.members.length - 1 && graph.hasEntity(parentRelation.members[i3 + 1].id);
21253 if (!memberBeforePresent && !memberAfterPresent && parentRelation.members.length > 1) {
21254 return "parent_incomplete";
21259 const relTypesExceptions = ["junction", "enforcement"];
21260 if (circularJunctions.includes(way.tags.junction) && way.isClosed() && !relTypesExceptions.includes(parentRelation.tags.type)) {
21261 return "simple_roundabout";
21266 action.limitWays = function(val) {
21267 if (!arguments.length) return _wayIDs;
21271 action.keepHistoryOn = function(val) {
21272 if (!arguments.length) return _keepHistoryOn;
21273 _keepHistoryOn = val;
21278 var init_split = __esm({
21279 "modules/actions/split.js"() {
21289 // modules/core/graph.js
21290 var graph_exports = {};
21291 __export(graph_exports, {
21292 coreGraph: () => coreGraph
21294 function coreGraph(other, mutable) {
21295 if (!(this instanceof coreGraph)) return new coreGraph(other, mutable);
21296 if (other instanceof coreGraph) {
21297 var base = other.base();
21298 this.entities = Object.assign(Object.create(base.entities), other.entities);
21299 this._parentWays = Object.assign(Object.create(base.parentWays), other._parentWays);
21300 this._parentRels = Object.assign(Object.create(base.parentRels), other._parentRels);
21302 this.entities = /* @__PURE__ */ Object.create({});
21303 this._parentWays = /* @__PURE__ */ Object.create({});
21304 this._parentRels = /* @__PURE__ */ Object.create({});
21305 this.rebase(other || [], [this]);
21307 this.transients = {};
21308 this._childNodes = {};
21309 this.frozen = !mutable;
21311 var init_graph = __esm({
21312 "modules/core/graph.js"() {
21316 coreGraph.prototype = {
21317 hasEntity: function(id2) {
21318 return this.entities[id2];
21320 entity: function(id2) {
21321 var entity = this.entities[id2];
21323 throw new Error("entity " + id2 + " not found");
21327 geometry: function(id2) {
21328 return this.entity(id2).geometry(this);
21330 transient: function(entity, key, fn) {
21331 var id2 = entity.id;
21332 var transients = this.transients[id2] || (this.transients[id2] = {});
21333 if (transients[key] !== void 0) {
21334 return transients[key];
21336 transients[key] = fn.call(entity);
21337 return transients[key];
21339 parentWays: function(entity) {
21340 var parents = this._parentWays[entity.id];
21343 parents.forEach(function(id2) {
21344 result.push(this.entity(id2));
21349 isPoi: function(entity) {
21350 var parents = this._parentWays[entity.id];
21351 return !parents || parents.size === 0;
21353 isShared: function(entity) {
21354 var parents = this._parentWays[entity.id];
21355 return parents && parents.size > 1;
21357 parentRelations: function(entity) {
21358 var parents = this._parentRels[entity.id];
21361 parents.forEach(function(id2) {
21362 result.push(this.entity(id2));
21367 parentMultipolygons: function(entity) {
21368 return this.parentRelations(entity).filter(function(relation) {
21369 return relation.isMultipolygon();
21372 childNodes: function(entity) {
21373 if (this._childNodes[entity.id]) return this._childNodes[entity.id];
21374 if (!entity.nodes) return [];
21376 for (var i3 = 0; i3 < entity.nodes.length; i3++) {
21377 nodes[i3] = this.entity(entity.nodes[i3]);
21379 if (debug) Object.freeze(nodes);
21380 this._childNodes[entity.id] = nodes;
21381 return this._childNodes[entity.id];
21385 "entities": Object.getPrototypeOf(this.entities),
21386 "parentWays": Object.getPrototypeOf(this._parentWays),
21387 "parentRels": Object.getPrototypeOf(this._parentRels)
21390 // Unlike other graph methods, rebase mutates in place. This is because it
21391 // is used only during the history operation that merges newly downloaded
21392 // data into each state. To external consumers, it should appear as if the
21393 // graph always contained the newly downloaded data.
21394 rebase: function(entities, stack, force) {
21395 var base = this.base();
21396 var i3, j3, k2, id2;
21397 for (i3 = 0; i3 < entities.length; i3++) {
21398 var entity = entities[i3];
21399 if (!entity.visible || !force && base.entities[entity.id]) continue;
21400 base.entities[entity.id] = entity;
21401 this._updateCalculated(void 0, entity, base.parentWays, base.parentRels);
21402 if (entity.type === "way") {
21403 for (j3 = 0; j3 < entity.nodes.length; j3++) {
21404 id2 = entity.nodes[j3];
21405 for (k2 = 1; k2 < stack.length; k2++) {
21406 var ents = stack[k2].entities;
21407 if (ents.hasOwnProperty(id2) && ents[id2] === void 0) {
21414 for (i3 = 0; i3 < stack.length; i3++) {
21415 stack[i3]._updateRebased();
21418 _updateRebased: function() {
21419 var base = this.base();
21420 Object.keys(this._parentWays).forEach(function(child) {
21421 if (base.parentWays[child]) {
21422 base.parentWays[child].forEach(function(id2) {
21423 if (!this.entities.hasOwnProperty(id2)) {
21424 this._parentWays[child].add(id2);
21429 Object.keys(this._parentRels).forEach(function(child) {
21430 if (base.parentRels[child]) {
21431 base.parentRels[child].forEach(function(id2) {
21432 if (!this.entities.hasOwnProperty(id2)) {
21433 this._parentRels[child].add(id2);
21438 this.transients = {};
21440 // Updates calculated properties (parentWays, parentRels) for the specified change
21441 _updateCalculated: function(oldentity, entity, parentWays, parentRels) {
21442 parentWays = parentWays || this._parentWays;
21443 parentRels = parentRels || this._parentRels;
21444 var type2 = entity && entity.type || oldentity && oldentity.type;
21445 var removed, added, i3;
21446 if (type2 === "way") {
21447 if (oldentity && entity) {
21448 removed = utilArrayDifference(oldentity.nodes, entity.nodes);
21449 added = utilArrayDifference(entity.nodes, oldentity.nodes);
21450 } else if (oldentity) {
21451 removed = oldentity.nodes;
21453 } else if (entity) {
21455 added = entity.nodes;
21457 for (i3 = 0; i3 < removed.length; i3++) {
21458 parentWays[removed[i3]] = new Set(parentWays[removed[i3]]);
21459 parentWays[removed[i3]].delete(oldentity.id);
21461 for (i3 = 0; i3 < added.length; i3++) {
21462 parentWays[added[i3]] = new Set(parentWays[added[i3]]);
21463 parentWays[added[i3]].add(entity.id);
21465 } else if (type2 === "relation") {
21466 var oldentityMemberIDs = oldentity ? oldentity.members.map(function(m3) {
21469 var entityMemberIDs = entity ? entity.members.map(function(m3) {
21472 if (oldentity && entity) {
21473 removed = utilArrayDifference(oldentityMemberIDs, entityMemberIDs);
21474 added = utilArrayDifference(entityMemberIDs, oldentityMemberIDs);
21475 } else if (oldentity) {
21476 removed = oldentityMemberIDs;
21478 } else if (entity) {
21480 added = entityMemberIDs;
21482 for (i3 = 0; i3 < removed.length; i3++) {
21483 parentRels[removed[i3]] = new Set(parentRels[removed[i3]]);
21484 parentRels[removed[i3]].delete(oldentity.id);
21486 for (i3 = 0; i3 < added.length; i3++) {
21487 parentRels[added[i3]] = new Set(parentRels[added[i3]]);
21488 parentRels[added[i3]].add(entity.id);
21492 replace: function(entity) {
21493 if (this.entities[entity.id] === entity) return this;
21494 return this.update(function() {
21495 this._updateCalculated(this.entities[entity.id], entity);
21496 this.entities[entity.id] = entity;
21499 remove: function(entity) {
21500 return this.update(function() {
21501 this._updateCalculated(entity, void 0);
21502 this.entities[entity.id] = void 0;
21505 revert: function(id2) {
21506 var baseEntity = this.base().entities[id2];
21507 var headEntity = this.entities[id2];
21508 if (headEntity === baseEntity) return this;
21509 return this.update(function() {
21510 this._updateCalculated(headEntity, baseEntity);
21511 delete this.entities[id2];
21514 update: function() {
21515 var graph = this.frozen ? coreGraph(this, true) : this;
21516 for (var i3 = 0; i3 < arguments.length; i3++) {
21517 arguments[i3].call(graph, graph);
21519 if (this.frozen) graph.frozen = true;
21522 // Obliterates any existing entities
21523 load: function(entities) {
21524 var base = this.base();
21525 this.entities = Object.create(base.entities);
21526 for (var i3 in entities) {
21527 this.entities[i3] = entities[i3];
21528 this._updateCalculated(base.entities[i3], this.entities[i3]);
21536 // modules/osm/intersection.js
21537 var intersection_exports = {};
21538 __export(intersection_exports, {
21539 osmInferRestriction: () => osmInferRestriction,
21540 osmIntersection: () => osmIntersection,
21541 osmTurn: () => osmTurn
21543 function osmTurn(turn) {
21544 if (!(this instanceof osmTurn)) {
21545 return new osmTurn(turn);
21547 Object.assign(this, turn);
21549 function osmIntersection(graph, startVertexId, maxDistance) {
21550 maxDistance = maxDistance || 30;
21551 var vgraph = coreGraph();
21553 function memberOfRestriction(entity) {
21554 return graph.parentRelations(entity).some(function(r2) {
21555 return r2.isRestriction();
21558 function isRoad(way2) {
21559 if (way2.isArea() || way2.isDegenerate()) return false;
21562 "motorway_link": true,
21564 "trunk_link": true,
21566 "primary_link": true,
21568 "secondary_link": true,
21570 "tertiary_link": true,
21571 "residential": true,
21572 "unclassified": true,
21573 "living_street": true,
21579 return roads[way2.tags.highway];
21581 var startNode = graph.entity(startVertexId);
21582 var checkVertices = [startNode];
21585 var vertexIds = [];
21595 while (checkVertices.length) {
21596 vertex = checkVertices.pop();
21597 checkWays = graph.parentWays(vertex);
21598 var hasWays = false;
21599 for (i3 = 0; i3 < checkWays.length; i3++) {
21600 way = checkWays[i3];
21601 if (!isRoad(way) && !memberOfRestriction(way)) continue;
21604 nodes = utilArrayUniq(graph.childNodes(way));
21605 for (j3 = 0; j3 < nodes.length; j3++) {
21607 if (node === vertex) continue;
21608 if (vertices.indexOf(node) !== -1) continue;
21609 if (geoSphericalDistance(node.loc, startNode.loc) > maxDistance) continue;
21610 var hasParents = false;
21611 parents = graph.parentWays(node);
21612 for (k2 = 0; k2 < parents.length; k2++) {
21613 parent2 = parents[k2];
21614 if (parent2 === way) continue;
21615 if (ways.indexOf(parent2) !== -1) continue;
21616 if (!isRoad(parent2)) continue;
21621 checkVertices.push(node);
21626 vertices.push(vertex);
21629 vertices = utilArrayUniq(vertices);
21630 ways = utilArrayUniq(ways);
21631 ways.forEach(function(way2) {
21632 graph.childNodes(way2).forEach(function(node2) {
21633 vgraph = vgraph.replace(node2);
21635 vgraph = vgraph.replace(way2);
21636 graph.parentRelations(way2).forEach(function(relation) {
21637 if (relation.isRestriction()) {
21638 if (relation.isValidRestriction(graph)) {
21639 vgraph = vgraph.replace(relation);
21640 } else if (relation.isComplete(graph)) {
21641 actions.push(actionDeleteRelation(relation.id));
21646 ways.forEach(function(w3) {
21647 var way2 = vgraph.entity(w3.id);
21648 if (way2.tags.oneway === "-1") {
21649 var action = actionReverse(way2.id, { reverseOneway: true });
21650 actions.push(action);
21651 vgraph = action(vgraph);
21654 var origCount = osmEntity.id.next.way;
21655 vertices.forEach(function(v3) {
21656 var splitAll = actionSplit([v3.id]).keepHistoryOn("first");
21657 if (!splitAll.disabled(vgraph)) {
21658 splitAll.ways(vgraph).forEach(function(way2) {
21659 var splitOne = actionSplit([v3.id]).limitWays([way2.id]).keepHistoryOn("first");
21660 actions.push(splitOne);
21661 vgraph = splitOne(vgraph);
21665 osmEntity.id.next.way = origCount;
21666 vertexIds = vertices.map(function(v3) {
21671 vertexIds.forEach(function(id2) {
21672 var vertex2 = vgraph.entity(id2);
21673 var parents2 = vgraph.parentWays(vertex2);
21674 vertices.push(vertex2);
21675 ways = ways.concat(parents2);
21677 vertices = utilArrayUniq(vertices);
21678 ways = utilArrayUniq(ways);
21679 vertexIds = vertices.map(function(v3) {
21682 wayIds = ways.map(function(w3) {
21685 function withMetadata(way2, vertexIds2) {
21686 var __oneWay = way2.isOneWay() && !way2.isBiDirectional();
21687 var __first = vertexIds2.indexOf(way2.first()) !== -1;
21688 var __last = vertexIds2.indexOf(way2.last()) !== -1;
21689 var __via = __first && __last;
21690 var __from = __first && !__oneWay || __last;
21691 var __to = __first || __last && !__oneWay;
21692 return way2.update({
21702 wayIds.forEach(function(id2) {
21703 var way2 = withMetadata(vgraph.entity(id2), vertexIds);
21704 vgraph = vgraph.replace(way2);
21708 var removeWayIds = [];
21709 var removeVertexIds = [];
21712 checkVertices = vertexIds.slice();
21713 for (i3 = 0; i3 < checkVertices.length; i3++) {
21714 var vertexId = checkVertices[i3];
21715 vertex = vgraph.hasEntity(vertexId);
21717 if (vertexIds.indexOf(vertexId) !== -1) {
21718 vertexIds.splice(vertexIds.indexOf(vertexId), 1);
21720 removeVertexIds.push(vertexId);
21723 parents = vgraph.parentWays(vertex);
21724 if (parents.length < 3) {
21725 if (vertexIds.indexOf(vertexId) !== -1) {
21726 vertexIds.splice(vertexIds.indexOf(vertexId), 1);
21729 if (parents.length === 2) {
21730 var a2 = parents[0];
21731 var b3 = parents[1];
21732 var aIsLeaf = a2 && !a2.__via;
21733 var bIsLeaf = b3 && !b3.__via;
21734 var leaf, survivor;
21735 if (aIsLeaf && !bIsLeaf) {
21738 } else if (!aIsLeaf && bIsLeaf) {
21742 if (leaf && survivor) {
21743 survivor = withMetadata(survivor, vertexIds);
21744 vgraph = vgraph.replace(survivor).remove(leaf);
21745 removeWayIds.push(leaf.id);
21749 parents = vgraph.parentWays(vertex);
21750 if (parents.length < 2) {
21751 if (vertexIds.indexOf(vertexId) !== -1) {
21752 vertexIds.splice(vertexIds.indexOf(vertexId), 1);
21754 removeVertexIds.push(vertexId);
21757 if (parents.length < 1) {
21758 vgraph = vgraph.remove(vertex);
21761 } while (keepGoing);
21762 vertices = vertices.filter(function(vertex2) {
21763 return removeVertexIds.indexOf(vertex2.id) === -1;
21764 }).map(function(vertex2) {
21765 return vgraph.entity(vertex2.id);
21767 ways = ways.filter(function(way2) {
21768 return removeWayIds.indexOf(way2.id) === -1;
21769 }).map(function(way2) {
21770 return vgraph.entity(way2.id);
21772 var intersection2 = {
21778 intersection2.turns = function(fromWayId, maxViaWay) {
21779 if (!fromWayId) return [];
21780 if (!maxViaWay) maxViaWay = 0;
21781 var vgraph2 = intersection2.graph;
21782 var keyVertexIds = intersection2.vertices.map(function(v3) {
21785 var start2 = vgraph2.entity(fromWayId);
21786 if (!start2 || !(start2.__from || start2.__via)) return [];
21787 var maxPathLength = maxViaWay * 2 + 3;
21791 function step(entity, currPath, currRestrictions, matchedRestriction) {
21792 currPath = (currPath || []).slice();
21793 if (currPath.length >= maxPathLength) return;
21794 currPath.push(entity.id);
21795 currRestrictions = (currRestrictions || []).slice();
21796 if (entity.type === "node") {
21797 stepNode(entity, currPath, currRestrictions);
21799 stepWay(entity, currPath, currRestrictions, matchedRestriction);
21802 function stepNode(entity, currPath, currRestrictions) {
21804 var parents2 = vgraph2.parentWays(entity);
21806 for (i4 = 0; i4 < parents2.length; i4++) {
21807 var way2 = parents2[i4];
21808 if (way2.__oneWay && way2.nodes[0] !== entity.id) continue;
21809 if (currPath.indexOf(way2.id) !== -1 && currPath.length >= 3) continue;
21810 var restrict = null;
21811 for (j4 = 0; j4 < currRestrictions.length; j4++) {
21812 var restriction = currRestrictions[j4];
21813 var f2 = restriction.memberByRole("from");
21814 var v3 = restriction.membersByRole("via");
21815 var t2 = restriction.memberByRole("to");
21816 var isNo = /^no_/.test(restriction.tags.restriction);
21817 var isOnly = /^only_/.test(restriction.tags.restriction);
21818 if (!(isNo || isOnly)) {
21821 var matchesFrom = f2.id === fromWayId;
21822 var matchesViaTo = false;
21823 var isAlongOnlyPath = false;
21824 if (t2.id === way2.id) {
21825 if (v3.length === 1 && v3[0].type === "node") {
21826 matchesViaTo = v3[0].id === entity.id && (matchesFrom && currPath.length === 2 || !matchesFrom && currPath.length > 2);
21829 for (k2 = 2; k2 < currPath.length; k2 += 2) {
21830 pathVias.push(currPath[k2]);
21832 var restrictionVias = [];
21833 for (k2 = 0; k2 < v3.length; k2++) {
21834 if (v3[k2].type === "way") {
21835 restrictionVias.push(v3[k2].id);
21838 var diff = utilArrayDifference(pathVias, restrictionVias);
21839 matchesViaTo = !diff.length;
21841 } else if (isOnly) {
21842 for (k2 = 0; k2 < v3.length; k2++) {
21843 if (v3[k2].type === "way" && v3[k2].id === way2.id) {
21844 isAlongOnlyPath = true;
21849 if (matchesViaTo) {
21851 restrict = { id: restriction.id, direct: matchesFrom, from: f2.id, only: true, end: true };
21853 restrict = { id: restriction.id, direct: matchesFrom, from: f2.id, no: true, end: true };
21856 if (isAlongOnlyPath) {
21857 restrict = { id: restriction.id, direct: false, from: f2.id, only: true, end: false };
21858 } else if (isOnly) {
21859 restrict = { id: restriction.id, direct: false, from: f2.id, no: true, end: true };
21862 if (restrict && restrict.direct) break;
21864 nextWays.push({ way: way2, restrict });
21866 nextWays.forEach(function(nextWay) {
21867 step(nextWay.way, currPath, currRestrictions, nextWay.restrict);
21870 function stepWay(entity, currPath, currRestrictions, matchedRestriction) {
21872 if (currPath.length >= 3) {
21873 var turnPath = currPath.slice();
21874 if (matchedRestriction && matchedRestriction.direct === false) {
21875 for (i4 = 0; i4 < turnPath.length; i4++) {
21876 if (turnPath[i4] === matchedRestriction.from) {
21877 turnPath = turnPath.slice(i4);
21882 var turn = pathToTurn(turnPath);
21884 if (matchedRestriction) {
21885 turn.restrictionID = matchedRestriction.id;
21886 turn.no = matchedRestriction.no;
21887 turn.only = matchedRestriction.only;
21888 turn.direct = matchedRestriction.direct;
21890 turns.push(osmTurn(turn));
21892 if (currPath[0] === currPath[2]) return;
21894 if (matchedRestriction && matchedRestriction.end) return;
21895 var n1 = vgraph2.entity(entity.first());
21896 var n22 = vgraph2.entity(entity.last());
21897 var dist = geoSphericalDistance(n1.loc, n22.loc);
21898 var nextNodes = [];
21899 if (currPath.length > 1) {
21900 if (dist > maxDistance) return;
21901 if (!entity.__via) return;
21903 if (!entity.__oneWay && // bidirectional..
21904 keyVertexIds.indexOf(n1.id) !== -1 && // key vertex..
21905 currPath.indexOf(n1.id) === -1) {
21906 nextNodes.push(n1);
21908 if (keyVertexIds.indexOf(n22.id) !== -1 && // key vertex..
21909 currPath.indexOf(n22.id) === -1) {
21910 nextNodes.push(n22);
21912 nextNodes.forEach(function(nextNode) {
21913 var fromRestrictions = vgraph2.parentRelations(entity).filter(function(r2) {
21914 if (!r2.isRestriction()) return false;
21915 var f2 = r2.memberByRole("from");
21916 if (!f2 || f2.id !== entity.id) return false;
21917 var isOnly = /^only_/.test(r2.tags.restriction);
21918 if (!isOnly) return true;
21919 var isOnlyVia = false;
21920 var v3 = r2.membersByRole("via");
21921 if (v3.length === 1 && v3[0].type === "node") {
21922 isOnlyVia = v3[0].id === nextNode.id;
21924 for (var i5 = 0; i5 < v3.length; i5++) {
21925 if (v3[i5].type !== "way") continue;
21926 var viaWay = vgraph2.entity(v3[i5].id);
21927 if (viaWay.first() === nextNode.id || viaWay.last() === nextNode.id) {
21935 step(nextNode, currPath, currRestrictions.concat(fromRestrictions), false);
21938 function pathToTurn(path) {
21939 if (path.length < 3) return;
21940 var fromWayId2, fromNodeId, fromVertexId;
21941 var toWayId, toNodeId, toVertexId;
21942 var viaWayIds, viaNodeId, isUturn;
21943 fromWayId2 = path[0];
21944 toWayId = path[path.length - 1];
21945 if (path.length === 3 && fromWayId2 === toWayId) {
21946 var way2 = vgraph2.entity(fromWayId2);
21947 if (way2.__oneWay) return null;
21949 viaNodeId = fromVertexId = toVertexId = path[1];
21950 fromNodeId = toNodeId = adjacentNode(fromWayId2, viaNodeId);
21953 fromVertexId = path[1];
21954 fromNodeId = adjacentNode(fromWayId2, fromVertexId);
21955 toVertexId = path[path.length - 2];
21956 toNodeId = adjacentNode(toWayId, toVertexId);
21957 if (path.length === 3) {
21958 viaNodeId = path[1];
21960 viaWayIds = path.filter(function(entityId) {
21961 return entityId[0] === "w";
21963 viaWayIds = viaWayIds.slice(1, viaWayIds.length - 1);
21967 key: path.join("_"),
21969 from: { node: fromNodeId, way: fromWayId2, vertex: fromVertexId },
21970 via: { node: viaNodeId, ways: viaWayIds },
21971 to: { node: toNodeId, way: toWayId, vertex: toVertexId },
21974 function adjacentNode(wayId, affixId) {
21975 var nodes2 = vgraph2.entity(wayId).nodes;
21976 return affixId === nodes2[0] ? nodes2[1] : nodes2[nodes2.length - 2];
21980 return intersection2;
21982 function osmInferRestriction(graph, turn, projection2) {
21983 var fromWay = graph.entity(turn.from.way);
21984 var fromNode = graph.entity(turn.from.node);
21985 var fromVertex = graph.entity(turn.from.vertex);
21986 var toWay = graph.entity(turn.to.way);
21987 var toNode = graph.entity(turn.to.node);
21988 var toVertex = graph.entity(turn.to.vertex);
21989 var fromOneWay = fromWay.tags.oneway === "yes";
21990 var toOneWay = toWay.tags.oneway === "yes";
21991 var angle2 = (geoAngle(fromVertex, fromNode, projection2) - geoAngle(toVertex, toNode, projection2)) * 180 / Math.PI;
21992 while (angle2 < 0) {
21995 if (fromNode === toNode) {
21996 return "no_u_turn";
21998 if ((angle2 < 23 || angle2 > 336) && fromOneWay && toOneWay) {
21999 return "no_u_turn";
22001 if ((angle2 < 40 || angle2 > 319) && fromOneWay && toOneWay && turn.from.vertex !== turn.to.vertex) {
22002 return "no_u_turn";
22004 if (angle2 < 158) {
22005 return "no_right_turn";
22007 if (angle2 > 202) {
22008 return "no_left_turn";
22010 return "no_straight_on";
22012 var init_intersection = __esm({
22013 "modules/osm/intersection.js"() {
22015 init_delete_relation();
22025 // modules/osm/index.js
22026 var osm_exports = {};
22027 __export(osm_exports, {
22028 QAItem: () => QAItem,
22029 osmAreaKeys: () => osmAreaKeys,
22030 osmChangeset: () => osmChangeset,
22031 osmEntity: () => osmEntity,
22032 osmFlowingWaterwayTagValues: () => osmFlowingWaterwayTagValues,
22033 osmInferRestriction: () => osmInferRestriction,
22034 osmIntersection: () => osmIntersection,
22035 osmIsInterestingTag: () => osmIsInterestingTag,
22036 osmJoinWays: () => osmJoinWays,
22037 osmLanes: () => osmLanes,
22038 osmLifecyclePrefixes: () => osmLifecyclePrefixes,
22039 osmNode: () => osmNode,
22040 osmNodeGeometriesForTags: () => osmNodeGeometriesForTags,
22041 osmNote: () => osmNote,
22042 osmPavedTags: () => osmPavedTags,
22043 osmPointTags: () => osmPointTags,
22044 osmRailwayTrackTagValues: () => osmRailwayTrackTagValues,
22045 osmRelation: () => osmRelation,
22046 osmRemoveLifecyclePrefix: () => osmRemoveLifecyclePrefix,
22047 osmRoutableHighwayTagValues: () => osmRoutableHighwayTagValues,
22048 osmSetAreaKeys: () => osmSetAreaKeys,
22049 osmSetPointTags: () => osmSetPointTags,
22050 osmSetVertexTags: () => osmSetVertexTags,
22051 osmTagSuggestingArea: () => osmTagSuggestingArea,
22052 osmTurn: () => osmTurn,
22053 osmVertexTags: () => osmVertexTags,
22054 osmWay: () => osmWay
22056 var init_osm = __esm({
22057 "modules/osm/index.js"() {
22066 init_intersection();
22068 init_multipolygon();
22073 // modules/actions/merge_polygon.js
22074 var merge_polygon_exports = {};
22075 __export(merge_polygon_exports, {
22076 actionMergePolygon: () => actionMergePolygon
22078 function actionMergePolygon(ids, newRelationId) {
22079 function groupEntities(graph) {
22080 var entities = ids.map(function(id2) {
22081 return graph.entity(id2);
22083 var geometryGroups = utilArrayGroupBy(entities, function(entity) {
22084 if (entity.type === "way" && entity.isClosed()) {
22085 return "closedWay";
22086 } else if (entity.type === "relation" && entity.isMultipolygon()) {
22087 return "multipolygon";
22092 return Object.assign(
22093 { closedWay: [], multipolygon: [], other: [] },
22097 var action = function(graph) {
22098 var entities = groupEntities(graph);
22099 var polygons = entities.multipolygon.reduce(function(polygons2, m3) {
22100 return polygons2.concat(osmJoinWays(m3.members, graph));
22101 }, []).concat(entities.closedWay.map(function(d4) {
22102 var member = [{ id: d4.id }];
22103 member.nodes = graph.childNodes(d4);
22106 var contained = polygons.map(function(w3, i3) {
22107 return polygons.map(function(d4, n3) {
22108 if (i3 === n3) return null;
22109 return geoPolygonContainsPolygon(
22110 d4.nodes.map(function(n4) {
22113 w3.nodes.map(function(n4) {
22121 while (polygons.length) {
22122 extractUncontained(polygons);
22123 polygons = polygons.filter(isContained);
22124 contained = contained.filter(isContained).map(filterContained);
22126 function isContained(d4, i3) {
22127 return contained[i3].some(function(val) {
22131 function filterContained(d4) {
22132 return d4.filter(isContained);
22134 function extractUncontained(polygons2) {
22135 polygons2.forEach(function(d4, i3) {
22136 if (!isContained(d4, i3)) {
22137 d4.forEach(function(member) {
22141 role: outer ? "outer" : "inner"
22149 if (entities.multipolygon.length > 0) {
22150 var oldestID = utilOldestID(entities.multipolygon.map((entity) => entity.id));
22151 relation = entities.multipolygon.find((entity) => entity.id === oldestID);
22153 relation = osmRelation({ id: newRelationId, tags: { type: "multipolygon" } });
22155 entities.multipolygon.forEach(function(m3) {
22156 if (m3.id !== relation.id) {
22157 relation = relation.mergeTags(m3.tags);
22158 graph = graph.remove(m3);
22161 entities.closedWay.forEach(function(way) {
22162 function isThisOuter(m3) {
22163 return m3.id === way.id && m3.role !== "inner";
22165 if (members.some(isThisOuter)) {
22166 relation = relation.mergeTags(way.tags);
22167 graph = graph.replace(way.update({ tags: {} }));
22170 return graph.replace(relation.update({
22172 tags: utilObjectOmit(relation.tags, ["area"])
22175 action.disabled = function(graph) {
22176 var entities = groupEntities(graph);
22177 if (entities.other.length > 0 || entities.closedWay.length + entities.multipolygon.length < 2) {
22178 return "not_eligible";
22180 if (!entities.multipolygon.every(function(r2) {
22181 return r2.isComplete(graph);
22183 return "incomplete_relation";
22185 if (!entities.multipolygon.length) {
22186 var sharedMultipolygons = [];
22187 entities.closedWay.forEach(function(way, i3) {
22189 sharedMultipolygons = graph.parentMultipolygons(way);
22191 sharedMultipolygons = utilArrayIntersection(sharedMultipolygons, graph.parentMultipolygons(way));
22194 sharedMultipolygons = sharedMultipolygons.filter(function(relation) {
22195 return relation.members.length === entities.closedWay.length;
22197 if (sharedMultipolygons.length) {
22198 return "not_eligible";
22200 } else if (entities.closedWay.some(function(way) {
22201 return utilArrayIntersection(graph.parentMultipolygons(way), entities.multipolygon).length;
22203 return "not_eligible";
22208 var init_merge_polygon = __esm({
22209 "modules/actions/merge_polygon.js"() {
22217 // node_modules/fast-deep-equal/index.js
22218 var require_fast_deep_equal = __commonJS({
22219 "node_modules/fast-deep-equal/index.js"(exports2, module2) {
22221 module2.exports = function equal(a2, b3) {
22222 if (a2 === b3) return true;
22223 if (a2 && b3 && typeof a2 == "object" && typeof b3 == "object") {
22224 if (a2.constructor !== b3.constructor) return false;
22225 var length2, i3, keys2;
22226 if (Array.isArray(a2)) {
22227 length2 = a2.length;
22228 if (length2 != b3.length) return false;
22229 for (i3 = length2; i3-- !== 0; )
22230 if (!equal(a2[i3], b3[i3])) return false;
22233 if (a2.constructor === RegExp) return a2.source === b3.source && a2.flags === b3.flags;
22234 if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b3.valueOf();
22235 if (a2.toString !== Object.prototype.toString) return a2.toString() === b3.toString();
22236 keys2 = Object.keys(a2);
22237 length2 = keys2.length;
22238 if (length2 !== Object.keys(b3).length) return false;
22239 for (i3 = length2; i3-- !== 0; )
22240 if (!Object.prototype.hasOwnProperty.call(b3, keys2[i3])) return false;
22241 for (i3 = length2; i3-- !== 0; ) {
22242 var key = keys2[i3];
22243 if (!equal(a2[key], b3[key])) return false;
22247 return a2 !== a2 && b3 !== b3;
22252 // node_modules/node-diff3/index.mjs
22253 function LCS(buffer1, buffer2) {
22254 let equivalenceClasses = {};
22255 for (let j3 = 0; j3 < buffer2.length; j3++) {
22256 const item = buffer2[j3];
22257 if (equivalenceClasses[item]) {
22258 equivalenceClasses[item].push(j3);
22260 equivalenceClasses[item] = [j3];
22263 const NULLRESULT = { buffer1index: -1, buffer2index: -1, chain: null };
22264 let candidates = [NULLRESULT];
22265 for (let i3 = 0; i3 < buffer1.length; i3++) {
22266 const item = buffer1[i3];
22267 const buffer2indices = equivalenceClasses[item] || [];
22269 let c2 = candidates[0];
22270 for (let jx = 0; jx < buffer2indices.length; jx++) {
22271 const j3 = buffer2indices[jx];
22273 for (s2 = r2; s2 < candidates.length; s2++) {
22274 if (candidates[s2].buffer2index < j3 && (s2 === candidates.length - 1 || candidates[s2 + 1].buffer2index > j3)) {
22278 if (s2 < candidates.length) {
22279 const newCandidate = { buffer1index: i3, buffer2index: j3, chain: candidates[s2] };
22280 if (r2 === candidates.length) {
22281 candidates.push(c2);
22283 candidates[r2] = c2;
22287 if (r2 === candidates.length) {
22292 candidates[r2] = c2;
22294 return candidates[candidates.length - 1];
22296 function diffIndices(buffer1, buffer2) {
22297 const lcs = LCS(buffer1, buffer2);
22299 let tail1 = buffer1.length;
22300 let tail2 = buffer2.length;
22301 for (let candidate = lcs; candidate !== null; candidate = candidate.chain) {
22302 const mismatchLength1 = tail1 - candidate.buffer1index - 1;
22303 const mismatchLength2 = tail2 - candidate.buffer2index - 1;
22304 tail1 = candidate.buffer1index;
22305 tail2 = candidate.buffer2index;
22306 if (mismatchLength1 || mismatchLength2) {
22308 buffer1: [tail1 + 1, mismatchLength1],
22309 buffer1Content: buffer1.slice(tail1 + 1, tail1 + 1 + mismatchLength1),
22310 buffer2: [tail2 + 1, mismatchLength2],
22311 buffer2Content: buffer2.slice(tail2 + 1, tail2 + 1 + mismatchLength2)
22318 function diff3MergeRegions(a2, o2, b3) {
22320 function addHunk(h3, ab) {
22323 oStart: h3.buffer1[0],
22324 oLength: h3.buffer1[1],
22325 // length of o to remove
22326 abStart: h3.buffer2[0],
22327 abLength: h3.buffer2[1]
22328 // length of a/b to insert
22329 // abContent: (ab === 'a' ? a : b).slice(h.buffer2[0], h.buffer2[0] + h.buffer2[1])
22332 diffIndices(o2, a2).forEach((item) => addHunk(item, "a"));
22333 diffIndices(o2, b3).forEach((item) => addHunk(item, "b"));
22334 hunks.sort((x2, y3) => x2.oStart - y3.oStart);
22336 let currOffset = 0;
22337 function advanceTo(endOffset) {
22338 if (endOffset > currOffset) {
22342 bufferStart: currOffset,
22343 bufferLength: endOffset - currOffset,
22344 bufferContent: o2.slice(currOffset, endOffset)
22346 currOffset = endOffset;
22349 while (hunks.length) {
22350 let hunk = hunks.shift();
22351 let regionStart = hunk.oStart;
22352 let regionEnd = hunk.oStart + hunk.oLength;
22353 let regionHunks = [hunk];
22354 advanceTo(regionStart);
22355 while (hunks.length) {
22356 const nextHunk = hunks[0];
22357 const nextHunkStart = nextHunk.oStart;
22358 if (nextHunkStart > regionEnd) break;
22359 regionEnd = Math.max(regionEnd, nextHunkStart + nextHunk.oLength);
22360 regionHunks.push(hunks.shift());
22362 if (regionHunks.length === 1) {
22363 if (hunk.abLength > 0) {
22364 const buffer = hunk.ab === "a" ? a2 : b3;
22368 bufferStart: hunk.abStart,
22369 bufferLength: hunk.abLength,
22370 bufferContent: buffer.slice(hunk.abStart, hunk.abStart + hunk.abLength)
22375 a: [a2.length, -1, o2.length, -1],
22376 b: [b3.length, -1, o2.length, -1]
22378 while (regionHunks.length) {
22379 hunk = regionHunks.shift();
22380 const oStart = hunk.oStart;
22381 const oEnd = oStart + hunk.oLength;
22382 const abStart = hunk.abStart;
22383 const abEnd = abStart + hunk.abLength;
22384 let b4 = bounds[hunk.ab];
22385 b4[0] = Math.min(abStart, b4[0]);
22386 b4[1] = Math.max(abEnd, b4[1]);
22387 b4[2] = Math.min(oStart, b4[2]);
22388 b4[3] = Math.max(oEnd, b4[3]);
22390 const aStart = bounds.a[0] + (regionStart - bounds.a[2]);
22391 const aEnd = bounds.a[1] + (regionEnd - bounds.a[3]);
22392 const bStart = bounds.b[0] + (regionStart - bounds.b[2]);
22393 const bEnd = bounds.b[1] + (regionEnd - bounds.b[3]);
22397 aLength: aEnd - aStart,
22398 aContent: a2.slice(aStart, aEnd),
22399 oStart: regionStart,
22400 oLength: regionEnd - regionStart,
22401 oContent: o2.slice(regionStart, regionEnd),
22403 bLength: bEnd - bStart,
22404 bContent: b3.slice(bStart, bEnd)
22406 results.push(result);
22408 currOffset = regionEnd;
22410 advanceTo(o2.length);
22413 function diff3Merge(a2, o2, b3, options) {
22415 excludeFalseConflicts: true,
22416 stringSeparator: /\s+/
22418 options = Object.assign(defaults, options);
22419 if (typeof a2 === "string") a2 = a2.split(options.stringSeparator);
22420 if (typeof o2 === "string") o2 = o2.split(options.stringSeparator);
22421 if (typeof b3 === "string") b3 = b3.split(options.stringSeparator);
22423 const regions = diff3MergeRegions(a2, o2, b3);
22425 function flushOk() {
22426 if (okBuffer.length) {
22427 results.push({ ok: okBuffer });
22431 function isFalseConflict(a3, b4) {
22432 if (a3.length !== b4.length) return false;
22433 for (let i3 = 0; i3 < a3.length; i3++) {
22434 if (a3[i3] !== b4[i3]) return false;
22438 regions.forEach((region) => {
22439 if (region.stable) {
22440 okBuffer.push(...region.bufferContent);
22442 if (options.excludeFalseConflicts && isFalseConflict(region.aContent, region.bContent)) {
22443 okBuffer.push(...region.aContent);
22448 a: region.aContent,
22449 aIndex: region.aStart,
22450 o: region.oContent,
22451 oIndex: region.oStart,
22452 b: region.bContent,
22453 bIndex: region.bStart
22462 var init_node_diff3 = __esm({
22463 "node_modules/node-diff3/index.mjs"() {
22467 // modules/actions/merge_remote_changes.js
22468 var merge_remote_changes_exports = {};
22469 __export(merge_remote_changes_exports, {
22470 actionMergeRemoteChanges: () => actionMergeRemoteChanges
22472 function actionMergeRemoteChanges(id2, localGraph, remoteGraph, discardTags, formatUser) {
22473 discardTags = discardTags || {};
22474 var _option = "safe";
22475 var _conflicts = [];
22476 function user(d4) {
22477 return typeof formatUser === "function" ? formatUser(d4) : escape_default(d4);
22479 function mergeLocation(remote, target) {
22480 function pointEqual(a2, b3) {
22481 var epsilon3 = 1e-6;
22482 return Math.abs(a2[0] - b3[0]) < epsilon3 && Math.abs(a2[1] - b3[1]) < epsilon3;
22484 if (_option === "force_local" || pointEqual(target.loc, remote.loc)) {
22487 if (_option === "force_remote") {
22488 return target.update({ loc: remote.loc });
22490 _conflicts.push(_t.html("merge_remote_changes.conflict.location", { user: { html: user(remote.user) } }));
22493 function mergeNodes(base, remote, target) {
22494 if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.nodes, remote.nodes)) {
22497 if (_option === "force_remote") {
22498 return target.update({ nodes: remote.nodes });
22500 var ccount = _conflicts.length;
22501 var o2 = base.nodes || [];
22502 var a2 = target.nodes || [];
22503 var b3 = remote.nodes || [];
22505 var hunks = diff3Merge(a2, o2, b3, { excludeFalseConflicts: true });
22506 for (var i3 = 0; i3 < hunks.length; i3++) {
22507 var hunk = hunks[i3];
22509 nodes.push.apply(nodes, hunk.ok);
22511 var c2 = hunk.conflict;
22512 if ((0, import_fast_deep_equal.default)(c2.o, c2.a)) {
22513 nodes.push.apply(nodes, c2.b);
22514 } else if ((0, import_fast_deep_equal.default)(c2.o, c2.b)) {
22515 nodes.push.apply(nodes, c2.a);
22517 _conflicts.push(_t.html("merge_remote_changes.conflict.nodelist", { user: { html: user(remote.user) } }));
22522 return _conflicts.length === ccount ? target.update({ nodes }) : target;
22524 function mergeChildren(targetWay, children2, updates, graph) {
22525 function isUsed(node2, targetWay2) {
22526 var hasInterestingParent = graph.parentWays(node2).some(function(way) {
22527 return way.id !== targetWay2.id;
22529 return node2.hasInterestingTags() || hasInterestingParent || graph.parentRelations(node2).length > 0;
22531 var ccount = _conflicts.length;
22532 for (var i3 = 0; i3 < children2.length; i3++) {
22533 var id3 = children2[i3];
22534 var node = graph.hasEntity(id3);
22535 if (targetWay.nodes.indexOf(id3) === -1) {
22536 if (node && !isUsed(node, targetWay)) {
22537 updates.removeIds.push(id3);
22541 var local = localGraph.hasEntity(id3);
22542 var remote = remoteGraph.hasEntity(id3);
22544 if (_option === "force_remote" && remote && remote.visible) {
22545 updates.replacements.push(remote);
22546 } else if (_option === "force_local" && local) {
22547 target = osmEntity(local);
22549 target = target.update({ version: remote.version });
22551 updates.replacements.push(target);
22552 } else if (_option === "safe" && local && remote && local.version !== remote.version) {
22553 target = osmEntity(local, { version: remote.version });
22554 if (remote.visible) {
22555 target = mergeLocation(remote, target);
22557 _conflicts.push(_t.html("merge_remote_changes.conflict.deleted", { user: { html: user(remote.user) } }));
22559 if (_conflicts.length !== ccount) break;
22560 updates.replacements.push(target);
22565 function updateChildren(updates, graph) {
22566 for (var i3 = 0; i3 < updates.replacements.length; i3++) {
22567 graph = graph.replace(updates.replacements[i3]);
22569 if (updates.removeIds.length) {
22570 graph = actionDeleteMultiple(updates.removeIds)(graph);
22574 function mergeMembers(remote, target) {
22575 if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.members, remote.members)) {
22578 if (_option === "force_remote") {
22579 return target.update({ members: remote.members });
22581 _conflicts.push(_t.html("merge_remote_changes.conflict.memberlist", { user: { html: user(remote.user) } }));
22584 function mergeTags(base, remote, target) {
22585 if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.tags, remote.tags)) {
22588 if (_option === "force_remote") {
22589 return target.update({ tags: remote.tags });
22591 var ccount = _conflicts.length;
22592 var o2 = base.tags || {};
22593 var a2 = target.tags || {};
22594 var b3 = remote.tags || {};
22595 var keys2 = utilArrayUnion(utilArrayUnion(Object.keys(o2), Object.keys(a2)), Object.keys(b3)).filter(function(k3) {
22596 return !discardTags[k3];
22598 var tags = Object.assign({}, a2);
22599 var changed = false;
22600 for (var i3 = 0; i3 < keys2.length; i3++) {
22601 var k2 = keys2[i3];
22602 if (o2[k2] !== b3[k2] && a2[k2] !== b3[k2]) {
22603 if (o2[k2] !== a2[k2]) {
22604 _conflicts.push(_t.html(
22605 "merge_remote_changes.conflict.tags",
22606 { tag: k2, local: a2[k2], remote: b3[k2], user: { html: user(remote.user) } }
22609 if (b3.hasOwnProperty(k2)) {
22618 return changed && _conflicts.length === ccount ? target.update({ tags }) : target;
22620 var action = function(graph) {
22621 var updates = { replacements: [], removeIds: [] };
22622 var base = graph.base().entities[id2];
22623 var local = localGraph.entity(id2);
22624 var remote = remoteGraph.entity(id2);
22625 var target = osmEntity(local, { version: remote.version });
22626 if (!remote.visible) {
22627 if (_option === "force_remote") {
22628 return actionDeleteMultiple([id2])(graph);
22629 } else if (_option === "force_local") {
22630 if (target.type === "way") {
22631 target = mergeChildren(target, utilArrayUniq(local.nodes), updates, graph);
22632 graph = updateChildren(updates, graph);
22634 return graph.replace(target);
22636 _conflicts.push(_t.html("merge_remote_changes.conflict.deleted", { user: { html: user(remote.user) } }));
22640 if (target.type === "node") {
22641 target = mergeLocation(remote, target);
22642 } else if (target.type === "way") {
22643 graph.rebase(remoteGraph.childNodes(remote), [graph], false);
22644 target = mergeNodes(base, remote, target);
22645 target = mergeChildren(target, utilArrayUnion(local.nodes, remote.nodes), updates, graph);
22646 } else if (target.type === "relation") {
22647 target = mergeMembers(remote, target);
22649 target = mergeTags(base, remote, target);
22650 if (!_conflicts.length) {
22651 graph = updateChildren(updates, graph).replace(target);
22655 action.withOption = function(opt) {
22659 action.conflicts = function() {
22664 var import_fast_deep_equal;
22665 var init_merge_remote_changes = __esm({
22666 "modules/actions/merge_remote_changes.js"() {
22668 import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
22672 init_delete_multiple();
22678 // modules/actions/move.js
22679 var move_exports = {};
22680 __export(move_exports, {
22681 actionMove: () => actionMove
22683 function actionMove(moveIDs, tryDelta, projection2, cache) {
22684 var _delta = tryDelta;
22685 function setupCache(graph) {
22686 function canMove(nodeID) {
22687 if (moveIDs.indexOf(nodeID) !== -1) return true;
22688 var parents = graph.parentWays(graph.entity(nodeID));
22689 if (parents.length < 3) return true;
22690 var parentsMoving = parents.every(function(way) {
22691 return cache.moving[way.id];
22693 if (!parentsMoving) delete cache.moving[nodeID];
22694 return parentsMoving;
22696 function cacheEntities(ids) {
22697 for (var i3 = 0; i3 < ids.length; i3++) {
22699 if (cache.moving[id2]) continue;
22700 cache.moving[id2] = true;
22701 var entity = graph.hasEntity(id2);
22702 if (!entity) continue;
22703 if (entity.type === "node") {
22704 cache.nodes.push(id2);
22705 cache.startLoc[id2] = entity.loc;
22706 } else if (entity.type === "way") {
22707 cache.ways.push(id2);
22708 cacheEntities(entity.nodes);
22710 cacheEntities(entity.members.map(function(member) {
22716 function cacheIntersections(ids) {
22717 function isEndpoint(way2, id3) {
22718 return !way2.isClosed() && !!way2.affix(id3);
22720 for (var i3 = 0; i3 < ids.length; i3++) {
22722 var childNodes = graph.childNodes(graph.entity(id2));
22723 for (var j3 = 0; j3 < childNodes.length; j3++) {
22724 var node = childNodes[j3];
22725 var parents = graph.parentWays(node);
22726 if (parents.length !== 2) continue;
22727 var moved = graph.entity(id2);
22728 var unmoved = null;
22729 for (var k2 = 0; k2 < parents.length; k2++) {
22730 var way = parents[k2];
22731 if (!cache.moving[way.id]) {
22736 if (!unmoved) continue;
22737 if (utilArrayIntersection(moved.nodes, unmoved.nodes).length > 2) continue;
22738 if (moved.isArea() || unmoved.isArea()) continue;
22739 cache.intersections.push({
22742 unmovedId: unmoved.id,
22743 movedIsEP: isEndpoint(moved, node.id),
22744 unmovedIsEP: isEndpoint(unmoved, node.id)
22754 cache.intersections = [];
22755 cache.replacedVertex = {};
22756 cache.startLoc = {};
22759 cacheEntities(moveIDs);
22760 cacheIntersections(cache.ways);
22761 cache.nodes = cache.nodes.filter(canMove);
22765 function replaceMovedVertex(nodeId, wayId, graph, delta) {
22766 var way = graph.entity(wayId);
22767 var moved = graph.entity(nodeId);
22768 var movedIndex = way.nodes.indexOf(nodeId);
22769 var len, prevIndex, nextIndex;
22770 if (way.isClosed()) {
22771 len = way.nodes.length - 1;
22772 prevIndex = (movedIndex + len - 1) % len;
22773 nextIndex = (movedIndex + len + 1) % len;
22775 len = way.nodes.length;
22776 prevIndex = movedIndex - 1;
22777 nextIndex = movedIndex + 1;
22779 var prev = graph.hasEntity(way.nodes[prevIndex]);
22780 var next = graph.hasEntity(way.nodes[nextIndex]);
22781 if (!prev || !next) return graph;
22782 var key = wayId + "_" + nodeId;
22783 var orig = cache.replacedVertex[key];
22786 cache.replacedVertex[key] = orig;
22787 cache.startLoc[orig.id] = cache.startLoc[nodeId];
22791 start2 = projection2(cache.startLoc[nodeId]);
22792 end = projection2.invert(geoVecAdd(start2, delta));
22794 end = cache.startLoc[nodeId];
22796 orig = orig.move(end);
22797 var angle2 = Math.abs(geoAngle(orig, prev, projection2) - geoAngle(orig, next, projection2)) * 180 / Math.PI;
22798 if (angle2 > 175 && angle2 < 185) return graph;
22799 var p1 = [prev.loc, orig.loc, moved.loc, next.loc].map(projection2);
22800 var p2 = [prev.loc, moved.loc, orig.loc, next.loc].map(projection2);
22801 var d1 = geoPathLength(p1);
22802 var d22 = geoPathLength(p2);
22803 var insertAt = d1 <= d22 ? movedIndex : nextIndex;
22804 if (way.isClosed() && insertAt === 0) insertAt = len;
22805 way = way.addNode(orig.id, insertAt);
22806 return graph.replace(orig).replace(way);
22808 function removeDuplicateVertices(wayId, graph) {
22809 var way = graph.entity(wayId);
22810 var epsilon3 = 1e-6;
22812 function isInteresting(node, graph2) {
22813 return graph2.parentWays(node).length > 1 || graph2.parentRelations(node).length || node.hasInterestingTags();
22815 for (var i3 = 0; i3 < way.nodes.length; i3++) {
22816 curr = graph.entity(way.nodes[i3]);
22817 if (prev && curr && geoVecEqual(prev.loc, curr.loc, epsilon3)) {
22818 if (!isInteresting(prev, graph)) {
22819 way = way.removeNode(prev.id);
22820 graph = graph.replace(way).remove(prev);
22821 } else if (!isInteresting(curr, graph)) {
22822 way = way.removeNode(curr.id);
22823 graph = graph.replace(way).remove(curr);
22830 function unZorroIntersection(intersection2, graph) {
22831 var vertex = graph.entity(intersection2.nodeId);
22832 var way1 = graph.entity(intersection2.movedId);
22833 var way2 = graph.entity(intersection2.unmovedId);
22834 var isEP1 = intersection2.movedIsEP;
22835 var isEP2 = intersection2.unmovedIsEP;
22836 if (isEP1 && isEP2) return graph;
22837 var nodes1 = graph.childNodes(way1).filter(function(n3) {
22838 return n3 !== vertex;
22840 var nodes2 = graph.childNodes(way2).filter(function(n3) {
22841 return n3 !== vertex;
22843 if (way1.isClosed() && way1.first() === vertex.id) nodes1.push(nodes1[0]);
22844 if (way2.isClosed() && way2.first() === vertex.id) nodes2.push(nodes2[0]);
22845 var edge1 = !isEP1 && geoChooseEdge(nodes1, projection2(vertex.loc), projection2);
22846 var edge2 = !isEP2 && geoChooseEdge(nodes2, projection2(vertex.loc), projection2);
22848 if (!isEP1 && !isEP2) {
22849 var epsilon3 = 1e-6, maxIter = 10;
22850 for (var i3 = 0; i3 < maxIter; i3++) {
22851 loc = geoVecInterp(edge1.loc, edge2.loc, 0.5);
22852 edge1 = geoChooseEdge(nodes1, projection2(loc), projection2);
22853 edge2 = geoChooseEdge(nodes2, projection2(loc), projection2);
22854 if (Math.abs(edge1.distance - edge2.distance) < epsilon3) break;
22856 } else if (!isEP1) {
22861 graph = graph.replace(vertex.move(loc));
22862 if (!isEP1 && edge1.index !== way1.nodes.indexOf(vertex.id)) {
22863 way1 = way1.removeNode(vertex.id).addNode(vertex.id, edge1.index);
22864 graph = graph.replace(way1);
22866 if (!isEP2 && edge2.index !== way2.nodes.indexOf(vertex.id)) {
22867 way2 = way2.removeNode(vertex.id).addNode(vertex.id, edge2.index);
22868 graph = graph.replace(way2);
22872 function cleanupIntersections(graph) {
22873 for (var i3 = 0; i3 < cache.intersections.length; i3++) {
22874 var obj = cache.intersections[i3];
22875 graph = replaceMovedVertex(obj.nodeId, obj.movedId, graph, _delta);
22876 graph = replaceMovedVertex(obj.nodeId, obj.unmovedId, graph, null);
22877 graph = unZorroIntersection(obj, graph);
22878 graph = removeDuplicateVertices(obj.movedId, graph);
22879 graph = removeDuplicateVertices(obj.unmovedId, graph);
22883 function limitDelta(graph) {
22884 function moveNode(loc) {
22885 return geoVecAdd(projection2(loc), _delta);
22887 for (var i3 = 0; i3 < cache.intersections.length; i3++) {
22888 var obj = cache.intersections[i3];
22889 if (obj.movedIsEP && obj.unmovedIsEP) continue;
22890 if (!obj.movedIsEP) continue;
22891 var node = graph.entity(obj.nodeId);
22892 var start2 = projection2(node.loc);
22893 var end = geoVecAdd(start2, _delta);
22894 var movedNodes = graph.childNodes(graph.entity(obj.movedId));
22895 var movedPath = movedNodes.map(function(n3) {
22896 return moveNode(n3.loc);
22898 var unmovedNodes = graph.childNodes(graph.entity(obj.unmovedId));
22899 var unmovedPath = unmovedNodes.map(function(n3) {
22900 return projection2(n3.loc);
22902 var hits = geoPathIntersections(movedPath, unmovedPath);
22903 for (var j3 = 0; i3 < hits.length; i3++) {
22904 if (geoVecEqual(hits[j3], end)) continue;
22905 var edge = geoChooseEdge(unmovedNodes, end, projection2);
22906 _delta = geoVecSubtract(projection2(edge.loc), start2);
22910 var action = function(graph) {
22911 if (_delta[0] === 0 && _delta[1] === 0) return graph;
22913 if (cache.intersections.length) {
22916 for (var i3 = 0; i3 < cache.nodes.length; i3++) {
22917 var node = graph.entity(cache.nodes[i3]);
22918 var start2 = projection2(node.loc);
22919 var end = geoVecAdd(start2, _delta);
22920 graph = graph.replace(node.move(projection2.invert(end)));
22922 if (cache.intersections.length) {
22923 graph = cleanupIntersections(graph);
22927 action.delta = function() {
22932 var init_move = __esm({
22933 "modules/actions/move.js"() {
22941 // modules/actions/move_member.js
22942 var move_member_exports = {};
22943 __export(move_member_exports, {
22944 actionMoveMember: () => actionMoveMember
22946 function actionMoveMember(relationId, fromIndex, toIndex) {
22947 return function(graph) {
22948 return graph.replace(graph.entity(relationId).moveMember(fromIndex, toIndex));
22951 var init_move_member = __esm({
22952 "modules/actions/move_member.js"() {
22957 // modules/actions/move_node.js
22958 var move_node_exports = {};
22959 __export(move_node_exports, {
22960 actionMoveNode: () => actionMoveNode
22962 function actionMoveNode(nodeID, toLoc) {
22963 var action = function(graph, t2) {
22964 if (t2 === null || !isFinite(t2)) t2 = 1;
22965 t2 = Math.min(Math.max(+t2, 0), 1);
22966 var node = graph.entity(nodeID);
22967 return graph.replace(
22968 node.move(geoVecInterp(node.loc, toLoc, t2))
22971 action.transitionable = true;
22974 var init_move_node = __esm({
22975 "modules/actions/move_node.js"() {
22981 // modules/actions/noop.js
22982 var noop_exports = {};
22983 __export(noop_exports, {
22984 actionNoop: () => actionNoop
22986 function actionNoop() {
22987 return function(graph) {
22991 var init_noop2 = __esm({
22992 "modules/actions/noop.js"() {
22997 // modules/actions/orthogonalize.js
22998 var orthogonalize_exports = {};
22999 __export(orthogonalize_exports, {
23000 actionOrthogonalize: () => actionOrthogonalize
23002 function actionOrthogonalize(wayID, projection2, vertexID, degThresh, ep) {
23003 var epsilon3 = ep || 1e-4;
23004 var threshold = degThresh || 13;
23005 var lowerThreshold = Math.cos((90 - threshold) * Math.PI / 180);
23006 var upperThreshold = Math.cos(threshold * Math.PI / 180);
23007 var action = function(graph, t2) {
23008 if (t2 === null || !isFinite(t2)) t2 = 1;
23009 t2 = Math.min(Math.max(+t2, 0), 1);
23010 var way = graph.entity(wayID);
23011 way = way.removeNode("");
23012 if (way.tags.nonsquare) {
23013 var tags = Object.assign({}, way.tags);
23014 delete tags.nonsquare;
23015 way = way.update({ tags });
23017 graph = graph.replace(way);
23018 var isClosed = way.isClosed();
23019 var nodes = graph.childNodes(way).slice();
23020 if (isClosed) nodes.pop();
23021 if (vertexID !== void 0) {
23022 nodes = nodeSubset(nodes, vertexID, isClosed);
23023 if (nodes.length !== 3) return graph;
23025 var nodeCount = {};
23027 var corner = { i: 0, dotp: 1 };
23028 var node, point, loc, score, motions, i3, j3;
23029 for (i3 = 0; i3 < nodes.length; i3++) {
23031 nodeCount[node.id] = (nodeCount[node.id] || 0) + 1;
23032 points.push({ id: node.id, coord: projection2(node.loc) });
23034 if (points.length === 3) {
23035 for (i3 = 0; i3 < 1e3; i3++) {
23036 const motion = calcMotion(points[1], 1, points);
23037 points[corner.i].coord = geoVecAdd(points[corner.i].coord, motion);
23038 score = corner.dotp;
23039 if (score < epsilon3) {
23043 node = graph.entity(nodes[corner.i].id);
23044 loc = projection2.invert(points[corner.i].coord);
23045 graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
23047 var straights = [];
23048 var simplified = [];
23049 for (i3 = 0; i3 < points.length; i3++) {
23050 point = points[i3];
23052 if (isClosed || i3 > 0 && i3 < points.length - 1) {
23053 var a2 = points[(i3 - 1 + points.length) % points.length];
23054 var b3 = points[(i3 + 1) % points.length];
23055 dotp = Math.abs(geoOrthoNormalizedDotProduct(a2.coord, b3.coord, point.coord));
23057 if (dotp > upperThreshold) {
23058 straights.push(point);
23060 simplified.push(point);
23063 var bestPoints = clonePoints(simplified);
23064 var originalPoints = clonePoints(simplified);
23066 for (i3 = 0; i3 < 1e3; i3++) {
23067 motions = simplified.map(calcMotion);
23068 for (j3 = 0; j3 < motions.length; j3++) {
23069 simplified[j3].coord = geoVecAdd(simplified[j3].coord, motions[j3]);
23071 var newScore = geoOrthoCalcScore(simplified, isClosed, epsilon3, threshold);
23072 if (newScore < score) {
23073 bestPoints = clonePoints(simplified);
23076 if (score < epsilon3) {
23080 var bestCoords = bestPoints.map(function(p2) {
23083 if (isClosed) bestCoords.push(bestCoords[0]);
23084 for (i3 = 0; i3 < bestPoints.length; i3++) {
23085 point = bestPoints[i3];
23086 if (!geoVecEqual(originalPoints[i3].coord, point.coord)) {
23087 node = graph.entity(point.id);
23088 loc = projection2.invert(point.coord);
23089 graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
23092 for (i3 = 0; i3 < straights.length; i3++) {
23093 point = straights[i3];
23094 if (nodeCount[point.id] > 1) continue;
23095 node = graph.entity(point.id);
23096 if (t2 === 1 && graph.parentWays(node).length === 1 && graph.parentRelations(node).length === 0 && !node.hasInterestingTags()) {
23097 graph = actionDeleteNode(node.id)(graph);
23099 var choice = geoVecProject(point.coord, bestCoords);
23101 loc = projection2.invert(choice.target);
23102 graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
23108 function clonePoints(array2) {
23109 return array2.map(function(p2) {
23110 return { id: p2.id, coord: [p2.coord[0], p2.coord[1]] };
23113 function calcMotion(point2, i4, array2) {
23114 if (!isClosed && (i4 === 0 || i4 === array2.length - 1)) return [0, 0];
23115 if (nodeCount[array2[i4].id] > 1) return [0, 0];
23116 var a3 = array2[(i4 - 1 + array2.length) % array2.length].coord;
23117 var origin = point2.coord;
23118 var b4 = array2[(i4 + 1) % array2.length].coord;
23119 var p2 = geoVecSubtract(a3, origin);
23120 var q3 = geoVecSubtract(b4, origin);
23121 var scale = 2 * Math.min(geoVecLength(p2), geoVecLength(q3));
23122 p2 = geoVecNormalize(p2);
23123 q3 = geoVecNormalize(q3);
23124 var dotp2 = p2[0] * q3[0] + p2[1] * q3[1];
23125 var val = Math.abs(dotp2);
23126 if (val < lowerThreshold) {
23129 var vec = geoVecNormalize(geoVecAdd(p2, q3));
23130 return geoVecScale(vec, 0.1 * dotp2 * scale);
23135 function nodeSubset(nodes, vertexID2, isClosed) {
23136 var first = isClosed ? 0 : 1;
23137 var last2 = isClosed ? nodes.length : nodes.length - 1;
23138 for (var i3 = first; i3 < last2; i3++) {
23139 if (nodes[i3].id === vertexID2) {
23141 nodes[(i3 - 1 + nodes.length) % nodes.length],
23143 nodes[(i3 + 1) % nodes.length]
23149 action.disabled = function(graph) {
23150 var way = graph.entity(wayID);
23151 way = way.removeNode("");
23152 graph = graph.replace(way);
23153 let isClosed = way.isClosed();
23154 var nodes = graph.childNodes(way).slice();
23155 if (isClosed) nodes.pop();
23156 var allowStraightAngles = false;
23157 if (vertexID !== void 0) {
23158 allowStraightAngles = true;
23159 nodes = nodeSubset(nodes, vertexID, isClosed);
23160 if (nodes.length !== 3) return "end_vertex";
23163 var coords = nodes.map(function(n3) {
23164 return projection2(n3.loc);
23166 var score = geoOrthoCanOrthogonalize(coords, isClosed, epsilon3, threshold, allowStraightAngles);
23167 if (score === null) {
23168 return "not_squarish";
23169 } else if (score === 0) {
23170 return "square_enough";
23175 action.transitionable = true;
23178 var init_orthogonalize = __esm({
23179 "modules/actions/orthogonalize.js"() {
23181 init_delete_node();
23186 // modules/actions/reflect.js
23187 var reflect_exports = {};
23188 __export(reflect_exports, {
23189 actionReflect: () => actionReflect
23191 function actionReflect(reflectIds, projection2) {
23192 var _useLongAxis = true;
23193 var action = function(graph, t2) {
23194 if (t2 === null || !isFinite(t2)) t2 = 1;
23195 t2 = Math.min(Math.max(+t2, 0), 1);
23196 var nodes = utilGetAllNodes(reflectIds, graph);
23197 var points = nodes.map(function(n3) {
23198 return projection2(n3.loc);
23200 var ssr = geoGetSmallestSurroundingRectangle(points);
23201 var p1 = [(ssr.poly[0][0] + ssr.poly[1][0]) / 2, (ssr.poly[0][1] + ssr.poly[1][1]) / 2];
23202 var q1 = [(ssr.poly[2][0] + ssr.poly[3][0]) / 2, (ssr.poly[2][1] + ssr.poly[3][1]) / 2];
23203 var p2 = [(ssr.poly[3][0] + ssr.poly[4][0]) / 2, (ssr.poly[3][1] + ssr.poly[4][1]) / 2];
23204 var q22 = [(ssr.poly[1][0] + ssr.poly[2][0]) / 2, (ssr.poly[1][1] + ssr.poly[2][1]) / 2];
23206 var isLong = geoVecLength(p1, q1) > geoVecLength(p2, q22);
23207 if (_useLongAxis && isLong || !_useLongAxis && !isLong) {
23214 var dx = q3[0] - p3[0];
23215 var dy = q3[1] - p3[1];
23216 var a2 = (dx * dx - dy * dy) / (dx * dx + dy * dy);
23217 var b3 = 2 * dx * dy / (dx * dx + dy * dy);
23218 for (var i3 = 0; i3 < nodes.length; i3++) {
23219 var node = nodes[i3];
23220 var c2 = projection2(node.loc);
23222 a2 * (c2[0] - p3[0]) + b3 * (c2[1] - p3[1]) + p3[0],
23223 b3 * (c2[0] - p3[0]) - a2 * (c2[1] - p3[1]) + p3[1]
23225 var loc2 = projection2.invert(c22);
23226 node = node.move(geoVecInterp(node.loc, loc2, t2));
23227 graph = graph.replace(node);
23231 action.useLongAxis = function(val) {
23232 if (!arguments.length) return _useLongAxis;
23233 _useLongAxis = val;
23236 action.transitionable = true;
23239 var init_reflect = __esm({
23240 "modules/actions/reflect.js"() {
23247 // modules/actions/restrict_turn.js
23248 var restrict_turn_exports = {};
23249 __export(restrict_turn_exports, {
23250 actionRestrictTurn: () => actionRestrictTurn
23252 function actionRestrictTurn(turn, restrictionType, restrictionID) {
23253 return function(graph) {
23254 var fromWay = graph.entity(turn.from.way);
23255 var toWay = graph.entity(turn.to.way);
23256 var viaNode = turn.via.node && graph.entity(turn.via.node);
23257 var viaWays = turn.via.ways && turn.via.ways.map(function(id2) {
23258 return graph.entity(id2);
23261 members.push({ id: fromWay.id, type: "way", role: "from" });
23263 members.push({ id: viaNode.id, type: "node", role: "via" });
23264 } else if (viaWays) {
23265 viaWays.forEach(function(viaWay) {
23266 members.push({ id: viaWay.id, type: "way", role: "via" });
23269 members.push({ id: toWay.id, type: "way", role: "to" });
23270 return graph.replace(osmRelation({
23273 type: "restriction",
23274 restriction: restrictionType
23280 var init_restrict_turn = __esm({
23281 "modules/actions/restrict_turn.js"() {
23287 // modules/actions/revert.js
23288 var revert_exports = {};
23289 __export(revert_exports, {
23290 actionRevert: () => actionRevert
23292 function actionRevert(id2) {
23293 var action = function(graph) {
23294 var entity = graph.hasEntity(id2), base = graph.base().entities[id2];
23295 if (entity && !base) {
23296 if (entity.type === "node") {
23297 graph.parentWays(entity).forEach(function(parent2) {
23298 parent2 = parent2.removeNode(id2);
23299 graph = graph.replace(parent2);
23300 if (parent2.isDegenerate()) {
23301 graph = actionDeleteWay(parent2.id)(graph);
23305 graph.parentRelations(entity).forEach(function(parent2) {
23306 parent2 = parent2.removeMembersWithID(id2);
23307 graph = graph.replace(parent2);
23308 if (parent2.isDegenerate()) {
23309 graph = actionDeleteRelation(parent2.id)(graph);
23313 return graph.revert(id2);
23317 var init_revert = __esm({
23318 "modules/actions/revert.js"() {
23320 init_delete_relation();
23325 // modules/actions/rotate.js
23326 var rotate_exports = {};
23327 __export(rotate_exports, {
23328 actionRotate: () => actionRotate
23330 function actionRotate(rotateIds, pivot, angle2, projection2) {
23331 var action = function(graph) {
23332 return graph.update(function(graph2) {
23333 utilGetAllNodes(rotateIds, graph2).forEach(function(node) {
23334 var point = geoRotate([projection2(node.loc)], angle2, pivot)[0];
23335 graph2 = graph2.replace(node.move(projection2.invert(point)));
23341 var init_rotate = __esm({
23342 "modules/actions/rotate.js"() {
23349 // modules/actions/scale.js
23350 var scale_exports = {};
23351 __export(scale_exports, {
23352 actionScale: () => actionScale
23354 function actionScale(ids, pivotLoc, scaleFactor, projection2) {
23355 return function(graph) {
23356 return graph.update(function(graph2) {
23358 utilGetAllNodes(ids, graph2).forEach(function(node) {
23359 point = projection2(node.loc);
23361 point[0] - pivotLoc[0],
23362 point[1] - pivotLoc[1]
23365 pivotLoc[0] + scaleFactor * radial[0],
23366 pivotLoc[1] + scaleFactor * radial[1]
23368 graph2 = graph2.replace(node.move(projection2.invert(point)));
23373 var init_scale = __esm({
23374 "modules/actions/scale.js"() {
23380 // modules/actions/straighten_nodes.js
23381 var straighten_nodes_exports = {};
23382 __export(straighten_nodes_exports, {
23383 actionStraightenNodes: () => actionStraightenNodes
23385 function actionStraightenNodes(nodeIDs, projection2) {
23386 function positionAlongWay(a2, o2, b3) {
23387 return geoVecDot(a2, b3, o2) / geoVecDot(b3, b3, o2);
23389 function getEndpoints(points) {
23390 var ssr = geoGetSmallestSurroundingRectangle(points);
23391 var p1 = [(ssr.poly[0][0] + ssr.poly[1][0]) / 2, (ssr.poly[0][1] + ssr.poly[1][1]) / 2];
23392 var q1 = [(ssr.poly[2][0] + ssr.poly[3][0]) / 2, (ssr.poly[2][1] + ssr.poly[3][1]) / 2];
23393 var p2 = [(ssr.poly[3][0] + ssr.poly[4][0]) / 2, (ssr.poly[3][1] + ssr.poly[4][1]) / 2];
23394 var q22 = [(ssr.poly[1][0] + ssr.poly[2][0]) / 2, (ssr.poly[1][1] + ssr.poly[2][1]) / 2];
23395 var isLong = geoVecLength(p1, q1) > geoVecLength(p2, q22);
23401 var action = function(graph, t2) {
23402 if (t2 === null || !isFinite(t2)) t2 = 1;
23403 t2 = Math.min(Math.max(+t2, 0), 1);
23404 var nodes = nodeIDs.map(function(id2) {
23405 return graph.entity(id2);
23407 var points = nodes.map(function(n3) {
23408 return projection2(n3.loc);
23410 var endpoints = getEndpoints(points);
23411 var startPoint = endpoints[0];
23412 var endPoint = endpoints[1];
23413 for (var i3 = 0; i3 < points.length; i3++) {
23414 var node = nodes[i3];
23415 var point = points[i3];
23416 var u2 = positionAlongWay(point, startPoint, endPoint);
23417 var point2 = geoVecInterp(startPoint, endPoint, u2);
23418 var loc2 = projection2.invert(point2);
23419 graph = graph.replace(node.move(geoVecInterp(node.loc, loc2, t2)));
23423 action.disabled = function(graph) {
23424 var nodes = nodeIDs.map(function(id2) {
23425 return graph.entity(id2);
23427 var points = nodes.map(function(n3) {
23428 return projection2(n3.loc);
23430 var endpoints = getEndpoints(points);
23431 var startPoint = endpoints[0];
23432 var endPoint = endpoints[1];
23433 var maxDistance = 0;
23434 for (var i3 = 0; i3 < points.length; i3++) {
23435 var point = points[i3];
23436 var u2 = positionAlongWay(point, startPoint, endPoint);
23437 var p2 = geoVecInterp(startPoint, endPoint, u2);
23438 var dist = geoVecLength(p2, point);
23439 if (!isNaN(dist) && dist > maxDistance) {
23440 maxDistance = dist;
23443 if (maxDistance < 1e-4) {
23444 return "straight_enough";
23447 action.transitionable = true;
23450 var init_straighten_nodes = __esm({
23451 "modules/actions/straighten_nodes.js"() {
23457 // modules/actions/straighten_way.js
23458 var straighten_way_exports = {};
23459 __export(straighten_way_exports, {
23460 actionStraightenWay: () => actionStraightenWay
23462 function actionStraightenWay(selectedIDs, projection2) {
23463 function positionAlongWay(a2, o2, b3) {
23464 return geoVecDot(a2, b3, o2) / geoVecDot(b3, b3, o2);
23466 function allNodes(graph) {
23468 var startNodes = [];
23470 var remainingWays = [];
23471 var selectedWays = selectedIDs.filter(function(w3) {
23472 return graph.entity(w3).type === "way";
23474 var selectedNodes = selectedIDs.filter(function(n3) {
23475 return graph.entity(n3).type === "node";
23477 for (var i3 = 0; i3 < selectedWays.length; i3++) {
23478 var way = graph.entity(selectedWays[i3]);
23479 nodes = way.nodes.slice(0);
23480 remainingWays.push(nodes);
23481 startNodes.push(nodes[0]);
23482 endNodes.push(nodes[nodes.length - 1]);
23484 startNodes = startNodes.filter(function(n3) {
23485 return startNodes.indexOf(n3) === startNodes.lastIndexOf(n3);
23487 endNodes = endNodes.filter(function(n3) {
23488 return endNodes.indexOf(n3) === endNodes.lastIndexOf(n3);
23490 var currNode = utilArrayDifference(startNodes, endNodes).concat(utilArrayDifference(endNodes, startNodes))[0];
23493 var getNextWay = function(currNode2, remainingWays2) {
23494 return remainingWays2.filter(function(way2) {
23495 return way2[0] === currNode2 || way2[way2.length - 1] === currNode2;
23498 while (remainingWays.length) {
23499 nextWay = getNextWay(currNode, remainingWays);
23500 remainingWays = utilArrayDifference(remainingWays, [nextWay]);
23501 if (nextWay[0] !== currNode) {
23504 nodes = nodes.concat(nextWay);
23505 currNode = nodes[nodes.length - 1];
23507 if (selectedNodes.length === 2) {
23508 var startNodeIdx = nodes.indexOf(selectedNodes[0]);
23509 var endNodeIdx = nodes.indexOf(selectedNodes[1]);
23510 var sortedStartEnd = [startNodeIdx, endNodeIdx];
23511 sortedStartEnd.sort(function(a2, b3) {
23514 nodes = nodes.slice(sortedStartEnd[0], sortedStartEnd[1] + 1);
23516 return nodes.map(function(n3) {
23517 return graph.entity(n3);
23520 function shouldKeepNode(node, graph) {
23521 return graph.parentWays(node).length > 1 || graph.parentRelations(node).length || node.hasInterestingTags();
23523 var action = function(graph, t2) {
23524 if (t2 === null || !isFinite(t2)) t2 = 1;
23525 t2 = Math.min(Math.max(+t2, 0), 1);
23526 var nodes = allNodes(graph);
23527 var points = nodes.map(function(n3) {
23528 return projection2(n3.loc);
23530 var startPoint = points[0];
23531 var endPoint = points[points.length - 1];
23534 for (i3 = 1; i3 < points.length - 1; i3++) {
23535 var node = nodes[i3];
23536 var point = points[i3];
23537 if (t2 < 1 || shouldKeepNode(node, graph)) {
23538 var u2 = positionAlongWay(point, startPoint, endPoint);
23539 var p2 = geoVecInterp(startPoint, endPoint, u2);
23540 var loc2 = projection2.invert(p2);
23541 graph = graph.replace(node.move(geoVecInterp(node.loc, loc2, t2)));
23543 if (toDelete.indexOf(node) === -1) {
23544 toDelete.push(node);
23548 for (i3 = 0; i3 < toDelete.length; i3++) {
23549 graph = actionDeleteNode(toDelete[i3].id)(graph);
23553 action.disabled = function(graph) {
23554 var nodes = allNodes(graph);
23555 var points = nodes.map(function(n3) {
23556 return projection2(n3.loc);
23558 var startPoint = points[0];
23559 var endPoint = points[points.length - 1];
23560 var threshold = 0.2 * geoVecLength(startPoint, endPoint);
23562 if (threshold === 0) {
23563 return "too_bendy";
23565 var maxDistance = 0;
23566 for (i3 = 1; i3 < points.length - 1; i3++) {
23567 var point = points[i3];
23568 var u2 = positionAlongWay(point, startPoint, endPoint);
23569 var p2 = geoVecInterp(startPoint, endPoint, u2);
23570 var dist = geoVecLength(p2, point);
23571 if (isNaN(dist) || dist > threshold) {
23572 return "too_bendy";
23573 } else if (dist > maxDistance) {
23574 maxDistance = dist;
23577 var keepingAllNodes = nodes.every(function(node, i4) {
23578 return i4 === 0 || i4 === nodes.length - 1 || shouldKeepNode(node, graph);
23580 if (maxDistance < 1e-4 && // Allow straightening even if already straight in order to remove extraneous nodes
23582 return "straight_enough";
23585 action.transitionable = true;
23588 var init_straighten_way = __esm({
23589 "modules/actions/straighten_way.js"() {
23591 init_delete_node();
23597 // modules/actions/unrestrict_turn.js
23598 var unrestrict_turn_exports = {};
23599 __export(unrestrict_turn_exports, {
23600 actionUnrestrictTurn: () => actionUnrestrictTurn
23602 function actionUnrestrictTurn(turn) {
23603 return function(graph) {
23604 return actionDeleteRelation(turn.restrictionID)(graph);
23607 var init_unrestrict_turn = __esm({
23608 "modules/actions/unrestrict_turn.js"() {
23610 init_delete_relation();
23614 // modules/actions/upgrade_tags.js
23615 var upgrade_tags_exports = {};
23616 __export(upgrade_tags_exports, {
23617 actionUpgradeTags: () => actionUpgradeTags
23619 function actionUpgradeTags(entityId, oldTags, replaceTags) {
23620 return function(graph) {
23621 var entity = graph.entity(entityId);
23622 var tags = Object.assign({}, entity.tags);
23625 for (var oldTagKey in oldTags) {
23626 if (!(oldTagKey in tags)) continue;
23627 if (oldTags[oldTagKey] === "*") {
23628 transferValue = tags[oldTagKey];
23629 delete tags[oldTagKey];
23630 } else if (oldTags[oldTagKey] === tags[oldTagKey]) {
23631 delete tags[oldTagKey];
23633 var vals = tags[oldTagKey].split(";").filter(Boolean);
23634 var oldIndex = vals.indexOf(oldTags[oldTagKey]);
23635 if (vals.length === 1 || oldIndex === -1) {
23636 delete tags[oldTagKey];
23638 if (replaceTags && replaceTags[oldTagKey]) {
23639 semiIndex = oldIndex;
23641 vals.splice(oldIndex, 1);
23642 tags[oldTagKey] = vals.join(";");
23647 for (var replaceKey in replaceTags) {
23648 var replaceValue = replaceTags[replaceKey];
23649 if (replaceValue === "*") {
23650 if (tags[replaceKey] && tags[replaceKey] !== "no") {
23653 tags[replaceKey] = "yes";
23655 } else if (replaceValue === "$1") {
23656 tags[replaceKey] = transferValue;
23658 if (tags[replaceKey] && oldTags[replaceKey] && semiIndex !== void 0) {
23659 var existingVals = tags[replaceKey].split(";").filter(Boolean);
23660 if (existingVals.indexOf(replaceValue) === -1) {
23661 existingVals.splice(semiIndex, 0, replaceValue);
23662 tags[replaceKey] = existingVals.join(";");
23665 tags[replaceKey] = replaceValue;
23670 return graph.replace(entity.update({ tags }));
23673 var init_upgrade_tags = __esm({
23674 "modules/actions/upgrade_tags.js"() {
23679 // modules/behavior/edit.js
23680 var edit_exports = {};
23681 __export(edit_exports, {
23682 behaviorEdit: () => behaviorEdit
23684 function behaviorEdit(context) {
23685 function behavior() {
23686 context.map().minzoom(context.minEditableZoom());
23688 behavior.off = function() {
23689 context.map().minzoom(0);
23693 var init_edit = __esm({
23694 "modules/behavior/edit.js"() {
23699 // modules/behavior/hover.js
23700 var hover_exports = {};
23701 __export(hover_exports, {
23702 behaviorHover: () => behaviorHover
23704 function behaviorHover(context) {
23705 var dispatch14 = dispatch_default("hover");
23706 var _selection = select_default2(null);
23707 var _newNodeId = null;
23708 var _initialNodeID = null;
23712 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
23713 function keydown(d3_event) {
23714 if (_altDisables && d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
23715 _selection.selectAll(".hover").classed("hover-suppressed", true).classed("hover", false);
23716 _selection.classed("hover-disabled", true);
23717 dispatch14.call("hover", this, null);
23720 function keyup(d3_event) {
23721 if (_altDisables && d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
23722 _selection.selectAll(".hover-suppressed").classed("hover-suppressed", false).classed("hover", true);
23723 _selection.classed("hover-disabled", false);
23724 dispatch14.call("hover", this, _targets);
23727 function behavior(selection2) {
23728 _selection = selection2;
23730 if (_initialNodeID) {
23731 _newNodeId = _initialNodeID;
23732 _initialNodeID = null;
23736 _selection.on(_pointerPrefix + "over.hover", pointerover).on(_pointerPrefix + "out.hover", pointerout).on(_pointerPrefix + "down.hover", pointerover);
23737 select_default2(window).on(_pointerPrefix + "up.hover pointercancel.hover", pointerout, true).on("keydown.hover", keydown).on("keyup.hover", keyup);
23738 function eventTarget(d3_event) {
23739 var datum2 = d3_event.target && d3_event.target.__data__;
23740 if (typeof datum2 !== "object") return null;
23741 if (!(datum2 instanceof osmEntity) && datum2.properties && datum2.properties.entity instanceof osmEntity) {
23742 return datum2.properties.entity;
23746 function pointerover(d3_event) {
23747 if (context.mode().id.indexOf("drag") === -1 && (!d3_event.pointerType || d3_event.pointerType === "mouse") && d3_event.buttons) return;
23748 var target = eventTarget(d3_event);
23749 if (target && _targets.indexOf(target) === -1) {
23750 _targets.push(target);
23751 updateHover(d3_event, _targets);
23754 function pointerout(d3_event) {
23755 var target = eventTarget(d3_event);
23756 var index = _targets.indexOf(target);
23757 if (index !== -1) {
23758 _targets.splice(index);
23759 updateHover(d3_event, _targets);
23762 function allowsVertex(d4) {
23763 return d4.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d4, context.graph());
23765 function modeAllowsHover(target) {
23766 var mode = context.mode();
23767 if (mode.id === "add-point") {
23768 return mode.preset.matchGeometry("vertex") || target.type !== "way" && target.geometry(context.graph()) !== "vertex";
23772 function updateHover(d3_event, targets) {
23773 _selection.selectAll(".hover").classed("hover", false);
23774 _selection.selectAll(".hover-suppressed").classed("hover-suppressed", false);
23775 var mode = context.mode();
23776 if (!_newNodeId && (mode.id === "draw-line" || mode.id === "draw-area")) {
23777 var node = targets.find(function(target) {
23778 return target instanceof osmEntity && target.type === "node";
23780 _newNodeId = node && node.id;
23782 targets = targets.filter(function(datum3) {
23783 if (datum3 instanceof osmEntity) {
23784 return datum3.id !== _newNodeId && (datum3.type !== "node" || !_ignoreVertex || allowsVertex(datum3)) && modeAllowsHover(datum3);
23789 for (var i3 in targets) {
23790 var datum2 = targets[i3];
23791 if (datum2.__featurehash__) {
23792 selector += ", .data" + datum2.__featurehash__;
23793 } else if (datum2 instanceof QAItem) {
23794 selector += ", ." + datum2.service + ".itemId-" + datum2.id;
23795 } else if (datum2 instanceof osmNote) {
23796 selector += ", .note-" + datum2.id;
23797 } else if (datum2 instanceof osmEntity) {
23798 selector += ", ." + datum2.id;
23799 if (datum2.type === "relation") {
23800 for (var j3 in datum2.members) {
23801 selector += ", ." + datum2.members[j3].id;
23806 var suppressed = _altDisables && d3_event && d3_event.altKey;
23807 if (selector.trim().length) {
23808 selector = selector.slice(1);
23809 _selection.selectAll(selector).classed(suppressed ? "hover-suppressed" : "hover", true);
23811 dispatch14.call("hover", this, !suppressed && targets);
23814 behavior.off = function(selection2) {
23815 selection2.selectAll(".hover").classed("hover", false);
23816 selection2.selectAll(".hover-suppressed").classed("hover-suppressed", false);
23817 selection2.classed("hover-disabled", false);
23818 selection2.on(_pointerPrefix + "over.hover", null).on(_pointerPrefix + "out.hover", null).on(_pointerPrefix + "down.hover", null);
23819 select_default2(window).on(_pointerPrefix + "up.hover pointercancel.hover", null, true).on("keydown.hover", null).on("keyup.hover", null);
23821 behavior.altDisables = function(val) {
23822 if (!arguments.length) return _altDisables;
23823 _altDisables = val;
23826 behavior.ignoreVertex = function(val) {
23827 if (!arguments.length) return _ignoreVertex;
23828 _ignoreVertex = val;
23831 behavior.initialNodeID = function(nodeId) {
23832 _initialNodeID = nodeId;
23835 return utilRebind(behavior, dispatch14, "on");
23837 var init_hover = __esm({
23838 "modules/behavior/hover.js"() {
23848 // modules/behavior/draw.js
23849 var draw_exports = {};
23850 __export(draw_exports, {
23851 behaviorDraw: () => behaviorDraw
23853 function behaviorDraw(context) {
23854 var dispatch14 = dispatch_default(
23865 var keybinding = utilKeybinding("draw");
23866 var _hover = behaviorHover(context).altDisables(true).ignoreVertex(true).on("hover", context.ui().sidebar.hover);
23867 var _edit = behaviorEdit(context);
23868 var _closeTolerance = 4;
23869 var _tolerance = 12;
23870 var _mouseLeave = false;
23871 var _lastMouse = null;
23872 var _lastPointerUpEvent;
23874 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
23875 function datum2(d3_event) {
23876 var mode = context.mode();
23877 var isNote = mode && mode.id.indexOf("note") !== -1;
23878 if (d3_event.altKey || isNote) return {};
23880 if (d3_event.type === "keydown") {
23881 element = _lastMouse && _lastMouse.target;
23883 element = d3_event.target;
23885 var d4 = element.__data__;
23886 return d4 && d4.properties && d4.properties.target ? d4 : {};
23888 function pointerdown(d3_event) {
23889 if (_downPointer) return;
23890 var pointerLocGetter = utilFastMouse(this);
23892 id: d3_event.pointerId || "mouse",
23894 downTime: +/* @__PURE__ */ new Date(),
23895 downLoc: pointerLocGetter(d3_event)
23897 dispatch14.call("down", this, d3_event, datum2(d3_event));
23899 function pointerup(d3_event) {
23900 if (!_downPointer || _downPointer.id !== (d3_event.pointerId || "mouse")) return;
23901 var downPointer = _downPointer;
23902 _downPointer = null;
23903 _lastPointerUpEvent = d3_event;
23904 if (downPointer.isCancelled) return;
23905 var t2 = +/* @__PURE__ */ new Date();
23906 var p2 = downPointer.pointerLocGetter(d3_event);
23907 var dist = geoVecLength(downPointer.downLoc, p2);
23908 if (dist < _closeTolerance || dist < _tolerance && t2 - downPointer.downTime < 500) {
23909 select_default2(window).on("click.draw-block", function() {
23910 d3_event.stopPropagation();
23912 context.map().dblclickZoomEnable(false);
23913 window.setTimeout(function() {
23914 context.map().dblclickZoomEnable(true);
23915 select_default2(window).on("click.draw-block", null);
23917 click(d3_event, p2);
23920 function pointermove(d3_event) {
23921 if (_downPointer && _downPointer.id === (d3_event.pointerId || "mouse") && !_downPointer.isCancelled) {
23922 var p2 = _downPointer.pointerLocGetter(d3_event);
23923 var dist = geoVecLength(_downPointer.downLoc, p2);
23924 if (dist >= _closeTolerance) {
23925 _downPointer.isCancelled = true;
23926 dispatch14.call("downcancel", this);
23929 if (d3_event.pointerType && d3_event.pointerType !== "mouse" || d3_event.buttons || _downPointer) return;
23930 if (_lastPointerUpEvent && _lastPointerUpEvent.pointerType !== "mouse" && d3_event.timeStamp - _lastPointerUpEvent.timeStamp < 100) return;
23931 _lastMouse = d3_event;
23932 dispatch14.call("move", this, d3_event, datum2(d3_event));
23934 function pointercancel(d3_event) {
23935 if (_downPointer && _downPointer.id === (d3_event.pointerId || "mouse")) {
23936 if (!_downPointer.isCancelled) {
23937 dispatch14.call("downcancel", this);
23939 _downPointer = null;
23942 function mouseenter() {
23943 _mouseLeave = false;
23945 function mouseleave() {
23946 _mouseLeave = true;
23948 function allowsVertex(d4) {
23949 return d4.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d4, context.graph());
23951 function click(d3_event, loc) {
23952 var d4 = datum2(d3_event);
23953 var target = d4 && d4.properties && d4.properties.entity;
23954 var mode = context.mode();
23955 if (target && target.type === "node" && allowsVertex(target)) {
23956 dispatch14.call("clickNode", this, target, d4);
23958 } else if (target && target.type === "way" && (mode.id !== "add-point" || mode.preset.matchGeometry("vertex"))) {
23959 var choice = geoChooseEdge(
23960 context.graph().childNodes(target),
23962 context.projection,
23966 var edge = [target.nodes[choice.index - 1], target.nodes[choice.index]];
23967 dispatch14.call("clickWay", this, choice.loc, edge, d4);
23970 } else if (mode.id !== "add-point" || mode.preset.matchGeometry("point")) {
23971 var locLatLng = context.projection.invert(loc);
23972 dispatch14.call("click", this, locLatLng, d4);
23975 function space(d3_event) {
23976 d3_event.preventDefault();
23977 d3_event.stopPropagation();
23978 var currSpace = context.map().mouse();
23979 if (_disableSpace && _lastSpace) {
23980 var dist = geoVecLength(_lastSpace, currSpace);
23981 if (dist > _tolerance) {
23982 _disableSpace = false;
23985 if (_disableSpace || _mouseLeave || !_lastMouse) return;
23986 _lastSpace = currSpace;
23987 _disableSpace = true;
23988 select_default2(window).on("keyup.space-block", function() {
23989 d3_event.preventDefault();
23990 d3_event.stopPropagation();
23991 _disableSpace = false;
23992 select_default2(window).on("keyup.space-block", null);
23994 var loc = context.map().mouse() || // or the map center if the mouse has never entered the map
23995 context.projection(context.map().center());
23996 click(d3_event, loc);
23998 function backspace(d3_event) {
23999 d3_event.preventDefault();
24000 dispatch14.call("undo");
24002 function del(d3_event) {
24003 d3_event.preventDefault();
24004 dispatch14.call("cancel");
24006 function ret(d3_event) {
24007 d3_event.preventDefault();
24008 dispatch14.call("finish");
24010 function behavior(selection2) {
24011 context.install(_hover);
24012 context.install(_edit);
24013 _downPointer = null;
24014 keybinding.on("\u232B", backspace).on("\u2326", del).on("\u238B", ret).on("\u21A9", ret).on("space", space).on("\u2325space", space);
24015 selection2.on("mouseenter.draw", mouseenter).on("mouseleave.draw", mouseleave).on(_pointerPrefix + "down.draw", pointerdown).on(_pointerPrefix + "move.draw", pointermove);
24016 select_default2(window).on(_pointerPrefix + "up.draw", pointerup, true).on("pointercancel.draw", pointercancel, true);
24017 select_default2(document).call(keybinding);
24020 behavior.off = function(selection2) {
24021 context.ui().sidebar.hover.cancel();
24022 context.uninstall(_hover);
24023 context.uninstall(_edit);
24024 selection2.on("mouseenter.draw", null).on("mouseleave.draw", null).on(_pointerPrefix + "down.draw", null).on(_pointerPrefix + "move.draw", null);
24025 select_default2(window).on(_pointerPrefix + "up.draw", null).on("pointercancel.draw", null);
24026 select_default2(document).call(keybinding.unbind);
24028 behavior.hover = function() {
24031 return utilRebind(behavior, dispatch14, "on");
24033 var _disableSpace, _lastSpace;
24034 var init_draw = __esm({
24035 "modules/behavior/draw.js"() {
24044 _disableSpace = false;
24049 // node_modules/d3-scale/src/init.js
24050 function initRange(domain, range3) {
24051 switch (arguments.length) {
24055 this.range(domain);
24058 this.range(range3).domain(domain);
24063 var init_init = __esm({
24064 "node_modules/d3-scale/src/init.js"() {
24068 // node_modules/d3-scale/src/constant.js
24069 function constants(x2) {
24070 return function() {
24074 var init_constant6 = __esm({
24075 "node_modules/d3-scale/src/constant.js"() {
24079 // node_modules/d3-scale/src/number.js
24080 function number2(x2) {
24083 var init_number3 = __esm({
24084 "node_modules/d3-scale/src/number.js"() {
24088 // node_modules/d3-scale/src/continuous.js
24089 function identity4(x2) {
24092 function normalize(a2, b3) {
24093 return (b3 -= a2 = +a2) ? function(x2) {
24094 return (x2 - a2) / b3;
24095 } : constants(isNaN(b3) ? NaN : 0.5);
24097 function clamper(a2, b3) {
24099 if (a2 > b3) t2 = a2, a2 = b3, b3 = t2;
24100 return function(x2) {
24101 return Math.max(a2, Math.min(b3, x2));
24104 function bimap(domain, range3, interpolate) {
24105 var d0 = domain[0], d1 = domain[1], r0 = range3[0], r1 = range3[1];
24106 if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
24107 else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
24108 return function(x2) {
24112 function polymap(domain, range3, interpolate) {
24113 var j3 = Math.min(domain.length, range3.length) - 1, d4 = new Array(j3), r2 = new Array(j3), i3 = -1;
24114 if (domain[j3] < domain[0]) {
24115 domain = domain.slice().reverse();
24116 range3 = range3.slice().reverse();
24118 while (++i3 < j3) {
24119 d4[i3] = normalize(domain[i3], domain[i3 + 1]);
24120 r2[i3] = interpolate(range3[i3], range3[i3 + 1]);
24122 return function(x2) {
24123 var i4 = bisect_default(domain, x2, 1, j3) - 1;
24124 return r2[i4](d4[i4](x2));
24127 function copy(source, target) {
24128 return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
24130 function transformer2() {
24131 var domain = unit, range3 = unit, interpolate = value_default, transform2, untransform, unknown, clamp2 = identity4, piecewise, output, input;
24132 function rescale() {
24133 var n3 = Math.min(domain.length, range3.length);
24134 if (clamp2 !== identity4) clamp2 = clamper(domain[0], domain[n3 - 1]);
24135 piecewise = n3 > 2 ? polymap : bimap;
24136 output = input = null;
24139 function scale(x2) {
24140 return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise(domain.map(transform2), range3, interpolate)))(transform2(clamp2(x2)));
24142 scale.invert = function(y3) {
24143 return clamp2(untransform((input || (input = piecewise(range3, domain.map(transform2), number_default)))(y3)));
24145 scale.domain = function(_3) {
24146 return arguments.length ? (domain = Array.from(_3, number2), rescale()) : domain.slice();
24148 scale.range = function(_3) {
24149 return arguments.length ? (range3 = Array.from(_3), rescale()) : range3.slice();
24151 scale.rangeRound = function(_3) {
24152 return range3 = Array.from(_3), interpolate = round_default, rescale();
24154 scale.clamp = function(_3) {
24155 return arguments.length ? (clamp2 = _3 ? true : identity4, rescale()) : clamp2 !== identity4;
24157 scale.interpolate = function(_3) {
24158 return arguments.length ? (interpolate = _3, rescale()) : interpolate;
24160 scale.unknown = function(_3) {
24161 return arguments.length ? (unknown = _3, scale) : unknown;
24163 return function(t2, u2) {
24164 transform2 = t2, untransform = u2;
24168 function continuous() {
24169 return transformer2()(identity4, identity4);
24172 var init_continuous = __esm({
24173 "node_modules/d3-scale/src/continuous.js"() {
24182 // node_modules/d3-format/src/formatDecimal.js
24183 function formatDecimal_default(x2) {
24184 return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10);
24186 function formatDecimalParts(x2, p2) {
24187 if ((i3 = (x2 = p2 ? x2.toExponential(p2 - 1) : x2.toExponential()).indexOf("e")) < 0) return null;
24188 var i3, coefficient = x2.slice(0, i3);
24190 coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
24194 var init_formatDecimal = __esm({
24195 "node_modules/d3-format/src/formatDecimal.js"() {
24199 // node_modules/d3-format/src/exponent.js
24200 function exponent_default(x2) {
24201 return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN;
24203 var init_exponent = __esm({
24204 "node_modules/d3-format/src/exponent.js"() {
24205 init_formatDecimal();
24209 // node_modules/d3-format/src/formatGroup.js
24210 function formatGroup_default(grouping, thousands) {
24211 return function(value, width) {
24212 var i3 = value.length, t2 = [], j3 = 0, g3 = grouping[0], length2 = 0;
24213 while (i3 > 0 && g3 > 0) {
24214 if (length2 + g3 + 1 > width) g3 = Math.max(1, width - length2);
24215 t2.push(value.substring(i3 -= g3, i3 + g3));
24216 if ((length2 += g3 + 1) > width) break;
24217 g3 = grouping[j3 = (j3 + 1) % grouping.length];
24219 return t2.reverse().join(thousands);
24222 var init_formatGroup = __esm({
24223 "node_modules/d3-format/src/formatGroup.js"() {
24227 // node_modules/d3-format/src/formatNumerals.js
24228 function formatNumerals_default(numerals) {
24229 return function(value) {
24230 return value.replace(/[0-9]/g, function(i3) {
24231 return numerals[+i3];
24235 var init_formatNumerals = __esm({
24236 "node_modules/d3-format/src/formatNumerals.js"() {
24240 // node_modules/d3-format/src/formatSpecifier.js
24241 function formatSpecifier(specifier) {
24242 if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
24244 return new FormatSpecifier({
24252 precision: match[8] && match[8].slice(1),
24257 function FormatSpecifier(specifier) {
24258 this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
24259 this.align = specifier.align === void 0 ? ">" : specifier.align + "";
24260 this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
24261 this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
24262 this.zero = !!specifier.zero;
24263 this.width = specifier.width === void 0 ? void 0 : +specifier.width;
24264 this.comma = !!specifier.comma;
24265 this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
24266 this.trim = !!specifier.trim;
24267 this.type = specifier.type === void 0 ? "" : specifier.type + "";
24270 var init_formatSpecifier = __esm({
24271 "node_modules/d3-format/src/formatSpecifier.js"() {
24272 re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
24273 formatSpecifier.prototype = FormatSpecifier.prototype;
24274 FormatSpecifier.prototype.toString = function() {
24275 return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
24280 // node_modules/d3-format/src/formatTrim.js
24281 function formatTrim_default(s2) {
24282 out: for (var n3 = s2.length, i3 = 1, i0 = -1, i1; i3 < n3; ++i3) {
24288 if (i0 === 0) i0 = i3;
24292 if (!+s2[i3]) break out;
24293 if (i0 > 0) i0 = 0;
24297 return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
24299 var init_formatTrim = __esm({
24300 "node_modules/d3-format/src/formatTrim.js"() {
24304 // node_modules/d3-format/src/formatPrefixAuto.js
24305 function formatPrefixAuto_default(x2, p2) {
24306 var d4 = formatDecimalParts(x2, p2);
24307 if (!d4) return x2 + "";
24308 var coefficient = d4[0], exponent = d4[1], i3 = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n3 = coefficient.length;
24309 return i3 === n3 ? coefficient : i3 > n3 ? coefficient + new Array(i3 - n3 + 1).join("0") : i3 > 0 ? coefficient.slice(0, i3) + "." + coefficient.slice(i3) : "0." + new Array(1 - i3).join("0") + formatDecimalParts(x2, Math.max(0, p2 + i3 - 1))[0];
24311 var prefixExponent;
24312 var init_formatPrefixAuto = __esm({
24313 "node_modules/d3-format/src/formatPrefixAuto.js"() {
24314 init_formatDecimal();
24318 // node_modules/d3-format/src/formatRounded.js
24319 function formatRounded_default(x2, p2) {
24320 var d4 = formatDecimalParts(x2, p2);
24321 if (!d4) return x2 + "";
24322 var coefficient = d4[0], exponent = d4[1];
24323 return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0");
24325 var init_formatRounded = __esm({
24326 "node_modules/d3-format/src/formatRounded.js"() {
24327 init_formatDecimal();
24331 // node_modules/d3-format/src/formatTypes.js
24332 var formatTypes_default;
24333 var init_formatTypes = __esm({
24334 "node_modules/d3-format/src/formatTypes.js"() {
24335 init_formatDecimal();
24336 init_formatPrefixAuto();
24337 init_formatRounded();
24338 formatTypes_default = {
24339 "%": (x2, p2) => (x2 * 100).toFixed(p2),
24340 "b": (x2) => Math.round(x2).toString(2),
24341 "c": (x2) => x2 + "",
24342 "d": formatDecimal_default,
24343 "e": (x2, p2) => x2.toExponential(p2),
24344 "f": (x2, p2) => x2.toFixed(p2),
24345 "g": (x2, p2) => x2.toPrecision(p2),
24346 "o": (x2) => Math.round(x2).toString(8),
24347 "p": (x2, p2) => formatRounded_default(x2 * 100, p2),
24348 "r": formatRounded_default,
24349 "s": formatPrefixAuto_default,
24350 "X": (x2) => Math.round(x2).toString(16).toUpperCase(),
24351 "x": (x2) => Math.round(x2).toString(16)
24356 // node_modules/d3-format/src/identity.js
24357 function identity_default4(x2) {
24360 var init_identity4 = __esm({
24361 "node_modules/d3-format/src/identity.js"() {
24365 // node_modules/d3-format/src/locale.js
24366 function locale_default(locale3) {
24367 var group = locale3.grouping === void 0 || locale3.thousands === void 0 ? identity_default4 : formatGroup_default(map.call(locale3.grouping, Number), locale3.thousands + ""), currencyPrefix = locale3.currency === void 0 ? "" : locale3.currency[0] + "", currencySuffix = locale3.currency === void 0 ? "" : locale3.currency[1] + "", decimal = locale3.decimal === void 0 ? "." : locale3.decimal + "", numerals = locale3.numerals === void 0 ? identity_default4 : formatNumerals_default(map.call(locale3.numerals, String)), percent = locale3.percent === void 0 ? "%" : locale3.percent + "", minus = locale3.minus === void 0 ? "\u2212" : locale3.minus + "", nan = locale3.nan === void 0 ? "NaN" : locale3.nan + "";
24368 function newFormat(specifier) {
24369 specifier = formatSpecifier(specifier);
24370 var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero3 = specifier.zero, width = specifier.width, comma = specifier.comma, precision3 = specifier.precision, trim = specifier.trim, type2 = specifier.type;
24371 if (type2 === "n") comma = true, type2 = "g";
24372 else if (!formatTypes_default[type2]) precision3 === void 0 && (precision3 = 12), trim = true, type2 = "g";
24373 if (zero3 || fill === "0" && align === "=") zero3 = true, fill = "0", align = "=";
24374 var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type2) ? "0" + type2.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type2) ? percent : "";
24375 var formatType = formatTypes_default[type2], maybeSuffix = /[defgprs%]/.test(type2);
24376 precision3 = precision3 === void 0 ? 6 : /[gprs]/.test(type2) ? Math.max(1, Math.min(21, precision3)) : Math.max(0, Math.min(20, precision3));
24377 function format2(value) {
24378 var valuePrefix = prefix, valueSuffix = suffix, i3, n3, c2;
24379 if (type2 === "c") {
24380 valueSuffix = formatType(value) + valueSuffix;
24384 var valueNegative = value < 0 || 1 / value < 0;
24385 value = isNaN(value) ? nan : formatType(Math.abs(value), precision3);
24386 if (trim) value = formatTrim_default(value);
24387 if (valueNegative && +value === 0 && sign2 !== "+") valueNegative = false;
24388 valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix;
24389 valueSuffix = (type2 === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : "");
24391 i3 = -1, n3 = value.length;
24392 while (++i3 < n3) {
24393 if (c2 = value.charCodeAt(i3), 48 > c2 || c2 > 57) {
24394 valueSuffix = (c2 === 46 ? decimal + value.slice(i3 + 1) : value.slice(i3)) + valueSuffix;
24395 value = value.slice(0, i3);
24401 if (comma && !zero3) value = group(value, Infinity);
24402 var length2 = valuePrefix.length + value.length + valueSuffix.length, padding = length2 < width ? new Array(width - length2 + 1).join(fill) : "";
24403 if (comma && zero3) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
24406 value = valuePrefix + value + valueSuffix + padding;
24409 value = valuePrefix + padding + value + valueSuffix;
24412 value = padding.slice(0, length2 = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length2);
24415 value = padding + valuePrefix + value + valueSuffix;
24418 return numerals(value);
24420 format2.toString = function() {
24421 return specifier + "";
24425 function formatPrefix2(specifier, value) {
24426 var f2 = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e3 = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k2 = Math.pow(10, -e3), prefix = prefixes[8 + e3 / 3];
24427 return function(value2) {
24428 return f2(k2 * value2) + prefix;
24433 formatPrefix: formatPrefix2
24437 var init_locale = __esm({
24438 "node_modules/d3-format/src/locale.js"() {
24440 init_formatGroup();
24441 init_formatNumerals();
24442 init_formatSpecifier();
24444 init_formatTypes();
24445 init_formatPrefixAuto();
24447 map = Array.prototype.map;
24448 prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
24452 // node_modules/d3-format/src/defaultLocale.js
24453 function defaultLocale(definition) {
24454 locale = locale_default(definition);
24455 format = locale.format;
24456 formatPrefix = locale.formatPrefix;
24459 var locale, format, formatPrefix;
24460 var init_defaultLocale = __esm({
24461 "node_modules/d3-format/src/defaultLocale.js"() {
24466 currency: ["$", ""]
24471 // node_modules/d3-format/src/precisionFixed.js
24472 function precisionFixed_default(step) {
24473 return Math.max(0, -exponent_default(Math.abs(step)));
24475 var init_precisionFixed = __esm({
24476 "node_modules/d3-format/src/precisionFixed.js"() {
24481 // node_modules/d3-format/src/precisionPrefix.js
24482 function precisionPrefix_default(step, value) {
24483 return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step)));
24485 var init_precisionPrefix = __esm({
24486 "node_modules/d3-format/src/precisionPrefix.js"() {
24491 // node_modules/d3-format/src/precisionRound.js
24492 function precisionRound_default(step, max3) {
24493 step = Math.abs(step), max3 = Math.abs(max3) - step;
24494 return Math.max(0, exponent_default(max3) - exponent_default(step)) + 1;
24496 var init_precisionRound = __esm({
24497 "node_modules/d3-format/src/precisionRound.js"() {
24502 // node_modules/d3-format/src/index.js
24503 var init_src13 = __esm({
24504 "node_modules/d3-format/src/index.js"() {
24505 init_defaultLocale();
24506 init_formatSpecifier();
24507 init_precisionFixed();
24508 init_precisionPrefix();
24509 init_precisionRound();
24513 // node_modules/d3-scale/src/tickFormat.js
24514 function tickFormat(start2, stop, count, specifier) {
24515 var step = tickStep(start2, stop, count), precision3;
24516 specifier = formatSpecifier(specifier == null ? ",f" : specifier);
24517 switch (specifier.type) {
24519 var value = Math.max(Math.abs(start2), Math.abs(stop));
24520 if (specifier.precision == null && !isNaN(precision3 = precisionPrefix_default(step, value))) specifier.precision = precision3;
24521 return formatPrefix(specifier, value);
24528 if (specifier.precision == null && !isNaN(precision3 = precisionRound_default(step, Math.max(Math.abs(start2), Math.abs(stop))))) specifier.precision = precision3 - (specifier.type === "e");
24533 if (specifier.precision == null && !isNaN(precision3 = precisionFixed_default(step))) specifier.precision = precision3 - (specifier.type === "%") * 2;
24537 return format(specifier);
24539 var init_tickFormat = __esm({
24540 "node_modules/d3-scale/src/tickFormat.js"() {
24546 // node_modules/d3-scale/src/linear.js
24547 function linearish(scale) {
24548 var domain = scale.domain;
24549 scale.ticks = function(count) {
24551 return ticks(d4[0], d4[d4.length - 1], count == null ? 10 : count);
24553 scale.tickFormat = function(count, specifier) {
24555 return tickFormat(d4[0], d4[d4.length - 1], count == null ? 10 : count, specifier);
24557 scale.nice = function(count) {
24558 if (count == null) count = 10;
24561 var i1 = d4.length - 1;
24562 var start2 = d4[i0];
24567 if (stop < start2) {
24568 step = start2, start2 = stop, stop = step;
24569 step = i0, i0 = i1, i1 = step;
24571 while (maxIter-- > 0) {
24572 step = tickIncrement(start2, stop, count);
24573 if (step === prestep) {
24577 } else if (step > 0) {
24578 start2 = Math.floor(start2 / step) * step;
24579 stop = Math.ceil(stop / step) * step;
24580 } else if (step < 0) {
24581 start2 = Math.ceil(start2 * step) / step;
24582 stop = Math.floor(stop * step) / step;
24592 function linear3() {
24593 var scale = continuous();
24594 scale.copy = function() {
24595 return copy(scale, linear3());
24597 initRange.apply(scale, arguments);
24598 return linearish(scale);
24600 var init_linear2 = __esm({
24601 "node_modules/d3-scale/src/linear.js"() {
24609 // node_modules/d3-scale/src/quantize.js
24610 function quantize() {
24611 var x05 = 0, x12 = 1, n3 = 1, domain = [0.5], range3 = [0, 1], unknown;
24612 function scale(x2) {
24613 return x2 != null && x2 <= x2 ? range3[bisect_default(domain, x2, 0, n3)] : unknown;
24615 function rescale() {
24617 domain = new Array(n3);
24618 while (++i3 < n3) domain[i3] = ((i3 + 1) * x12 - (i3 - n3) * x05) / (n3 + 1);
24621 scale.domain = function(_3) {
24622 return arguments.length ? ([x05, x12] = _3, x05 = +x05, x12 = +x12, rescale()) : [x05, x12];
24624 scale.range = function(_3) {
24625 return arguments.length ? (n3 = (range3 = Array.from(_3)).length - 1, rescale()) : range3.slice();
24627 scale.invertExtent = function(y3) {
24628 var i3 = range3.indexOf(y3);
24629 return i3 < 0 ? [NaN, NaN] : i3 < 1 ? [x05, domain[0]] : i3 >= n3 ? [domain[n3 - 1], x12] : [domain[i3 - 1], domain[i3]];
24631 scale.unknown = function(_3) {
24632 return arguments.length ? (unknown = _3, scale) : scale;
24634 scale.thresholds = function() {
24635 return domain.slice();
24637 scale.copy = function() {
24638 return quantize().domain([x05, x12]).range(range3).unknown(unknown);
24640 return initRange.apply(linearish(scale), arguments);
24642 var init_quantize2 = __esm({
24643 "node_modules/d3-scale/src/quantize.js"() {
24650 // node_modules/d3-time/src/interval.js
24651 function timeInterval(floori, offseti, count, field) {
24652 function interval2(date) {
24653 return floori(date = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date)), date;
24655 interval2.floor = (date) => {
24656 return floori(date = /* @__PURE__ */ new Date(+date)), date;
24658 interval2.ceil = (date) => {
24659 return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
24661 interval2.round = (date) => {
24662 const d0 = interval2(date), d1 = interval2.ceil(date);
24663 return date - d0 < d1 - date ? d0 : d1;
24665 interval2.offset = (date, step) => {
24666 return offseti(date = /* @__PURE__ */ new Date(+date), step == null ? 1 : Math.floor(step)), date;
24668 interval2.range = (start2, stop, step) => {
24670 start2 = interval2.ceil(start2);
24671 step = step == null ? 1 : Math.floor(step);
24672 if (!(start2 < stop) || !(step > 0)) return range3;
24675 range3.push(previous = /* @__PURE__ */ new Date(+start2)), offseti(start2, step), floori(start2);
24676 while (previous < start2 && start2 < stop);
24679 interval2.filter = (test) => {
24680 return timeInterval((date) => {
24681 if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
24682 }, (date, step) => {
24683 if (date >= date) {
24684 if (step < 0) while (++step <= 0) {
24685 while (offseti(date, -1), !test(date)) {
24688 else while (--step >= 0) {
24689 while (offseti(date, 1), !test(date)) {
24696 interval2.count = (start2, end) => {
24697 t0.setTime(+start2), t1.setTime(+end);
24698 floori(t0), floori(t1);
24699 return Math.floor(count(t0, t1));
24701 interval2.every = (step) => {
24702 step = Math.floor(step);
24703 return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval2 : interval2.filter(field ? (d4) => field(d4) % step === 0 : (d4) => interval2.count(0, d4) % step === 0);
24709 var init_interval = __esm({
24710 "node_modules/d3-time/src/interval.js"() {
24711 t0 = /* @__PURE__ */ new Date();
24712 t1 = /* @__PURE__ */ new Date();
24716 // node_modules/d3-time/src/duration.js
24717 var durationSecond, durationMinute, durationHour, durationDay, durationWeek, durationMonth, durationYear;
24718 var init_duration2 = __esm({
24719 "node_modules/d3-time/src/duration.js"() {
24720 durationSecond = 1e3;
24721 durationMinute = durationSecond * 60;
24722 durationHour = durationMinute * 60;
24723 durationDay = durationHour * 24;
24724 durationWeek = durationDay * 7;
24725 durationMonth = durationDay * 30;
24726 durationYear = durationDay * 365;
24730 // node_modules/d3-time/src/day.js
24731 var timeDay, timeDays, utcDay, utcDays, unixDay, unixDays;
24732 var init_day = __esm({
24733 "node_modules/d3-time/src/day.js"() {
24736 timeDay = timeInterval(
24737 (date) => date.setHours(0, 0, 0, 0),
24738 (date, step) => date.setDate(date.getDate() + step),
24739 (start2, end) => (end - start2 - (end.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationDay,
24740 (date) => date.getDate() - 1
24742 timeDays = timeDay.range;
24743 utcDay = timeInterval((date) => {
24744 date.setUTCHours(0, 0, 0, 0);
24745 }, (date, step) => {
24746 date.setUTCDate(date.getUTCDate() + step);
24747 }, (start2, end) => {
24748 return (end - start2) / durationDay;
24750 return date.getUTCDate() - 1;
24752 utcDays = utcDay.range;
24753 unixDay = timeInterval((date) => {
24754 date.setUTCHours(0, 0, 0, 0);
24755 }, (date, step) => {
24756 date.setUTCDate(date.getUTCDate() + step);
24757 }, (start2, end) => {
24758 return (end - start2) / durationDay;
24760 return Math.floor(date / durationDay);
24762 unixDays = unixDay.range;
24766 // node_modules/d3-time/src/week.js
24767 function timeWeekday(i3) {
24768 return timeInterval((date) => {
24769 date.setDate(date.getDate() - (date.getDay() + 7 - i3) % 7);
24770 date.setHours(0, 0, 0, 0);
24771 }, (date, step) => {
24772 date.setDate(date.getDate() + step * 7);
24773 }, (start2, end) => {
24774 return (end - start2 - (end.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationWeek;
24777 function utcWeekday(i3) {
24778 return timeInterval((date) => {
24779 date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i3) % 7);
24780 date.setUTCHours(0, 0, 0, 0);
24781 }, (date, step) => {
24782 date.setUTCDate(date.getUTCDate() + step * 7);
24783 }, (start2, end) => {
24784 return (end - start2) / durationWeek;
24787 var timeSunday, timeMonday, timeTuesday, timeWednesday, timeThursday, timeFriday, timeSaturday, timeSundays, timeMondays, timeTuesdays, timeWednesdays, timeThursdays, timeFridays, timeSaturdays, utcSunday, utcMonday, utcTuesday, utcWednesday, utcThursday, utcFriday, utcSaturday, utcSundays, utcMondays, utcTuesdays, utcWednesdays, utcThursdays, utcFridays, utcSaturdays;
24788 var init_week = __esm({
24789 "node_modules/d3-time/src/week.js"() {
24792 timeSunday = timeWeekday(0);
24793 timeMonday = timeWeekday(1);
24794 timeTuesday = timeWeekday(2);
24795 timeWednesday = timeWeekday(3);
24796 timeThursday = timeWeekday(4);
24797 timeFriday = timeWeekday(5);
24798 timeSaturday = timeWeekday(6);
24799 timeSundays = timeSunday.range;
24800 timeMondays = timeMonday.range;
24801 timeTuesdays = timeTuesday.range;
24802 timeWednesdays = timeWednesday.range;
24803 timeThursdays = timeThursday.range;
24804 timeFridays = timeFriday.range;
24805 timeSaturdays = timeSaturday.range;
24806 utcSunday = utcWeekday(0);
24807 utcMonday = utcWeekday(1);
24808 utcTuesday = utcWeekday(2);
24809 utcWednesday = utcWeekday(3);
24810 utcThursday = utcWeekday(4);
24811 utcFriday = utcWeekday(5);
24812 utcSaturday = utcWeekday(6);
24813 utcSundays = utcSunday.range;
24814 utcMondays = utcMonday.range;
24815 utcTuesdays = utcTuesday.range;
24816 utcWednesdays = utcWednesday.range;
24817 utcThursdays = utcThursday.range;
24818 utcFridays = utcFriday.range;
24819 utcSaturdays = utcSaturday.range;
24823 // node_modules/d3-time/src/year.js
24824 var timeYear, timeYears, utcYear, utcYears;
24825 var init_year = __esm({
24826 "node_modules/d3-time/src/year.js"() {
24828 timeYear = timeInterval((date) => {
24829 date.setMonth(0, 1);
24830 date.setHours(0, 0, 0, 0);
24831 }, (date, step) => {
24832 date.setFullYear(date.getFullYear() + step);
24833 }, (start2, end) => {
24834 return end.getFullYear() - start2.getFullYear();
24836 return date.getFullYear();
24838 timeYear.every = (k2) => {
24839 return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date) => {
24840 date.setFullYear(Math.floor(date.getFullYear() / k2) * k2);
24841 date.setMonth(0, 1);
24842 date.setHours(0, 0, 0, 0);
24843 }, (date, step) => {
24844 date.setFullYear(date.getFullYear() + step * k2);
24847 timeYears = timeYear.range;
24848 utcYear = timeInterval((date) => {
24849 date.setUTCMonth(0, 1);
24850 date.setUTCHours(0, 0, 0, 0);
24851 }, (date, step) => {
24852 date.setUTCFullYear(date.getUTCFullYear() + step);
24853 }, (start2, end) => {
24854 return end.getUTCFullYear() - start2.getUTCFullYear();
24856 return date.getUTCFullYear();
24858 utcYear.every = (k2) => {
24859 return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date) => {
24860 date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k2) * k2);
24861 date.setUTCMonth(0, 1);
24862 date.setUTCHours(0, 0, 0, 0);
24863 }, (date, step) => {
24864 date.setUTCFullYear(date.getUTCFullYear() + step * k2);
24867 utcYears = utcYear.range;
24871 // node_modules/d3-time/src/index.js
24872 var init_src14 = __esm({
24873 "node_modules/d3-time/src/index.js"() {
24880 // node_modules/d3-time-format/src/locale.js
24881 function localDate(d4) {
24882 if (0 <= d4.y && d4.y < 100) {
24883 var date = new Date(-1, d4.m, d4.d, d4.H, d4.M, d4.S, d4.L);
24884 date.setFullYear(d4.y);
24887 return new Date(d4.y, d4.m, d4.d, d4.H, d4.M, d4.S, d4.L);
24889 function utcDate(d4) {
24890 if (0 <= d4.y && d4.y < 100) {
24891 var date = new Date(Date.UTC(-1, d4.m, d4.d, d4.H, d4.M, d4.S, d4.L));
24892 date.setUTCFullYear(d4.y);
24895 return new Date(Date.UTC(d4.y, d4.m, d4.d, d4.H, d4.M, d4.S, d4.L));
24897 function newDate(y3, m3, d4) {
24898 return { y: y3, m: m3, d: d4, H: 0, M: 0, S: 0, L: 0 };
24900 function formatLocale(locale3) {
24901 var locale_dateTime = locale3.dateTime, locale_date = locale3.date, locale_time = locale3.time, locale_periods = locale3.periods, locale_weekdays = locale3.days, locale_shortWeekdays = locale3.shortDays, locale_months = locale3.months, locale_shortMonths = locale3.shortMonths;
24902 var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths);
24904 "a": formatShortWeekday,
24905 "A": formatWeekday,
24906 "b": formatShortMonth,
24909 "d": formatDayOfMonth,
24910 "e": formatDayOfMonth,
24911 "f": formatMicroseconds,
24912 "g": formatYearISO,
24913 "G": formatFullYearISO,
24916 "j": formatDayOfYear,
24917 "L": formatMilliseconds,
24918 "m": formatMonthNumber,
24919 "M": formatMinutes,
24921 "q": formatQuarter,
24922 "Q": formatUnixTimestamp,
24923 "s": formatUnixTimestampSeconds,
24924 "S": formatSeconds,
24925 "u": formatWeekdayNumberMonday,
24926 "U": formatWeekNumberSunday,
24927 "V": formatWeekNumberISO,
24928 "w": formatWeekdayNumberSunday,
24929 "W": formatWeekNumberMonday,
24933 "Y": formatFullYear,
24935 "%": formatLiteralPercent
24938 "a": formatUTCShortWeekday,
24939 "A": formatUTCWeekday,
24940 "b": formatUTCShortMonth,
24941 "B": formatUTCMonth,
24943 "d": formatUTCDayOfMonth,
24944 "e": formatUTCDayOfMonth,
24945 "f": formatUTCMicroseconds,
24946 "g": formatUTCYearISO,
24947 "G": formatUTCFullYearISO,
24948 "H": formatUTCHour24,
24949 "I": formatUTCHour12,
24950 "j": formatUTCDayOfYear,
24951 "L": formatUTCMilliseconds,
24952 "m": formatUTCMonthNumber,
24953 "M": formatUTCMinutes,
24954 "p": formatUTCPeriod,
24955 "q": formatUTCQuarter,
24956 "Q": formatUnixTimestamp,
24957 "s": formatUnixTimestampSeconds,
24958 "S": formatUTCSeconds,
24959 "u": formatUTCWeekdayNumberMonday,
24960 "U": formatUTCWeekNumberSunday,
24961 "V": formatUTCWeekNumberISO,
24962 "w": formatUTCWeekdayNumberSunday,
24963 "W": formatUTCWeekNumberMonday,
24966 "y": formatUTCYear,
24967 "Y": formatUTCFullYear,
24968 "Z": formatUTCZone,
24969 "%": formatLiteralPercent
24972 "a": parseShortWeekday,
24974 "b": parseShortMonth,
24976 "c": parseLocaleDateTime,
24977 "d": parseDayOfMonth,
24978 "e": parseDayOfMonth,
24979 "f": parseMicroseconds,
24981 "G": parseFullYear,
24984 "j": parseDayOfYear,
24985 "L": parseMilliseconds,
24986 "m": parseMonthNumber,
24990 "Q": parseUnixTimestamp,
24991 "s": parseUnixTimestampSeconds,
24993 "u": parseWeekdayNumberMonday,
24994 "U": parseWeekNumberSunday,
24995 "V": parseWeekNumberISO,
24996 "w": parseWeekdayNumberSunday,
24997 "W": parseWeekNumberMonday,
24998 "x": parseLocaleDate,
24999 "X": parseLocaleTime,
25001 "Y": parseFullYear,
25003 "%": parseLiteralPercent
25005 formats.x = newFormat(locale_date, formats);
25006 formats.X = newFormat(locale_time, formats);
25007 formats.c = newFormat(locale_dateTime, formats);
25008 utcFormats.x = newFormat(locale_date, utcFormats);
25009 utcFormats.X = newFormat(locale_time, utcFormats);
25010 utcFormats.c = newFormat(locale_dateTime, utcFormats);
25011 function newFormat(specifier, formats2) {
25012 return function(date) {
25013 var string = [], i3 = -1, j3 = 0, n3 = specifier.length, c2, pad3, format2;
25014 if (!(date instanceof Date)) date = /* @__PURE__ */ new Date(+date);
25015 while (++i3 < n3) {
25016 if (specifier.charCodeAt(i3) === 37) {
25017 string.push(specifier.slice(j3, i3));
25018 if ((pad3 = pads[c2 = specifier.charAt(++i3)]) != null) c2 = specifier.charAt(++i3);
25019 else pad3 = c2 === "e" ? " " : "0";
25020 if (format2 = formats2[c2]) c2 = format2(date, pad3);
25025 string.push(specifier.slice(j3, i3));
25026 return string.join("");
25029 function newParse(specifier, Z3) {
25030 return function(string) {
25031 var d4 = newDate(1900, void 0, 1), i3 = parseSpecifier(d4, specifier, string += "", 0), week, day;
25032 if (i3 != string.length) return null;
25033 if ("Q" in d4) return new Date(d4.Q);
25034 if ("s" in d4) return new Date(d4.s * 1e3 + ("L" in d4 ? d4.L : 0));
25035 if (Z3 && !("Z" in d4)) d4.Z = 0;
25036 if ("p" in d4) d4.H = d4.H % 12 + d4.p * 12;
25037 if (d4.m === void 0) d4.m = "q" in d4 ? d4.q : 0;
25039 if (d4.V < 1 || d4.V > 53) return null;
25040 if (!("w" in d4)) d4.w = 1;
25042 week = utcDate(newDate(d4.y, 0, 1)), day = week.getUTCDay();
25043 week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
25044 week = utcDay.offset(week, (d4.V - 1) * 7);
25045 d4.y = week.getUTCFullYear();
25046 d4.m = week.getUTCMonth();
25047 d4.d = week.getUTCDate() + (d4.w + 6) % 7;
25049 week = localDate(newDate(d4.y, 0, 1)), day = week.getDay();
25050 week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
25051 week = timeDay.offset(week, (d4.V - 1) * 7);
25052 d4.y = week.getFullYear();
25053 d4.m = week.getMonth();
25054 d4.d = week.getDate() + (d4.w + 6) % 7;
25056 } else if ("W" in d4 || "U" in d4) {
25057 if (!("w" in d4)) d4.w = "u" in d4 ? d4.u % 7 : "W" in d4 ? 1 : 0;
25058 day = "Z" in d4 ? utcDate(newDate(d4.y, 0, 1)).getUTCDay() : localDate(newDate(d4.y, 0, 1)).getDay();
25060 d4.d = "W" in d4 ? (d4.w + 6) % 7 + d4.W * 7 - (day + 5) % 7 : d4.w + d4.U * 7 - (day + 6) % 7;
25063 d4.H += d4.Z / 100 | 0;
25064 d4.M += d4.Z % 100;
25065 return utcDate(d4);
25067 return localDate(d4);
25070 function parseSpecifier(d4, specifier, string, j3) {
25071 var i3 = 0, n3 = specifier.length, m3 = string.length, c2, parse;
25073 if (j3 >= m3) return -1;
25074 c2 = specifier.charCodeAt(i3++);
25076 c2 = specifier.charAt(i3++);
25077 parse = parses[c2 in pads ? specifier.charAt(i3++) : c2];
25078 if (!parse || (j3 = parse(d4, string, j3)) < 0) return -1;
25079 } else if (c2 != string.charCodeAt(j3++)) {
25085 function parsePeriod(d4, string, i3) {
25086 var n3 = periodRe.exec(string.slice(i3));
25087 return n3 ? (d4.p = periodLookup.get(n3[0].toLowerCase()), i3 + n3[0].length) : -1;
25089 function parseShortWeekday(d4, string, i3) {
25090 var n3 = shortWeekdayRe.exec(string.slice(i3));
25091 return n3 ? (d4.w = shortWeekdayLookup.get(n3[0].toLowerCase()), i3 + n3[0].length) : -1;
25093 function parseWeekday(d4, string, i3) {
25094 var n3 = weekdayRe.exec(string.slice(i3));
25095 return n3 ? (d4.w = weekdayLookup.get(n3[0].toLowerCase()), i3 + n3[0].length) : -1;
25097 function parseShortMonth(d4, string, i3) {
25098 var n3 = shortMonthRe.exec(string.slice(i3));
25099 return n3 ? (d4.m = shortMonthLookup.get(n3[0].toLowerCase()), i3 + n3[0].length) : -1;
25101 function parseMonth(d4, string, i3) {
25102 var n3 = monthRe.exec(string.slice(i3));
25103 return n3 ? (d4.m = monthLookup.get(n3[0].toLowerCase()), i3 + n3[0].length) : -1;
25105 function parseLocaleDateTime(d4, string, i3) {
25106 return parseSpecifier(d4, locale_dateTime, string, i3);
25108 function parseLocaleDate(d4, string, i3) {
25109 return parseSpecifier(d4, locale_date, string, i3);
25111 function parseLocaleTime(d4, string, i3) {
25112 return parseSpecifier(d4, locale_time, string, i3);
25114 function formatShortWeekday(d4) {
25115 return locale_shortWeekdays[d4.getDay()];
25117 function formatWeekday(d4) {
25118 return locale_weekdays[d4.getDay()];
25120 function formatShortMonth(d4) {
25121 return locale_shortMonths[d4.getMonth()];
25123 function formatMonth(d4) {
25124 return locale_months[d4.getMonth()];
25126 function formatPeriod(d4) {
25127 return locale_periods[+(d4.getHours() >= 12)];
25129 function formatQuarter(d4) {
25130 return 1 + ~~(d4.getMonth() / 3);
25132 function formatUTCShortWeekday(d4) {
25133 return locale_shortWeekdays[d4.getUTCDay()];
25135 function formatUTCWeekday(d4) {
25136 return locale_weekdays[d4.getUTCDay()];
25138 function formatUTCShortMonth(d4) {
25139 return locale_shortMonths[d4.getUTCMonth()];
25141 function formatUTCMonth(d4) {
25142 return locale_months[d4.getUTCMonth()];
25144 function formatUTCPeriod(d4) {
25145 return locale_periods[+(d4.getUTCHours() >= 12)];
25147 function formatUTCQuarter(d4) {
25148 return 1 + ~~(d4.getUTCMonth() / 3);
25151 format: function(specifier) {
25152 var f2 = newFormat(specifier += "", formats);
25153 f2.toString = function() {
25158 parse: function(specifier) {
25159 var p2 = newParse(specifier += "", false);
25160 p2.toString = function() {
25165 utcFormat: function(specifier) {
25166 var f2 = newFormat(specifier += "", utcFormats);
25167 f2.toString = function() {
25172 utcParse: function(specifier) {
25173 var p2 = newParse(specifier += "", true);
25174 p2.toString = function() {
25181 function pad(value, fill, width) {
25182 var sign2 = value < 0 ? "-" : "", string = (sign2 ? -value : value) + "", length2 = string.length;
25183 return sign2 + (length2 < width ? new Array(width - length2 + 1).join(fill) + string : string);
25185 function requote(s2) {
25186 return s2.replace(requoteRe, "\\$&");
25188 function formatRe(names) {
25189 return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
25191 function formatLookup(names) {
25192 return new Map(names.map((name, i3) => [name.toLowerCase(), i3]));
25194 function parseWeekdayNumberSunday(d4, string, i3) {
25195 var n3 = numberRe.exec(string.slice(i3, i3 + 1));
25196 return n3 ? (d4.w = +n3[0], i3 + n3[0].length) : -1;
25198 function parseWeekdayNumberMonday(d4, string, i3) {
25199 var n3 = numberRe.exec(string.slice(i3, i3 + 1));
25200 return n3 ? (d4.u = +n3[0], i3 + n3[0].length) : -1;
25202 function parseWeekNumberSunday(d4, string, i3) {
25203 var n3 = numberRe.exec(string.slice(i3, i3 + 2));
25204 return n3 ? (d4.U = +n3[0], i3 + n3[0].length) : -1;
25206 function parseWeekNumberISO(d4, string, i3) {
25207 var n3 = numberRe.exec(string.slice(i3, i3 + 2));
25208 return n3 ? (d4.V = +n3[0], i3 + n3[0].length) : -1;
25210 function parseWeekNumberMonday(d4, string, i3) {
25211 var n3 = numberRe.exec(string.slice(i3, i3 + 2));
25212 return n3 ? (d4.W = +n3[0], i3 + n3[0].length) : -1;
25214 function parseFullYear(d4, string, i3) {
25215 var n3 = numberRe.exec(string.slice(i3, i3 + 4));
25216 return n3 ? (d4.y = +n3[0], i3 + n3[0].length) : -1;
25218 function parseYear(d4, string, i3) {
25219 var n3 = numberRe.exec(string.slice(i3, i3 + 2));
25220 return n3 ? (d4.y = +n3[0] + (+n3[0] > 68 ? 1900 : 2e3), i3 + n3[0].length) : -1;
25222 function parseZone(d4, string, i3) {
25223 var n3 = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i3, i3 + 6));
25224 return n3 ? (d4.Z = n3[1] ? 0 : -(n3[2] + (n3[3] || "00")), i3 + n3[0].length) : -1;
25226 function parseQuarter(d4, string, i3) {
25227 var n3 = numberRe.exec(string.slice(i3, i3 + 1));
25228 return n3 ? (d4.q = n3[0] * 3 - 3, i3 + n3[0].length) : -1;
25230 function parseMonthNumber(d4, string, i3) {
25231 var n3 = numberRe.exec(string.slice(i3, i3 + 2));
25232 return n3 ? (d4.m = n3[0] - 1, i3 + n3[0].length) : -1;
25234 function parseDayOfMonth(d4, string, i3) {
25235 var n3 = numberRe.exec(string.slice(i3, i3 + 2));
25236 return n3 ? (d4.d = +n3[0], i3 + n3[0].length) : -1;
25238 function parseDayOfYear(d4, string, i3) {
25239 var n3 = numberRe.exec(string.slice(i3, i3 + 3));
25240 return n3 ? (d4.m = 0, d4.d = +n3[0], i3 + n3[0].length) : -1;
25242 function parseHour24(d4, string, i3) {
25243 var n3 = numberRe.exec(string.slice(i3, i3 + 2));
25244 return n3 ? (d4.H = +n3[0], i3 + n3[0].length) : -1;
25246 function parseMinutes(d4, string, i3) {
25247 var n3 = numberRe.exec(string.slice(i3, i3 + 2));
25248 return n3 ? (d4.M = +n3[0], i3 + n3[0].length) : -1;
25250 function parseSeconds(d4, string, i3) {
25251 var n3 = numberRe.exec(string.slice(i3, i3 + 2));
25252 return n3 ? (d4.S = +n3[0], i3 + n3[0].length) : -1;
25254 function parseMilliseconds(d4, string, i3) {
25255 var n3 = numberRe.exec(string.slice(i3, i3 + 3));
25256 return n3 ? (d4.L = +n3[0], i3 + n3[0].length) : -1;
25258 function parseMicroseconds(d4, string, i3) {
25259 var n3 = numberRe.exec(string.slice(i3, i3 + 6));
25260 return n3 ? (d4.L = Math.floor(n3[0] / 1e3), i3 + n3[0].length) : -1;
25262 function parseLiteralPercent(d4, string, i3) {
25263 var n3 = percentRe.exec(string.slice(i3, i3 + 1));
25264 return n3 ? i3 + n3[0].length : -1;
25266 function parseUnixTimestamp(d4, string, i3) {
25267 var n3 = numberRe.exec(string.slice(i3));
25268 return n3 ? (d4.Q = +n3[0], i3 + n3[0].length) : -1;
25270 function parseUnixTimestampSeconds(d4, string, i3) {
25271 var n3 = numberRe.exec(string.slice(i3));
25272 return n3 ? (d4.s = +n3[0], i3 + n3[0].length) : -1;
25274 function formatDayOfMonth(d4, p2) {
25275 return pad(d4.getDate(), p2, 2);
25277 function formatHour24(d4, p2) {
25278 return pad(d4.getHours(), p2, 2);
25280 function formatHour12(d4, p2) {
25281 return pad(d4.getHours() % 12 || 12, p2, 2);
25283 function formatDayOfYear(d4, p2) {
25284 return pad(1 + timeDay.count(timeYear(d4), d4), p2, 3);
25286 function formatMilliseconds(d4, p2) {
25287 return pad(d4.getMilliseconds(), p2, 3);
25289 function formatMicroseconds(d4, p2) {
25290 return formatMilliseconds(d4, p2) + "000";
25292 function formatMonthNumber(d4, p2) {
25293 return pad(d4.getMonth() + 1, p2, 2);
25295 function formatMinutes(d4, p2) {
25296 return pad(d4.getMinutes(), p2, 2);
25298 function formatSeconds(d4, p2) {
25299 return pad(d4.getSeconds(), p2, 2);
25301 function formatWeekdayNumberMonday(d4) {
25302 var day = d4.getDay();
25303 return day === 0 ? 7 : day;
25305 function formatWeekNumberSunday(d4, p2) {
25306 return pad(timeSunday.count(timeYear(d4) - 1, d4), p2, 2);
25308 function dISO(d4) {
25309 var day = d4.getDay();
25310 return day >= 4 || day === 0 ? timeThursday(d4) : timeThursday.ceil(d4);
25312 function formatWeekNumberISO(d4, p2) {
25314 return pad(timeThursday.count(timeYear(d4), d4) + (timeYear(d4).getDay() === 4), p2, 2);
25316 function formatWeekdayNumberSunday(d4) {
25317 return d4.getDay();
25319 function formatWeekNumberMonday(d4, p2) {
25320 return pad(timeMonday.count(timeYear(d4) - 1, d4), p2, 2);
25322 function formatYear(d4, p2) {
25323 return pad(d4.getFullYear() % 100, p2, 2);
25325 function formatYearISO(d4, p2) {
25327 return pad(d4.getFullYear() % 100, p2, 2);
25329 function formatFullYear(d4, p2) {
25330 return pad(d4.getFullYear() % 1e4, p2, 4);
25332 function formatFullYearISO(d4, p2) {
25333 var day = d4.getDay();
25334 d4 = day >= 4 || day === 0 ? timeThursday(d4) : timeThursday.ceil(d4);
25335 return pad(d4.getFullYear() % 1e4, p2, 4);
25337 function formatZone(d4) {
25338 var z3 = d4.getTimezoneOffset();
25339 return (z3 > 0 ? "-" : (z3 *= -1, "+")) + pad(z3 / 60 | 0, "0", 2) + pad(z3 % 60, "0", 2);
25341 function formatUTCDayOfMonth(d4, p2) {
25342 return pad(d4.getUTCDate(), p2, 2);
25344 function formatUTCHour24(d4, p2) {
25345 return pad(d4.getUTCHours(), p2, 2);
25347 function formatUTCHour12(d4, p2) {
25348 return pad(d4.getUTCHours() % 12 || 12, p2, 2);
25350 function formatUTCDayOfYear(d4, p2) {
25351 return pad(1 + utcDay.count(utcYear(d4), d4), p2, 3);
25353 function formatUTCMilliseconds(d4, p2) {
25354 return pad(d4.getUTCMilliseconds(), p2, 3);
25356 function formatUTCMicroseconds(d4, p2) {
25357 return formatUTCMilliseconds(d4, p2) + "000";
25359 function formatUTCMonthNumber(d4, p2) {
25360 return pad(d4.getUTCMonth() + 1, p2, 2);
25362 function formatUTCMinutes(d4, p2) {
25363 return pad(d4.getUTCMinutes(), p2, 2);
25365 function formatUTCSeconds(d4, p2) {
25366 return pad(d4.getUTCSeconds(), p2, 2);
25368 function formatUTCWeekdayNumberMonday(d4) {
25369 var dow = d4.getUTCDay();
25370 return dow === 0 ? 7 : dow;
25372 function formatUTCWeekNumberSunday(d4, p2) {
25373 return pad(utcSunday.count(utcYear(d4) - 1, d4), p2, 2);
25375 function UTCdISO(d4) {
25376 var day = d4.getUTCDay();
25377 return day >= 4 || day === 0 ? utcThursday(d4) : utcThursday.ceil(d4);
25379 function formatUTCWeekNumberISO(d4, p2) {
25381 return pad(utcThursday.count(utcYear(d4), d4) + (utcYear(d4).getUTCDay() === 4), p2, 2);
25383 function formatUTCWeekdayNumberSunday(d4) {
25384 return d4.getUTCDay();
25386 function formatUTCWeekNumberMonday(d4, p2) {
25387 return pad(utcMonday.count(utcYear(d4) - 1, d4), p2, 2);
25389 function formatUTCYear(d4, p2) {
25390 return pad(d4.getUTCFullYear() % 100, p2, 2);
25392 function formatUTCYearISO(d4, p2) {
25394 return pad(d4.getUTCFullYear() % 100, p2, 2);
25396 function formatUTCFullYear(d4, p2) {
25397 return pad(d4.getUTCFullYear() % 1e4, p2, 4);
25399 function formatUTCFullYearISO(d4, p2) {
25400 var day = d4.getUTCDay();
25401 d4 = day >= 4 || day === 0 ? utcThursday(d4) : utcThursday.ceil(d4);
25402 return pad(d4.getUTCFullYear() % 1e4, p2, 4);
25404 function formatUTCZone() {
25407 function formatLiteralPercent() {
25410 function formatUnixTimestamp(d4) {
25413 function formatUnixTimestampSeconds(d4) {
25414 return Math.floor(+d4 / 1e3);
25416 var pads, numberRe, percentRe, requoteRe;
25417 var init_locale2 = __esm({
25418 "node_modules/d3-time-format/src/locale.js"() {
25420 pads = { "-": "", "_": " ", "0": "0" };
25421 numberRe = /^\s*\d+/;
25423 requoteRe = /[\\^$*+?|[\]().{}]/g;
25427 // node_modules/d3-time-format/src/defaultLocale.js
25428 function defaultLocale2(definition) {
25429 locale2 = formatLocale(definition);
25430 timeFormat = locale2.format;
25431 timeParse = locale2.parse;
25432 utcFormat = locale2.utcFormat;
25433 utcParse = locale2.utcParse;
25436 var locale2, timeFormat, timeParse, utcFormat, utcParse;
25437 var init_defaultLocale2 = __esm({
25438 "node_modules/d3-time-format/src/defaultLocale.js"() {
25441 dateTime: "%x, %X",
25442 date: "%-m/%-d/%Y",
25443 time: "%-I:%M:%S %p",
25444 periods: ["AM", "PM"],
25445 days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
25446 shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
25447 months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
25448 shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
25453 // node_modules/d3-time-format/src/index.js
25454 var init_src15 = __esm({
25455 "node_modules/d3-time-format/src/index.js"() {
25456 init_defaultLocale2();
25460 // node_modules/d3-scale/src/index.js
25461 var init_src16 = __esm({
25462 "node_modules/d3-scale/src/index.js"() {
25468 // modules/behavior/breathe.js
25469 var breathe_exports = {};
25470 __export(breathe_exports, {
25471 behaviorBreathe: () => behaviorBreathe
25473 function behaviorBreathe() {
25474 var duration = 800;
25476 var selector = ".selected.shadow, .selected .shadow";
25477 var _selected = select_default2(null);
25482 function ratchetyInterpolator(a2, b3, steps2, units) {
25485 var sample = quantize().domain([0, 1]).range(quantize_default(number_default(a2, b3), steps2));
25486 return function(t2) {
25487 return String(sample(t2)) + (units || "");
25490 function reset(selection2) {
25491 selection2.style("stroke-opacity", null).style("stroke-width", null).style("fill-opacity", null).style("r", null);
25493 function setAnimationParams(transition2, fromTo) {
25494 var toFrom = fromTo === "from" ? "to" : "from";
25495 transition2.styleTween("stroke-opacity", function(d4) {
25496 return ratchetyInterpolator(
25497 _params[d4.id][toFrom].opacity,
25498 _params[d4.id][fromTo].opacity,
25501 }).styleTween("stroke-width", function(d4) {
25502 return ratchetyInterpolator(
25503 _params[d4.id][toFrom].width,
25504 _params[d4.id][fromTo].width,
25508 }).styleTween("fill-opacity", function(d4) {
25509 return ratchetyInterpolator(
25510 _params[d4.id][toFrom].opacity,
25511 _params[d4.id][fromTo].opacity,
25514 }).styleTween("r", function(d4) {
25515 return ratchetyInterpolator(
25516 _params[d4.id][toFrom].width,
25517 _params[d4.id][fromTo].width,
25523 function calcAnimationParams(selection2) {
25524 selection2.call(reset).each(function(d4) {
25525 var s2 = select_default2(this);
25526 var tag = s2.node().tagName;
25527 var p2 = { "from": {}, "to": {} };
25530 if (tag === "circle") {
25531 opacity = Number(s2.style("fill-opacity") || 0.5);
25532 width = Number(s2.style("r") || 15.5);
25534 opacity = Number(s2.style("stroke-opacity") || 0.7);
25535 width = Number(s2.style("stroke-width") || 10);
25538 p2.from.opacity = opacity * 0.6;
25539 p2.to.opacity = opacity * 1.25;
25540 p2.from.width = width * 0.7;
25541 p2.to.width = width * (tag === "circle" ? 1.5 : 1);
25542 _params[d4.id] = p2;
25545 function run(surface, fromTo) {
25546 var toFrom = fromTo === "from" ? "to" : "from";
25547 var currSelected = surface.selectAll(selector);
25548 var currClassed = surface.attr("class");
25549 if (_done || currSelected.empty()) {
25550 _selected.call(reset);
25551 _selected = select_default2(null);
25554 if (!(0, import_fast_deep_equal2.default)(currSelected.data(), _selected.data()) || currClassed !== _classed) {
25555 _selected.call(reset);
25556 _classed = currClassed;
25557 _selected = currSelected.call(calcAnimationParams);
25559 var didCallNextRun = false;
25560 _selected.transition().duration(duration).call(setAnimationParams, fromTo).on("end", function() {
25561 if (!didCallNextRun) {
25562 surface.call(run, toFrom);
25563 didCallNextRun = true;
25565 if (!select_default2(this).classed("selected")) {
25566 reset(select_default2(this));
25570 function behavior(surface) {
25572 _timer = timer(function() {
25573 if (surface.selectAll(selector).empty()) {
25576 surface.call(run, "from");
25581 behavior.restartIfNeeded = function(surface) {
25582 if (_selected.empty()) {
25583 surface.call(run, "from");
25589 behavior.off = function() {
25594 _selected.interrupt().call(reset);
25598 var import_fast_deep_equal2;
25599 var init_breathe = __esm({
25600 "modules/behavior/breathe.js"() {
25602 import_fast_deep_equal2 = __toESM(require_fast_deep_equal(), 1);
25610 // node_modules/d3-dsv/src/index.js
25611 var init_src17 = __esm({
25612 "node_modules/d3-dsv/src/index.js"() {
25616 // node_modules/d3-fetch/src/text.js
25617 function responseText(response) {
25618 if (!response.ok) throw new Error(response.status + " " + response.statusText);
25619 return response.text();
25621 function text_default3(input, init2) {
25622 return fetch(input, init2).then(responseText);
25624 var init_text3 = __esm({
25625 "node_modules/d3-fetch/src/text.js"() {
25629 // node_modules/d3-fetch/src/json.js
25630 function responseJson(response) {
25631 if (!response.ok) throw new Error(response.status + " " + response.statusText);
25632 if (response.status === 204 || response.status === 205) return;
25633 return response.json();
25635 function json_default(input, init2) {
25636 return fetch(input, init2).then(responseJson);
25638 var init_json = __esm({
25639 "node_modules/d3-fetch/src/json.js"() {
25643 // node_modules/d3-fetch/src/xml.js
25644 function parser(type2) {
25645 return (input, init2) => text_default3(input, init2).then((text) => new DOMParser().parseFromString(text, type2));
25647 var xml_default, html, svg;
25648 var init_xml = __esm({
25649 "node_modules/d3-fetch/src/xml.js"() {
25651 xml_default = parser("application/xml");
25652 html = parser("text/html");
25653 svg = parser("image/svg+xml");
25657 // node_modules/d3-fetch/src/index.js
25658 var init_src18 = __esm({
25659 "node_modules/d3-fetch/src/index.js"() {
25666 // modules/core/difference.js
25667 var difference_exports = {};
25668 __export(difference_exports, {
25669 coreDifference: () => coreDifference
25671 function coreDifference(base, head) {
25673 var _didChange = {};
25675 function checkEntityID(id2) {
25676 var h3 = head.entities[id2];
25677 var b3 = base.entities[id2];
25678 if (h3 === b3) return;
25679 if (_changes[id2]) return;
25681 _changes[id2] = { base: b3, head: h3 };
25682 _didChange.deletion = true;
25686 _changes[id2] = { base: b3, head: h3 };
25687 _didChange.addition = true;
25691 if (h3.members && b3.members && !(0, import_fast_deep_equal3.default)(h3.members, b3.members)) {
25692 _changes[id2] = { base: b3, head: h3 };
25693 _didChange.geometry = true;
25694 _didChange.properties = true;
25697 if (h3.loc && b3.loc && !geoVecEqual(h3.loc, b3.loc)) {
25698 _changes[id2] = { base: b3, head: h3 };
25699 _didChange.geometry = true;
25701 if (h3.nodes && b3.nodes && !(0, import_fast_deep_equal3.default)(h3.nodes, b3.nodes)) {
25702 _changes[id2] = { base: b3, head: h3 };
25703 _didChange.geometry = true;
25705 if (h3.tags && b3.tags && !(0, import_fast_deep_equal3.default)(h3.tags, b3.tags)) {
25706 _changes[id2] = { base: b3, head: h3 };
25707 _didChange.properties = true;
25712 var ids = utilArrayUniq(Object.keys(head.entities).concat(Object.keys(base.entities)));
25713 for (var i3 = 0; i3 < ids.length; i3++) {
25714 checkEntityID(ids[i3]);
25718 _diff.length = function length2() {
25719 return Object.keys(_changes).length;
25721 _diff.changes = function changes() {
25724 _diff.didChange = _didChange;
25725 _diff.extantIDs = function extantIDs(includeRelMembers) {
25726 var result = /* @__PURE__ */ new Set();
25727 Object.keys(_changes).forEach(function(id2) {
25728 if (_changes[id2].head) {
25731 var h3 = _changes[id2].head;
25732 var b3 = _changes[id2].base;
25733 var entity = h3 || b3;
25734 if (includeRelMembers && entity.type === "relation") {
25735 var mh = h3 ? h3.members.map(function(m3) {
25738 var mb = b3 ? b3.members.map(function(m3) {
25741 utilArrayUnion(mh, mb).forEach(function(memberID) {
25742 if (head.hasEntity(memberID)) {
25743 result.add(memberID);
25748 return Array.from(result);
25750 _diff.modified = function modified() {
25752 Object.values(_changes).forEach(function(change) {
25753 if (change.base && change.head) {
25754 result.push(change.head);
25759 _diff.created = function created() {
25761 Object.values(_changes).forEach(function(change) {
25762 if (!change.base && change.head) {
25763 result.push(change.head);
25768 _diff.deleted = function deleted() {
25770 Object.values(_changes).forEach(function(change) {
25771 if (change.base && !change.head) {
25772 result.push(change.base);
25777 _diff.summary = function summary() {
25779 var keys2 = Object.keys(_changes);
25780 for (var i3 = 0; i3 < keys2.length; i3++) {
25781 var change = _changes[keys2[i3]];
25782 if (change.head && change.head.geometry(head) !== "vertex") {
25783 addEntity(change.head, head, change.base ? "modified" : "created");
25784 } else if (change.base && change.base.geometry(base) !== "vertex") {
25785 addEntity(change.base, base, "deleted");
25786 } else if (change.base && change.head) {
25787 var moved = !(0, import_fast_deep_equal3.default)(change.base.loc, change.head.loc);
25788 var retagged = !(0, import_fast_deep_equal3.default)(change.base.tags, change.head.tags);
25790 addParents(change.head);
25792 if (retagged || moved && change.head.hasInterestingTags()) {
25793 addEntity(change.head, head, "modified");
25795 } else if (change.head && change.head.hasInterestingTags()) {
25796 addEntity(change.head, head, "created");
25797 } else if (change.base && change.base.hasInterestingTags()) {
25798 addEntity(change.base, base, "deleted");
25801 return Object.values(relevant);
25802 function addEntity(entity, graph, changeType) {
25803 relevant[entity.id] = {
25809 function addParents(entity) {
25810 var parents = head.parentWays(entity);
25811 for (var j3 = parents.length - 1; j3 >= 0; j3--) {
25812 var parent2 = parents[j3];
25813 if (!(parent2.id in relevant)) {
25814 addEntity(parent2, head, "modified");
25819 _diff.complete = function complete(extent) {
25822 for (id2 in _changes) {
25823 change = _changes[id2];
25824 var h3 = change.head;
25825 var b3 = change.base;
25826 var entity = h3 || b3;
25828 if (extent && (!h3 || !h3.intersects(extent, head)) && (!b3 || !b3.intersects(extent, base))) {
25832 if (entity.type === "way") {
25833 var nh = h3 ? h3.nodes : [];
25834 var nb = b3 ? b3.nodes : [];
25836 diff = utilArrayDifference(nh, nb);
25837 for (i3 = 0; i3 < diff.length; i3++) {
25838 result[diff[i3]] = head.hasEntity(diff[i3]);
25840 diff = utilArrayDifference(nb, nh);
25841 for (i3 = 0; i3 < diff.length; i3++) {
25842 result[diff[i3]] = head.hasEntity(diff[i3]);
25845 if (entity.type === "relation" && entity.isMultipolygon()) {
25846 var mh = h3 ? h3.members.map(function(m3) {
25849 var mb = b3 ? b3.members.map(function(m3) {
25852 var ids = utilArrayUnion(mh, mb);
25853 for (i3 = 0; i3 < ids.length; i3++) {
25854 var member = head.hasEntity(ids[i3]);
25855 if (!member) continue;
25856 if (extent && !member.intersects(extent, head)) continue;
25857 result[ids[i3]] = member;
25860 addParents(head.parentWays(entity), result);
25861 addParents(head.parentRelations(entity), result);
25864 function addParents(parents, result2) {
25865 for (var i4 = 0; i4 < parents.length; i4++) {
25866 var parent2 = parents[i4];
25867 if (parent2.id in result2) continue;
25868 result2[parent2.id] = parent2;
25869 addParents(head.parentRelations(parent2), result2);
25875 var import_fast_deep_equal3;
25876 var init_difference = __esm({
25877 "modules/core/difference.js"() {
25879 import_fast_deep_equal3 = __toESM(require_fast_deep_equal(), 1);
25885 // node_modules/quickselect/index.js
25886 function quickselect2(arr, k2, left = 0, right = arr.length - 1, compare2 = defaultCompare) {
25887 while (right > left) {
25888 if (right - left > 600) {
25889 const n3 = right - left + 1;
25890 const m3 = k2 - left + 1;
25891 const z3 = Math.log(n3);
25892 const s2 = 0.5 * Math.exp(2 * z3 / 3);
25893 const sd = 0.5 * Math.sqrt(z3 * s2 * (n3 - s2) / n3) * (m3 - n3 / 2 < 0 ? -1 : 1);
25894 const newLeft = Math.max(left, Math.floor(k2 - m3 * s2 / n3 + sd));
25895 const newRight = Math.min(right, Math.floor(k2 + (n3 - m3) * s2 / n3 + sd));
25896 quickselect2(arr, k2, newLeft, newRight, compare2);
25898 const t2 = arr[k2];
25901 swap2(arr, left, k2);
25902 if (compare2(arr[right], t2) > 0) swap2(arr, left, right);
25904 swap2(arr, i3, j3);
25907 while (compare2(arr[i3], t2) < 0) i3++;
25908 while (compare2(arr[j3], t2) > 0) j3--;
25910 if (compare2(arr[left], t2) === 0) swap2(arr, left, j3);
25913 swap2(arr, j3, right);
25915 if (j3 <= k2) left = j3 + 1;
25916 if (k2 <= j3) right = j3 - 1;
25919 function swap2(arr, i3, j3) {
25920 const tmp = arr[i3];
25924 function defaultCompare(a2, b3) {
25925 return a2 < b3 ? -1 : a2 > b3 ? 1 : 0;
25927 var init_quickselect2 = __esm({
25928 "node_modules/quickselect/index.js"() {
25932 // node_modules/rbush/index.js
25933 function findItem(item, items, equalsFn) {
25934 if (!equalsFn) return items.indexOf(item);
25935 for (let i3 = 0; i3 < items.length; i3++) {
25936 if (equalsFn(item, items[i3])) return i3;
25940 function calcBBox(node, toBBox) {
25941 distBBox(node, 0, node.children.length, toBBox, node);
25943 function distBBox(node, k2, p2, toBBox, destNode) {
25944 if (!destNode) destNode = createNode(null);
25945 destNode.minX = Infinity;
25946 destNode.minY = Infinity;
25947 destNode.maxX = -Infinity;
25948 destNode.maxY = -Infinity;
25949 for (let i3 = k2; i3 < p2; i3++) {
25950 const child = node.children[i3];
25951 extend2(destNode, node.leaf ? toBBox(child) : child);
25955 function extend2(a2, b3) {
25956 a2.minX = Math.min(a2.minX, b3.minX);
25957 a2.minY = Math.min(a2.minY, b3.minY);
25958 a2.maxX = Math.max(a2.maxX, b3.maxX);
25959 a2.maxY = Math.max(a2.maxY, b3.maxY);
25962 function compareNodeMinX(a2, b3) {
25963 return a2.minX - b3.minX;
25965 function compareNodeMinY(a2, b3) {
25966 return a2.minY - b3.minY;
25968 function bboxArea(a2) {
25969 return (a2.maxX - a2.minX) * (a2.maxY - a2.minY);
25971 function bboxMargin(a2) {
25972 return a2.maxX - a2.minX + (a2.maxY - a2.minY);
25974 function enlargedArea(a2, b3) {
25975 return (Math.max(b3.maxX, a2.maxX) - Math.min(b3.minX, a2.minX)) * (Math.max(b3.maxY, a2.maxY) - Math.min(b3.minY, a2.minY));
25977 function intersectionArea(a2, b3) {
25978 const minX = Math.max(a2.minX, b3.minX);
25979 const minY = Math.max(a2.minY, b3.minY);
25980 const maxX = Math.min(a2.maxX, b3.maxX);
25981 const maxY = Math.min(a2.maxY, b3.maxY);
25982 return Math.max(0, maxX - minX) * Math.max(0, maxY - minY);
25984 function contains(a2, b3) {
25985 return a2.minX <= b3.minX && a2.minY <= b3.minY && b3.maxX <= a2.maxX && b3.maxY <= a2.maxY;
25987 function intersects(a2, b3) {
25988 return b3.minX <= a2.maxX && b3.minY <= a2.maxY && b3.maxX >= a2.minX && b3.maxY >= a2.minY;
25990 function createNode(children2) {
25992 children: children2,
26001 function multiSelect(arr, left, right, n3, compare2) {
26002 const stack = [left, right];
26003 while (stack.length) {
26004 right = stack.pop();
26005 left = stack.pop();
26006 if (right - left <= n3) continue;
26007 const mid = left + Math.ceil((right - left) / n3 / 2) * n3;
26008 quickselect2(arr, mid, left, right, compare2);
26009 stack.push(left, mid, mid, right);
26013 var init_rbush = __esm({
26014 "node_modules/rbush/index.js"() {
26015 init_quickselect2();
26017 constructor(maxEntries = 9) {
26018 this._maxEntries = Math.max(4, maxEntries);
26019 this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));
26023 return this._all(this.data, []);
26026 let node = this.data;
26028 if (!intersects(bbox2, node)) return result;
26029 const toBBox = this.toBBox;
26030 const nodesToSearch = [];
26032 for (let i3 = 0; i3 < node.children.length; i3++) {
26033 const child = node.children[i3];
26034 const childBBox = node.leaf ? toBBox(child) : child;
26035 if (intersects(bbox2, childBBox)) {
26036 if (node.leaf) result.push(child);
26037 else if (contains(bbox2, childBBox)) this._all(child, result);
26038 else nodesToSearch.push(child);
26041 node = nodesToSearch.pop();
26046 let node = this.data;
26047 if (!intersects(bbox2, node)) return false;
26048 const nodesToSearch = [];
26050 for (let i3 = 0; i3 < node.children.length; i3++) {
26051 const child = node.children[i3];
26052 const childBBox = node.leaf ? this.toBBox(child) : child;
26053 if (intersects(bbox2, childBBox)) {
26054 if (node.leaf || contains(bbox2, childBBox)) return true;
26055 nodesToSearch.push(child);
26058 node = nodesToSearch.pop();
26063 if (!(data && data.length)) return this;
26064 if (data.length < this._minEntries) {
26065 for (let i3 = 0; i3 < data.length; i3++) {
26066 this.insert(data[i3]);
26070 let node = this._build(data.slice(), 0, data.length - 1, 0);
26071 if (!this.data.children.length) {
26073 } else if (this.data.height === node.height) {
26074 this._splitRoot(this.data, node);
26076 if (this.data.height < node.height) {
26077 const tmpNode = this.data;
26081 this._insert(node, this.data.height - node.height - 1, true);
26086 if (item) this._insert(item, this.data.height - 1);
26090 this.data = createNode([]);
26093 remove(item, equalsFn) {
26094 if (!item) return this;
26095 let node = this.data;
26096 const bbox2 = this.toBBox(item);
26098 const indexes = [];
26099 let i3, parent2, goingUp;
26100 while (node || path.length) {
26103 parent2 = path[path.length - 1];
26104 i3 = indexes.pop();
26108 const index = findItem(item, node.children, equalsFn);
26109 if (index !== -1) {
26110 node.children.splice(index, 1);
26112 this._condense(path);
26116 if (!goingUp && !node.leaf && contains(node, bbox2)) {
26121 node = node.children[0];
26122 } else if (parent2) {
26124 node = parent2.children[i3];
26126 } else node = null;
26133 compareMinX(a2, b3) {
26134 return a2.minX - b3.minX;
26136 compareMinY(a2, b3) {
26137 return a2.minY - b3.minY;
26146 _all(node, result) {
26147 const nodesToSearch = [];
26149 if (node.leaf) result.push(...node.children);
26150 else nodesToSearch.push(...node.children);
26151 node = nodesToSearch.pop();
26155 _build(items, left, right, height) {
26156 const N3 = right - left + 1;
26157 let M3 = this._maxEntries;
26160 node = createNode(items.slice(left, right + 1));
26161 calcBBox(node, this.toBBox);
26165 height = Math.ceil(Math.log(N3) / Math.log(M3));
26166 M3 = Math.ceil(N3 / Math.pow(M3, height - 1));
26168 node = createNode([]);
26170 node.height = height;
26171 const N22 = Math.ceil(N3 / M3);
26172 const N1 = N22 * Math.ceil(Math.sqrt(M3));
26173 multiSelect(items, left, right, N1, this.compareMinX);
26174 for (let i3 = left; i3 <= right; i3 += N1) {
26175 const right2 = Math.min(i3 + N1 - 1, right);
26176 multiSelect(items, i3, right2, N22, this.compareMinY);
26177 for (let j3 = i3; j3 <= right2; j3 += N22) {
26178 const right3 = Math.min(j3 + N22 - 1, right2);
26179 node.children.push(this._build(items, j3, right3, height - 1));
26182 calcBBox(node, this.toBBox);
26185 _chooseSubtree(bbox2, node, level, path) {
26188 if (node.leaf || path.length - 1 === level) break;
26189 let minArea = Infinity;
26190 let minEnlargement = Infinity;
26192 for (let i3 = 0; i3 < node.children.length; i3++) {
26193 const child = node.children[i3];
26194 const area = bboxArea(child);
26195 const enlargement = enlargedArea(bbox2, child) - area;
26196 if (enlargement < minEnlargement) {
26197 minEnlargement = enlargement;
26198 minArea = area < minArea ? area : minArea;
26199 targetNode = child;
26200 } else if (enlargement === minEnlargement) {
26201 if (area < minArea) {
26203 targetNode = child;
26207 node = targetNode || node.children[0];
26211 _insert(item, level, isNode) {
26212 const bbox2 = isNode ? item : this.toBBox(item);
26213 const insertPath = [];
26214 const node = this._chooseSubtree(bbox2, this.data, level, insertPath);
26215 node.children.push(item);
26216 extend2(node, bbox2);
26217 while (level >= 0) {
26218 if (insertPath[level].children.length > this._maxEntries) {
26219 this._split(insertPath, level);
26223 this._adjustParentBBoxes(bbox2, insertPath, level);
26225 // split overflowed node into two
26226 _split(insertPath, level) {
26227 const node = insertPath[level];
26228 const M3 = node.children.length;
26229 const m3 = this._minEntries;
26230 this._chooseSplitAxis(node, m3, M3);
26231 const splitIndex = this._chooseSplitIndex(node, m3, M3);
26232 const newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));
26233 newNode.height = node.height;
26234 newNode.leaf = node.leaf;
26235 calcBBox(node, this.toBBox);
26236 calcBBox(newNode, this.toBBox);
26237 if (level) insertPath[level - 1].children.push(newNode);
26238 else this._splitRoot(node, newNode);
26240 _splitRoot(node, newNode) {
26241 this.data = createNode([node, newNode]);
26242 this.data.height = node.height + 1;
26243 this.data.leaf = false;
26244 calcBBox(this.data, this.toBBox);
26246 _chooseSplitIndex(node, m3, M3) {
26248 let minOverlap = Infinity;
26249 let minArea = Infinity;
26250 for (let i3 = m3; i3 <= M3 - m3; i3++) {
26251 const bbox1 = distBBox(node, 0, i3, this.toBBox);
26252 const bbox2 = distBBox(node, i3, M3, this.toBBox);
26253 const overlap = intersectionArea(bbox1, bbox2);
26254 const area = bboxArea(bbox1) + bboxArea(bbox2);
26255 if (overlap < minOverlap) {
26256 minOverlap = overlap;
26258 minArea = area < minArea ? area : minArea;
26259 } else if (overlap === minOverlap) {
26260 if (area < minArea) {
26266 return index || M3 - m3;
26268 // sorts node children by the best axis for split
26269 _chooseSplitAxis(node, m3, M3) {
26270 const compareMinX = node.leaf ? this.compareMinX : compareNodeMinX;
26271 const compareMinY = node.leaf ? this.compareMinY : compareNodeMinY;
26272 const xMargin = this._allDistMargin(node, m3, M3, compareMinX);
26273 const yMargin = this._allDistMargin(node, m3, M3, compareMinY);
26274 if (xMargin < yMargin) node.children.sort(compareMinX);
26276 // total margin of all possible split distributions where each node is at least m full
26277 _allDistMargin(node, m3, M3, compare2) {
26278 node.children.sort(compare2);
26279 const toBBox = this.toBBox;
26280 const leftBBox = distBBox(node, 0, m3, toBBox);
26281 const rightBBox = distBBox(node, M3 - m3, M3, toBBox);
26282 let margin = bboxMargin(leftBBox) + bboxMargin(rightBBox);
26283 for (let i3 = m3; i3 < M3 - m3; i3++) {
26284 const child = node.children[i3];
26285 extend2(leftBBox, node.leaf ? toBBox(child) : child);
26286 margin += bboxMargin(leftBBox);
26288 for (let i3 = M3 - m3 - 1; i3 >= m3; i3--) {
26289 const child = node.children[i3];
26290 extend2(rightBBox, node.leaf ? toBBox(child) : child);
26291 margin += bboxMargin(rightBBox);
26295 _adjustParentBBoxes(bbox2, path, level) {
26296 for (let i3 = level; i3 >= 0; i3--) {
26297 extend2(path[i3], bbox2);
26301 for (let i3 = path.length - 1, siblings; i3 >= 0; i3--) {
26302 if (path[i3].children.length === 0) {
26304 siblings = path[i3 - 1].children;
26305 siblings.splice(siblings.indexOf(path[i3]), 1);
26306 } else this.clear();
26307 } else calcBBox(path[i3], this.toBBox);
26314 // modules/core/tree.js
26315 var tree_exports = {};
26316 __export(tree_exports, {
26317 coreTree: () => coreTree
26319 function coreTree(head) {
26320 var _rtree = new RBush();
26322 var _segmentsRTree = new RBush();
26323 var _segmentsBBoxes = {};
26324 var _segmentsByWayId = {};
26326 function entityBBox(entity) {
26327 var bbox2 = entity.extent(head).bbox();
26328 bbox2.id = entity.id;
26329 _bboxes[entity.id] = bbox2;
26332 function segmentBBox(segment) {
26333 var extent = segment.extent(head);
26334 if (!extent) return null;
26335 var bbox2 = extent.bbox();
26336 bbox2.segment = segment;
26337 _segmentsBBoxes[segment.id] = bbox2;
26340 function removeEntity(entity) {
26341 _rtree.remove(_bboxes[entity.id]);
26342 delete _bboxes[entity.id];
26343 if (_segmentsByWayId[entity.id]) {
26344 _segmentsByWayId[entity.id].forEach(function(segment) {
26345 _segmentsRTree.remove(_segmentsBBoxes[segment.id]);
26346 delete _segmentsBBoxes[segment.id];
26348 delete _segmentsByWayId[entity.id];
26351 function loadEntities(entities) {
26352 _rtree.load(entities.map(entityBBox));
26354 entities.forEach(function(entity) {
26355 if (entity.segments) {
26356 var entitySegments = entity.segments(head);
26357 _segmentsByWayId[entity.id] = entitySegments;
26358 segments = segments.concat(entitySegments);
26361 if (segments.length) _segmentsRTree.load(segments.map(segmentBBox).filter(Boolean));
26363 function updateParents(entity, insertions, memo) {
26364 head.parentWays(entity).forEach(function(way) {
26365 if (_bboxes[way.id]) {
26367 insertions[way.id] = way;
26369 updateParents(way, insertions, memo);
26371 head.parentRelations(entity).forEach(function(relation) {
26372 if (memo[relation.id]) return;
26373 memo[relation.id] = true;
26374 if (_bboxes[relation.id]) {
26375 removeEntity(relation);
26376 insertions[relation.id] = relation;
26378 updateParents(relation, insertions, memo);
26381 tree.rebase = function(entities, force) {
26382 var insertions = {};
26383 for (var i3 = 0; i3 < entities.length; i3++) {
26384 var entity = entities[i3];
26385 if (!entity.visible) continue;
26386 if (head.entities.hasOwnProperty(entity.id) || _bboxes[entity.id]) {
26389 } else if (_bboxes[entity.id]) {
26390 removeEntity(entity);
26393 insertions[entity.id] = entity;
26394 updateParents(entity, insertions, {});
26396 loadEntities(Object.values(insertions));
26399 function updateToGraph(graph) {
26400 if (graph === head) return;
26401 var diff = coreDifference(head, graph);
26403 var changed = diff.didChange;
26404 if (!changed.addition && !changed.deletion && !changed.geometry) return;
26405 var insertions = {};
26406 if (changed.deletion) {
26407 diff.deleted().forEach(function(entity) {
26408 removeEntity(entity);
26411 if (changed.geometry) {
26412 diff.modified().forEach(function(entity) {
26413 removeEntity(entity);
26414 insertions[entity.id] = entity;
26415 updateParents(entity, insertions, {});
26418 if (changed.addition) {
26419 diff.created().forEach(function(entity) {
26420 insertions[entity.id] = entity;
26423 loadEntities(Object.values(insertions));
26425 tree.intersects = function(extent, graph) {
26426 updateToGraph(graph);
26427 return _rtree.search(extent.bbox()).map(function(bbox2) {
26428 return graph.entity(bbox2.id);
26431 tree.waySegments = function(extent, graph) {
26432 updateToGraph(graph);
26433 return _segmentsRTree.search(extent.bbox()).map(function(bbox2) {
26434 return bbox2.segment;
26439 var init_tree = __esm({
26440 "modules/core/tree.js"() {
26447 // modules/svg/icon.js
26448 var icon_exports = {};
26449 __export(icon_exports, {
26450 svgIcon: () => svgIcon
26452 function svgIcon(name, svgklass, useklass) {
26453 return function drawIcon(selection2) {
26454 selection2.selectAll("svg.icon" + (svgklass ? "." + svgklass.split(" ")[0] : "")).data([0]).enter().append("svg").attr("class", "icon " + (svgklass || "")).append("use").attr("xlink:href", name).attr("class", useklass);
26457 var init_icon = __esm({
26458 "modules/svg/icon.js"() {
26463 // modules/ui/modal.js
26464 var modal_exports = {};
26465 __export(modal_exports, {
26466 uiModal: () => uiModal
26468 function uiModal(selection2, blocking) {
26469 let keybinding = utilKeybinding("modal");
26470 let previous = selection2.select("div.modal");
26471 let animate = previous.empty();
26472 previous.transition().duration(200).style("opacity", 0).remove();
26473 let shaded = selection2.append("div").attr("class", "shaded").style("opacity", 0);
26474 shaded.close = () => {
26475 shaded.transition().duration(200).style("opacity", 0).remove();
26476 modal.transition().duration(200).style("top", "0px");
26477 select_default2(document).call(keybinding.unbind);
26479 let modal = shaded.append("div").attr("class", "modal fillL");
26480 modal.append("input").attr("class", "keytrap keytrap-first").on("focus.keytrap", moveFocusToLast);
26482 shaded.on("click.remove-modal", (d3_event) => {
26483 if (d3_event.target === this) {
26487 modal.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", shaded.close).call(svgIcon("#iD-icon-close"));
26488 keybinding.on("\u232B", shaded.close).on("\u238B", shaded.close);
26489 select_default2(document).call(keybinding);
26491 modal.append("div").attr("class", "content");
26492 modal.append("input").attr("class", "keytrap keytrap-last").on("focus.keytrap", moveFocusToFirst);
26494 shaded.transition().style("opacity", 1);
26496 shaded.style("opacity", 1);
26499 function moveFocusToFirst() {
26500 let node = modal.select("a, button, input:not(.keytrap), select, textarea").node();
26504 select_default2(this).node().blur();
26507 function moveFocusToLast() {
26508 let nodes = modal.selectAll("a, button, input:not(.keytrap), select, textarea").nodes();
26509 if (nodes.length) {
26510 nodes[nodes.length - 1].focus();
26512 select_default2(this).node().blur();
26516 var init_modal = __esm({
26517 "modules/ui/modal.js"() {
26526 // modules/ui/loading.js
26527 var loading_exports = {};
26528 __export(loading_exports, {
26529 uiLoading: () => uiLoading
26531 function uiLoading(context) {
26532 let _modalSelection = select_default2(null);
26534 let _blocking = false;
26535 let loading = (selection2) => {
26536 _modalSelection = uiModal(selection2, _blocking);
26537 let loadertext = _modalSelection.select(".content").classed("loading-modal", true).append("div").attr("class", "modal-section fillL");
26538 loadertext.append("img").attr("class", "loader").attr("src", context.imagePath("loader-white.gif"));
26539 loadertext.append("h3").html(_message);
26540 _modalSelection.select("button.close").attr("class", "hide");
26543 loading.message = function(val) {
26544 if (!arguments.length) return _message;
26548 loading.blocking = function(val) {
26549 if (!arguments.length) return _blocking;
26553 loading.close = () => {
26554 _modalSelection.remove();
26556 loading.isShown = () => {
26557 return _modalSelection && !_modalSelection.empty() && _modalSelection.node().parentNode;
26561 var init_loading = __esm({
26562 "modules/ui/loading.js"() {
26569 // modules/core/history.js
26570 var history_exports = {};
26571 __export(history_exports, {
26572 coreHistory: () => coreHistory
26574 function coreHistory(context) {
26575 var dispatch14 = dispatch_default("reset", "change", "merge", "restore", "undone", "redone", "storage_error");
26576 var lock = utilSessionMutex("lock");
26577 var _hasUnresolvedRestorableChanges = lock.lock() && !!corePreferences(getKey("saved_history"));
26578 var duration = 150;
26579 var _imageryUsed = [];
26580 var _photoOverlaysUsed = [];
26581 var _checkpoints = {};
26586 function _act(actions, t2) {
26587 actions = Array.prototype.slice.call(actions);
26589 if (typeof actions[actions.length - 1] !== "function") {
26590 annotation = actions.pop();
26592 var graph = _stack[_index].graph;
26593 for (var i3 = 0; i3 < actions.length; i3++) {
26594 graph = actions[i3](graph, t2);
26599 imageryUsed: _imageryUsed,
26600 photoOverlaysUsed: _photoOverlaysUsed,
26601 transform: context.projection.transform(),
26602 selectedIDs: context.selectedIDs()
26605 function _perform(args, t2) {
26606 var previous = _stack[_index].graph;
26607 _stack = _stack.slice(0, _index + 1);
26608 var actionResult = _act(args, t2);
26609 _stack.push(actionResult);
26611 return change(previous);
26613 function _replace(args, t2) {
26614 var previous = _stack[_index].graph;
26615 var actionResult = _act(args, t2);
26616 _stack[_index] = actionResult;
26617 return change(previous);
26619 function _overwrite(args, t2) {
26620 var previous = _stack[_index].graph;
26625 _stack = _stack.slice(0, _index + 1);
26626 var actionResult = _act(args, t2);
26627 _stack.push(actionResult);
26629 return change(previous);
26631 function change(previous) {
26632 var difference2 = coreDifference(previous, history.graph());
26633 if (!_pausedGraph) {
26634 dispatch14.call("change", this, difference2);
26636 return difference2;
26638 function getKey(n3) {
26639 return "iD_" + window.location.origin + "_" + n3;
26642 graph: function() {
26643 return _stack[_index].graph;
26649 return _stack[0].graph;
26651 merge: function(entities) {
26652 var stack = _stack.map(function(state) {
26653 return state.graph;
26655 _stack[0].graph.rebase(entities, stack, false);
26656 _tree.rebase(entities, false);
26657 dispatch14.call("merge", this, entities);
26659 perform: function() {
26660 select_default2(document).interrupt("history.perform");
26661 var transitionable = false;
26662 var action0 = arguments[0];
26663 if (arguments.length === 1 || arguments.length === 2 && typeof arguments[1] !== "function") {
26664 transitionable = !!action0.transitionable;
26666 if (transitionable) {
26667 var origArguments = arguments;
26668 return new Promise((resolve) => {
26669 select_default2(document).transition("history.perform").duration(duration).ease(linear2).tween("history.tween", function() {
26670 return function(t2) {
26671 if (t2 < 1) _overwrite([action0], t2);
26673 }).on("start", function() {
26674 resolve(_perform([action0], 0));
26675 }).on("end interrupt", function() {
26676 resolve(_overwrite(origArguments, 1));
26680 return _perform(arguments);
26683 replace: function() {
26684 select_default2(document).interrupt("history.perform");
26685 return _replace(arguments);
26687 pop: function(n3) {
26688 select_default2(document).interrupt("history.perform");
26689 var previous = _stack[_index].graph;
26690 if (isNaN(+n3) || +n3 < 0) {
26693 while (n3-- > 0 && _index > 0) {
26697 return change(previous);
26699 // Back to the previous annotated state or _index = 0.
26701 select_default2(document).interrupt("history.perform");
26702 var previousStack = _stack[_index];
26703 var previous = previousStack.graph;
26704 while (_index > 0) {
26706 if (_stack[_index].annotation) break;
26708 dispatch14.call("undone", this, _stack[_index], previousStack);
26709 return change(previous);
26711 // Forward to the next annotated state.
26713 select_default2(document).interrupt("history.perform");
26714 var previousStack = _stack[_index];
26715 var previous = previousStack.graph;
26716 var tryIndex = _index;
26717 while (tryIndex < _stack.length - 1) {
26719 if (_stack[tryIndex].annotation) {
26721 dispatch14.call("redone", this, _stack[_index], previousStack);
26725 return change(previous);
26727 pauseChangeDispatch: function() {
26728 if (!_pausedGraph) {
26729 _pausedGraph = _stack[_index].graph;
26732 resumeChangeDispatch: function() {
26733 if (_pausedGraph) {
26734 var previous = _pausedGraph;
26735 _pausedGraph = null;
26736 return change(previous);
26739 undoAnnotation: function() {
26742 if (_stack[i3].annotation) return _stack[i3].annotation;
26746 redoAnnotation: function() {
26747 var i3 = _index + 1;
26748 while (i3 <= _stack.length - 1) {
26749 if (_stack[i3].annotation) return _stack[i3].annotation;
26753 // Returns the entities from the active graph with bounding boxes
26754 // overlapping the given `extent`.
26755 intersects: function(extent) {
26756 return _tree.intersects(extent, _stack[_index].graph);
26758 difference: function() {
26759 var base = _stack[0].graph;
26760 var head = _stack[_index].graph;
26761 return coreDifference(base, head);
26763 changes: function(action) {
26764 var base = _stack[0].graph;
26765 var head = _stack[_index].graph;
26767 head = action(head);
26769 var difference2 = coreDifference(base, head);
26771 modified: difference2.modified(),
26772 created: difference2.created(),
26773 deleted: difference2.deleted()
26776 hasChanges: function() {
26777 return this.difference().length() > 0;
26779 imageryUsed: function(sources) {
26781 _imageryUsed = sources;
26784 var s2 = /* @__PURE__ */ new Set();
26785 _stack.slice(1, _index + 1).forEach(function(state) {
26786 state.imageryUsed.forEach(function(source) {
26787 if (source !== "Custom") {
26792 return Array.from(s2);
26795 photoOverlaysUsed: function(sources) {
26797 _photoOverlaysUsed = sources;
26800 var s2 = /* @__PURE__ */ new Set();
26801 _stack.slice(1, _index + 1).forEach(function(state) {
26802 if (state.photoOverlaysUsed && Array.isArray(state.photoOverlaysUsed)) {
26803 state.photoOverlaysUsed.forEach(function(photoOverlay) {
26804 s2.add(photoOverlay);
26808 return Array.from(s2);
26811 // save the current history state
26812 checkpoint: function(key) {
26813 _checkpoints[key] = {
26819 // restore history state to a given checkpoint or reset completely
26820 reset: function(key) {
26821 if (key !== void 0 && _checkpoints.hasOwnProperty(key)) {
26822 _stack = _checkpoints[key].stack;
26823 _index = _checkpoints[key].index;
26825 _stack = [{ graph: coreGraph() }];
26827 _tree = coreTree(_stack[0].graph);
26830 dispatch14.call("reset");
26831 dispatch14.call("change");
26834 // `toIntroGraph()` is used to export the intro graph used by the walkthrough.
26837 // 1. Start the walkthrough.
26838 // 2. Get to a "free editing" tutorial step
26839 // 3. Make your edits to the walkthrough map
26840 // 4. In your browser dev console run:
26841 // `id.history().toIntroGraph()`
26842 // 5. This outputs stringified JSON to the browser console
26843 // 6. Copy it to `data/intro_graph.json` and prettify it in your code editor
26844 toIntroGraph: function() {
26845 var nextID = { n: 0, r: 0, w: 0 };
26847 var graph = this.graph();
26848 var baseEntities = {};
26849 Object.values(graph.base().entities).forEach(function(entity) {
26850 var copy2 = copyIntroEntity(entity);
26851 baseEntities[copy2.id] = copy2;
26853 Object.keys(graph.entities).forEach(function(id2) {
26854 var entity = graph.entities[id2];
26856 var copy2 = copyIntroEntity(entity);
26857 baseEntities[copy2.id] = copy2;
26859 delete baseEntities[id2];
26862 Object.values(baseEntities).forEach(function(entity) {
26863 if (Array.isArray(entity.nodes)) {
26864 entity.nodes = entity.nodes.map(function(node) {
26865 return permIDs[node] || node;
26868 if (Array.isArray(entity.members)) {
26869 entity.members = entity.members.map(function(member) {
26870 member.id = permIDs[member.id] || member.id;
26875 return JSON.stringify({ dataIntroGraph: baseEntities });
26876 function copyIntroEntity(source) {
26877 var copy2 = utilObjectOmit(source, ["type", "user", "v", "version", "visible"]);
26878 if (copy2.tags && !Object.keys(copy2.tags)) {
26881 if (Array.isArray(copy2.loc)) {
26882 copy2.loc[0] = +copy2.loc[0].toFixed(6);
26883 copy2.loc[1] = +copy2.loc[1].toFixed(6);
26885 var match = source.id.match(/([nrw])-\d*/);
26886 if (match !== null) {
26887 var nrw = match[1];
26890 permID = nrw + ++nextID[nrw];
26891 } while (baseEntities.hasOwnProperty(permID));
26892 copy2.id = permIDs[source.id] = permID;
26897 toJSON: function() {
26898 if (!this.hasChanges()) return;
26899 var allEntities = {};
26900 var baseEntities = {};
26901 var base = _stack[0];
26902 var s2 = _stack.map(function(i3) {
26905 Object.keys(i3.graph.entities).forEach(function(id2) {
26906 var entity = i3.graph.entities[id2];
26908 var key = osmEntity.key(entity);
26909 allEntities[key] = entity;
26910 modified.push(key);
26914 if (id2 in base.graph.entities) {
26915 baseEntities[id2] = base.graph.entities[id2];
26917 if (entity && entity.nodes) {
26918 entity.nodes.forEach(function(nodeID) {
26919 if (nodeID in base.graph.entities) {
26920 baseEntities[nodeID] = base.graph.entities[nodeID];
26924 var baseParents = base.graph._parentWays[id2];
26926 baseParents.forEach(function(parentID) {
26927 if (parentID in base.graph.entities) {
26928 baseEntities[parentID] = base.graph.entities[parentID];
26934 if (modified.length) x2.modified = modified;
26935 if (deleted.length) x2.deleted = deleted;
26936 if (i3.imageryUsed) x2.imageryUsed = i3.imageryUsed;
26937 if (i3.photoOverlaysUsed) x2.photoOverlaysUsed = i3.photoOverlaysUsed;
26938 if (i3.annotation) x2.annotation = i3.annotation;
26939 if (i3.transform) x2.transform = i3.transform;
26940 if (i3.selectedIDs) x2.selectedIDs = i3.selectedIDs;
26943 return JSON.stringify({
26945 entities: Object.values(allEntities),
26946 baseEntities: Object.values(baseEntities),
26948 nextIDs: osmEntity.id.next,
26950 // note the time the changes were saved
26951 timestamp: (/* @__PURE__ */ new Date()).getTime()
26954 fromJSON: function(json, loadChildNodes) {
26955 var h3 = JSON.parse(json);
26956 var loadComplete = true;
26957 osmEntity.id.next = h3.nextIDs;
26959 if (h3.version === 2 || h3.version === 3) {
26960 var allEntities = {};
26961 h3.entities.forEach(function(entity) {
26962 allEntities[osmEntity.key(entity)] = osmEntity(entity);
26964 if (h3.version === 3) {
26965 var baseEntities = h3.baseEntities.map(function(d4) {
26966 return osmEntity(d4);
26968 var stack = _stack.map(function(state) {
26969 return state.graph;
26971 _stack[0].graph.rebase(baseEntities, stack, true);
26972 _tree.rebase(baseEntities, true);
26973 if (loadChildNodes) {
26974 var osm = context.connection();
26975 var baseWays = baseEntities.filter(function(e3) {
26976 return e3.type === "way";
26978 var nodeIDs = baseWays.reduce(function(acc, way) {
26979 return utilArrayUnion(acc, way.nodes);
26981 var missing = nodeIDs.filter(function(n3) {
26982 return !_stack[0].graph.hasEntity(n3);
26984 if (missing.length && osm) {
26985 loadComplete = false;
26986 context.map().redrawEnable(false);
26987 var loading = uiLoading(context).blocking(true);
26988 context.container().call(loading);
26989 var childNodesLoaded = function(err, result) {
26991 var visibleGroups = utilArrayGroupBy(result.data, "visible");
26992 var visibles = visibleGroups.true || [];
26993 var invisibles = visibleGroups.false || [];
26994 if (visibles.length) {
26995 var visibleIDs = visibles.map(function(entity) {
26998 var stack2 = _stack.map(function(state) {
26999 return state.graph;
27001 missing = utilArrayDifference(missing, visibleIDs);
27002 _stack[0].graph.rebase(visibles, stack2, true);
27003 _tree.rebase(visibles, true);
27005 invisibles.forEach(function(entity) {
27006 osm.loadEntityVersion(entity.id, +entity.version - 1, childNodesLoaded);
27009 if (err || !missing.length) {
27011 context.map().redrawEnable(true);
27012 dispatch14.call("change");
27013 dispatch14.call("restore", this);
27016 osm.loadMultiple(missing, childNodesLoaded);
27020 _stack = h3.stack.map(function(d4) {
27021 var entities = {}, entity;
27023 d4.modified.forEach(function(key) {
27024 entity = allEntities[key];
27025 entities[entity.id] = entity;
27029 d4.deleted.forEach(function(id2) {
27030 entities[id2] = void 0;
27034 graph: coreGraph(_stack[0].graph).load(entities),
27035 annotation: d4.annotation,
27036 imageryUsed: d4.imageryUsed,
27037 photoOverlaysUsed: d4.photoOverlaysUsed,
27038 transform: d4.transform,
27039 selectedIDs: d4.selectedIDs
27043 _stack = h3.stack.map(function(d4) {
27045 for (var i3 in d4.entities) {
27046 var entity = d4.entities[i3];
27047 entities[i3] = entity === "undefined" ? void 0 : osmEntity(entity);
27049 d4.graph = coreGraph(_stack[0].graph).load(entities);
27053 var transform2 = _stack[_index].transform;
27055 context.map().transformEase(transform2, 0);
27057 if (loadComplete) {
27058 dispatch14.call("change");
27059 dispatch14.call("restore", this);
27064 return lock.lock();
27066 unlock: function() {
27070 if (lock.locked() && // don't overwrite existing, unresolved changes
27071 !_hasUnresolvedRestorableChanges) {
27072 const success = corePreferences(getKey("saved_history"), history.toJSON() || null);
27073 if (!success) dispatch14.call("storage_error");
27077 // delete the history version saved in localStorage
27078 clearSaved: function() {
27079 context.debouncedSave.cancel();
27080 if (lock.locked()) {
27081 _hasUnresolvedRestorableChanges = false;
27082 corePreferences(getKey("saved_history"), null);
27083 corePreferences("comment", null);
27084 corePreferences("hashtags", null);
27085 corePreferences("source", null);
27089 savedHistoryJSON: function() {
27090 return corePreferences(getKey("saved_history"));
27092 hasRestorableChanges: function() {
27093 return _hasUnresolvedRestorableChanges;
27095 // load history from a version stored in localStorage
27096 restore: function() {
27097 if (lock.locked()) {
27098 _hasUnresolvedRestorableChanges = false;
27099 var json = this.savedHistoryJSON();
27100 if (json) history.fromJSON(json, true);
27106 return utilRebind(history, dispatch14, "on");
27108 var init_history = __esm({
27109 "modules/core/history.js"() {
27114 init_preferences();
27124 // modules/util/utilDisplayLabel.js
27125 var utilDisplayLabel_exports = {};
27126 __export(utilDisplayLabel_exports, {
27127 utilDisplayLabel: () => utilDisplayLabel
27129 function utilDisplayLabel(entity, graphOrGeometry, verbose) {
27131 var displayName = utilDisplayName(entity);
27132 var preset = typeof graphOrGeometry === "string" ? _mainPresetIndex.matchTags(entity.tags, graphOrGeometry) : _mainPresetIndex.match(entity, graphOrGeometry);
27133 var presetName = preset && (preset.suggestion ? preset.subtitle() : preset.name());
27135 result = [presetName, displayName].filter(Boolean).join(" ");
27137 result = displayName || presetName;
27139 return result || utilDisplayType(entity.id);
27141 var init_utilDisplayLabel = __esm({
27142 "modules/util/utilDisplayLabel.js"() {
27149 // modules/core/validation/models.js
27150 var models_exports = {};
27151 __export(models_exports, {
27152 validationIssue: () => validationIssue,
27153 validationIssueFix: () => validationIssueFix
27155 function validationIssue(attrs) {
27156 this.type = attrs.type;
27157 this.subtype = attrs.subtype;
27158 this.severity = attrs.severity;
27159 this.message = attrs.message;
27160 this.reference = attrs.reference;
27161 this.entityIds = attrs.entityIds;
27162 this.loc = attrs.loc;
27163 this.data = attrs.data;
27164 this.dynamicFixes = attrs.dynamicFixes;
27165 this.hash = attrs.hash;
27166 this.extent = attrs.extent;
27167 this.id = generateID.apply(this);
27168 this.key = generateKey.apply(this);
27169 this.autoFix = null;
27170 function generateID() {
27171 var parts = [this.type];
27173 parts.push(this.hash);
27175 if (this.subtype) {
27176 parts.push(this.subtype);
27178 if (this.entityIds) {
27179 var entityKeys = this.entityIds.slice().sort();
27180 parts.push.apply(parts, entityKeys);
27182 return parts.join(":");
27184 function generateKey() {
27185 return this.id + ":" + Date.now().toString();
27187 this.extent = this.extent || function(resolver) {
27189 return geoExtent(this.loc);
27191 if (this.entityIds && this.entityIds.length) {
27192 return this.entityIds.reduce(function(extent, entityId) {
27193 return extent.extend(resolver.entity(entityId).extent(resolver));
27198 this.fixes = function(context) {
27199 var fixes = this.dynamicFixes ? this.dynamicFixes(context) : [];
27201 if (issue.severity === "warning" || issue.severity === "suggestion") {
27202 fixes.push(new validationIssueFix({
27203 title: _t.append("issues.fix.ignore_issue.title"),
27204 icon: "iD-icon-close",
27205 onClick: function() {
27206 context.validator().ignoreIssue(this.issue.id);
27210 fixes.forEach(function(fix) {
27211 fix.id = fix.title.stringId;
27213 if (fix.autoArgs) {
27214 issue.autoFix = fix;
27220 function validationIssueFix(attrs) {
27221 this.title = attrs.title;
27222 this.onClick = attrs.onClick;
27223 this.disabledReason = attrs.disabledReason;
27224 this.icon = attrs.icon;
27225 this.entityIds = attrs.entityIds || [];
27226 this.autoArgs = attrs.autoArgs;
27229 var init_models = __esm({
27230 "modules/core/validation/models.js"() {
27234 validationIssue.ICONS = {
27235 suggestion: "#iD-icon-info",
27236 warning: "#iD-icon-alert",
27237 error: "#iD-icon-error"
27242 // modules/core/validation/index.js
27243 var validation_exports = {};
27244 __export(validation_exports, {
27245 validationIssue: () => validationIssue,
27246 validationIssueFix: () => validationIssueFix
27248 var init_validation = __esm({
27249 "modules/core/validation/index.js"() {
27255 // modules/services/keepRight.js
27256 var keepRight_exports = {};
27257 __export(keepRight_exports, {
27258 default: () => keepRight_default
27260 function abortRequest(controller) {
27262 controller.abort();
27265 function abortUnwantedRequests(cache, tiles) {
27266 Object.keys(cache.inflightTile).forEach((k2) => {
27267 const wanted = tiles.find((tile) => k2 === tile.id);
27269 abortRequest(cache.inflightTile[k2]);
27270 delete cache.inflightTile[k2];
27274 function encodeIssueRtree(d4) {
27275 return { minX: d4.loc[0], minY: d4.loc[1], maxX: d4.loc[0], maxY: d4.loc[1], data: d4 };
27277 function updateRtree(item, replace) {
27278 _cache.rtree.remove(item, (a2, b3) => a2.data.id === b3.data.id);
27280 _cache.rtree.insert(item);
27283 function tokenReplacements(d4) {
27284 if (!(d4 instanceof QAItem)) return;
27285 const replacements = {};
27286 const issueTemplate = _krData.errorTypes[d4.whichType];
27287 if (!issueTemplate) {
27288 console.log("No Template: ", d4.whichType);
27289 console.log(" ", d4.description);
27292 if (!issueTemplate.regex) return;
27293 const errorRegex = new RegExp(issueTemplate.regex, "i");
27294 const errorMatch = errorRegex.exec(d4.description);
27296 console.log("Unmatched: ", d4.whichType);
27297 console.log(" ", d4.description);
27298 console.log(" ", errorRegex);
27301 for (let i3 = 1; i3 < errorMatch.length; i3++) {
27302 let capture = errorMatch[i3];
27304 idType = "IDs" in issueTemplate ? issueTemplate.IDs[i3 - 1] : "";
27305 if (idType && capture) {
27306 capture = parseError(capture, idType);
27308 const compare2 = capture.toLowerCase();
27309 if (_krData.localizeStrings[compare2]) {
27310 capture = _t("QA.keepRight.error_parts." + _krData.localizeStrings[compare2]);
27312 capture = unescape_default(capture);
27315 replacements["var" + i3] = capture;
27317 return replacements;
27319 function parseError(capture, idType) {
27320 const compare2 = capture.toLowerCase();
27321 if (_krData.localizeStrings[compare2]) {
27322 capture = _t("QA.keepRight.error_parts." + _krData.localizeStrings[compare2]);
27325 // link a string like "this node"
27327 capture = linkErrorObject(capture);
27330 capture = linkURL(capture);
27332 // link an entity ID
27336 capture = linkEntity(idType + capture);
27338 // some errors have more complex ID lists/variance
27340 capture = parse20(capture);
27343 capture = parse211(capture);
27346 capture = parse231(capture);
27349 capture = parse294(capture);
27352 capture = parse370(capture);
27356 function linkErrorObject(d4) {
27357 return { html: `<a class="error_object_link">${d4}</a>` };
27359 function linkEntity(d4) {
27360 return { html: `<a class="error_entity_link">${d4}</a>` };
27362 function linkURL(d4) {
27363 return { html: `<a class="kr_external_link" target="_blank" href="${d4}">${d4}</a>` };
27365 function parse211(capture2) {
27367 const items = capture2.split(", ");
27368 items.forEach((item) => {
27369 let id2 = linkEntity("n" + item.slice(1));
27372 return newList.join(", ");
27374 function parse231(capture2) {
27376 const items = capture2.split("),");
27377 items.forEach((item) => {
27378 const match = item.match(/\#(\d+)\((.+)\)?/);
27379 if (match !== null && match.length > 2) {
27381 linkEntity("w" + match[1]) + " " + _t("QA.keepRight.errorTypes.231.layer", { layer: match[2] })
27385 return newList.join(", ");
27387 function parse294(capture2) {
27389 const items = capture2.split(",");
27390 items.forEach((item) => {
27391 item = item.split(" ");
27392 const role = `"${item[0]}"`;
27393 const idType2 = item[1].slice(0, 1);
27394 let id2 = item[2].slice(1);
27395 id2 = linkEntity(idType2 + id2);
27396 newList.push(`${role} ${item[1]} ${id2}`);
27398 return newList.join(", ");
27400 function parse370(capture2) {
27401 if (!capture2) return "";
27402 const match = capture2.match(/\(including the name (\'.+\')\)/);
27403 if (match && match.length) {
27404 return _t("QA.keepRight.errorTypes.370.including_the_name", { name: match[1] });
27408 function parse20(capture2) {
27410 const items = capture2.split(",");
27411 items.forEach((item) => {
27412 const id2 = linkEntity("n" + item.slice(1));
27415 return newList.join(", ");
27418 var tiler, dispatch2, _tileZoom, _krUrlRoot, _krData, _cache, _krRuleset, keepRight_default;
27419 var init_keepRight = __esm({
27420 "modules/services/keepRight.js"() {
27426 init_file_fetcher();
27431 tiler = utilTiler();
27432 dispatch2 = dispatch_default("loaded");
27434 _krUrlRoot = "https://www.keepright.at";
27435 _krData = { errorTypes: {}, localizeStrings: {} };
27437 // no 20 - multiple node on same spot - these are mostly boundaries overlapping roads
27510 keepRight_default = {
27511 title: "keepRight",
27513 _mainFileFetcher.get("keepRight").then((d4) => _krData = d4);
27517 this.event = utilRebind(this, dispatch2, "on");
27521 Object.values(_cache.inflightTile).forEach(abortRequest);
27532 // KeepRight API: http://osm.mueschelsoft.de/keepright/interfacing.php
27533 loadIssues(projection2) {
27538 const tiles = tiler.zoomExtent([_tileZoom, _tileZoom]).getTiles(projection2);
27539 abortUnwantedRequests(_cache, tiles);
27540 tiles.forEach((tile) => {
27541 if (_cache.loadedTile[tile.id] || _cache.inflightTile[tile.id]) return;
27542 const [left, top, right, bottom] = tile.extent.rectangle();
27543 const params = Object.assign({}, options, { left, bottom, right, top });
27544 const url = `${_krUrlRoot}/export.php?` + utilQsString(params);
27545 const controller = new AbortController();
27546 _cache.inflightTile[tile.id] = controller;
27547 json_default(url, { signal: controller.signal }).then((data) => {
27548 delete _cache.inflightTile[tile.id];
27549 _cache.loadedTile[tile.id] = true;
27550 if (!data || !data.features || !data.features.length) {
27551 throw new Error("No Data");
27553 data.features.forEach((feature3) => {
27556 error_type: itemType,
27559 object_id: objectId,
27560 object_type: objectType,
27566 geometry: { coordinates: loc },
27567 properties: { description = "" }
27569 const issueTemplate = _krData.errorTypes[itemType];
27570 const parentIssueType = (Math.floor(itemType / 10) * 10).toString();
27571 const whichType = issueTemplate ? itemType : parentIssueType;
27572 const whichTemplate = _krData.errorTypes[whichType];
27573 switch (whichType) {
27575 description = `This feature has a FIXME tag: ${description}`;
27579 description = description.replace("A turn-", "This turn-");
27586 description = `This turn-restriction~${description}`;
27589 description = "This highway is missing a maxspeed tag";
27594 description = `This feature~${description}`;
27597 let coincident = false;
27599 let delta = coincident ? [1e-5, 0] : [0, 1e-5];
27600 loc = geoVecAdd(loc, delta);
27601 let bbox2 = geoExtent(loc).bbox();
27602 coincident = _cache.rtree.search(bbox2).length;
27603 } while (coincident);
27604 let d4 = new QAItem(loc, this, itemType, id2, {
27609 severity: whichTemplate.severity || "error",
27615 d4.replacements = tokenReplacements(d4);
27616 _cache.data[id2] = d4;
27617 _cache.rtree.insert(encodeIssueRtree(d4));
27619 dispatch2.call("loaded");
27621 delete _cache.inflightTile[tile.id];
27622 _cache.loadedTile[tile.id] = true;
27626 postUpdate(d4, callback) {
27627 if (_cache.inflightPost[d4.id]) {
27628 return callback({ message: "Error update already inflight", status: -2 }, d4);
27630 const params = { schema: d4.schema, id: d4.id };
27631 if (d4.newStatus) {
27632 params.st = d4.newStatus;
27634 if (d4.newComment !== void 0) {
27635 params.co = d4.newComment;
27637 const url = `${_krUrlRoot}/comment.php?` + utilQsString(params);
27638 const controller = new AbortController();
27639 _cache.inflightPost[d4.id] = controller;
27640 json_default(url, { signal: controller.signal }).finally(() => {
27641 delete _cache.inflightPost[d4.id];
27642 if (d4.newStatus === "ignore") {
27643 this.removeItem(d4);
27644 } else if (d4.newStatus === "ignore_t") {
27645 this.removeItem(d4);
27646 _cache.closed[`${d4.schema}:${d4.id}`] = true;
27648 d4 = this.replaceItem(d4.update({
27649 comment: d4.newComment,
27650 newComment: void 0,
27654 if (callback) callback(null, d4);
27657 // Get all cached QAItems covering the viewport
27658 getItems(projection2) {
27659 const viewport = projection2.clipExtent();
27660 const min3 = [viewport[0][0], viewport[1][1]];
27661 const max3 = [viewport[1][0], viewport[0][1]];
27662 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
27663 return _cache.rtree.search(bbox2).map((d4) => d4.data);
27665 // Get a QAItem from cache
27666 // NOTE: Don't change method name until UI v3 is merged
27668 return _cache.data[id2];
27670 // Replace a single QAItem in the cache
27671 replaceItem(item) {
27672 if (!(item instanceof QAItem) || !item.id) return;
27673 _cache.data[item.id] = item;
27674 updateRtree(encodeIssueRtree(item), true);
27677 // Remove a single QAItem from the cache
27679 if (!(item instanceof QAItem) || !item.id) return;
27680 delete _cache.data[item.id];
27681 updateRtree(encodeIssueRtree(item), false);
27684 return `${_krUrlRoot}/report_map.php?schema=${item.schema}&error=${item.id}`;
27686 // Get an array of issues closed during this session.
27687 // Used to populate `closed:keepright` changeset tag
27689 return Object.keys(_cache.closed).sort();
27695 // node_modules/marked/lib/marked.esm.js
27697 return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
27702 function h(l4, e3 = "") {
27703 let t2 = typeof l4 == "string" ? l4 : l4.source, n3 = { replace: (r2, i3) => {
27704 let s2 = typeof i3 == "string" ? i3 : i3.source;
27705 return s2 = s2.replace(m.caret, "$1"), t2 = t2.replace(r2, s2), n3;
27706 }, getRegex: () => new RegExp(t2, e3) };
27709 function w(l4, e3) {
27711 if (m.escapeTest.test(l4)) return l4.replace(m.escapeReplace, ke);
27712 } else if (m.escapeTestNoEncode.test(l4)) return l4.replace(m.escapeReplaceNoEncode, ke);
27717 l4 = encodeURI(l4).replace(m.percentDecode, "%");
27723 function V(l4, e3) {
27725 let t2 = l4.replace(m.findPipe, (i3, s2, o2) => {
27726 let a2 = false, u2 = s2;
27727 for (; --u2 >= 0 && o2[u2] === "\\"; ) a2 = !a2;
27728 return a2 ? "|" : " |";
27729 }), n3 = t2.split(m.splitPipe), r2 = 0;
27730 if (n3[0].trim() || n3.shift(), n3.length > 0 && !((_a4 = n3.at(-1)) == null ? void 0 : _a4.trim()) && n3.pop(), e3) if (n3.length > e3) n3.splice(e3);
27731 else for (; n3.length < e3; ) n3.push("");
27732 for (; r2 < n3.length; r2++) n3[r2] = n3[r2].trim().replace(m.slashPipe, "|");
27735 function z(l4, e3, t2) {
27736 let n3 = l4.length;
27737 if (n3 === 0) return "";
27739 for (; r2 < n3; ) {
27740 let i3 = l4.charAt(n3 - r2 - 1);
27741 if (i3 === e3 && !t2) r2++;
27742 else if (i3 !== e3 && t2) r2++;
27745 return l4.slice(0, n3 - r2);
27747 function ge(l4, e3) {
27748 if (l4.indexOf(e3[1]) === -1) return -1;
27750 for (let n3 = 0; n3 < l4.length; n3++) if (l4[n3] === "\\") n3++;
27751 else if (l4[n3] === e3[0]) t2++;
27752 else if (l4[n3] === e3[1] && (t2--, t2 < 0)) return n3;
27753 return t2 > 0 ? -2 : -1;
27755 function fe(l4, e3, t2, n3, r2) {
27756 let i3 = e3.href, s2 = e3.title || null, o2 = l4[1].replace(r2.other.outputLinkReplace, "$1");
27757 n3.state.inLink = true;
27758 let a2 = { type: l4[0].charAt(0) === "!" ? "image" : "link", raw: t2, href: i3, title: s2, text: o2, tokens: n3.inlineTokens(o2) };
27759 return n3.state.inLink = false, a2;
27761 function Je(l4, e3, t2) {
27762 let n3 = l4.match(t2.other.indentCodeCompensation);
27763 if (n3 === null) return e3;
27767 let s2 = i3.match(t2.other.beginningSpace);
27768 if (s2 === null) return i3;
27770 return o2.length >= r2.length ? i3.slice(r2.length) : i3;
27774 function d(l4, e3) {
27775 return _.parse(l4, e3);
27777 var O, E, m, xe, be, Re, C, Oe, j, se, ie, Te, F, we, Q, ye, Pe, v, U, Se, oe, $e, K, re2, _e, Le, Me, ze, ae, Ae, D, W, le, Ee, ue, Ce, Ie, Be, pe, qe, ve, ce, De, Ze, Ge, He, Ne, je, Fe, q, Qe, he, de, Ue, X, Ke, N, We, I, M, Xe, ke, y, b, P, S, R, _a, $, B, _, Dt, Zt, Gt, Ht, Nt, Ft, Qt;
27778 var init_marked_esm = __esm({
27779 "node_modules/marked/lib/marked.esm.js"() {
27781 E = { exec: () => null };
27782 m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l4) => new RegExp(`^( {0,3}${l4})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}#`), htmlBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}<(?:[a-z].*>|!--)`, "i") };
27783 xe = /^(?:[ \t]*(?:\n|$))+/;
27784 be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
27785 Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
27786 C = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
27787 Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
27788 j = /(?:[*+-]|\d{1,9}[.)])/;
27789 se = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
27790 ie = h(se).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
27791 Te = h(se).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
27792 F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
27794 Q = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
27795 ye = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
27796 Pe = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, j).getRegex();
27797 v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
27798 U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
27799 Se = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
27800 oe = h(F).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
27801 $e = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex();
27802 K = { blockquote: $e, code: be, def: ye, fences: Re, heading: Oe, hr: C, html: Se, lheading: ie, list: Pe, newline: xe, paragraph: oe, table: E, text: we };
27803 re2 = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
27804 _e = { ...K, lheading: Te, table: re2, paragraph: h(F).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re2).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() };
27805 Le = { ...K, html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: E, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: h(F).replace("hr", C).replace("heading", ` *#{1,6} *[^
27806 ]`).replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
27807 Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
27808 ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
27809 ae = /^( {2,}|\\)\n(?!\s*$)/;
27810 Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
27811 D = /[\p{P}\p{S}]/u;
27812 W = /[\s\p{P}\p{S}]/u;
27813 le = /[^\s\p{P}\p{S}]/u;
27814 Ee = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex();
27815 ue = /(?!~)[\p{P}\p{S}]/u;
27816 Ce = /(?!~)[\s\p{P}\p{S}]/u;
27817 Ie = /(?:[^\s\p{P}\p{S}]|~)/u;
27818 Be = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g;
27819 pe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
27820 qe = h(pe, "u").replace(/punct/g, D).getRegex();
27821 ve = h(pe, "u").replace(/punct/g, ue).getRegex();
27822 ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
27823 De = h(ce, "gu").replace(/notPunctSpace/g, le).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
27824 Ze = h(ce, "gu").replace(/notPunctSpace/g, Ie).replace(/punctSpace/g, Ce).replace(/punct/g, ue).getRegex();
27825 Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, le).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
27826 He = h(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
27827 Ne = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
27828 je = h(U).replace("(?:-->|$)", "-->").getRegex();
27829 Fe = h("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
27830 q = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
27831 Qe = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
27832 he = h(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex();
27833 de = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex();
27834 Ue = h("reflink|nolink(?!\\()", "g").replace("reflink", he).replace("nolink", de).getRegex();
27835 X = { _backpedal: E, anyPunctuation: He, autolink: Ne, blockSkip: Be, br: ae, code: ze, del: E, emStrongLDelim: qe, emStrongRDelimAst: De, emStrongRDelimUnd: Ge, escape: Me, link: Qe, nolink: de, punctuation: Ee, reflink: he, reflinkSearch: Ue, tag: Fe, text: Ae, url: E };
27836 Ke = { ...X, link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
27837 N = { ...X, emStrongRDelimAst: Ze, emStrongLDelim: ve, url: h(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ };
27838 We = { ...N, br: h(ae).replace("{2,}", "*").getRegex(), text: h(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
27839 I = { normal: K, gfm: _e, pedantic: Le };
27840 M = { normal: X, gfm: N, breaks: We, pedantic: Ke };
27841 Xe = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
27842 ke = (l4) => Xe[l4];
27845 __publicField(this, "options");
27846 __publicField(this, "rules");
27847 __publicField(this, "lexer");
27848 this.options = e3 || O;
27851 let t2 = this.rules.block.newline.exec(e3);
27852 if (t2 && t2[0].length > 0) return { type: "space", raw: t2[0] };
27855 let t2 = this.rules.block.code.exec(e3);
27857 let n3 = t2[0].replace(this.rules.other.codeRemoveIndent, "");
27858 return { type: "code", raw: t2[0], codeBlockStyle: "indented", text: this.options.pedantic ? n3 : z(n3, `
27863 let t2 = this.rules.block.fences.exec(e3);
27865 let n3 = t2[0], r2 = Je(n3, t2[3] || "", this.rules);
27866 return { type: "code", raw: n3, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: r2 };
27870 let t2 = this.rules.block.heading.exec(e3);
27872 let n3 = t2[2].trim();
27873 if (this.rules.other.endingHash.test(n3)) {
27874 let r2 = z(n3, "#");
27875 (this.options.pedantic || !r2 || this.rules.other.endingSpaceChar.test(r2)) && (n3 = r2.trim());
27877 return { type: "heading", raw: t2[0], depth: t2[1].length, text: n3, tokens: this.lexer.inline(n3) };
27881 let t2 = this.rules.block.hr.exec(e3);
27882 if (t2) return { type: "hr", raw: z(t2[0], `
27886 let t2 = this.rules.block.blockquote.exec(e3);
27888 let n3 = z(t2[0], `
27890 `), r2 = "", i3 = "", s2 = [];
27891 for (; n3.length > 0; ) {
27892 let o2 = false, a2 = [], u2;
27893 for (u2 = 0; u2 < n3.length; u2++) if (this.rules.other.blockquoteStart.test(n3[u2])) a2.push(n3[u2]), o2 = true;
27894 else if (!o2) a2.push(n3[u2]);
27898 `), c2 = p2.replace(this.rules.other.blockquoteSetextReplace, `
27899 $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
27901 ${p2}` : p2, i3 = i3 ? `${i3}
27903 let f2 = this.lexer.state.top;
27904 if (this.lexer.state.top = true, this.lexer.blockTokens(c2, s2, true), this.lexer.state.top = f2, n3.length === 0) break;
27905 let k2 = s2.at(-1);
27906 if ((k2 == null ? void 0 : k2.type) === "code") break;
27907 if ((k2 == null ? void 0 : k2.type) === "blockquote") {
27908 let x2 = k2, g3 = x2.raw + `
27910 `), T2 = this.blockquote(g3);
27911 s2[s2.length - 1] = T2, r2 = r2.substring(0, r2.length - x2.raw.length) + T2.raw, i3 = i3.substring(0, i3.length - x2.text.length) + T2.text;
27913 } else if ((k2 == null ? void 0 : k2.type) === "list") {
27914 let x2 = k2, g3 = x2.raw + `
27916 `), T2 = this.list(g3);
27917 s2[s2.length - 1] = T2, r2 = r2.substring(0, r2.length - k2.raw.length) + T2.raw, i3 = i3.substring(0, i3.length - x2.raw.length) + T2.raw, n3 = g3.substring(s2.at(-1).raw.length).split(`
27922 return { type: "blockquote", raw: r2, tokens: s2, text: i3 };
27926 let t2 = this.rules.block.list.exec(e3);
27928 let n3 = t2[1].trim(), r2 = n3.length > 1, i3 = { type: "list", raw: "", ordered: r2, start: r2 ? +n3.slice(0, -1) : "", loose: false, items: [] };
27929 n3 = r2 ? `\\d{1,9}\\${n3.slice(-1)}` : `\\${n3}`, this.options.pedantic && (n3 = r2 ? n3 : "[*+-]");
27930 let s2 = this.rules.other.listItemRegex(n3), o2 = false;
27932 let u2 = false, p2 = "", c2 = "";
27933 if (!(t2 = s2.exec(e3)) || this.rules.block.hr.test(e3)) break;
27934 p2 = t2[0], e3 = e3.substring(p2.length);
27935 let f2 = t2[2].split(`
27936 `, 1)[0].replace(this.rules.other.listReplaceTabs, (Z3) => " ".repeat(3 * Z3.length)), k2 = e3.split(`
27937 `, 1)[0], x2 = !f2.trim(), g3 = 0;
27938 if (this.options.pedantic ? (g3 = 2, c2 = f2.trimStart()) : x2 ? g3 = t2[1].length + 1 : (g3 = t2[2].search(this.rules.other.nonSpaceChar), g3 = g3 > 4 ? 1 : g3, c2 = f2.slice(g3), g3 += t2[1].length), x2 && this.rules.other.blankLine.test(k2) && (p2 += k2 + `
27939 `, e3 = e3.substring(k2.length + 1), u2 = true), !u2) {
27940 let Z3 = this.rules.other.nextBulletRegex(g3), ee2 = this.rules.other.hrRegex(g3), te2 = this.rules.other.fencesBeginRegex(g3), ne2 = this.rules.other.headingBeginRegex(g3), me2 = this.rules.other.htmlBeginRegex(g3);
27942 let G2 = e3.split(`
27944 if (k2 = G2, this.options.pedantic ? (k2 = k2.replace(this.rules.other.listReplaceNesting, " "), A2 = k2) : A2 = k2.replace(this.rules.other.tabCharGlobal, " "), te2.test(k2) || ne2.test(k2) || me2.test(k2) || Z3.test(k2) || ee2.test(k2)) break;
27945 if (A2.search(this.rules.other.nonSpaceChar) >= g3 || !k2.trim()) c2 += `
27948 if (x2 || f2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te2.test(f2) || ne2.test(f2) || ee2.test(f2)) break;
27952 !x2 && !k2.trim() && (x2 = true), p2 += G2 + `
27953 `, e3 = e3.substring(G2.length + 1), f2 = A2.slice(g3);
27956 i3.loose || (o2 ? i3.loose = true : this.rules.other.doubleBlankLine.test(p2) && (o2 = true));
27958 this.options.gfm && (T2 = this.rules.other.listIsTask.exec(c2), T2 && (Y4 = T2[0] !== "[ ] ", c2 = c2.replace(this.rules.other.listReplaceTask, ""))), i3.items.push({ type: "list_item", raw: p2, task: !!T2, checked: Y4, loose: false, text: c2, tokens: [] }), i3.raw += p2;
27960 let a2 = i3.items.at(-1);
27961 if (a2) a2.raw = a2.raw.trimEnd(), a2.text = a2.text.trimEnd();
27963 i3.raw = i3.raw.trimEnd();
27964 for (let u2 = 0; u2 < i3.items.length; u2++) if (this.lexer.state.top = false, i3.items[u2].tokens = this.lexer.blockTokens(i3.items[u2].text, []), !i3.loose) {
27965 let p2 = i3.items[u2].tokens.filter((f2) => f2.type === "space"), c2 = p2.length > 0 && p2.some((f2) => this.rules.other.anyLine.test(f2.raw));
27968 if (i3.loose) for (let u2 = 0; u2 < i3.items.length; u2++) i3.items[u2].loose = true;
27973 let t2 = this.rules.block.html.exec(e3);
27974 if (t2) return { type: "html", block: true, raw: t2[0], pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: t2[0] };
27977 let t2 = this.rules.block.def.exec(e3);
27979 let n3 = t2[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r2 = t2[2] ? t2[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i3 = t2[3] ? t2[3].substring(1, t2[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t2[3];
27980 return { type: "def", tag: n3, raw: t2[0], href: r2, title: i3 };
27985 let t2 = this.rules.block.table.exec(e3);
27986 if (!t2 || !this.rules.other.tableDelimiter.test(t2[2])) return;
27987 let n3 = V(t2[1]), r2 = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), i3 = ((_a4 = t2[3]) == null ? void 0 : _a4.trim()) ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split(`
27988 `) : [], s2 = { type: "table", raw: t2[0], header: [], align: [], rows: [] };
27989 if (n3.length === r2.length) {
27990 for (let o2 of r2) this.rules.other.tableAlignRight.test(o2) ? s2.align.push("right") : this.rules.other.tableAlignCenter.test(o2) ? s2.align.push("center") : this.rules.other.tableAlignLeft.test(o2) ? s2.align.push("left") : s2.align.push(null);
27991 for (let o2 = 0; o2 < n3.length; o2++) s2.header.push({ text: n3[o2], tokens: this.lexer.inline(n3[o2]), header: true, align: s2.align[o2] });
27992 for (let o2 of i3) s2.rows.push(V(o2, s2.header.length).map((a2, u2) => ({ text: a2, tokens: this.lexer.inline(a2), header: false, align: s2.align[u2] })));
27997 let t2 = this.rules.block.lheading.exec(e3);
27998 if (t2) return { type: "heading", raw: t2[0], depth: t2[2].charAt(0) === "=" ? 1 : 2, text: t2[1], tokens: this.lexer.inline(t2[1]) };
28001 let t2 = this.rules.block.paragraph.exec(e3);
28003 let n3 = t2[1].charAt(t2[1].length - 1) === `
28004 ` ? t2[1].slice(0, -1) : t2[1];
28005 return { type: "paragraph", raw: t2[0], text: n3, tokens: this.lexer.inline(n3) };
28009 let t2 = this.rules.block.text.exec(e3);
28010 if (t2) return { type: "text", raw: t2[0], text: t2[0], tokens: this.lexer.inline(t2[0]) };
28013 let t2 = this.rules.inline.escape.exec(e3);
28014 if (t2) return { type: "escape", raw: t2[0], text: t2[1] };
28017 let t2 = this.rules.inline.tag.exec(e3);
28018 if (t2) return !this.lexer.state.inLink && this.rules.other.startATag.test(t2[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t2[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t2[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t2[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t2[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t2[0] };
28021 let t2 = this.rules.inline.link.exec(e3);
28023 let n3 = t2[2].trim();
28024 if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n3)) {
28025 if (!this.rules.other.endAngleBracket.test(n3)) return;
28026 let s2 = z(n3.slice(0, -1), "\\");
28027 if ((n3.length - s2.length) % 2 === 0) return;
28029 let s2 = ge(t2[2], "()");
28030 if (s2 === -2) return;
28032 let a2 = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + s2;
28033 t2[2] = t2[2].substring(0, s2), t2[0] = t2[0].substring(0, a2).trim(), t2[3] = "";
28036 let r2 = t2[2], i3 = "";
28037 if (this.options.pedantic) {
28038 let s2 = this.rules.other.pedanticHrefTitle.exec(r2);
28039 s2 && (r2 = s2[1], i3 = s2[3]);
28040 } else i3 = t2[3] ? t2[3].slice(1, -1) : "";
28041 return r2 = r2.trim(), this.rules.other.startAngleBracket.test(r2) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n3) ? r2 = r2.slice(1) : r2 = r2.slice(1, -1)), fe(t2, { href: r2 && r2.replace(this.rules.inline.anyPunctuation, "$1"), title: i3 && i3.replace(this.rules.inline.anyPunctuation, "$1") }, t2[0], this.lexer, this.rules);
28046 if ((n3 = this.rules.inline.reflink.exec(e3)) || (n3 = this.rules.inline.nolink.exec(e3))) {
28047 let r2 = (n3[2] || n3[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i3 = t2[r2.toLowerCase()];
28049 let s2 = n3[0].charAt(0);
28050 return { type: "text", raw: s2, text: s2 };
28052 return fe(n3, i3, n3[0], this.lexer, this.rules);
28055 emStrong(e3, t2, n3 = "") {
28056 let r2 = this.rules.inline.emStrongLDelim.exec(e3);
28057 if (!r2 || r2[3] && n3.match(this.rules.other.unicodeAlphaNumeric)) return;
28058 if (!(r2[1] || r2[2] || "") || !n3 || this.rules.inline.punctuation.exec(n3)) {
28059 let s2 = [...r2[0]].length - 1, o2, a2, u2 = s2, p2 = 0, c2 = r2[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
28060 for (c2.lastIndex = 0, t2 = t2.slice(-1 * e3.length + s2); (r2 = c2.exec(t2)) != null; ) {
28061 if (o2 = r2[1] || r2[2] || r2[3] || r2[4] || r2[5] || r2[6], !o2) continue;
28062 if (a2 = [...o2].length, r2[3] || r2[4]) {
28065 } else if ((r2[5] || r2[6]) && s2 % 3 && !((s2 + a2) % 3)) {
28069 if (u2 -= a2, u2 > 0) continue;
28070 a2 = Math.min(a2, a2 + u2 + p2);
28071 let f2 = [...r2[0]][0].length, k2 = e3.slice(0, s2 + r2.index + f2 + a2);
28072 if (Math.min(s2, a2) % 2) {
28073 let g3 = k2.slice(1, -1);
28074 return { type: "em", raw: k2, text: g3, tokens: this.lexer.inlineTokens(g3) };
28076 let x2 = k2.slice(2, -2);
28077 return { type: "strong", raw: k2, text: x2, tokens: this.lexer.inlineTokens(x2) };
28082 let t2 = this.rules.inline.code.exec(e3);
28084 let n3 = t2[2].replace(this.rules.other.newLineCharGlobal, " "), r2 = this.rules.other.nonSpaceChar.test(n3), i3 = this.rules.other.startingSpaceChar.test(n3) && this.rules.other.endingSpaceChar.test(n3);
28085 return r2 && i3 && (n3 = n3.substring(1, n3.length - 1)), { type: "codespan", raw: t2[0], text: n3 };
28089 let t2 = this.rules.inline.br.exec(e3);
28090 if (t2) return { type: "br", raw: t2[0] };
28093 let t2 = this.rules.inline.del.exec(e3);
28094 if (t2) return { type: "del", raw: t2[0], text: t2[2], tokens: this.lexer.inlineTokens(t2[2]) };
28097 let t2 = this.rules.inline.autolink.exec(e3);
28100 return t2[2] === "@" ? (n3 = t2[1], r2 = "mailto:" + n3) : (n3 = t2[1], r2 = n3), { type: "link", raw: t2[0], text: n3, href: r2, tokens: [{ type: "text", raw: n3, text: n3 }] };
28106 if (t2 = this.rules.inline.url.exec(e3)) {
28108 if (t2[2] === "@") n3 = t2[0], r2 = "mailto:" + n3;
28112 i3 = t2[0], t2[0] = (_b2 = (_a4 = this.rules.inline._backpedal.exec(t2[0])) == null ? void 0 : _a4[0]) != null ? _b2 : "";
28113 while (i3 !== t2[0]);
28114 n3 = t2[0], t2[1] === "www." ? r2 = "http://" + t2[0] : r2 = t2[0];
28116 return { type: "link", raw: t2[0], text: n3, href: r2, tokens: [{ type: "text", raw: n3, text: n3 }] };
28120 let t2 = this.rules.inline.text.exec(e3);
28122 let n3 = this.lexer.state.inRawBlock;
28123 return { type: "text", raw: t2[0], text: t2[0], escaped: n3 };
28129 __publicField(this, "tokens");
28130 __publicField(this, "options");
28131 __publicField(this, "state");
28132 __publicField(this, "tokenizer");
28133 __publicField(this, "inlineQueue");
28134 this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e3 || O, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
28135 let t2 = { other: m, block: I.normal, inline: M.normal };
28136 this.options.pedantic ? (t2.block = I.pedantic, t2.inline = M.pedantic) : this.options.gfm && (t2.block = I.gfm, this.options.breaks ? t2.inline = M.breaks : t2.inline = M.gfm), this.tokenizer.rules = t2;
28138 static get rules() {
28139 return { block: I, inline: M };
28141 static lex(e3, t2) {
28142 return new l(t2).lex(e3);
28144 static lexInline(e3, t2) {
28145 return new l(t2).inlineTokens(e3);
28148 e3 = e3.replace(m.carriageReturn, `
28149 `), this.blockTokens(e3, this.tokens);
28150 for (let t2 = 0; t2 < this.inlineQueue.length; t2++) {
28151 let n3 = this.inlineQueue[t2];
28152 this.inlineTokens(n3.src, n3.tokens);
28154 return this.inlineQueue = [], this.tokens;
28156 blockTokens(e3, t2 = [], n3 = false) {
28158 for (this.options.pedantic && (e3 = e3.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e3; ) {
28160 if ((_b2 = (_a4 = this.options.extensions) == null ? void 0 : _a4.block) == null ? void 0 : _b2.some((s2) => (r2 = s2.call({ lexer: this }, e3, t2)) ? (e3 = e3.substring(r2.raw.length), t2.push(r2), true) : false)) continue;
28161 if (r2 = this.tokenizer.space(e3)) {
28162 e3 = e3.substring(r2.raw.length);
28163 let s2 = t2.at(-1);
28164 r2.raw.length === 1 && s2 !== void 0 ? s2.raw += `
28168 if (r2 = this.tokenizer.code(e3)) {
28169 e3 = e3.substring(r2.raw.length);
28170 let s2 = t2.at(-1);
28171 (s2 == null ? void 0 : s2.type) === "paragraph" || (s2 == null ? void 0 : s2.type) === "text" ? (s2.raw += (s2.raw.endsWith(`
28173 `) + r2.raw, s2.text += `
28174 ` + r2.text, this.inlineQueue.at(-1).src = s2.text) : t2.push(r2);
28177 if (r2 = this.tokenizer.fences(e3)) {
28178 e3 = e3.substring(r2.raw.length), t2.push(r2);
28181 if (r2 = this.tokenizer.heading(e3)) {
28182 e3 = e3.substring(r2.raw.length), t2.push(r2);
28185 if (r2 = this.tokenizer.hr(e3)) {
28186 e3 = e3.substring(r2.raw.length), t2.push(r2);
28189 if (r2 = this.tokenizer.blockquote(e3)) {
28190 e3 = e3.substring(r2.raw.length), t2.push(r2);
28193 if (r2 = this.tokenizer.list(e3)) {
28194 e3 = e3.substring(r2.raw.length), t2.push(r2);
28197 if (r2 = this.tokenizer.html(e3)) {
28198 e3 = e3.substring(r2.raw.length), t2.push(r2);
28201 if (r2 = this.tokenizer.def(e3)) {
28202 e3 = e3.substring(r2.raw.length);
28203 let s2 = t2.at(-1);
28204 (s2 == null ? void 0 : s2.type) === "paragraph" || (s2 == null ? void 0 : s2.type) === "text" ? (s2.raw += (s2.raw.endsWith(`
28206 `) + r2.raw, s2.text += `
28207 ` + r2.raw, this.inlineQueue.at(-1).src = s2.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t2.push(r2));
28210 if (r2 = this.tokenizer.table(e3)) {
28211 e3 = e3.substring(r2.raw.length), t2.push(r2);
28214 if (r2 = this.tokenizer.lheading(e3)) {
28215 e3 = e3.substring(r2.raw.length), t2.push(r2);
28219 if ((_c = this.options.extensions) == null ? void 0 : _c.startBlock) {
28220 let s2 = 1 / 0, o2 = e3.slice(1), a2;
28221 this.options.extensions.startBlock.forEach((u2) => {
28222 a2 = u2.call({ lexer: this }, o2), typeof a2 == "number" && a2 >= 0 && (s2 = Math.min(s2, a2));
28223 }), s2 < 1 / 0 && s2 >= 0 && (i3 = e3.substring(0, s2 + 1));
28225 if (this.state.top && (r2 = this.tokenizer.paragraph(i3))) {
28226 let s2 = t2.at(-1);
28227 n3 && (s2 == null ? void 0 : s2.type) === "paragraph" ? (s2.raw += (s2.raw.endsWith(`
28229 `) + r2.raw, s2.text += `
28230 ` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t2.push(r2), n3 = i3.length !== e3.length, e3 = e3.substring(r2.raw.length);
28233 if (r2 = this.tokenizer.text(e3)) {
28234 e3 = e3.substring(r2.raw.length);
28235 let s2 = t2.at(-1);
28236 (s2 == null ? void 0 : s2.type) === "text" ? (s2.raw += (s2.raw.endsWith(`
28238 `) + r2.raw, s2.text += `
28239 ` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t2.push(r2);
28243 let s2 = "Infinite loop on byte: " + e3.charCodeAt(0);
28244 if (this.options.silent) {
28247 } else throw new Error(s2);
28250 return this.state.top = true, t2;
28252 inline(e3, t2 = []) {
28253 return this.inlineQueue.push({ src: e3, tokens: t2 }), t2;
28255 inlineTokens(e3, t2 = []) {
28257 let n3 = e3, r2 = null;
28258 if (this.tokens.links) {
28259 let o2 = Object.keys(this.tokens.links);
28260 if (o2.length > 0) for (; (r2 = this.tokenizer.rules.inline.reflinkSearch.exec(n3)) != null; ) o2.includes(r2[0].slice(r2[0].lastIndexOf("[") + 1, -1)) && (n3 = n3.slice(0, r2.index) + "[" + "a".repeat(r2[0].length - 2) + "]" + n3.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
28262 for (; (r2 = this.tokenizer.rules.inline.anyPunctuation.exec(n3)) != null; ) n3 = n3.slice(0, r2.index) + "++" + n3.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
28263 for (; (r2 = this.tokenizer.rules.inline.blockSkip.exec(n3)) != null; ) n3 = n3.slice(0, r2.index) + "[" + "a".repeat(r2[0].length - 2) + "]" + n3.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
28264 let i3 = false, s2 = "";
28266 i3 || (s2 = ""), i3 = false;
28268 if ((_b2 = (_a4 = this.options.extensions) == null ? void 0 : _a4.inline) == null ? void 0 : _b2.some((u2) => (o2 = u2.call({ lexer: this }, e3, t2)) ? (e3 = e3.substring(o2.raw.length), t2.push(o2), true) : false)) continue;
28269 if (o2 = this.tokenizer.escape(e3)) {
28270 e3 = e3.substring(o2.raw.length), t2.push(o2);
28273 if (o2 = this.tokenizer.tag(e3)) {
28274 e3 = e3.substring(o2.raw.length), t2.push(o2);
28277 if (o2 = this.tokenizer.link(e3)) {
28278 e3 = e3.substring(o2.raw.length), t2.push(o2);
28281 if (o2 = this.tokenizer.reflink(e3, this.tokens.links)) {
28282 e3 = e3.substring(o2.raw.length);
28283 let u2 = t2.at(-1);
28284 o2.type === "text" && (u2 == null ? void 0 : u2.type) === "text" ? (u2.raw += o2.raw, u2.text += o2.text) : t2.push(o2);
28287 if (o2 = this.tokenizer.emStrong(e3, n3, s2)) {
28288 e3 = e3.substring(o2.raw.length), t2.push(o2);
28291 if (o2 = this.tokenizer.codespan(e3)) {
28292 e3 = e3.substring(o2.raw.length), t2.push(o2);
28295 if (o2 = this.tokenizer.br(e3)) {
28296 e3 = e3.substring(o2.raw.length), t2.push(o2);
28299 if (o2 = this.tokenizer.del(e3)) {
28300 e3 = e3.substring(o2.raw.length), t2.push(o2);
28303 if (o2 = this.tokenizer.autolink(e3)) {
28304 e3 = e3.substring(o2.raw.length), t2.push(o2);
28307 if (!this.state.inLink && (o2 = this.tokenizer.url(e3))) {
28308 e3 = e3.substring(o2.raw.length), t2.push(o2);
28312 if ((_c = this.options.extensions) == null ? void 0 : _c.startInline) {
28313 let u2 = 1 / 0, p2 = e3.slice(1), c2;
28314 this.options.extensions.startInline.forEach((f2) => {
28315 c2 = f2.call({ lexer: this }, p2), typeof c2 == "number" && c2 >= 0 && (u2 = Math.min(u2, c2));
28316 }), u2 < 1 / 0 && u2 >= 0 && (a2 = e3.substring(0, u2 + 1));
28318 if (o2 = this.tokenizer.inlineText(a2)) {
28319 e3 = e3.substring(o2.raw.length), o2.raw.slice(-1) !== "_" && (s2 = o2.raw.slice(-1)), i3 = true;
28320 let u2 = t2.at(-1);
28321 (u2 == null ? void 0 : u2.type) === "text" ? (u2.raw += o2.raw, u2.text += o2.text) : t2.push(o2);
28325 let u2 = "Infinite loop on byte: " + e3.charCodeAt(0);
28326 if (this.options.silent) {
28329 } else throw new Error(u2);
28337 __publicField(this, "options");
28338 __publicField(this, "parser");
28339 this.options = e3 || O;
28344 code({ text: e3, lang: t2, escaped: n3 }) {
28346 let r2 = (_a4 = (t2 || "").match(m.notSpaceStart)) == null ? void 0 : _a4[0], i3 = e3.replace(m.endingNewline, "") + `
28348 return r2 ? '<pre><code class="language-' + w(r2) + '">' + (n3 ? i3 : w(i3, true)) + `</code></pre>
28349 ` : "<pre><code>" + (n3 ? i3 : w(i3, true)) + `</code></pre>
28352 blockquote({ tokens: e3 }) {
28353 return `<blockquote>
28354 ${this.parser.parse(e3)}</blockquote>
28357 html({ text: e3 }) {
28363 heading({ tokens: e3, depth: t2 }) {
28364 return `<h${t2}>${this.parser.parseInline(e3)}</h${t2}>
28372 let t2 = e3.ordered, n3 = e3.start, r2 = "";
28373 for (let o2 = 0; o2 < e3.items.length; o2++) {
28374 let a2 = e3.items[o2];
28375 r2 += this.listitem(a2);
28377 let i3 = t2 ? "ol" : "ul", s2 = t2 && n3 !== 1 ? ' start="' + n3 + '"' : "";
28378 return "<" + i3 + s2 + `>
28379 ` + r2 + "</" + i3 + `>
28386 let n3 = this.checkbox({ checked: !!e3.checked });
28387 e3.loose ? ((_a4 = e3.tokens[0]) == null ? void 0 : _a4.type) === "paragraph" ? (e3.tokens[0].text = n3 + " " + e3.tokens[0].text, e3.tokens[0].tokens && e3.tokens[0].tokens.length > 0 && e3.tokens[0].tokens[0].type === "text" && (e3.tokens[0].tokens[0].text = n3 + " " + w(e3.tokens[0].tokens[0].text), e3.tokens[0].tokens[0].escaped = true)) : e3.tokens.unshift({ type: "text", raw: n3 + " ", text: n3 + " ", escaped: true }) : t2 += n3 + " ";
28389 return t2 += this.parser.parse(e3.tokens, !!e3.loose), `<li>${t2}</li>
28392 checkbox({ checked: e3 }) {
28393 return "<input " + (e3 ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
28395 paragraph({ tokens: e3 }) {
28396 return `<p>${this.parser.parseInline(e3)}</p>
28400 let t2 = "", n3 = "";
28401 for (let i3 = 0; i3 < e3.header.length; i3++) n3 += this.tablecell(e3.header[i3]);
28402 t2 += this.tablerow({ text: n3 });
28404 for (let i3 = 0; i3 < e3.rows.length; i3++) {
28405 let s2 = e3.rows[i3];
28407 for (let o2 = 0; o2 < s2.length; o2++) n3 += this.tablecell(s2[o2]);
28408 r2 += this.tablerow({ text: n3 });
28410 return r2 && (r2 = `<tbody>${r2}</tbody>`), `<table>
28416 tablerow({ text: e3 }) {
28422 let t2 = this.parser.parseInline(e3.tokens), n3 = e3.header ? "th" : "td";
28423 return (e3.align ? `<${n3} align="${e3.align}">` : `<${n3}>`) + t2 + `</${n3}>
28426 strong({ tokens: e3 }) {
28427 return `<strong>${this.parser.parseInline(e3)}</strong>`;
28429 em({ tokens: e3 }) {
28430 return `<em>${this.parser.parseInline(e3)}</em>`;
28432 codespan({ text: e3 }) {
28433 return `<code>${w(e3, true)}</code>`;
28438 del({ tokens: e3 }) {
28439 return `<del>${this.parser.parseInline(e3)}</del>`;
28441 link({ href: e3, title: t2, tokens: n3 }) {
28442 let r2 = this.parser.parseInline(n3), i3 = J(e3);
28443 if (i3 === null) return r2;
28445 let s2 = '<a href="' + e3 + '"';
28446 return t2 && (s2 += ' title="' + w(t2) + '"'), s2 += ">" + r2 + "</a>", s2;
28448 image({ href: e3, title: t2, text: n3, tokens: r2 }) {
28449 r2 && (n3 = this.parser.parseInline(r2, this.parser.textRenderer));
28451 if (i3 === null) return w(n3);
28453 let s2 = `<img src="${e3}" alt="${n3}"`;
28454 return t2 && (s2 += ` title="${w(t2)}"`), s2 += ">", s2;
28457 return "tokens" in e3 && e3.tokens ? this.parser.parseInline(e3.tokens) : "escaped" in e3 && e3.escaped ? e3.text : w(e3.text);
28461 strong({ text: e3 }) {
28467 codespan({ text: e3 }) {
28470 del({ text: e3 }) {
28473 html({ text: e3 }) {
28476 text({ text: e3 }) {
28479 link({ text: e3 }) {
28482 image({ text: e3 }) {
28491 __publicField(this, "options");
28492 __publicField(this, "renderer");
28493 __publicField(this, "textRenderer");
28494 this.options = e3 || O, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new S();
28496 static parse(e3, t2) {
28497 return new l2(t2).parse(e3);
28499 static parseInline(e3, t2) {
28500 return new l2(t2).parseInline(e3);
28502 parse(e3, t2 = true) {
28505 for (let r2 = 0; r2 < e3.length; r2++) {
28507 if ((_b2 = (_a4 = this.options.extensions) == null ? void 0 : _a4.renderers) == null ? void 0 : _b2[i3.type]) {
28508 let o2 = i3, a2 = this.options.extensions.renderers[o2.type].call({ parser: this }, o2);
28509 if (a2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(o2.type)) {
28517 n3 += this.renderer.space(s2);
28521 n3 += this.renderer.hr(s2);
28525 n3 += this.renderer.heading(s2);
28529 n3 += this.renderer.code(s2);
28533 n3 += this.renderer.table(s2);
28536 case "blockquote": {
28537 n3 += this.renderer.blockquote(s2);
28541 n3 += this.renderer.list(s2);
28545 n3 += this.renderer.html(s2);
28549 n3 += this.renderer.def(s2);
28552 case "paragraph": {
28553 n3 += this.renderer.paragraph(s2);
28557 let o2 = s2, a2 = this.renderer.text(o2);
28558 for (; r2 + 1 < e3.length && e3[r2 + 1].type === "text"; ) o2 = e3[++r2], a2 += `
28559 ` + this.renderer.text(o2);
28560 t2 ? n3 += this.renderer.paragraph({ type: "paragraph", raw: a2, text: a2, tokens: [{ type: "text", raw: a2, text: a2, escaped: true }] }) : n3 += a2;
28564 let o2 = 'Token with "' + s2.type + '" type was not found.';
28565 if (this.options.silent) return console.error(o2), "";
28566 throw new Error(o2);
28572 parseInline(e3, t2 = this.renderer) {
28575 for (let r2 = 0; r2 < e3.length; r2++) {
28577 if ((_b2 = (_a4 = this.options.extensions) == null ? void 0 : _a4.renderers) == null ? void 0 : _b2[i3.type]) {
28578 let o2 = this.options.extensions.renderers[i3.type].call({ parser: this }, i3);
28579 if (o2 !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i3.type)) {
28599 n3 += t2.image(s2);
28603 n3 += t2.strong(s2);
28611 n3 += t2.codespan(s2);
28627 let o2 = 'Token with "' + s2.type + '" type was not found.';
28628 if (this.options.silent) return console.error(o2), "";
28629 throw new Error(o2);
28638 __publicField(this, "options");
28639 __publicField(this, "block");
28640 this.options = e3 || O;
28648 processAllTokens(e3) {
28652 return this.block ? b.lex : b.lexInline;
28655 return this.block ? R.parse : R.parseInline;
28657 }, __publicField(_a, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), _a);
28659 constructor(...e3) {
28660 __publicField(this, "defaults", L());
28661 __publicField(this, "options", this.setOptions);
28662 __publicField(this, "parse", this.parseMarkdown(true));
28663 __publicField(this, "parseInline", this.parseMarkdown(false));
28664 __publicField(this, "Parser", R);
28665 __publicField(this, "Renderer", P);
28666 __publicField(this, "TextRenderer", S);
28667 __publicField(this, "Lexer", b);
28668 __publicField(this, "Tokenizer", y);
28669 __publicField(this, "Hooks", $);
28672 walkTokens(e3, t2) {
28675 for (let r2 of e3) switch (n3 = n3.concat(t2.call(this, r2)), r2.type) {
28678 for (let s2 of i3.header) n3 = n3.concat(this.walkTokens(s2.tokens, t2));
28679 for (let s2 of i3.rows) for (let o2 of s2) n3 = n3.concat(this.walkTokens(o2.tokens, t2));
28684 n3 = n3.concat(this.walkTokens(i3.items, t2));
28689 ((_b2 = (_a4 = this.defaults.extensions) == null ? void 0 : _a4.childTokens) == null ? void 0 : _b2[i3.type]) ? this.defaults.extensions.childTokens[i3.type].forEach((s2) => {
28690 let o2 = i3[s2].flat(1 / 0);
28691 n3 = n3.concat(this.walkTokens(o2, t2));
28692 }) : i3.tokens && (n3 = n3.concat(this.walkTokens(i3.tokens, t2)));
28698 let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} };
28699 return e3.forEach((n3) => {
28700 let r2 = { ...n3 };
28701 if (r2.async = this.defaults.async || r2.async || false, n3.extensions && (n3.extensions.forEach((i3) => {
28702 if (!i3.name) throw new Error("extension name required");
28703 if ("renderer" in i3) {
28704 let s2 = t2.renderers[i3.name];
28705 s2 ? t2.renderers[i3.name] = function(...o2) {
28706 let a2 = i3.renderer.apply(this, o2);
28707 return a2 === false && (a2 = s2.apply(this, o2)), a2;
28708 } : t2.renderers[i3.name] = i3.renderer;
28710 if ("tokenizer" in i3) {
28711 if (!i3.level || i3.level !== "block" && i3.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
28712 let s2 = t2[i3.level];
28713 s2 ? s2.unshift(i3.tokenizer) : t2[i3.level] = [i3.tokenizer], i3.start && (i3.level === "block" ? t2.startBlock ? t2.startBlock.push(i3.start) : t2.startBlock = [i3.start] : i3.level === "inline" && (t2.startInline ? t2.startInline.push(i3.start) : t2.startInline = [i3.start]));
28715 "childTokens" in i3 && i3.childTokens && (t2.childTokens[i3.name] = i3.childTokens);
28716 }), r2.extensions = t2), n3.renderer) {
28717 let i3 = this.defaults.renderer || new P(this.defaults);
28718 for (let s2 in n3.renderer) {
28719 if (!(s2 in i3)) throw new Error(`renderer '${s2}' does not exist`);
28720 if (["options", "parser"].includes(s2)) continue;
28721 let o2 = s2, a2 = n3.renderer[o2], u2 = i3[o2];
28722 i3[o2] = (...p2) => {
28723 let c2 = a2.apply(i3, p2);
28724 return c2 === false && (c2 = u2.apply(i3, p2)), c2 || "";
28729 if (n3.tokenizer) {
28730 let i3 = this.defaults.tokenizer || new y(this.defaults);
28731 for (let s2 in n3.tokenizer) {
28732 if (!(s2 in i3)) throw new Error(`tokenizer '${s2}' does not exist`);
28733 if (["options", "rules", "lexer"].includes(s2)) continue;
28734 let o2 = s2, a2 = n3.tokenizer[o2], u2 = i3[o2];
28735 i3[o2] = (...p2) => {
28736 let c2 = a2.apply(i3, p2);
28737 return c2 === false && (c2 = u2.apply(i3, p2)), c2;
28743 let i3 = this.defaults.hooks || new $();
28744 for (let s2 in n3.hooks) {
28745 if (!(s2 in i3)) throw new Error(`hook '${s2}' does not exist`);
28746 if (["options", "block"].includes(s2)) continue;
28747 let o2 = s2, a2 = n3.hooks[o2], u2 = i3[o2];
28748 $.passThroughHooks.has(s2) ? i3[o2] = (p2) => {
28749 if (this.defaults.async) return Promise.resolve(a2.call(i3, p2)).then((f2) => u2.call(i3, f2));
28750 let c2 = a2.call(i3, p2);
28751 return u2.call(i3, c2);
28752 } : i3[o2] = (...p2) => {
28753 let c2 = a2.apply(i3, p2);
28754 return c2 === false && (c2 = u2.apply(i3, p2)), c2;
28759 if (n3.walkTokens) {
28760 let i3 = this.defaults.walkTokens, s2 = n3.walkTokens;
28761 r2.walkTokens = function(o2) {
28763 return a2.push(s2.call(this, o2)), i3 && (a2 = a2.concat(i3.call(this, o2))), a2;
28766 this.defaults = { ...this.defaults, ...r2 };
28770 return this.defaults = { ...this.defaults, ...e3 }, this;
28773 return b.lex(e3, t2 != null ? t2 : this.defaults);
28776 return R.parse(e3, t2 != null ? t2 : this.defaults);
28778 parseMarkdown(e3) {
28779 return (n3, r2) => {
28780 let i3 = { ...r2 }, s2 = { ...this.defaults, ...i3 }, o2 = this.onError(!!s2.silent, !!s2.async);
28781 if (this.defaults.async === true && i3.async === false) return o2(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
28782 if (typeof n3 > "u" || n3 === null) return o2(new Error("marked(): input parameter is undefined or null"));
28783 if (typeof n3 != "string") return o2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n3) + ", string expected"));
28784 s2.hooks && (s2.hooks.options = s2, s2.hooks.block = e3);
28785 let a2 = s2.hooks ? s2.hooks.provideLexer() : e3 ? b.lex : b.lexInline, u2 = s2.hooks ? s2.hooks.provideParser() : e3 ? R.parse : R.parseInline;
28786 if (s2.async) return Promise.resolve(s2.hooks ? s2.hooks.preprocess(n3) : n3).then((p2) => a2(p2, s2)).then((p2) => s2.hooks ? s2.hooks.processAllTokens(p2) : p2).then((p2) => s2.walkTokens ? Promise.all(this.walkTokens(p2, s2.walkTokens)).then(() => p2) : p2).then((p2) => u2(p2, s2)).then((p2) => s2.hooks ? s2.hooks.postprocess(p2) : p2).catch(o2);
28788 s2.hooks && (n3 = s2.hooks.preprocess(n3));
28789 let p2 = a2(n3, s2);
28790 s2.hooks && (p2 = s2.hooks.processAllTokens(p2)), s2.walkTokens && this.walkTokens(p2, s2.walkTokens);
28791 let c2 = u2(p2, s2);
28792 return s2.hooks && (c2 = s2.hooks.postprocess(c2)), c2;
28800 if (n3.message += `
28801 Please report this to https://github.com/markedjs/marked.`, e3) {
28802 let r2 = "<p>An error occurred:</p><pre>" + w(n3.message + "", true) + "</pre>";
28803 return t2 ? Promise.resolve(r2) : r2;
28805 if (t2) return Promise.reject(n3);
28811 d.options = d.setOptions = function(l4) {
28812 return _.setOptions(l4), d.defaults = _.defaults, H(d.defaults), d;
28816 d.use = function(...l4) {
28817 return _.use(...l4), d.defaults = _.defaults, H(d.defaults), d;
28819 d.walkTokens = function(l4, e3) {
28820 return _.walkTokens(l4, e3);
28822 d.parseInline = _.parseInline;
28824 d.parser = R.parse;
28826 d.TextRenderer = S;
28836 Nt = d.parseInline;
28842 // modules/services/osmose.js
28843 var osmose_exports = {};
28844 __export(osmose_exports, {
28845 default: () => osmose_default
28847 function abortRequest2(controller) {
28849 controller.abort();
28852 function abortUnwantedRequests2(cache, tiles) {
28853 Object.keys(cache.inflightTile).forEach((k2) => {
28854 let wanted = tiles.find((tile) => k2 === tile.id);
28856 abortRequest2(cache.inflightTile[k2]);
28857 delete cache.inflightTile[k2];
28861 function encodeIssueRtree2(d4) {
28862 return { minX: d4.loc[0], minY: d4.loc[1], maxX: d4.loc[0], maxY: d4.loc[1], data: d4 };
28864 function updateRtree2(item, replace) {
28865 _cache2.rtree.remove(item, (a2, b3) => a2.data.id === b3.data.id);
28867 _cache2.rtree.insert(item);
28870 function preventCoincident(loc) {
28871 let coincident = false;
28873 let delta = coincident ? [1e-5, 0] : [0, 1e-5];
28874 loc = geoVecAdd(loc, delta);
28875 let bbox2 = geoExtent(loc).bbox();
28876 coincident = _cache2.rtree.search(bbox2).length;
28877 } while (coincident);
28880 var tiler2, dispatch3, _tileZoom2, _osmoseUrlRoot, _osmoseData, _cache2, osmose_default;
28881 var init_osmose = __esm({
28882 "modules/services/osmose.js"() {
28888 init_file_fetcher();
28893 tiler2 = utilTiler();
28894 dispatch3 = dispatch_default("loaded");
28896 _osmoseUrlRoot = "https://osmose.openstreetmap.fr/api/0.3";
28897 _osmoseData = { icons: {}, items: [] };
28901 _mainFileFetcher.get("qa_data").then((d4) => {
28902 _osmoseData = d4.osmose;
28903 _osmoseData.items = Object.keys(d4.osmose.icons).map((s2) => s2.split("-")[0]).reduce((unique, item) => unique.indexOf(item) !== -1 ? unique : [...unique, item], []);
28908 this.event = utilRebind(this, dispatch3, "on");
28914 Object.values(_cache2.inflightTile).forEach(abortRequest2);
28915 _strings = _cache2.strings;
28916 _colors = _cache2.colors;
28924 rtree: new RBush(),
28929 loadIssues(projection2) {
28931 // Tiles return a maximum # of issues
28932 // So we want to filter our request for only types iD supports
28933 item: _osmoseData.items
28935 let tiles = tiler2.zoomExtent([_tileZoom2, _tileZoom2]).getTiles(projection2);
28936 abortUnwantedRequests2(_cache2, tiles);
28937 tiles.forEach((tile) => {
28938 if (_cache2.loadedTile[tile.id] || _cache2.inflightTile[tile.id]) return;
28939 let [x2, y3, z3] = tile.xyz;
28940 let url = `${_osmoseUrlRoot}/issues/${z3}/${x2}/${y3}.geojson?` + utilQsString(params);
28941 let controller = new AbortController();
28942 _cache2.inflightTile[tile.id] = controller;
28943 json_default(url, { signal: controller.signal }).then((data) => {
28944 delete _cache2.inflightTile[tile.id];
28945 _cache2.loadedTile[tile.id] = true;
28946 if (data.features) {
28947 data.features.forEach((issue) => {
28948 const { item, class: cl, uuid: id2 } = issue.properties;
28949 const itemType = `${item}-${cl}`;
28950 if (itemType in _osmoseData.icons) {
28951 let loc = issue.geometry.coordinates;
28952 loc = preventCoincident(loc);
28953 let d4 = new QAItem(loc, this, itemType, id2, { item });
28954 if (item === 8300 || item === 8360) {
28957 _cache2.data[d4.id] = d4;
28958 _cache2.rtree.insert(encodeIssueRtree2(d4));
28962 dispatch3.call("loaded");
28964 delete _cache2.inflightTile[tile.id];
28965 _cache2.loadedTile[tile.id] = true;
28969 loadIssueDetail(issue) {
28970 if (issue.elems !== void 0) {
28971 return Promise.resolve(issue);
28973 const url = `${_osmoseUrlRoot}/issue/${issue.id}?langs=${_mainLocalizer.localeCode()}`;
28974 const cacheDetails = (data) => {
28975 issue.elems = data.elems.map((e3) => e3.type.substring(0, 1) + e3.id);
28976 issue.detail = data.subtitle ? d(data.subtitle.auto) : "";
28977 this.replaceItem(issue);
28979 return json_default(url).then(cacheDetails).then(() => issue);
28981 loadStrings(locale3 = _mainLocalizer.localeCode()) {
28982 const items = Object.keys(_osmoseData.icons);
28983 if (locale3 in _cache2.strings && Object.keys(_cache2.strings[locale3]).length === items.length) {
28984 return Promise.resolve(_cache2.strings[locale3]);
28986 if (!(locale3 in _cache2.strings)) {
28987 _cache2.strings[locale3] = {};
28989 const allRequests = items.map((itemType) => {
28990 if (itemType in _cache2.strings[locale3]) return null;
28991 const cacheData = (data) => {
28992 const [cat = { items: [] }] = data.categories;
28993 const [item2 = { class: [] }] = cat.items;
28994 const [cl2 = null] = item2.class;
28996 console.log(`Osmose strings request (${itemType}) had unexpected data`);
28999 const { item: itemInt, color: color2 } = item2;
29000 if (/^#[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/.test(color2)) {
29001 _cache2.colors[itemInt] = color2;
29003 const { title, detail, fix, trap } = cl2;
29004 let issueStrings = {};
29005 if (title) issueStrings.title = title.auto;
29006 if (detail) issueStrings.detail = d(detail.auto);
29007 if (trap) issueStrings.trap = d(trap.auto);
29008 if (fix) issueStrings.fix = d(fix.auto);
29009 _cache2.strings[locale3][itemType] = issueStrings;
29011 const [item, cl] = itemType.split("-");
29012 const url = `${_osmoseUrlRoot}/items/${item}/class/${cl}?langs=${locale3}`;
29013 return json_default(url).then(cacheData);
29014 }).filter(Boolean);
29015 return Promise.all(allRequests).then(() => _cache2.strings[locale3]);
29017 getStrings(itemType, locale3 = _mainLocalizer.localeCode()) {
29018 return locale3 in _cache2.strings ? _cache2.strings[locale3][itemType] : {};
29020 getColor(itemType) {
29021 return itemType in _cache2.colors ? _cache2.colors[itemType] : "#FFFFFF";
29023 postUpdate(issue, callback) {
29024 if (_cache2.inflightPost[issue.id]) {
29025 return callback({ message: "Issue update already inflight", status: -2 }, issue);
29027 const url = `${_osmoseUrlRoot}/issue/${issue.id}/${issue.newStatus}`;
29028 const controller = new AbortController();
29029 const after = () => {
29030 delete _cache2.inflightPost[issue.id];
29031 this.removeItem(issue);
29032 if (issue.newStatus === "done") {
29033 if (!(issue.item in _cache2.closed)) {
29034 _cache2.closed[issue.item] = 0;
29036 _cache2.closed[issue.item] += 1;
29038 if (callback) callback(null, issue);
29040 _cache2.inflightPost[issue.id] = controller;
29041 fetch(url, { signal: controller.signal }).then(after).catch((err) => {
29042 delete _cache2.inflightPost[issue.id];
29043 if (callback) callback(err.message);
29046 // Get all cached QAItems covering the viewport
29047 getItems(projection2) {
29048 const viewport = projection2.clipExtent();
29049 const min3 = [viewport[0][0], viewport[1][1]];
29050 const max3 = [viewport[1][0], viewport[0][1]];
29051 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
29052 return _cache2.rtree.search(bbox2).map((d4) => d4.data);
29054 // Get a QAItem from cache
29055 // NOTE: Don't change method name until UI v3 is merged
29057 return _cache2.data[id2];
29059 // get the name of the icon to display for this item
29060 getIcon(itemType) {
29061 return _osmoseData.icons[itemType];
29063 // Replace a single QAItem in the cache
29064 replaceItem(item) {
29065 if (!(item instanceof QAItem) || !item.id) return;
29066 _cache2.data[item.id] = item;
29067 updateRtree2(encodeIssueRtree2(item), true);
29070 // Remove a single QAItem from the cache
29072 if (!(item instanceof QAItem) || !item.id) return;
29073 delete _cache2.data[item.id];
29074 updateRtree2(encodeIssueRtree2(item), false);
29076 // Used to populate `closed:osmose:*` changeset tags
29077 getClosedCounts() {
29078 return _cache2.closed;
29081 return `https://osmose.openstreetmap.fr/en/error/${item.id}`;
29087 // node_modules/pbf/index.js
29088 function readVarintRemainder(l4, s2, p2) {
29089 const buf = p2.buf;
29091 b3 = buf[p2.pos++];
29092 h3 = (b3 & 112) >> 4;
29093 if (b3 < 128) return toNum(l4, h3, s2);
29094 b3 = buf[p2.pos++];
29095 h3 |= (b3 & 127) << 3;
29096 if (b3 < 128) return toNum(l4, h3, s2);
29097 b3 = buf[p2.pos++];
29098 h3 |= (b3 & 127) << 10;
29099 if (b3 < 128) return toNum(l4, h3, s2);
29100 b3 = buf[p2.pos++];
29101 h3 |= (b3 & 127) << 17;
29102 if (b3 < 128) return toNum(l4, h3, s2);
29103 b3 = buf[p2.pos++];
29104 h3 |= (b3 & 127) << 24;
29105 if (b3 < 128) return toNum(l4, h3, s2);
29106 b3 = buf[p2.pos++];
29107 h3 |= (b3 & 1) << 31;
29108 if (b3 < 128) return toNum(l4, h3, s2);
29109 throw new Error("Expected varint not more than 10 bytes");
29111 function toNum(low, high, isSigned) {
29112 return isSigned ? high * 4294967296 + (low >>> 0) : (high >>> 0) * 4294967296 + (low >>> 0);
29114 function writeBigVarint(val, pbf) {
29117 low = val % 4294967296 | 0;
29118 high = val / 4294967296 | 0;
29120 low = ~(-val % 4294967296);
29121 high = ~(-val / 4294967296);
29122 if (low ^ 4294967295) {
29126 high = high + 1 | 0;
29129 if (val >= 18446744073709552e3 || val < -18446744073709552e3) {
29130 throw new Error("Given varint doesn't fit into 10 bytes");
29133 writeBigVarintLow(low, high, pbf);
29134 writeBigVarintHigh(high, pbf);
29136 function writeBigVarintLow(low, high, pbf) {
29137 pbf.buf[pbf.pos++] = low & 127 | 128;
29139 pbf.buf[pbf.pos++] = low & 127 | 128;
29141 pbf.buf[pbf.pos++] = low & 127 | 128;
29143 pbf.buf[pbf.pos++] = low & 127 | 128;
29145 pbf.buf[pbf.pos] = low & 127;
29147 function writeBigVarintHigh(high, pbf) {
29148 const lsb = (high & 7) << 4;
29149 pbf.buf[pbf.pos++] |= lsb | ((high >>>= 3) ? 128 : 0);
29151 pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
29153 pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
29155 pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
29157 pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
29159 pbf.buf[pbf.pos++] = high & 127;
29161 function makeRoomForExtraLength(startPos, len, pbf) {
29162 const extraLen = len <= 16383 ? 1 : len <= 2097151 ? 2 : len <= 268435455 ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));
29163 pbf.realloc(extraLen);
29164 for (let i3 = pbf.pos - 1; i3 >= startPos; i3--) pbf.buf[i3 + extraLen] = pbf.buf[i3];
29166 function writePackedVarint(arr, pbf) {
29167 for (let i3 = 0; i3 < arr.length; i3++) pbf.writeVarint(arr[i3]);
29169 function writePackedSVarint(arr, pbf) {
29170 for (let i3 = 0; i3 < arr.length; i3++) pbf.writeSVarint(arr[i3]);
29172 function writePackedFloat(arr, pbf) {
29173 for (let i3 = 0; i3 < arr.length; i3++) pbf.writeFloat(arr[i3]);
29175 function writePackedDouble(arr, pbf) {
29176 for (let i3 = 0; i3 < arr.length; i3++) pbf.writeDouble(arr[i3]);
29178 function writePackedBoolean(arr, pbf) {
29179 for (let i3 = 0; i3 < arr.length; i3++) pbf.writeBoolean(arr[i3]);
29181 function writePackedFixed32(arr, pbf) {
29182 for (let i3 = 0; i3 < arr.length; i3++) pbf.writeFixed32(arr[i3]);
29184 function writePackedSFixed32(arr, pbf) {
29185 for (let i3 = 0; i3 < arr.length; i3++) pbf.writeSFixed32(arr[i3]);
29187 function writePackedFixed64(arr, pbf) {
29188 for (let i3 = 0; i3 < arr.length; i3++) pbf.writeFixed64(arr[i3]);
29190 function writePackedSFixed64(arr, pbf) {
29191 for (let i3 = 0; i3 < arr.length; i3++) pbf.writeSFixed64(arr[i3]);
29193 function readUtf8(buf, pos, end) {
29197 const b0 = buf[i3];
29199 let bytesPerSequence = b0 > 239 ? 4 : b0 > 223 ? 3 : b0 > 191 ? 2 : 1;
29200 if (i3 + bytesPerSequence > end) break;
29202 if (bytesPerSequence === 1) {
29206 } else if (bytesPerSequence === 2) {
29208 if ((b1 & 192) === 128) {
29209 c2 = (b0 & 31) << 6 | b1 & 63;
29214 } else if (bytesPerSequence === 3) {
29217 if ((b1 & 192) === 128 && (b22 & 192) === 128) {
29218 c2 = (b0 & 15) << 12 | (b1 & 63) << 6 | b22 & 63;
29219 if (c2 <= 2047 || c2 >= 55296 && c2 <= 57343) {
29223 } else if (bytesPerSequence === 4) {
29227 if ((b1 & 192) === 128 && (b22 & 192) === 128 && (b3 & 192) === 128) {
29228 c2 = (b0 & 15) << 18 | (b1 & 63) << 12 | (b22 & 63) << 6 | b3 & 63;
29229 if (c2 <= 65535 || c2 >= 1114112) {
29236 bytesPerSequence = 1;
29237 } else if (c2 > 65535) {
29239 str += String.fromCharCode(c2 >>> 10 & 1023 | 55296);
29240 c2 = 56320 | c2 & 1023;
29242 str += String.fromCharCode(c2);
29243 i3 += bytesPerSequence;
29247 function writeUtf8(buf, str, pos) {
29248 for (let i3 = 0, c2, lead; i3 < str.length; i3++) {
29249 c2 = str.charCodeAt(i3);
29250 if (c2 > 55295 && c2 < 57344) {
29259 c2 = lead - 55296 << 10 | c2 - 56320 | 65536;
29263 if (c2 > 56319 || i3 + 1 === str.length) {
29282 buf[pos++] = c2 >> 6 | 192;
29285 buf[pos++] = c2 >> 12 | 224;
29287 buf[pos++] = c2 >> 18 | 240;
29288 buf[pos++] = c2 >> 12 & 63 | 128;
29290 buf[pos++] = c2 >> 6 & 63 | 128;
29292 buf[pos++] = c2 & 63 | 128;
29297 var SHIFT_LEFT_32, SHIFT_RIGHT_32, TEXT_DECODER_MIN_LENGTH, utf8TextDecoder, PBF_VARINT, PBF_FIXED64, PBF_BYTES, PBF_FIXED32, Pbf;
29298 var init_pbf = __esm({
29299 "node_modules/pbf/index.js"() {
29300 SHIFT_LEFT_32 = (1 << 16) * (1 << 16);
29301 SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;
29302 TEXT_DECODER_MIN_LENGTH = 12;
29303 utf8TextDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder("utf-8");
29310 * @param {Uint8Array | ArrayBuffer} [buf]
29312 constructor(buf = new Uint8Array(16)) {
29313 this.buf = ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf);
29314 this.dataView = new DataView(this.buf.buffer);
29317 this.length = this.buf.length;
29319 // === READING =================================================================
29322 * @param {(tag: number, result: T, pbf: Pbf) => void} readField
29323 * @param {T} result
29324 * @param {number} [end]
29326 readFields(readField, result, end = this.length) {
29327 while (this.pos < end) {
29328 const val = this.readVarint(), tag = val >> 3, startPos = this.pos;
29329 this.type = val & 7;
29330 readField(tag, result, this);
29331 if (this.pos === startPos) this.skip(val);
29337 * @param {(tag: number, result: T, pbf: Pbf) => void} readField
29338 * @param {T} result
29340 readMessage(readField, result) {
29341 return this.readFields(readField, result, this.readVarint() + this.pos);
29344 const val = this.dataView.getUint32(this.pos, true);
29349 const val = this.dataView.getInt32(this.pos, true);
29353 // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
29355 const val = this.dataView.getUint32(this.pos, true) + this.dataView.getUint32(this.pos + 4, true) * SHIFT_LEFT_32;
29360 const val = this.dataView.getUint32(this.pos, true) + this.dataView.getInt32(this.pos + 4, true) * SHIFT_LEFT_32;
29365 const val = this.dataView.getFloat32(this.pos, true);
29370 const val = this.dataView.getFloat64(this.pos, true);
29375 * @param {boolean} [isSigned]
29377 readVarint(isSigned) {
29378 const buf = this.buf;
29380 b3 = buf[this.pos++];
29382 if (b3 < 128) return val;
29383 b3 = buf[this.pos++];
29384 val |= (b3 & 127) << 7;
29385 if (b3 < 128) return val;
29386 b3 = buf[this.pos++];
29387 val |= (b3 & 127) << 14;
29388 if (b3 < 128) return val;
29389 b3 = buf[this.pos++];
29390 val |= (b3 & 127) << 21;
29391 if (b3 < 128) return val;
29392 b3 = buf[this.pos];
29393 val |= (b3 & 15) << 28;
29394 return readVarintRemainder(val, isSigned, this);
29397 return this.readVarint(true);
29400 const num = this.readVarint();
29401 return num % 2 === 1 ? (num + 1) / -2 : num / 2;
29404 return Boolean(this.readVarint());
29407 const end = this.readVarint() + this.pos;
29408 const pos = this.pos;
29410 if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {
29411 return utf8TextDecoder.decode(this.buf.subarray(pos, end));
29413 return readUtf8(this.buf, pos, end);
29416 const end = this.readVarint() + this.pos, buffer = this.buf.subarray(this.pos, end);
29420 // verbose for performance reasons; doesn't affect gzipped size
29422 * @param {number[]} [arr]
29423 * @param {boolean} [isSigned]
29425 readPackedVarint(arr = [], isSigned) {
29426 const end = this.readPackedEnd();
29427 while (this.pos < end) arr.push(this.readVarint(isSigned));
29430 /** @param {number[]} [arr] */
29431 readPackedSVarint(arr = []) {
29432 const end = this.readPackedEnd();
29433 while (this.pos < end) arr.push(this.readSVarint());
29436 /** @param {boolean[]} [arr] */
29437 readPackedBoolean(arr = []) {
29438 const end = this.readPackedEnd();
29439 while (this.pos < end) arr.push(this.readBoolean());
29442 /** @param {number[]} [arr] */
29443 readPackedFloat(arr = []) {
29444 const end = this.readPackedEnd();
29445 while (this.pos < end) arr.push(this.readFloat());
29448 /** @param {number[]} [arr] */
29449 readPackedDouble(arr = []) {
29450 const end = this.readPackedEnd();
29451 while (this.pos < end) arr.push(this.readDouble());
29454 /** @param {number[]} [arr] */
29455 readPackedFixed32(arr = []) {
29456 const end = this.readPackedEnd();
29457 while (this.pos < end) arr.push(this.readFixed32());
29460 /** @param {number[]} [arr] */
29461 readPackedSFixed32(arr = []) {
29462 const end = this.readPackedEnd();
29463 while (this.pos < end) arr.push(this.readSFixed32());
29466 /** @param {number[]} [arr] */
29467 readPackedFixed64(arr = []) {
29468 const end = this.readPackedEnd();
29469 while (this.pos < end) arr.push(this.readFixed64());
29472 /** @param {number[]} [arr] */
29473 readPackedSFixed64(arr = []) {
29474 const end = this.readPackedEnd();
29475 while (this.pos < end) arr.push(this.readSFixed64());
29479 return this.type === PBF_BYTES ? this.readVarint() + this.pos : this.pos + 1;
29481 /** @param {number} val */
29483 const type2 = val & 7;
29484 if (type2 === PBF_VARINT) while (this.buf[this.pos++] > 127) {
29486 else if (type2 === PBF_BYTES) this.pos = this.readVarint() + this.pos;
29487 else if (type2 === PBF_FIXED32) this.pos += 4;
29488 else if (type2 === PBF_FIXED64) this.pos += 8;
29489 else throw new Error(`Unimplemented type: ${type2}`);
29491 // === WRITING =================================================================
29493 * @param {number} tag
29494 * @param {number} type
29496 writeTag(tag, type2) {
29497 this.writeVarint(tag << 3 | type2);
29499 /** @param {number} min */
29501 let length2 = this.length || 16;
29502 while (length2 < this.pos + min3) length2 *= 2;
29503 if (length2 !== this.length) {
29504 const buf = new Uint8Array(length2);
29507 this.dataView = new DataView(buf.buffer);
29508 this.length = length2;
29512 this.length = this.pos;
29514 return this.buf.subarray(0, this.length);
29516 /** @param {number} val */
29517 writeFixed32(val) {
29519 this.dataView.setInt32(this.pos, val, true);
29522 /** @param {number} val */
29523 writeSFixed32(val) {
29525 this.dataView.setInt32(this.pos, val, true);
29528 /** @param {number} val */
29529 writeFixed64(val) {
29531 this.dataView.setInt32(this.pos, val & -1, true);
29532 this.dataView.setInt32(this.pos + 4, Math.floor(val * SHIFT_RIGHT_32), true);
29535 /** @param {number} val */
29536 writeSFixed64(val) {
29538 this.dataView.setInt32(this.pos, val & -1, true);
29539 this.dataView.setInt32(this.pos + 4, Math.floor(val * SHIFT_RIGHT_32), true);
29542 /** @param {number} val */
29545 if (val > 268435455 || val < 0) {
29546 writeBigVarint(val, this);
29550 this.buf[this.pos++] = val & 127 | (val > 127 ? 128 : 0);
29551 if (val <= 127) return;
29552 this.buf[this.pos++] = (val >>>= 7) & 127 | (val > 127 ? 128 : 0);
29553 if (val <= 127) return;
29554 this.buf[this.pos++] = (val >>>= 7) & 127 | (val > 127 ? 128 : 0);
29555 if (val <= 127) return;
29556 this.buf[this.pos++] = val >>> 7 & 127;
29558 /** @param {number} val */
29559 writeSVarint(val) {
29560 this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);
29562 /** @param {boolean} val */
29563 writeBoolean(val) {
29564 this.writeVarint(+val);
29566 /** @param {string} str */
29569 this.realloc(str.length * 4);
29571 const startPos = this.pos;
29572 this.pos = writeUtf8(this.buf, str, this.pos);
29573 const len = this.pos - startPos;
29574 if (len >= 128) makeRoomForExtraLength(startPos, len, this);
29575 this.pos = startPos - 1;
29576 this.writeVarint(len);
29579 /** @param {number} val */
29582 this.dataView.setFloat32(this.pos, val, true);
29585 /** @param {number} val */
29588 this.dataView.setFloat64(this.pos, val, true);
29591 /** @param {Uint8Array} buffer */
29592 writeBytes(buffer) {
29593 const len = buffer.length;
29594 this.writeVarint(len);
29596 for (let i3 = 0; i3 < len; i3++) this.buf[this.pos++] = buffer[i3];
29600 * @param {(obj: T, pbf: Pbf) => void} fn
29603 writeRawMessage(fn, obj) {
29605 const startPos = this.pos;
29607 const len = this.pos - startPos;
29608 if (len >= 128) makeRoomForExtraLength(startPos, len, this);
29609 this.pos = startPos - 1;
29610 this.writeVarint(len);
29615 * @param {number} tag
29616 * @param {(obj: T, pbf: Pbf) => void} fn
29619 writeMessage(tag, fn, obj) {
29620 this.writeTag(tag, PBF_BYTES);
29621 this.writeRawMessage(fn, obj);
29624 * @param {number} tag
29625 * @param {number[]} arr
29627 writePackedVarint(tag, arr) {
29628 if (arr.length) this.writeMessage(tag, writePackedVarint, arr);
29631 * @param {number} tag
29632 * @param {number[]} arr
29634 writePackedSVarint(tag, arr) {
29635 if (arr.length) this.writeMessage(tag, writePackedSVarint, arr);
29638 * @param {number} tag
29639 * @param {boolean[]} arr
29641 writePackedBoolean(tag, arr) {
29642 if (arr.length) this.writeMessage(tag, writePackedBoolean, arr);
29645 * @param {number} tag
29646 * @param {number[]} arr
29648 writePackedFloat(tag, arr) {
29649 if (arr.length) this.writeMessage(tag, writePackedFloat, arr);
29652 * @param {number} tag
29653 * @param {number[]} arr
29655 writePackedDouble(tag, arr) {
29656 if (arr.length) this.writeMessage(tag, writePackedDouble, arr);
29659 * @param {number} tag
29660 * @param {number[]} arr
29662 writePackedFixed32(tag, arr) {
29663 if (arr.length) this.writeMessage(tag, writePackedFixed32, arr);
29666 * @param {number} tag
29667 * @param {number[]} arr
29669 writePackedSFixed32(tag, arr) {
29670 if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr);
29673 * @param {number} tag
29674 * @param {number[]} arr
29676 writePackedFixed64(tag, arr) {
29677 if (arr.length) this.writeMessage(tag, writePackedFixed64, arr);
29680 * @param {number} tag
29681 * @param {number[]} arr
29683 writePackedSFixed64(tag, arr) {
29684 if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr);
29687 * @param {number} tag
29688 * @param {Uint8Array} buffer
29690 writeBytesField(tag, buffer) {
29691 this.writeTag(tag, PBF_BYTES);
29692 this.writeBytes(buffer);
29695 * @param {number} tag
29696 * @param {number} val
29698 writeFixed32Field(tag, val) {
29699 this.writeTag(tag, PBF_FIXED32);
29700 this.writeFixed32(val);
29703 * @param {number} tag
29704 * @param {number} val
29706 writeSFixed32Field(tag, val) {
29707 this.writeTag(tag, PBF_FIXED32);
29708 this.writeSFixed32(val);
29711 * @param {number} tag
29712 * @param {number} val
29714 writeFixed64Field(tag, val) {
29715 this.writeTag(tag, PBF_FIXED64);
29716 this.writeFixed64(val);
29719 * @param {number} tag
29720 * @param {number} val
29722 writeSFixed64Field(tag, val) {
29723 this.writeTag(tag, PBF_FIXED64);
29724 this.writeSFixed64(val);
29727 * @param {number} tag
29728 * @param {number} val
29730 writeVarintField(tag, val) {
29731 this.writeTag(tag, PBF_VARINT);
29732 this.writeVarint(val);
29735 * @param {number} tag
29736 * @param {number} val
29738 writeSVarintField(tag, val) {
29739 this.writeTag(tag, PBF_VARINT);
29740 this.writeSVarint(val);
29743 * @param {number} tag
29744 * @param {string} str
29746 writeStringField(tag, str) {
29747 this.writeTag(tag, PBF_BYTES);
29748 this.writeString(str);
29751 * @param {number} tag
29752 * @param {number} val
29754 writeFloatField(tag, val) {
29755 this.writeTag(tag, PBF_FIXED32);
29756 this.writeFloat(val);
29759 * @param {number} tag
29760 * @param {number} val
29762 writeDoubleField(tag, val) {
29763 this.writeTag(tag, PBF_FIXED64);
29764 this.writeDouble(val);
29767 * @param {number} tag
29768 * @param {boolean} val
29770 writeBooleanField(tag, val) {
29771 this.writeVarintField(tag, +val);
29777 // node_modules/@mapbox/point-geometry/index.js
29778 function Point(x2, y3) {
29782 var init_point_geometry = __esm({
29783 "node_modules/@mapbox/point-geometry/index.js"() {
29784 Point.prototype = {
29786 * Clone this point, returning a new point that can be modified
29787 * without affecting the old one.
29788 * @return {Point} the clone
29791 return new Point(this.x, this.y);
29794 * Add this point's x & y coordinates to another point,
29795 * yielding a new point.
29796 * @param {Point} p the other point
29797 * @return {Point} output point
29800 return this.clone()._add(p2);
29803 * Subtract this point's x & y coordinates to from point,
29804 * yielding a new point.
29805 * @param {Point} p the other point
29806 * @return {Point} output point
29809 return this.clone()._sub(p2);
29812 * Multiply this point's x & y coordinates by point,
29813 * yielding a new point.
29814 * @param {Point} p the other point
29815 * @return {Point} output point
29818 return this.clone()._multByPoint(p2);
29821 * Divide this point's x & y coordinates by point,
29822 * yielding a new point.
29823 * @param {Point} p the other point
29824 * @return {Point} output point
29827 return this.clone()._divByPoint(p2);
29830 * Multiply this point's x & y coordinates by a factor,
29831 * yielding a new point.
29832 * @param {number} k factor
29833 * @return {Point} output point
29836 return this.clone()._mult(k2);
29839 * Divide this point's x & y coordinates by a factor,
29840 * yielding a new point.
29841 * @param {number} k factor
29842 * @return {Point} output point
29845 return this.clone()._div(k2);
29848 * Rotate this point around the 0, 0 origin by an angle a,
29850 * @param {number} a angle to rotate around, in radians
29851 * @return {Point} output point
29854 return this.clone()._rotate(a2);
29857 * Rotate this point around p point by an angle a,
29859 * @param {number} a angle to rotate around, in radians
29860 * @param {Point} p Point to rotate around
29861 * @return {Point} output point
29863 rotateAround(a2, p2) {
29864 return this.clone()._rotateAround(a2, p2);
29867 * Multiply this point by a 4x1 transformation matrix
29868 * @param {[number, number, number, number]} m transformation matrix
29869 * @return {Point} output point
29872 return this.clone()._matMult(m3);
29875 * Calculate this point but as a unit vector from 0, 0, meaning
29876 * that the distance from the resulting point to the 0, 0
29877 * coordinate will be equal to 1 and the angle from the resulting
29878 * point to the 0, 0 coordinate will be the same as before.
29879 * @return {Point} unit vector point
29882 return this.clone()._unit();
29885 * Compute a perpendicular point, where the new y coordinate
29886 * is the old x coordinate and the new x coordinate is the old y
29887 * coordinate multiplied by -1
29888 * @return {Point} perpendicular point
29891 return this.clone()._perp();
29894 * Return a version of this point with the x & y coordinates
29895 * rounded to integers.
29896 * @return {Point} rounded point
29899 return this.clone()._round();
29902 * Return the magnitude of this point: this is the Euclidean
29903 * distance from the 0, 0 coordinate to this point's x and y
29905 * @return {number} magnitude
29908 return Math.sqrt(this.x * this.x + this.y * this.y);
29911 * Judge whether this point is equal to another point, returning
29913 * @param {Point} other the other point
29914 * @return {boolean} whether the points are equal
29917 return this.x === other.x && this.y === other.y;
29920 * Calculate the distance from this point to another point
29921 * @param {Point} p the other point
29922 * @return {number} distance
29925 return Math.sqrt(this.distSqr(p2));
29928 * Calculate the distance from this point to another point,
29929 * without the square root step. Useful if you're comparing
29930 * relative distances.
29931 * @param {Point} p the other point
29932 * @return {number} distance
29935 const dx = p2.x - this.x, dy = p2.y - this.y;
29936 return dx * dx + dy * dy;
29939 * Get the angle from the 0, 0 coordinate to this point, in radians
29941 * @return {number} angle
29944 return Math.atan2(this.y, this.x);
29947 * Get the angle from this point to another point, in radians
29948 * @param {Point} b the other point
29949 * @return {number} angle
29952 return Math.atan2(this.y - b3.y, this.x - b3.x);
29955 * Get the angle between this point and another point, in radians
29956 * @param {Point} b the other point
29957 * @return {number} angle
29960 return this.angleWithSep(b3.x, b3.y);
29963 * Find the angle of the two vectors, solving the formula for
29964 * the cross product a x b = |a||b|sin(θ) for θ.
29965 * @param {number} x the x-coordinate
29966 * @param {number} y the y-coordinate
29967 * @return {number} the angle in radians
29969 angleWithSep(x2, y3) {
29971 this.x * y3 - this.y * x2,
29972 this.x * x2 + this.y * y3
29975 /** @param {[number, number, number, number]} m */
29977 const x2 = m3[0] * this.x + m3[1] * this.y, y3 = m3[2] * this.x + m3[3] * this.y;
29982 /** @param {Point} p */
29988 /** @param {Point} p */
29994 /** @param {number} k */
30000 /** @param {number} k */
30006 /** @param {Point} p */
30012 /** @param {Point} p */
30019 this._div(this.mag());
30028 /** @param {number} angle */
30030 const cos2 = Math.cos(angle2), sin2 = Math.sin(angle2), x2 = cos2 * this.x - sin2 * this.y, y3 = sin2 * this.x + cos2 * this.y;
30036 * @param {number} angle
30039 _rotateAround(angle2, p2) {
30040 const cos2 = Math.cos(angle2), sin2 = Math.sin(angle2), x2 = p2.x + cos2 * (this.x - p2.x) - sin2 * (this.y - p2.y), y3 = p2.y + sin2 * (this.x - p2.x) + cos2 * (this.y - p2.y);
30046 this.x = Math.round(this.x);
30047 this.y = Math.round(this.y);
30052 Point.convert = function(p2) {
30053 if (p2 instanceof Point) {
30055 /** @type {Point} */
30059 if (Array.isArray(p2)) {
30060 return new Point(+p2[0], +p2[1]);
30062 if (p2.x !== void 0 && p2.y !== void 0) {
30063 return new Point(+p2.x, +p2.y);
30065 throw new Error("Expected [x, y] or {x, y} point format");
30070 // node_modules/@mapbox/vector-tile/index.js
30071 function readFeature(tag, feature3, pbf) {
30072 if (tag === 1) feature3.id = pbf.readVarint();
30073 else if (tag === 2) readTag(pbf, feature3);
30074 else if (tag === 3) feature3.type = /** @type {0 | 1 | 2 | 3} */
30076 else if (tag === 4) feature3._geometry = pbf.pos;
30078 function readTag(pbf, feature3) {
30079 const end = pbf.readVarint() + pbf.pos;
30080 while (pbf.pos < end) {
30081 const key = feature3._keys[pbf.readVarint()];
30082 const value = feature3._values[pbf.readVarint()];
30083 feature3.properties[key] = value;
30086 function classifyRings(rings) {
30087 const len = rings.length;
30088 if (len <= 1) return [rings];
30089 const polygons = [];
30091 for (let i3 = 0; i3 < len; i3++) {
30092 const area = signedArea(rings[i3]);
30093 if (area === 0) continue;
30094 if (ccw === void 0) ccw = area < 0;
30095 if (ccw === area < 0) {
30096 if (polygon2) polygons.push(polygon2);
30097 polygon2 = [rings[i3]];
30098 } else if (polygon2) {
30099 polygon2.push(rings[i3]);
30102 if (polygon2) polygons.push(polygon2);
30105 function signedArea(ring) {
30107 for (let i3 = 0, len = ring.length, j3 = len - 1, p1, p2; i3 < len; j3 = i3++) {
30110 sum += (p2.x - p1.x) * (p1.y + p2.y);
30114 function readLayer(tag, layer, pbf) {
30115 if (tag === 15) layer.version = pbf.readVarint();
30116 else if (tag === 1) layer.name = pbf.readString();
30117 else if (tag === 5) layer.extent = pbf.readVarint();
30118 else if (tag === 2) layer._features.push(pbf.pos);
30119 else if (tag === 3) layer._keys.push(pbf.readString());
30120 else if (tag === 4) layer._values.push(readValueMessage(pbf));
30122 function readValueMessage(pbf) {
30124 const end = pbf.readVarint() + pbf.pos;
30125 while (pbf.pos < end) {
30126 const tag = pbf.readVarint() >> 3;
30127 value = tag === 1 ? pbf.readString() : tag === 2 ? pbf.readFloat() : tag === 3 ? pbf.readDouble() : tag === 4 ? pbf.readVarint64() : tag === 5 ? pbf.readVarint() : tag === 6 ? pbf.readSVarint() : tag === 7 ? pbf.readBoolean() : null;
30129 if (value == null) {
30130 throw new Error("unknown feature value");
30134 function readTile(tag, layers, pbf) {
30136 const layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);
30137 if (layer.length) layers[layer.name] = layer;
30140 var VectorTileFeature, VectorTileLayer, VectorTile;
30141 var init_vector_tile = __esm({
30142 "node_modules/@mapbox/vector-tile/index.js"() {
30143 init_point_geometry();
30144 VectorTileFeature = class {
30147 * @param {number} end
30148 * @param {number} extent
30149 * @param {string[]} keys
30150 * @param {(number | string | boolean)[]} values
30152 constructor(pbf, end, extent, keys2, values) {
30153 this.properties = {};
30154 this.extent = extent;
30158 this._geometry = -1;
30159 this._keys = keys2;
30160 this._values = values;
30161 pbf.readFields(readFeature, this, end);
30164 const pbf = this._pbf;
30165 pbf.pos = this._geometry;
30166 const end = pbf.readVarint() + pbf.pos;
30173 while (pbf.pos < end) {
30174 if (length2 <= 0) {
30175 const cmdLen = pbf.readVarint();
30177 length2 = cmdLen >> 3;
30180 if (cmd === 1 || cmd === 2) {
30181 x2 += pbf.readSVarint();
30182 y3 += pbf.readSVarint();
30184 if (line) lines.push(line);
30187 if (line) line.push(new Point(x2, y3));
30188 } else if (cmd === 7) {
30190 line.push(line[0].clone());
30193 throw new Error(`unknown command ${cmd}`);
30196 if (line) lines.push(line);
30200 const pbf = this._pbf;
30201 pbf.pos = this._geometry;
30202 const end = pbf.readVarint() + pbf.pos;
30203 let cmd = 1, length2 = 0, x2 = 0, y3 = 0, x12 = Infinity, x22 = -Infinity, y12 = Infinity, y22 = -Infinity;
30204 while (pbf.pos < end) {
30205 if (length2 <= 0) {
30206 const cmdLen = pbf.readVarint();
30208 length2 = cmdLen >> 3;
30211 if (cmd === 1 || cmd === 2) {
30212 x2 += pbf.readSVarint();
30213 y3 += pbf.readSVarint();
30214 if (x2 < x12) x12 = x2;
30215 if (x2 > x22) x22 = x2;
30216 if (y3 < y12) y12 = y3;
30217 if (y3 > y22) y22 = y3;
30218 } else if (cmd !== 7) {
30219 throw new Error(`unknown command ${cmd}`);
30222 return [x12, y12, x22, y22];
30225 * @param {number} x
30226 * @param {number} y
30227 * @param {number} z
30228 * @return {Feature}
30230 toGeoJSON(x2, y3, z3) {
30231 const size = this.extent * Math.pow(2, z3), x05 = this.extent * x2, y05 = this.extent * y3, vtCoords = this.loadGeometry();
30232 function projectPoint(p2) {
30234 (p2.x + x05) * 360 / size - 180,
30235 360 / Math.PI * Math.atan(Math.exp((1 - (p2.y + y05) * 2 / size) * Math.PI)) - 90
30238 function projectLine(line) {
30239 return line.map(projectPoint);
30242 if (this.type === 1) {
30244 for (const line of vtCoords) {
30245 points.push(line[0]);
30247 const coordinates = projectLine(points);
30248 geometry = points.length === 1 ? { type: "Point", coordinates: coordinates[0] } : { type: "MultiPoint", coordinates };
30249 } else if (this.type === 2) {
30250 const coordinates = vtCoords.map(projectLine);
30251 geometry = coordinates.length === 1 ? { type: "LineString", coordinates: coordinates[0] } : { type: "MultiLineString", coordinates };
30252 } else if (this.type === 3) {
30253 const polygons = classifyRings(vtCoords);
30254 const coordinates = [];
30255 for (const polygon2 of polygons) {
30256 coordinates.push(polygon2.map(projectLine));
30258 geometry = coordinates.length === 1 ? { type: "Polygon", coordinates: coordinates[0] } : { type: "MultiPolygon", coordinates };
30260 throw new Error("unknown feature type");
30265 properties: this.properties
30267 if (this.id != null) {
30268 result.id = this.id;
30273 VectorTileFeature.types = ["Unknown", "Point", "LineString", "Polygon"];
30274 VectorTileLayer = class {
30277 * @param {number} [end]
30279 constructor(pbf, end) {
30282 this.extent = 4096;
30287 this._features = [];
30288 pbf.readFields(readLayer, this, end);
30289 this.length = this._features.length;
30291 /** return feature `i` from this layer as a `VectorTileFeature`
30292 * @param {number} i
30295 if (i3 < 0 || i3 >= this._features.length) throw new Error("feature index out of bounds");
30296 this._pbf.pos = this._features[i3];
30297 const end = this._pbf.readVarint() + this._pbf.pos;
30298 return new VectorTileFeature(this._pbf, end, this.extent, this._keys, this._values);
30301 VectorTile = class {
30304 * @param {number} [end]
30306 constructor(pbf, end) {
30307 this.layers = pbf.readFields(readTile, {}, end);
30313 // modules/services/mapillary.js
30314 var mapillary_exports = {};
30315 __export(mapillary_exports, {
30316 default: () => mapillary_default
30318 function loadTiles(which, url, maxZoom2, projection2) {
30319 const tiler8 = utilTiler().zoomExtent([minZoom, maxZoom2]).skipNullIsland(true);
30320 const tiles = tiler8.getTiles(projection2);
30321 tiles.forEach(function(tile) {
30322 loadTile(which, url, tile);
30325 function loadTile(which, url, tile) {
30326 const cache = _mlyCache.requests;
30327 const tileId = `${tile.id}-${which}`;
30328 if (cache.loaded[tileId] || cache.inflight[tileId]) return;
30329 const controller = new AbortController();
30330 cache.inflight[tileId] = controller;
30331 const requestUrl = url.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace("{z}", tile.xyz[2]);
30332 fetch(requestUrl, { signal: controller.signal }).then(function(response) {
30333 if (!response.ok) {
30334 throw new Error(response.status + " " + response.statusText);
30336 cache.loaded[tileId] = true;
30337 delete cache.inflight[tileId];
30338 return response.arrayBuffer();
30339 }).then(function(data) {
30341 throw new Error("No Data");
30343 loadTileDataToCache(data, tile, which);
30344 if (which === "images") {
30345 dispatch4.call("loadedImages");
30346 } else if (which === "signs") {
30347 dispatch4.call("loadedSigns");
30348 } else if (which === "points") {
30349 dispatch4.call("loadedMapFeatures");
30351 }).catch(function() {
30352 cache.loaded[tileId] = true;
30353 delete cache.inflight[tileId];
30356 function loadTileDataToCache(data, tile, which) {
30357 const vectorTile = new VectorTile(new Pbf(data));
30358 let features, cache, layer, i3, feature3, loc, d4;
30359 if (vectorTile.layers.hasOwnProperty("image")) {
30361 cache = _mlyCache.images;
30362 layer = vectorTile.layers.image;
30363 for (i3 = 0; i3 < layer.length; i3++) {
30364 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
30365 loc = feature3.geometry.coordinates;
30369 captured_at: feature3.properties.captured_at,
30370 ca: feature3.properties.compass_angle,
30371 id: feature3.properties.id,
30372 is_pano: feature3.properties.is_pano,
30373 sequence_id: feature3.properties.sequence_id
30375 cache.forImageId[d4.id] = d4;
30385 cache.rtree.load(features);
30388 if (vectorTile.layers.hasOwnProperty("sequence")) {
30390 cache = _mlyCache.sequences;
30391 layer = vectorTile.layers.sequence;
30392 for (i3 = 0; i3 < layer.length; i3++) {
30393 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
30394 if (cache.lineString[feature3.properties.id]) {
30395 cache.lineString[feature3.properties.id].push(feature3);
30397 cache.lineString[feature3.properties.id] = [feature3];
30401 if (vectorTile.layers.hasOwnProperty("point")) {
30403 cache = _mlyCache[which];
30404 layer = vectorTile.layers.point;
30405 for (i3 = 0; i3 < layer.length; i3++) {
30406 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
30407 loc = feature3.geometry.coordinates;
30411 id: feature3.properties.id,
30412 first_seen_at: feature3.properties.first_seen_at,
30413 last_seen_at: feature3.properties.last_seen_at,
30414 value: feature3.properties.value
30425 cache.rtree.load(features);
30428 if (vectorTile.layers.hasOwnProperty("traffic_sign")) {
30430 cache = _mlyCache[which];
30431 layer = vectorTile.layers.traffic_sign;
30432 for (i3 = 0; i3 < layer.length; i3++) {
30433 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
30434 loc = feature3.geometry.coordinates;
30438 id: feature3.properties.id,
30439 first_seen_at: feature3.properties.first_seen_at,
30440 last_seen_at: feature3.properties.last_seen_at,
30441 value: feature3.properties.value
30452 cache.rtree.load(features);
30456 function loadData(url) {
30457 return fetch(url).then(function(response) {
30458 if (!response.ok) {
30459 throw new Error(response.status + " " + response.statusText);
30461 return response.json();
30462 }).then(function(result) {
30466 return result.data || [];
30469 function partitionViewport(projection2) {
30470 const z3 = geoScaleToZoom(projection2.scale());
30471 const z22 = Math.ceil(z3 * 2) / 2 + 2.5;
30472 const tiler8 = utilTiler().zoomExtent([z22, z22]);
30473 return tiler8.getTiles(projection2).map(function(tile) {
30474 return tile.extent;
30477 function searchLimited(limit, projection2, rtree) {
30478 limit = limit || 5;
30479 return partitionViewport(projection2).reduce(function(result, extent) {
30480 const found = rtree.search(extent.bbox()).slice(0, limit).map(function(d4) {
30483 return found.length ? result.concat(found) : result;
30486 var accessToken, apiUrl, baseTileUrl, mapFeatureTileUrl, tileUrl, trafficSignTileUrl, viewercss, viewerjs, minZoom, dispatch4, _loadViewerPromise, _mlyActiveImage, _mlyCache, _mlyFallback, _mlyHighlightedDetection, _mlyShowFeatureDetections, _mlyShowSignDetections, _mlyViewer, _mlyViewerFilter, _isViewerOpen, mapillary_default;
30487 var init_mapillary = __esm({
30488 "modules/services/mapillary.js"() {
30494 init_vector_tile();
30498 accessToken = "MLY|4100327730013843|5bb78b81720791946a9a7b956c57b7cf";
30499 apiUrl = "https://graph.mapillary.com/";
30500 baseTileUrl = "https://tiles.mapillary.com/maps/vtp";
30501 mapFeatureTileUrl = `${baseTileUrl}/mly_map_feature_point/2/{z}/{x}/{y}?access_token=${accessToken}`;
30502 tileUrl = `${baseTileUrl}/mly1_public/2/{z}/{x}/{y}?access_token=${accessToken}`;
30503 trafficSignTileUrl = `${baseTileUrl}/mly_map_feature_traffic_sign/2/{z}/{x}/{y}?access_token=${accessToken}`;
30504 viewercss = "mapillary-js/mapillary.css";
30505 viewerjs = "mapillary-js/mapillary.js";
30507 dispatch4 = dispatch_default("change", "loadedImages", "loadedSigns", "loadedMapFeatures", "bearingChanged", "imageChanged");
30508 _mlyFallback = false;
30509 _mlyShowFeatureDetections = false;
30510 _mlyShowSignDetections = false;
30511 _mlyViewerFilter = ["all"];
30512 _isViewerOpen = false;
30513 mapillary_default = {
30514 // Initialize Mapillary
30519 this.event = utilRebind(this, dispatch4, "on");
30521 // Reset cache and state
30522 reset: function() {
30524 Object.values(_mlyCache.requests.inflight).forEach(function(request3) {
30529 images: { rtree: new RBush(), forImageId: {} },
30530 image_detections: { forImageId: {} },
30531 signs: { rtree: new RBush() },
30532 points: { rtree: new RBush() },
30533 sequences: { rtree: new RBush(), lineString: {} },
30534 requests: { loaded: {}, inflight: {} }
30536 _mlyActiveImage = null;
30538 // Get visible images
30539 images: function(projection2) {
30541 return searchLimited(limit, projection2, _mlyCache.images.rtree);
30543 // Get visible traffic signs
30544 signs: function(projection2) {
30546 return searchLimited(limit, projection2, _mlyCache.signs.rtree);
30548 // Get visible map (point) features
30549 mapFeatures: function(projection2) {
30551 return searchLimited(limit, projection2, _mlyCache.points.rtree);
30553 // Get cached image by id
30554 cachedImage: function(imageId) {
30555 return _mlyCache.images.forImageId[imageId];
30557 // Get visible sequences
30558 sequences: function(projection2) {
30559 const viewport = projection2.clipExtent();
30560 const min3 = [viewport[0][0], viewport[1][1]];
30561 const max3 = [viewport[1][0], viewport[0][1]];
30562 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
30563 const sequenceIds = {};
30564 let lineStrings = [];
30565 _mlyCache.images.rtree.search(bbox2).forEach(function(d4) {
30566 if (d4.data.sequence_id) {
30567 sequenceIds[d4.data.sequence_id] = true;
30570 Object.keys(sequenceIds).forEach(function(sequenceId) {
30571 if (_mlyCache.sequences.lineString[sequenceId]) {
30572 lineStrings = lineStrings.concat(_mlyCache.sequences.lineString[sequenceId]);
30575 return lineStrings;
30577 // Load images in the visible area
30578 loadImages: function(projection2) {
30579 loadTiles("images", tileUrl, 14, projection2);
30581 // Load traffic signs in the visible area
30582 loadSigns: function(projection2) {
30583 loadTiles("signs", trafficSignTileUrl, 14, projection2);
30585 // Load map (point) features in the visible area
30586 loadMapFeatures: function(projection2) {
30587 loadTiles("points", mapFeatureTileUrl, 14, projection2);
30589 // Return a promise that resolves when the image viewer (Mapillary JS) library has finished loading
30590 ensureViewerLoaded: function(context) {
30591 if (_loadViewerPromise) return _loadViewerPromise;
30592 const wrap2 = context.container().select(".photoviewer").selectAll(".mly-wrapper").data([0]);
30593 wrap2.enter().append("div").attr("id", "ideditor-mly").attr("class", "photo-wrapper mly-wrapper").classed("hide", true);
30595 _loadViewerPromise = new Promise((resolve, reject) => {
30596 let loadedCount = 0;
30597 function loaded() {
30599 if (loadedCount === 2) resolve();
30601 const head = select_default2("head");
30602 head.selectAll("#ideditor-mapillary-viewercss").data([0]).enter().append("link").attr("id", "ideditor-mapillary-viewercss").attr("rel", "stylesheet").attr("crossorigin", "anonymous").attr("href", context.asset(viewercss)).on("load.serviceMapillary", loaded).on("error.serviceMapillary", function() {
30605 head.selectAll("#ideditor-mapillary-viewerjs").data([0]).enter().append("script").attr("id", "ideditor-mapillary-viewerjs").attr("crossorigin", "anonymous").attr("src", context.asset(viewerjs)).on("load.serviceMapillary", loaded).on("error.serviceMapillary", function() {
30608 }).catch(function() {
30609 _loadViewerPromise = null;
30610 }).then(function() {
30611 that.initViewer(context);
30613 return _loadViewerPromise;
30615 // Load traffic sign image sprites
30616 loadSignResources: function(context) {
30617 context.ui().svgDefs.addSprites(
30618 ["mapillary-sprite"],
30620 /* don't override colors */
30624 // Load map (point) feature image sprites
30625 loadObjectResources: function(context) {
30626 context.ui().svgDefs.addSprites(
30627 ["mapillary-object-sprite"],
30629 /* don't override colors */
30633 // Remove previous detections in image viewer
30634 resetTags: function() {
30635 if (_mlyViewer && !_mlyFallback) {
30636 _mlyViewer.getComponent("tag").removeAll();
30639 // Show map feature detections in image viewer
30640 showFeatureDetections: function(value) {
30641 _mlyShowFeatureDetections = value;
30642 if (!_mlyShowFeatureDetections && !_mlyShowSignDetections) {
30646 // Show traffic sign detections in image viewer
30647 showSignDetections: function(value) {
30648 _mlyShowSignDetections = value;
30649 if (!_mlyShowFeatureDetections && !_mlyShowSignDetections) {
30653 // Apply filter to image viewer
30654 filterViewer: function(context) {
30655 const showsPano = context.photos().showsPanoramic();
30656 const showsFlat = context.photos().showsFlat();
30657 const fromDate = context.photos().fromDate();
30658 const toDate = context.photos().toDate();
30659 const filter2 = ["all"];
30660 if (!showsPano) filter2.push(["!=", "cameraType", "spherical"]);
30661 if (!showsFlat && showsPano) filter2.push(["==", "pano", true]);
30663 filter2.push([">=", "capturedAt", new Date(fromDate).getTime()]);
30666 filter2.push([">=", "capturedAt", new Date(toDate).getTime()]);
30669 _mlyViewer.setFilter(filter2);
30671 _mlyViewerFilter = filter2;
30674 // Make the image viewer visible
30675 showViewer: function(context) {
30676 const wrap2 = context.container().select(".photoviewer");
30677 const isHidden = wrap2.selectAll(".photo-wrapper.mly-wrapper.hide").size();
30678 if (isHidden && _mlyViewer) {
30679 for (const service of Object.values(services)) {
30680 if (service === this) continue;
30681 if (typeof service.hideViewer === "function") {
30682 service.hideViewer(context);
30685 wrap2.classed("hide", false).selectAll(".photo-wrapper.mly-wrapper").classed("hide", false);
30686 _mlyViewer.resize();
30688 _isViewerOpen = true;
30691 // Hide the image viewer and resets map markers
30692 hideViewer: function(context) {
30693 _mlyActiveImage = null;
30694 if (!_mlyFallback && _mlyViewer) {
30695 _mlyViewer.getComponent("sequence").stop();
30697 const viewer = context.container().select(".photoviewer");
30698 if (!viewer.empty()) viewer.datum(null);
30699 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
30700 this.updateUrlImage(null);
30701 dispatch4.call("imageChanged");
30702 dispatch4.call("loadedMapFeatures");
30703 dispatch4.call("loadedSigns");
30704 _isViewerOpen = false;
30705 return this.setStyles(context, null);
30707 // Get viewer status
30708 isViewerOpen: function() {
30709 return _isViewerOpen;
30711 // Update the URL with current image id
30712 updateUrlImage: function(imageId) {
30713 const hash2 = utilStringQs(window.location.hash);
30715 hash2.photo = "mapillary/" + imageId;
30717 delete hash2.photo;
30719 window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
30721 // Highlight the detection in the viewer that is related to the clicked map feature
30722 highlightDetection: function(detection) {
30724 _mlyHighlightedDetection = detection.id;
30728 // Initialize image viewer (Mapillar JS)
30729 initViewer: function(context) {
30730 if (!window.mapillary) return;
30738 container: "ideditor-mly"
30740 if (!mapillary.isSupported() && mapillary.isFallbackSupported()) {
30741 _mlyFallback = true;
30756 _mlyViewer = new mapillary.Viewer(opts);
30757 _mlyViewer.on("image", imageChanged.bind(this));
30758 _mlyViewer.on("bearing", bearingChanged);
30759 if (_mlyViewerFilter) {
30760 _mlyViewer.setFilter(_mlyViewerFilter);
30762 context.ui().photoviewer.on("resize.mapillary", function() {
30763 if (_mlyViewer) _mlyViewer.resize();
30765 function imageChanged(photo) {
30767 const image = photo.image;
30768 this.setActiveImage(image);
30769 this.setStyles(context, null);
30770 const loc = [image.originalLngLat.lng, image.originalLngLat.lat];
30771 context.map().centerEase(loc);
30772 this.updateUrlImage(image.id);
30773 if (_mlyShowFeatureDetections || _mlyShowSignDetections) {
30774 this.updateDetections(image.id, `${apiUrl}/${image.id}/detections?access_token=${accessToken}&fields=id,image,geometry,value`);
30776 dispatch4.call("imageChanged");
30778 function bearingChanged(e3) {
30779 dispatch4.call("bearingChanged", void 0, e3);
30782 // Move to an image
30783 selectImage: function(context, imageId) {
30784 if (_mlyViewer && imageId) {
30785 _mlyViewer.moveTo(imageId).then((image) => this.setActiveImage(image)).catch(function(e3) {
30786 console.error("mly3", e3);
30791 // Return the currently displayed image
30792 getActiveImage: function() {
30793 return _mlyActiveImage;
30795 // Return a list of detection objects for the given id
30796 getDetections: function(id2) {
30797 return loadData(`${apiUrl}/${id2}/detections?access_token=${accessToken}&fields=id,value,image`);
30799 // Set the currently visible image
30800 setActiveImage: function(image) {
30802 _mlyActiveImage = {
30803 ca: image.originalCompassAngle,
30805 loc: [image.originalLngLat.lng, image.originalLngLat.lat],
30806 is_pano: image.cameraType === "spherical",
30807 sequence_id: image.sequenceId
30810 _mlyActiveImage = null;
30813 // Update the currently highlighted sequence and selected bubble.
30814 setStyles: function(context, hovered) {
30815 const hoveredImageId = hovered && hovered.id;
30816 const hoveredSequenceId = hovered && hovered.sequence_id;
30817 const selectedSequenceId = _mlyActiveImage && _mlyActiveImage.sequence_id;
30818 context.container().selectAll(".layer-mapillary .viewfield-group").classed("highlighted", function(d4) {
30819 return d4.sequence_id === selectedSequenceId || d4.id === hoveredImageId;
30820 }).classed("hovered", function(d4) {
30821 return d4.id === hoveredImageId;
30823 context.container().selectAll(".layer-mapillary .sequence").classed("highlighted", function(d4) {
30824 return d4.properties.id === hoveredSequenceId;
30825 }).classed("currentView", function(d4) {
30826 return d4.properties.id === selectedSequenceId;
30830 // Get detections for the current image and shows them in the image viewer
30831 updateDetections: function(imageId, url) {
30832 if (!_mlyViewer || _mlyFallback) return;
30833 if (!imageId) return;
30834 const cache = _mlyCache.image_detections;
30835 if (cache.forImageId[imageId]) {
30836 showDetections(_mlyCache.image_detections.forImageId[imageId]);
30838 loadData(url).then((detections) => {
30839 detections.forEach(function(detection) {
30840 if (!cache.forImageId[imageId]) {
30841 cache.forImageId[imageId] = [];
30843 cache.forImageId[imageId].push({
30844 geometry: detection.geometry,
30847 value: detection.value
30850 showDetections(_mlyCache.image_detections.forImageId[imageId] || []);
30853 function showDetections(detections) {
30854 const tagComponent = _mlyViewer.getComponent("tag");
30855 detections.forEach(function(data) {
30856 const tag = makeTag(data);
30858 tagComponent.add([tag]);
30862 function makeTag(data) {
30863 const valueParts = data.value.split("--");
30864 if (!valueParts.length) return;
30867 let color2 = 16777215;
30868 if (_mlyHighlightedDetection === data.id) {
30870 text = valueParts[1];
30871 if (text === "flat" || text === "discrete" || text === "sign") {
30872 text = valueParts[2];
30874 text = text.replace(/-/g, " ");
30875 text = text.charAt(0).toUpperCase() + text.slice(1);
30876 _mlyHighlightedDetection = null;
30878 var decodedGeometry = window.atob(data.geometry);
30879 var uintArray = new Uint8Array(decodedGeometry.length);
30880 for (var i3 = 0; i3 < decodedGeometry.length; i3++) {
30881 uintArray[i3] = decodedGeometry.charCodeAt(i3);
30883 const tile = new VectorTile(new Pbf(uintArray.buffer));
30884 const layer = tile.layers["mpy-or"];
30885 const geometries = layer.feature(0).loadGeometry();
30886 const polygon2 = geometries.map((ring) => ring.map((point) => [point.x / layer.extent, point.y / layer.extent]));
30887 tag = new mapillary.OutlineTag(
30889 new mapillary.PolygonGeometry(polygon2[0]),
30902 // Return the current cache
30903 cache: function() {
30910 // modules/services/maprules.js
30911 var maprules_exports = {};
30912 __export(maprules_exports, {
30913 default: () => maprules_default
30915 var buildRuleChecks, buildLineKeys, maprules_default;
30916 var init_maprules = __esm({
30917 "modules/services/maprules.js"() {
30922 buildRuleChecks = function() {
30924 equals: function(equals) {
30925 return function(tags) {
30926 return Object.keys(equals).every(function(k2) {
30927 return equals[k2] === tags[k2];
30931 notEquals: function(notEquals) {
30932 return function(tags) {
30933 return Object.keys(notEquals).some(function(k2) {
30934 return notEquals[k2] !== tags[k2];
30938 absence: function(absence) {
30939 return function(tags) {
30940 return Object.keys(tags).indexOf(absence) === -1;
30943 presence: function(presence) {
30944 return function(tags) {
30945 return Object.keys(tags).indexOf(presence) > -1;
30948 greaterThan: function(greaterThan) {
30949 var key = Object.keys(greaterThan)[0];
30950 var value = greaterThan[key];
30951 return function(tags) {
30952 return tags[key] > value;
30955 greaterThanEqual: function(greaterThanEqual) {
30956 var key = Object.keys(greaterThanEqual)[0];
30957 var value = greaterThanEqual[key];
30958 return function(tags) {
30959 return tags[key] >= value;
30962 lessThan: function(lessThan) {
30963 var key = Object.keys(lessThan)[0];
30964 var value = lessThan[key];
30965 return function(tags) {
30966 return tags[key] < value;
30969 lessThanEqual: function(lessThanEqual) {
30970 var key = Object.keys(lessThanEqual)[0];
30971 var value = lessThanEqual[key];
30972 return function(tags) {
30973 return tags[key] <= value;
30976 positiveRegex: function(positiveRegex) {
30977 var tagKey = Object.keys(positiveRegex)[0];
30978 var expression = positiveRegex[tagKey].join("|");
30979 var regex = new RegExp(expression);
30980 return function(tags) {
30981 return regex.test(tags[tagKey]);
30984 negativeRegex: function(negativeRegex) {
30985 var tagKey = Object.keys(negativeRegex)[0];
30986 var expression = negativeRegex[tagKey].join("|");
30987 var regex = new RegExp(expression);
30988 return function(tags) {
30989 return !regex.test(tags[tagKey]);
30994 buildLineKeys = function() {
31009 maprules_default = {
31011 this._ruleChecks = buildRuleChecks();
31012 this._validationRules = [];
31013 this._areaKeys = osmAreaKeys;
31014 this._lineKeys = buildLineKeys();
31016 // list of rules only relevant to tag checks...
31017 filterRuleChecks: function(selector) {
31018 var _ruleChecks = this._ruleChecks;
31019 return Object.keys(selector).reduce(function(rules, key) {
31020 if (["geometry", "error", "warning"].indexOf(key) === -1) {
31021 rules.push(_ruleChecks[key](selector[key]));
31026 // builds tagMap from mapcss-parse selector object...
31027 buildTagMap: function(selector) {
31028 var getRegexValues = function(regexes) {
31029 return regexes.map(function(regex) {
31030 return regex.replace(/\$|\^/g, "");
31033 var tagMap = Object.keys(selector).reduce(function(expectedTags, key) {
31035 var isRegex = /regex/gi.test(key);
31036 var isEqual2 = /equals/gi.test(key);
31037 if (isRegex || isEqual2) {
31038 Object.keys(selector[key]).forEach(function(selectorKey) {
31039 values = isEqual2 ? [selector[key][selectorKey]] : getRegexValues(selector[key][selectorKey]);
31040 if (expectedTags.hasOwnProperty(selectorKey)) {
31041 values = values.concat(expectedTags[selectorKey]);
31043 expectedTags[selectorKey] = values;
31045 } else if (/(greater|less)Than(Equal)?|presence/g.test(key)) {
31046 var tagKey = /presence/.test(key) ? selector[key] : Object.keys(selector[key])[0];
31047 values = [selector[key][tagKey]];
31048 if (expectedTags.hasOwnProperty(tagKey)) {
31049 values = values.concat(expectedTags[tagKey]);
31051 expectedTags[tagKey] = values;
31053 return expectedTags;
31057 // inspired by osmWay#isArea()
31058 inferGeometry: function(tagMap) {
31059 var _lineKeys = this._lineKeys;
31060 var _areaKeys = this._areaKeys;
31061 var keyValueDoesNotImplyArea = function(key2) {
31062 return utilArrayIntersection(tagMap[key2], Object.keys(_areaKeys[key2])).length > 0;
31064 var keyValueImpliesLine = function(key2) {
31065 return utilArrayIntersection(tagMap[key2], Object.keys(_lineKeys[key2])).length > 0;
31067 if (tagMap.hasOwnProperty("area")) {
31068 if (tagMap.area.indexOf("yes") > -1) {
31071 if (tagMap.area.indexOf("no") > -1) {
31075 for (var key in tagMap) {
31076 if (key in _areaKeys && !keyValueDoesNotImplyArea(key)) {
31079 if (key in _lineKeys && keyValueImpliesLine(key)) {
31085 // adds from mapcss-parse selector check...
31086 addRule: function(selector) {
31088 // checks relevant to mapcss-selector
31089 checks: this.filterRuleChecks(selector),
31090 // true if all conditions for a tag error are true..
31091 matches: function(entity) {
31092 return this.checks.every(function(check) {
31093 return check(entity.tags);
31096 // borrowed from Way#isArea()
31097 inferredGeometry: this.inferGeometry(this.buildTagMap(selector), this._areaKeys),
31098 geometryMatches: function(entity, graph) {
31099 if (entity.type === "node" || entity.type === "relation") {
31100 return selector.geometry === entity.type;
31101 } else if (entity.type === "way") {
31102 return this.inferredGeometry === entity.geometry(graph);
31105 // when geometries match and tag matches are present, return a warning...
31106 findIssues: function(entity, graph, issues) {
31107 if (this.geometryMatches(entity, graph) && this.matches(entity)) {
31108 var severity = Object.keys(selector).indexOf("error") > -1 ? "error" : "warning";
31109 var message = selector[severity];
31110 issues.push(new validationIssue({
31113 message: function() {
31116 entityIds: [entity.id]
31121 this._validationRules.push(rule);
31123 clearRules: function() {
31124 this._validationRules = [];
31126 // returns validationRules...
31127 validationRules: function() {
31128 return this._validationRules;
31130 // returns ruleChecks
31131 ruleChecks: function() {
31132 return this._ruleChecks;
31138 // modules/services/nominatim.js
31139 var nominatim_exports = {};
31140 __export(nominatim_exports, {
31141 default: () => nominatim_default
31143 var apibase, _inflight, _nominatimCache, nominatim_default;
31144 var init_nominatim = __esm({
31145 "modules/services/nominatim.js"() {
31153 apibase = nominatimApiUrl;
31155 nominatim_default = {
31158 _nominatimCache = new RBush();
31160 reset: function() {
31161 Object.values(_inflight).forEach(function(controller) {
31162 controller.abort();
31165 _nominatimCache = new RBush();
31167 countryCode: function(location, callback) {
31168 this.reverse(location, function(err, result) {
31170 return callback(err);
31171 } else if (result.address) {
31172 return callback(null, result.address.country_code);
31174 return callback("Unable to geocode", null);
31178 reverse: function(loc, callback) {
31179 var cached = _nominatimCache.search(
31180 { minX: loc[0], minY: loc[1], maxX: loc[0], maxY: loc[1] }
31182 if (cached.length > 0) {
31183 if (callback) callback(null, cached[0].data);
31186 var params = { zoom: 13, format: "json", addressdetails: 1, lat: loc[1], lon: loc[0] };
31187 var url = apibase + "reverse?" + utilQsString(params);
31188 if (_inflight[url]) return;
31189 var controller = new AbortController();
31190 _inflight[url] = controller;
31191 json_default(url, {
31192 signal: controller.signal,
31194 "Accept-Language": _mainLocalizer.localeCodes().join(",")
31196 }).then(function(result) {
31197 delete _inflight[url];
31198 if (result && result.error) {
31199 throw new Error(result.error);
31201 var extent = geoExtent(loc).padByMeters(200);
31202 _nominatimCache.insert(Object.assign(extent.bbox(), { data: result }));
31203 if (callback) callback(null, result);
31204 }).catch(function(err) {
31205 delete _inflight[url];
31206 if (err.name === "AbortError") return;
31207 if (callback) callback(err.message);
31210 search: function(val, callback) {
31216 var url = apibase + "search?" + utilQsString(params);
31217 if (_inflight[url]) return;
31218 var controller = new AbortController();
31219 _inflight[url] = controller;
31220 json_default(url, {
31221 signal: controller.signal,
31223 "Accept-Language": _mainLocalizer.localeCodes().join(",")
31225 }).then(function(result) {
31226 delete _inflight[url];
31227 if (result && result.error) {
31228 throw new Error(result.error);
31230 if (callback) callback(null, result);
31231 }).catch(function(err) {
31232 delete _inflight[url];
31233 if (err.name === "AbortError") return;
31234 if (callback) callback(err.message);
31241 // node_modules/which-polygon/node_modules/quickselect/quickselect.js
31242 var require_quickselect = __commonJS({
31243 "node_modules/which-polygon/node_modules/quickselect/quickselect.js"(exports2, module2) {
31244 (function(global2, factory) {
31245 typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.quickselect = factory();
31246 })(exports2, (function() {
31248 function quickselect3(arr, k2, left, right, compare2) {
31249 quickselectStep(arr, k2, left || 0, right || arr.length - 1, compare2 || defaultCompare2);
31251 function quickselectStep(arr, k2, left, right, compare2) {
31252 while (right > left) {
31253 if (right - left > 600) {
31254 var n3 = right - left + 1;
31255 var m3 = k2 - left + 1;
31256 var z3 = Math.log(n3);
31257 var s2 = 0.5 * Math.exp(2 * z3 / 3);
31258 var sd = 0.5 * Math.sqrt(z3 * s2 * (n3 - s2) / n3) * (m3 - n3 / 2 < 0 ? -1 : 1);
31259 var newLeft = Math.max(left, Math.floor(k2 - m3 * s2 / n3 + sd));
31260 var newRight = Math.min(right, Math.floor(k2 + (n3 - m3) * s2 / n3 + sd));
31261 quickselectStep(arr, k2, newLeft, newRight, compare2);
31266 swap3(arr, left, k2);
31267 if (compare2(arr[right], t2) > 0) swap3(arr, left, right);
31269 swap3(arr, i3, j3);
31272 while (compare2(arr[i3], t2) < 0) i3++;
31273 while (compare2(arr[j3], t2) > 0) j3--;
31275 if (compare2(arr[left], t2) === 0) swap3(arr, left, j3);
31278 swap3(arr, j3, right);
31280 if (j3 <= k2) left = j3 + 1;
31281 if (k2 <= j3) right = j3 - 1;
31284 function swap3(arr, i3, j3) {
31289 function defaultCompare2(a2, b3) {
31290 return a2 < b3 ? -1 : a2 > b3 ? 1 : 0;
31292 return quickselect3;
31297 // node_modules/which-polygon/node_modules/rbush/index.js
31298 var require_rbush = __commonJS({
31299 "node_modules/which-polygon/node_modules/rbush/index.js"(exports2, module2) {
31301 module2.exports = rbush;
31302 module2.exports.default = rbush;
31303 var quickselect3 = require_quickselect();
31304 function rbush(maxEntries, format2) {
31305 if (!(this instanceof rbush)) return new rbush(maxEntries, format2);
31306 this._maxEntries = Math.max(4, maxEntries || 9);
31307 this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));
31309 this._initFormat(format2);
31313 rbush.prototype = {
31315 return this._all(this.data, []);
31317 search: function(bbox2) {
31318 var node = this.data, result = [], toBBox = this.toBBox;
31319 if (!intersects2(bbox2, node)) return result;
31320 var nodesToSearch = [], i3, len, child, childBBox;
31322 for (i3 = 0, len = node.children.length; i3 < len; i3++) {
31323 child = node.children[i3];
31324 childBBox = node.leaf ? toBBox(child) : child;
31325 if (intersects2(bbox2, childBBox)) {
31326 if (node.leaf) result.push(child);
31327 else if (contains2(bbox2, childBBox)) this._all(child, result);
31328 else nodesToSearch.push(child);
31331 node = nodesToSearch.pop();
31335 collides: function(bbox2) {
31336 var node = this.data, toBBox = this.toBBox;
31337 if (!intersects2(bbox2, node)) return false;
31338 var nodesToSearch = [], i3, len, child, childBBox;
31340 for (i3 = 0, len = node.children.length; i3 < len; i3++) {
31341 child = node.children[i3];
31342 childBBox = node.leaf ? toBBox(child) : child;
31343 if (intersects2(bbox2, childBBox)) {
31344 if (node.leaf || contains2(bbox2, childBBox)) return true;
31345 nodesToSearch.push(child);
31348 node = nodesToSearch.pop();
31352 load: function(data) {
31353 if (!(data && data.length)) return this;
31354 if (data.length < this._minEntries) {
31355 for (var i3 = 0, len = data.length; i3 < len; i3++) {
31356 this.insert(data[i3]);
31360 var node = this._build(data.slice(), 0, data.length - 1, 0);
31361 if (!this.data.children.length) {
31363 } else if (this.data.height === node.height) {
31364 this._splitRoot(this.data, node);
31366 if (this.data.height < node.height) {
31367 var tmpNode = this.data;
31371 this._insert(node, this.data.height - node.height - 1, true);
31375 insert: function(item) {
31376 if (item) this._insert(item, this.data.height - 1);
31379 clear: function() {
31380 this.data = createNode2([]);
31383 remove: function(item, equalsFn) {
31384 if (!item) return this;
31385 var node = this.data, bbox2 = this.toBBox(item), path = [], indexes = [], i3, parent2, index, goingUp;
31386 while (node || path.length) {
31389 parent2 = path[path.length - 1];
31390 i3 = indexes.pop();
31394 index = findItem2(item, node.children, equalsFn);
31395 if (index !== -1) {
31396 node.children.splice(index, 1);
31398 this._condense(path);
31402 if (!goingUp && !node.leaf && contains2(node, bbox2)) {
31407 node = node.children[0];
31408 } else if (parent2) {
31410 node = parent2.children[i3];
31412 } else node = null;
31416 toBBox: function(item) {
31419 compareMinX: compareNodeMinX2,
31420 compareMinY: compareNodeMinY2,
31421 toJSON: function() {
31424 fromJSON: function(data) {
31428 _all: function(node, result) {
31429 var nodesToSearch = [];
31431 if (node.leaf) result.push.apply(result, node.children);
31432 else nodesToSearch.push.apply(nodesToSearch, node.children);
31433 node = nodesToSearch.pop();
31437 _build: function(items, left, right, height) {
31438 var N3 = right - left + 1, M3 = this._maxEntries, node;
31440 node = createNode2(items.slice(left, right + 1));
31441 calcBBox2(node, this.toBBox);
31445 height = Math.ceil(Math.log(N3) / Math.log(M3));
31446 M3 = Math.ceil(N3 / Math.pow(M3, height - 1));
31448 node = createNode2([]);
31450 node.height = height;
31451 var N22 = Math.ceil(N3 / M3), N1 = N22 * Math.ceil(Math.sqrt(M3)), i3, j3, right2, right3;
31452 multiSelect2(items, left, right, N1, this.compareMinX);
31453 for (i3 = left; i3 <= right; i3 += N1) {
31454 right2 = Math.min(i3 + N1 - 1, right);
31455 multiSelect2(items, i3, right2, N22, this.compareMinY);
31456 for (j3 = i3; j3 <= right2; j3 += N22) {
31457 right3 = Math.min(j3 + N22 - 1, right2);
31458 node.children.push(this._build(items, j3, right3, height - 1));
31461 calcBBox2(node, this.toBBox);
31464 _chooseSubtree: function(bbox2, node, level, path) {
31465 var i3, len, child, targetNode, area, enlargement, minArea, minEnlargement;
31468 if (node.leaf || path.length - 1 === level) break;
31469 minArea = minEnlargement = Infinity;
31470 for (i3 = 0, len = node.children.length; i3 < len; i3++) {
31471 child = node.children[i3];
31472 area = bboxArea2(child);
31473 enlargement = enlargedArea2(bbox2, child) - area;
31474 if (enlargement < minEnlargement) {
31475 minEnlargement = enlargement;
31476 minArea = area < minArea ? area : minArea;
31477 targetNode = child;
31478 } else if (enlargement === minEnlargement) {
31479 if (area < minArea) {
31481 targetNode = child;
31485 node = targetNode || node.children[0];
31489 _insert: function(item, level, isNode) {
31490 var toBBox = this.toBBox, bbox2 = isNode ? item : toBBox(item), insertPath = [];
31491 var node = this._chooseSubtree(bbox2, this.data, level, insertPath);
31492 node.children.push(item);
31493 extend3(node, bbox2);
31494 while (level >= 0) {
31495 if (insertPath[level].children.length > this._maxEntries) {
31496 this._split(insertPath, level);
31500 this._adjustParentBBoxes(bbox2, insertPath, level);
31502 // split overflowed node into two
31503 _split: function(insertPath, level) {
31504 var node = insertPath[level], M3 = node.children.length, m3 = this._minEntries;
31505 this._chooseSplitAxis(node, m3, M3);
31506 var splitIndex = this._chooseSplitIndex(node, m3, M3);
31507 var newNode = createNode2(node.children.splice(splitIndex, node.children.length - splitIndex));
31508 newNode.height = node.height;
31509 newNode.leaf = node.leaf;
31510 calcBBox2(node, this.toBBox);
31511 calcBBox2(newNode, this.toBBox);
31512 if (level) insertPath[level - 1].children.push(newNode);
31513 else this._splitRoot(node, newNode);
31515 _splitRoot: function(node, newNode) {
31516 this.data = createNode2([node, newNode]);
31517 this.data.height = node.height + 1;
31518 this.data.leaf = false;
31519 calcBBox2(this.data, this.toBBox);
31521 _chooseSplitIndex: function(node, m3, M3) {
31522 var i3, bbox1, bbox2, overlap, area, minOverlap, minArea, index;
31523 minOverlap = minArea = Infinity;
31524 for (i3 = m3; i3 <= M3 - m3; i3++) {
31525 bbox1 = distBBox2(node, 0, i3, this.toBBox);
31526 bbox2 = distBBox2(node, i3, M3, this.toBBox);
31527 overlap = intersectionArea2(bbox1, bbox2);
31528 area = bboxArea2(bbox1) + bboxArea2(bbox2);
31529 if (overlap < minOverlap) {
31530 minOverlap = overlap;
31532 minArea = area < minArea ? area : minArea;
31533 } else if (overlap === minOverlap) {
31534 if (area < minArea) {
31542 // sorts node children by the best axis for split
31543 _chooseSplitAxis: function(node, m3, M3) {
31544 var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX2, compareMinY = node.leaf ? this.compareMinY : compareNodeMinY2, xMargin = this._allDistMargin(node, m3, M3, compareMinX), yMargin = this._allDistMargin(node, m3, M3, compareMinY);
31545 if (xMargin < yMargin) node.children.sort(compareMinX);
31547 // total margin of all possible split distributions where each node is at least m full
31548 _allDistMargin: function(node, m3, M3, compare2) {
31549 node.children.sort(compare2);
31550 var toBBox = this.toBBox, leftBBox = distBBox2(node, 0, m3, toBBox), rightBBox = distBBox2(node, M3 - m3, M3, toBBox), margin = bboxMargin2(leftBBox) + bboxMargin2(rightBBox), i3, child;
31551 for (i3 = m3; i3 < M3 - m3; i3++) {
31552 child = node.children[i3];
31553 extend3(leftBBox, node.leaf ? toBBox(child) : child);
31554 margin += bboxMargin2(leftBBox);
31556 for (i3 = M3 - m3 - 1; i3 >= m3; i3--) {
31557 child = node.children[i3];
31558 extend3(rightBBox, node.leaf ? toBBox(child) : child);
31559 margin += bboxMargin2(rightBBox);
31563 _adjustParentBBoxes: function(bbox2, path, level) {
31564 for (var i3 = level; i3 >= 0; i3--) {
31565 extend3(path[i3], bbox2);
31568 _condense: function(path) {
31569 for (var i3 = path.length - 1, siblings; i3 >= 0; i3--) {
31570 if (path[i3].children.length === 0) {
31572 siblings = path[i3 - 1].children;
31573 siblings.splice(siblings.indexOf(path[i3]), 1);
31574 } else this.clear();
31575 } else calcBBox2(path[i3], this.toBBox);
31578 _initFormat: function(format2) {
31579 var compareArr = ["return a", " - b", ";"];
31580 this.compareMinX = new Function("a", "b", compareArr.join(format2[0]));
31581 this.compareMinY = new Function("a", "b", compareArr.join(format2[1]));
31582 this.toBBox = new Function(
31584 "return {minX: a" + format2[0] + ", minY: a" + format2[1] + ", maxX: a" + format2[2] + ", maxY: a" + format2[3] + "};"
31588 function findItem2(item, items, equalsFn) {
31589 if (!equalsFn) return items.indexOf(item);
31590 for (var i3 = 0; i3 < items.length; i3++) {
31591 if (equalsFn(item, items[i3])) return i3;
31595 function calcBBox2(node, toBBox) {
31596 distBBox2(node, 0, node.children.length, toBBox, node);
31598 function distBBox2(node, k2, p2, toBBox, destNode) {
31599 if (!destNode) destNode = createNode2(null);
31600 destNode.minX = Infinity;
31601 destNode.minY = Infinity;
31602 destNode.maxX = -Infinity;
31603 destNode.maxY = -Infinity;
31604 for (var i3 = k2, child; i3 < p2; i3++) {
31605 child = node.children[i3];
31606 extend3(destNode, node.leaf ? toBBox(child) : child);
31610 function extend3(a2, b3) {
31611 a2.minX = Math.min(a2.minX, b3.minX);
31612 a2.minY = Math.min(a2.minY, b3.minY);
31613 a2.maxX = Math.max(a2.maxX, b3.maxX);
31614 a2.maxY = Math.max(a2.maxY, b3.maxY);
31617 function compareNodeMinX2(a2, b3) {
31618 return a2.minX - b3.minX;
31620 function compareNodeMinY2(a2, b3) {
31621 return a2.minY - b3.minY;
31623 function bboxArea2(a2) {
31624 return (a2.maxX - a2.minX) * (a2.maxY - a2.minY);
31626 function bboxMargin2(a2) {
31627 return a2.maxX - a2.minX + (a2.maxY - a2.minY);
31629 function enlargedArea2(a2, b3) {
31630 return (Math.max(b3.maxX, a2.maxX) - Math.min(b3.minX, a2.minX)) * (Math.max(b3.maxY, a2.maxY) - Math.min(b3.minY, a2.minY));
31632 function intersectionArea2(a2, b3) {
31633 var minX = Math.max(a2.minX, b3.minX), minY = Math.max(a2.minY, b3.minY), maxX = Math.min(a2.maxX, b3.maxX), maxY = Math.min(a2.maxY, b3.maxY);
31634 return Math.max(0, maxX - minX) * Math.max(0, maxY - minY);
31636 function contains2(a2, b3) {
31637 return a2.minX <= b3.minX && a2.minY <= b3.minY && b3.maxX <= a2.maxX && b3.maxY <= a2.maxY;
31639 function intersects2(a2, b3) {
31640 return b3.minX <= a2.maxX && b3.minY <= a2.maxY && b3.maxX >= a2.minX && b3.maxY >= a2.minY;
31642 function createNode2(children2) {
31644 children: children2,
31653 function multiSelect2(arr, left, right, n3, compare2) {
31654 var stack = [left, right], mid;
31655 while (stack.length) {
31656 right = stack.pop();
31657 left = stack.pop();
31658 if (right - left <= n3) continue;
31659 mid = left + Math.ceil((right - left) / n3 / 2) * n3;
31660 quickselect3(arr, mid, left, right, compare2);
31661 stack.push(left, mid, mid, right);
31667 // node_modules/lineclip/index.js
31668 var require_lineclip = __commonJS({
31669 "node_modules/lineclip/index.js"(exports2, module2) {
31671 module2.exports = lineclip2;
31672 lineclip2.polyline = lineclip2;
31673 lineclip2.polygon = polygonclip2;
31674 function lineclip2(points, bbox2, result) {
31675 var len = points.length, codeA = bitCode2(points[0], bbox2), part = [], i3, a2, b3, codeB, lastCode;
31676 if (!result) result = [];
31677 for (i3 = 1; i3 < len; i3++) {
31678 a2 = points[i3 - 1];
31680 codeB = lastCode = bitCode2(b3, bbox2);
31682 if (!(codeA | codeB)) {
31684 if (codeB !== lastCode) {
31686 if (i3 < len - 1) {
31690 } else if (i3 === len - 1) {
31694 } else if (codeA & codeB) {
31696 } else if (codeA) {
31697 a2 = intersect2(a2, b3, codeA, bbox2);
31698 codeA = bitCode2(a2, bbox2);
31700 b3 = intersect2(a2, b3, codeB, bbox2);
31701 codeB = bitCode2(b3, bbox2);
31706 if (part.length) result.push(part);
31709 function polygonclip2(points, bbox2) {
31710 var result, edge, prev, prevInside, i3, p2, inside;
31711 for (edge = 1; edge <= 8; edge *= 2) {
31713 prev = points[points.length - 1];
31714 prevInside = !(bitCode2(prev, bbox2) & edge);
31715 for (i3 = 0; i3 < points.length; i3++) {
31717 inside = !(bitCode2(p2, bbox2) & edge);
31718 if (inside !== prevInside) result.push(intersect2(prev, p2, edge, bbox2));
31719 if (inside) result.push(p2);
31721 prevInside = inside;
31724 if (!points.length) break;
31728 function intersect2(a2, b3, edge, bbox2) {
31729 return edge & 8 ? [a2[0] + (b3[0] - a2[0]) * (bbox2[3] - a2[1]) / (b3[1] - a2[1]), bbox2[3]] : (
31731 edge & 4 ? [a2[0] + (b3[0] - a2[0]) * (bbox2[1] - a2[1]) / (b3[1] - a2[1]), bbox2[1]] : (
31733 edge & 2 ? [bbox2[2], a2[1] + (b3[1] - a2[1]) * (bbox2[2] - a2[0]) / (b3[0] - a2[0])] : (
31735 edge & 1 ? [bbox2[0], a2[1] + (b3[1] - a2[1]) * (bbox2[0] - a2[0]) / (b3[0] - a2[0])] : (
31743 function bitCode2(p2, bbox2) {
31745 if (p2[0] < bbox2[0]) code |= 1;
31746 else if (p2[0] > bbox2[2]) code |= 2;
31747 if (p2[1] < bbox2[1]) code |= 4;
31748 else if (p2[1] > bbox2[3]) code |= 8;
31754 // node_modules/which-polygon/index.js
31755 var require_which_polygon = __commonJS({
31756 "node_modules/which-polygon/index.js"(exports2, module2) {
31758 var rbush = require_rbush();
31759 var lineclip2 = require_lineclip();
31760 module2.exports = whichPolygon5;
31761 function whichPolygon5(data) {
31763 for (var i3 = 0; i3 < data.features.length; i3++) {
31764 var feature3 = data.features[i3];
31765 if (!feature3.geometry) continue;
31766 var coords = feature3.geometry.coordinates;
31767 if (feature3.geometry.type === "Polygon") {
31768 bboxes.push(treeItem(coords, feature3.properties));
31769 } else if (feature3.geometry.type === "MultiPolygon") {
31770 for (var j3 = 0; j3 < coords.length; j3++) {
31771 bboxes.push(treeItem(coords[j3], feature3.properties));
31775 var tree = rbush().load(bboxes);
31776 function query(p2, multi) {
31777 var output = [], result = tree.search({
31783 for (var i4 = 0; i4 < result.length; i4++) {
31784 if (insidePolygon(result[i4].coords, p2)) {
31786 output.push(result[i4].props);
31788 return result[i4].props;
31791 return multi && output.length ? output : null;
31794 query.bbox = function queryBBox(bbox2) {
31796 var result = tree.search({
31802 for (var i4 = 0; i4 < result.length; i4++) {
31803 if (polygonIntersectsBBox(result[i4].coords, bbox2)) {
31804 output.push(result[i4].props);
31811 function polygonIntersectsBBox(polygon2, bbox2) {
31813 (bbox2[0] + bbox2[2]) / 2,
31814 (bbox2[1] + bbox2[3]) / 2
31816 if (insidePolygon(polygon2, bboxCenter)) return true;
31817 for (var i3 = 0; i3 < polygon2.length; i3++) {
31818 if (lineclip2(polygon2[i3], bbox2).length > 0) return true;
31822 function insidePolygon(rings, p2) {
31823 var inside = false;
31824 for (var i3 = 0, len = rings.length; i3 < len; i3++) {
31825 var ring = rings[i3];
31826 for (var j3 = 0, len2 = ring.length, k2 = len2 - 1; j3 < len2; k2 = j3++) {
31827 if (rayIntersect(p2, ring[j3], ring[k2])) inside = !inside;
31832 function rayIntersect(p2, p1, p22) {
31833 return p1[1] > p2[1] !== p22[1] > p2[1] && p2[0] < (p22[0] - p1[0]) * (p2[1] - p1[1]) / (p22[1] - p1[1]) + p1[0];
31835 function treeItem(coords, props) {
31844 for (var i3 = 0; i3 < coords[0].length; i3++) {
31845 var p2 = coords[0][i3];
31846 item.minX = Math.min(item.minX, p2[0]);
31847 item.minY = Math.min(item.minY, p2[1]);
31848 item.maxX = Math.max(item.maxX, p2[0]);
31849 item.maxY = Math.max(item.maxY, p2[1]);
31856 // node_modules/name-suggestion-index/lib/simplify.js
31857 function simplify(str) {
31858 if (typeof str !== "string") return "";
31859 return import_diacritics2.default.remove(
31860 str.replace(/&/g, "and").replace(/(İ|i̇)/ig, "i").replace(/[\s\-=_!"#%'*{},.\/:;?\(\)\[\]@\\$\^*+<>«»~`’\u00a1\u00a7\u00b6\u00b7\u00bf\u037e\u0387\u055a-\u055f\u0589\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0af0\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f14\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1360-\u1368\u166d\u166e\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u1805\u1807-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cc0-\u1cc7\u1cd3\u2000-\u206f\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e7f\u3001-\u3003\u303d\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uaaf0\uaaf1\uabeb\ufe10-\ufe16\ufe19\ufe30\ufe45\ufe46\ufe49-\ufe4c\ufe50-\ufe52\ufe54-\ufe57\ufe5f-\ufe61\ufe68\ufe6a\ufe6b\ufeff\uff01-\uff03\uff05-\uff07\uff0a\uff0c\uff0e\uff0f\uff1a\uff1b\uff1f\uff20\uff3c\uff61\uff64\uff65]+/g, "").toLowerCase()
31863 var import_diacritics2;
31864 var init_simplify = __esm({
31865 "node_modules/name-suggestion-index/lib/simplify.js"() {
31866 import_diacritics2 = __toESM(require_diacritics(), 1);
31870 // node_modules/name-suggestion-index/config/matchGroups.json
31871 var matchGroups_default;
31872 var init_matchGroups = __esm({
31873 "node_modules/name-suggestion-index/config/matchGroups.json"() {
31874 matchGroups_default = {
31876 adult_gaming_centre: [
31878 "amenity/gambling",
31879 "leisure/adult_gaming_centre"
31884 "amenity/restaurant"
31888 "shop/hairdresser_supply"
31902 "tourism/camp_site",
31903 "tourism/caravan_site"
31914 "healthcare/clinic",
31915 "healthcare/laboratory",
31916 "healthcare/physiotherapist",
31917 "healthcare/sample_collection",
31918 "healthcare/dialysis"
31923 "shop/convenience",
31931 "amenity/coworking_space",
31932 "office/coworking",
31933 "office/coworking_space"
31938 "healthcare/dentist"
31941 "office/telecommunication",
31944 "shop/electronics",
31948 "shop/mobile_phone",
31949 "shop/telecommunication",
31953 "office/estate_agent",
31954 "shop/estate_agent",
31960 "shop/haberdashery",
31964 "shop/accessories",
31968 "shop/department_store",
31970 "shop/fashion_accessories",
31976 "office/accountant",
31977 "office/financial",
31978 "office/financial_advisor",
31979 "office/tax_advisor",
31983 "leisure/fitness_centre",
31984 "leisure/fitness_center",
31985 "leisure/sports_centre",
31986 "leisure/sports_center"
31990 "amenity/fast_food",
31991 "amenity/ice_cream",
31992 "amenity/restaurant",
31997 "shop/confectionary",
31998 "shop/confectionery",
32009 "shop/convenience;gas",
32010 "shop/gas;convenience"
32020 "craft/window_construction",
32025 "shop/bathroom_furnishing",
32028 "shop/doityourself",
32033 "shop/hardware_store",
32034 "shop/power_tools",
32041 "shop/health_food",
32043 "shop/nutrition_supplements"
32046 "shop/electronics",
32053 "shop/video_games",
32058 "amenity/hospital",
32059 "healthcare/hospital"
32063 "shop/interior_decoration"
32066 "amenity/lifeboat_station",
32067 "emergency/lifeboat_station",
32068 "emergency/marine_rescue",
32069 "emergency/water_rescue"
32072 "craft/key_cutter",
32077 "tourism/guest_house",
32082 "amenity/money_transfer",
32083 "shop/money_transfer"
32085 music: ["shop/music", "shop/musical_instrument"],
32087 "shop/office_supplies",
32097 "amenity/parcel_locker",
32098 "amenity/vending_machine"
32102 "amenity/pharmacy",
32103 "healthcare/pharmacy",
32107 "amenity/theme_park",
32108 "leisure/amusement_arcade",
32109 "leisure/playground"
32112 "amenity/bicycle_rental",
32113 "amenity/boat_rental",
32114 "amenity/car_rental",
32115 "amenity/truck_rental",
32116 "amenity/vehicle_rental",
32123 "amenity/childcare",
32125 "amenity/kindergarten",
32126 "amenity/language_school",
32127 "amenity/prep_school",
32129 "amenity/university"
32132 "shop/storage_units",
32133 "shop/storage_rental"
32137 "power/substation",
32138 "power/sub_station"
32142 "shop/frozen_food",
32143 "shop/greengrocer",
32145 "shop/supermarket",
32154 "shop/e-cigarette",
32158 "shop/variety_store",
32163 "amenity/vending_machine",
32165 "shop/vending_machine"
32170 "amenity/weight_clinic",
32171 "healthcare/counselling",
32172 "leisure/fitness_centre",
32173 "office/therapist",
32177 "shop/health_food",
32180 "shop/nutrition_supplements",
32185 "shop/supermarket",
32186 "shop/department_store"
32193 // node_modules/name-suggestion-index/config/genericWords.json
32194 var genericWords_default;
32195 var init_genericWords = __esm({
32196 "node_modules/name-suggestion-index/config/genericWords.json"() {
32197 genericWords_default = {
32199 "^(barn|bazaa?r|bench|bou?tique|building|casa|church)$",
32200 "^(baseball|basketball|football|soccer|softball|tennis(halle)?)\\s?(field|court)?$",
32201 "^(club|green|out|ware)\\s?house$",
32202 "^(driveway|el \xE1rbol|fountain|generic|golf|government|graveyard)$",
32203 "^(fixme|n\\s?\\/?\\s?a|name|no\\s?name|none|null|temporary|test|unknown)$",
32204 "^(hofladen|librairie|magazine?|maison|toko)$",
32205 "^(mobile home|skate)?\\s?park$",
32206 "^(obuwie|pond|pool|sale|shops?|sklep|stores?)$",
32209 "^tattoo( studio)?$",
32211 "^\u0446\u0435\u0440\u043A\u043E\u0432\u043D\u0430\u044F( \u043B\u0430\u0432\u043A\u0430)?$"
32217 // node_modules/name-suggestion-index/config/trees.json
32219 var init_trees = __esm({
32220 "node_modules/name-suggestion-index/config/trees.json"() {
32224 emoji: "\u{1F354}",
32225 mainTag: "brand:wikidata",
32226 sourceTags: ["brand", "name"],
32228 primary: "^(name|name:\\w+)$",
32229 alternate: "^(brand|brand:\\w+|operator|operator:\\w+|\\w+_name|\\w+_name:\\w+)$"
32233 emoji: "\u{1F6A9}",
32234 mainTag: "flag:wikidata",
32236 primary: "^(flag:name|flag:name:\\w+)$",
32237 alternate: "^(country|country:\\w+|flag|flag:\\w+|subject|subject:\\w+)$"
32241 emoji: "\u{1F4BC}",
32242 mainTag: "operator:wikidata",
32243 sourceTags: ["operator"],
32245 primary: "^(name|name:\\w+|operator|operator:\\w+)$",
32246 alternate: "^(brand|brand:\\w+|\\w+_name|\\w+_name:\\w+)$"
32250 emoji: "\u{1F687}",
32251 mainTag: "network:wikidata",
32252 sourceTags: ["network"],
32254 primary: "^network$",
32255 alternate: "^(operator|operator:\\w+|network:\\w+|\\w+_name|\\w+_name:\\w+)$"
32263 // node_modules/name-suggestion-index/lib/matcher.js
32264 var import_which_polygon, matchGroups, trees, Matcher;
32265 var init_matcher2 = __esm({
32266 "node_modules/name-suggestion-index/lib/matcher.js"() {
32267 import_which_polygon = __toESM(require_which_polygon(), 1);
32269 init_matchGroups();
32270 init_genericWords();
32272 matchGroups = matchGroups_default.matchGroups;
32273 trees = trees_default.trees;
32277 // initialize the genericWords regexes
32279 this.matchIndex = void 0;
32280 this.genericWords = /* @__PURE__ */ new Map();
32281 (genericWords_default.genericWords || []).forEach((s2) => this.genericWords.set(s2, new RegExp(s2, "i")));
32282 this.itemLocation = void 0;
32283 this.locationSets = void 0;
32284 this.locationIndex = void 0;
32285 this.warnings = [];
32288 // `buildMatchIndex()`
32289 // Call this to prepare the matcher for use
32291 // `data` needs to be an Object indexed on a 'tree/key/value' path.
32292 // (e.g. cache filled by `fileTree.read` or data found in `dist/nsi.json`)
32294 // 'brands/amenity/bank': { properties: {}, items: [ {}, {}, … ] },
32295 // 'brands/amenity/bar': { properties: {}, items: [ {}, {}, … ] },
32299 buildMatchIndex(data) {
32301 if (that.matchIndex) return;
32302 that.matchIndex = /* @__PURE__ */ new Map();
32303 const seenTree = /* @__PURE__ */ new Map();
32304 Object.keys(data).forEach((tkv) => {
32305 const category = data[tkv];
32306 const parts = tkv.split("/", 3);
32307 const t2 = parts[0];
32308 const k2 = parts[1];
32309 const v3 = parts[2];
32310 const thiskv = `${k2}/${v3}`;
32311 const tree = trees[t2];
32312 let branch = that.matchIndex.get(thiskv);
32315 primary: /* @__PURE__ */ new Map(),
32316 alternate: /* @__PURE__ */ new Map(),
32317 excludeGeneric: /* @__PURE__ */ new Map(),
32318 excludeNamed: /* @__PURE__ */ new Map()
32320 that.matchIndex.set(thiskv, branch);
32322 const properties = category.properties || {};
32323 const exclude = properties.exclude || {};
32324 (exclude.generic || []).forEach((s2) => branch.excludeGeneric.set(s2, new RegExp(s2, "i")));
32325 (exclude.named || []).forEach((s2) => branch.excludeNamed.set(s2, new RegExp(s2, "i")));
32326 const excludeRegexes = [...branch.excludeGeneric.values(), ...branch.excludeNamed.values()];
32327 let items = category.items;
32328 if (!Array.isArray(items) || !items.length) return;
32329 const primaryName = new RegExp(tree.nameTags.primary, "i");
32330 const alternateName = new RegExp(tree.nameTags.alternate, "i");
32331 const notName = /:(colou?r|type|forward|backward|left|right|etymology|pronunciation|wikipedia)$/i;
32332 const skipGenericKV = skipGenericKVMatches(t2, k2, v3);
32333 const genericKV = /* @__PURE__ */ new Set([`${k2}/yes`, `building/yes`]);
32334 const matchGroupKV = /* @__PURE__ */ new Set();
32335 Object.values(matchGroups).forEach((matchGroup) => {
32336 const inGroup = matchGroup.some((otherkv) => otherkv === thiskv);
32337 if (!inGroup) return;
32338 matchGroup.forEach((otherkv) => {
32339 if (otherkv === thiskv) return;
32340 matchGroupKV.add(otherkv);
32341 const otherk = otherkv.split("/", 2)[0];
32342 genericKV.add(`${otherk}/yes`);
32345 items.forEach((item) => {
32346 if (!item.id) return;
32347 if (Array.isArray(item.matchTags) && item.matchTags.length) {
32348 item.matchTags = item.matchTags.filter((matchTag) => !matchGroupKV.has(matchTag) && matchTag !== thiskv && !genericKV.has(matchTag));
32349 if (!item.matchTags.length) delete item.matchTags;
32351 let kvTags = [`${thiskv}`].concat(item.matchTags || []);
32352 if (!skipGenericKV) {
32353 kvTags = kvTags.concat(Array.from(genericKV));
32355 Object.keys(item.tags).forEach((osmkey) => {
32356 if (notName.test(osmkey)) return;
32357 const osmvalue = item.tags[osmkey];
32358 if (!osmvalue || excludeRegexes.some((regex) => regex.test(osmvalue))) return;
32359 if (primaryName.test(osmkey)) {
32360 kvTags.forEach((kv) => insertName("primary", t2, kv, simplify(osmvalue), item.id));
32361 } else if (alternateName.test(osmkey)) {
32362 kvTags.forEach((kv) => insertName("alternate", t2, kv, simplify(osmvalue), item.id));
32365 let keepMatchNames = /* @__PURE__ */ new Set();
32366 (item.matchNames || []).forEach((matchName) => {
32367 const nsimple = simplify(matchName);
32368 kvTags.forEach((kv) => {
32369 const branch2 = that.matchIndex.get(kv);
32370 const primaryLeaf = branch2 && branch2.primary.get(nsimple);
32371 const alternateLeaf = branch2 && branch2.alternate.get(nsimple);
32372 const inPrimary = primaryLeaf && primaryLeaf.has(item.id);
32373 const inAlternate = alternateLeaf && alternateLeaf.has(item.id);
32374 if (!inPrimary && !inAlternate) {
32375 insertName("alternate", t2, kv, nsimple, item.id);
32376 keepMatchNames.add(matchName);
32380 if (keepMatchNames.size) {
32381 item.matchNames = Array.from(keepMatchNames);
32383 delete item.matchNames;
32387 function insertName(which, t2, kv, nsimple, itemID) {
32389 that.warnings.push(`Warning: skipping empty ${which} name for item ${t2}/${kv}: ${itemID}`);
32392 let branch = that.matchIndex.get(kv);
32395 primary: /* @__PURE__ */ new Map(),
32396 alternate: /* @__PURE__ */ new Map(),
32397 excludeGeneric: /* @__PURE__ */ new Map(),
32398 excludeNamed: /* @__PURE__ */ new Map()
32400 that.matchIndex.set(kv, branch);
32402 let leaf = branch[which].get(nsimple);
32404 leaf = /* @__PURE__ */ new Set();
32405 branch[which].set(nsimple, leaf);
32408 if (!/yes$/.test(kv)) {
32409 const kvnsimple = `${kv}/${nsimple}`;
32410 const existing = seenTree.get(kvnsimple);
32411 if (existing && existing !== t2) {
32412 const items = Array.from(leaf);
32413 that.warnings.push(`Duplicate cache key "${kvnsimple}" in trees "${t2}" and "${existing}", check items: ${items}`);
32416 seenTree.set(kvnsimple, t2);
32419 function skipGenericKVMatches(t2, k2, v3) {
32420 return t2 === "flags" || t2 === "transit" || k2 === "landuse" || v3 === "atm" || v3 === "bicycle_parking" || v3 === "car_sharing" || v3 === "caravan_site" || v3 === "charging_station" || v3 === "dog_park" || v3 === "parking" || v3 === "phone" || v3 === "playground" || v3 === "post_box" || v3 === "public_bookcase" || v3 === "recycling" || v3 === "vending_machine";
32424 // `buildLocationIndex()`
32425 // Call this to prepare a which-polygon location index.
32426 // This *resolves* all the locationSets into GeoJSON, which takes some time.
32427 // You can skip this step if you don't care about matching within a location.
32429 // `data` needs to be an Object indexed on a 'tree/key/value' path.
32430 // (e.g. cache filled by `fileTree.read` or data found in `dist/nsi.json`)
32432 // 'brands/amenity/bank': { properties: {}, items: [ {}, {}, … ] },
32433 // 'brands/amenity/bar': { properties: {}, items: [ {}, {}, … ] },
32437 buildLocationIndex(data, loco) {
32439 if (that.locationIndex) return;
32440 that.itemLocation = /* @__PURE__ */ new Map();
32441 that.locationSets = /* @__PURE__ */ new Map();
32442 Object.keys(data).forEach((tkv) => {
32443 const items = data[tkv].items;
32444 if (!Array.isArray(items) || !items.length) return;
32445 items.forEach((item) => {
32446 if (that.itemLocation.has(item.id)) return;
32449 resolved = loco.resolveLocationSet(item.locationSet);
32451 console.warn(`buildLocationIndex: ${err.message}`);
32453 if (!resolved || !resolved.id) return;
32454 that.itemLocation.set(item.id, resolved.id);
32455 if (that.locationSets.has(resolved.id)) return;
32456 let feature3 = _cloneDeep2(resolved.feature);
32457 feature3.id = resolved.id;
32458 feature3.properties.id = resolved.id;
32459 if (!feature3.geometry.coordinates.length || !feature3.properties.area) {
32460 console.warn(`buildLocationIndex: locationSet ${resolved.id} for ${item.id} resolves to an empty feature:`);
32461 console.warn(JSON.stringify(feature3));
32464 that.locationSets.set(resolved.id, feature3);
32467 that.locationIndex = (0, import_which_polygon.default)({ type: "FeatureCollection", features: [...that.locationSets.values()] });
32468 function _cloneDeep2(obj) {
32469 return JSON.parse(JSON.stringify(obj));
32474 // Pass parts and return an Array of matches.
32478 // `loc` - optional - [lon,lat] location to search
32480 // 1. If the [k,v,n] tuple matches a canonical item…
32481 // Return an Array of match results.
32482 // Each result will include the area in km² that the item is valid.
32484 // Order of results:
32485 // Primary ordering will be on the "match" column:
32486 // "primary" - where the query matches the `name` tag, followed by
32487 // "alternate" - where the query matches an alternate name tag (e.g. short_name, brand, operator, etc)
32488 // Secondary ordering will be on the "area" column:
32489 // "area descending" if no location was provided, (worldwide before local)
32490 // "area ascending" if location was provided (local before worldwide)
32493 // { match: 'primary', itemID: String, area: Number, kv: String, nsimple: String },
32494 // { match: 'primary', itemID: String, area: Number, kv: String, nsimple: String },
32495 // { match: 'alternate', itemID: String, area: Number, kv: String, nsimple: String },
32496 // { match: 'alternate', itemID: String, area: Number, kv: String, nsimple: String },
32502 // 2. If the [k,v,n] tuple matches an exclude pattern…
32503 // Return an Array with a single exclude result, either
32505 // [ { match: 'excludeGeneric', pattern: String, kv: String } ] // "generic" e.g. "Food Court"
32507 // [ { match: 'excludeNamed', pattern: String, kv: String } ] // "named", e.g. "Kebabai"
32510 // "generic" - a generic word that is probably not really a name.
32511 // For these, iD should warn the user "Hey don't put 'food court' in the name tag".
32512 // "named" - a real name like "Kebabai" that is just common, but not a brand.
32513 // For these, iD should just let it be. We don't include these in NSI, but we don't want to nag users about it either.
32517 // 3. If the [k,v,n] tuple matches nothing of any kind, return `null`
32520 match(k2, v3, n3, loc) {
32522 if (!that.matchIndex) {
32523 throw new Error("match: matchIndex not built.");
32525 let matchLocations;
32526 if (Array.isArray(loc) && that.locationIndex) {
32527 matchLocations = that.locationIndex([loc[0], loc[1], loc[0], loc[1]], true);
32529 const nsimple = simplify(n3);
32530 let seen = /* @__PURE__ */ new Set();
32532 gatherResults("primary");
32533 gatherResults("alternate");
32534 if (results.length) return results;
32535 gatherResults("exclude");
32536 return results.length ? results : null;
32537 function gatherResults(which) {
32538 const kv = `${k2}/${v3}`;
32539 let didMatch = tryMatch(which, kv);
32540 if (didMatch) return;
32541 for (let mg in matchGroups) {
32542 const matchGroup = matchGroups[mg];
32543 const inGroup = matchGroup.some((otherkv) => otherkv === kv);
32544 if (!inGroup) continue;
32545 for (let i3 = 0; i3 < matchGroup.length; i3++) {
32546 const otherkv = matchGroup[i3];
32547 if (otherkv === kv) continue;
32548 didMatch = tryMatch(which, otherkv);
32549 if (didMatch) return;
32552 if (which === "exclude") {
32553 const regex = [...that.genericWords.values()].find((regex2) => regex2.test(n3));
32555 results.push({ match: "excludeGeneric", pattern: String(regex) });
32560 function tryMatch(which, kv) {
32561 const branch = that.matchIndex.get(kv);
32562 if (!branch) return;
32563 if (which === "exclude") {
32564 let regex = [...branch.excludeNamed.values()].find((regex2) => regex2.test(n3));
32566 results.push({ match: "excludeNamed", pattern: String(regex), kv });
32569 regex = [...branch.excludeGeneric.values()].find((regex2) => regex2.test(n3));
32571 results.push({ match: "excludeGeneric", pattern: String(regex), kv });
32576 const leaf = branch[which].get(nsimple);
32577 if (!leaf || !leaf.size) return;
32578 let hits = Array.from(leaf).map((itemID) => {
32579 let area = Infinity;
32580 if (that.itemLocation && that.locationSets) {
32581 const location = that.locationSets.get(that.itemLocation.get(itemID));
32582 area = location && location.properties.area || Infinity;
32584 return { match: which, itemID, area, kv, nsimple };
32586 let sortFn = byAreaDescending;
32587 if (matchLocations) {
32588 hits = hits.filter(isValidLocation);
32589 sortFn = byAreaAscending;
32591 if (!hits.length) return;
32592 hits.sort(sortFn).forEach((hit) => {
32593 if (seen.has(hit.itemID)) return;
32594 seen.add(hit.itemID);
32598 function isValidLocation(hit) {
32599 if (!that.itemLocation) return true;
32600 return matchLocations.find((props) => props.id === that.itemLocation.get(hit.itemID));
32602 function byAreaAscending(hitA, hitB) {
32603 return hitA.area - hitB.area;
32605 function byAreaDescending(hitA, hitB) {
32606 return hitB.area - hitA.area;
32612 // Return any warnings discovered when buiding the index.
32613 // (currently this does nothing)
32616 return this.warnings;
32622 // node_modules/name-suggestion-index/lib/stemmer.js
32623 var init_stemmer = __esm({
32624 "node_modules/name-suggestion-index/lib/stemmer.js"() {
32629 // node_modules/name-suggestion-index/index.mjs
32630 var init_name_suggestion_index = __esm({
32631 "node_modules/name-suggestion-index/index.mjs"() {
32638 // node_modules/vparse/index.js
32639 var require_vparse = __commonJS({
32640 "node_modules/vparse/index.js"(exports2, module2) {
32641 (function(window2) {
32643 function parseVersion2(v3) {
32644 var m3 = v3.replace(/[^0-9.]/g, "").match(/[0-9]*\.|[0-9]+/g) || [];
32646 major: +m3[0] || 0,
32647 minor: +m3[1] || 0,
32648 patch: +m3[2] || 0,
32651 v3.isEmpty = !v3.major && !v3.minor && !v3.patch && !v3.build;
32652 v3.parsed = [v3.major, v3.minor, v3.patch, v3.build];
32653 v3.text = v3.parsed.join(".");
32654 v3.compare = compare2;
32657 function compare2(v3) {
32658 if (typeof v3 === "string") {
32659 v3 = parseVersion2(v3);
32661 for (var i3 = 0; i3 < 4; i3++) {
32662 if (this.parsed[i3] !== v3.parsed[i3]) {
32663 return this.parsed[i3] > v3.parsed[i3] ? 1 : -1;
32668 if (typeof module2 === "object" && module2 && typeof module2.exports === "object") {
32669 module2.exports = parseVersion2;
32671 window2.parseVersion = parseVersion2;
32677 // modules/services/nsi.js
32678 var nsi_exports = {};
32679 __export(nsi_exports, {
32680 default: () => nsi_default
32682 function setNsiSources() {
32683 const nsiVersion = package_default.dependencies["name-suggestion-index"] || package_default.devDependencies["name-suggestion-index"];
32684 const v3 = (0, import_vparse.default)(nsiVersion);
32685 const vMinor = `${v3.major}.${v3.minor}`;
32686 const cdn = nsiCdnUrl.replace("{version}", vMinor);
32688 "nsi_data": cdn + "dist/nsi.min.json",
32689 "nsi_dissolved": cdn + "dist/dissolved.min.json",
32690 "nsi_features": cdn + "dist/featureCollection.min.json",
32691 "nsi_generics": cdn + "dist/genericWords.min.json",
32692 "nsi_presets": cdn + "dist/presets/nsi-id-presets.min.json",
32693 "nsi_replacements": cdn + "dist/replacements.min.json",
32694 "nsi_trees": cdn + "dist/trees.min.json"
32696 let fileMap = _mainFileFetcher.fileMap();
32697 for (const k2 in sources) {
32698 if (!fileMap[k2]) fileMap[k2] = sources[k2];
32701 function loadNsiPresets() {
32702 return Promise.all([
32703 _mainFileFetcher.get("nsi_presets"),
32704 _mainFileFetcher.get("nsi_features")
32705 ]).then((vals) => {
32706 Object.values(vals[0].presets).forEach((preset) => preset.suggestion = true);
32707 Object.values(vals[0].presets).forEach((preset) => {
32708 if (preset.tags["brand:wikidata"]) {
32709 preset.removeTags = { "brand:wikipedia": "*", ...preset.removeTags || preset.addTags || preset.tags };
32711 if (preset.tags["operator:wikidata"]) {
32712 preset.removeTags = { "operator:wikipedia": "*", ...preset.removeTags || preset.addTags || preset.tags };
32714 if (preset.tags["network:wikidata"]) {
32715 preset.removeTags = { "network:wikipedia": "*", ...preset.removeTags || preset.addTags || preset.tags };
32718 _mainPresetIndex.merge({
32719 presets: vals[0].presets,
32720 featureCollection: vals[1]
32724 function loadNsiData() {
32725 return Promise.all([
32726 _mainFileFetcher.get("nsi_data"),
32727 _mainFileFetcher.get("nsi_dissolved"),
32728 _mainFileFetcher.get("nsi_replacements"),
32729 _mainFileFetcher.get("nsi_trees")
32730 ]).then((vals) => {
32733 // the raw name-suggestion-index data
32734 dissolved: vals[1].dissolved,
32735 // list of dissolved items
32736 replacements: vals[2].replacements,
32737 // trivial old->new qid replacements
32738 trees: vals[3].trees,
32739 // metadata about trees, main tags
32740 kvt: /* @__PURE__ */ new Map(),
32741 // Map (k -> Map (v -> t) )
32742 qids: /* @__PURE__ */ new Map(),
32743 // Map (wd/wp tag values -> qids)
32744 ids: /* @__PURE__ */ new Map()
32745 // Map (id -> NSI item)
32747 const matcher = _nsi.matcher = new Matcher();
32748 matcher.buildMatchIndex(_nsi.data);
32749 matcher.itemLocation = /* @__PURE__ */ new Map();
32750 matcher.locationSets = /* @__PURE__ */ new Map();
32751 Object.keys(_nsi.data).forEach((tkv) => {
32752 const items = _nsi.data[tkv].items;
32753 if (!Array.isArray(items) || !items.length) return;
32754 items.forEach((item) => {
32755 if (matcher.itemLocation.has(item.id)) return;
32756 const locationSetID = _sharedLocationManager.locationSetID(item.locationSet);
32757 matcher.itemLocation.set(item.id, locationSetID);
32758 if (matcher.locationSets.has(locationSetID)) return;
32759 const fakeFeature = { id: locationSetID, properties: { id: locationSetID, area: 1 } };
32760 matcher.locationSets.set(locationSetID, fakeFeature);
32763 matcher.locationIndex = (bbox2) => {
32764 const validHere = _sharedLocationManager.locationSetsAt([bbox2[0], bbox2[1]]);
32765 const results = [];
32766 for (const [locationSetID, area] of Object.entries(validHere)) {
32767 const fakeFeature = matcher.locationSets.get(locationSetID);
32769 fakeFeature.properties.area = area;
32770 results.push(fakeFeature);
32775 Object.keys(_nsi.data).forEach((tkv) => {
32776 const category = _nsi.data[tkv];
32777 const parts = tkv.split("/", 3);
32778 const t2 = parts[0];
32779 const k2 = parts[1];
32780 const v3 = parts[2];
32781 let vmap = _nsi.kvt.get(k2);
32783 vmap = /* @__PURE__ */ new Map();
32784 _nsi.kvt.set(k2, vmap);
32787 const tree = _nsi.trees[t2];
32788 const mainTag = tree.mainTag;
32789 const items = category.items || [];
32790 items.forEach((item) => {
32792 item.mainTag = mainTag;
32793 _nsi.ids.set(item.id, item);
32794 const wd = item.tags[mainTag];
32795 const wp = item.tags[mainTag.replace("wikidata", "wikipedia")];
32796 if (wd) _nsi.qids.set(wd, wd);
32797 if (wp && wd) _nsi.qids.set(wp, wd);
32802 function gatherKVs(tags) {
32803 let primary = /* @__PURE__ */ new Set();
32804 let alternate = /* @__PURE__ */ new Set();
32805 Object.keys(tags).forEach((osmkey) => {
32806 const osmvalue = tags[osmkey];
32807 if (!osmvalue) return;
32808 if (osmkey === "route_master") osmkey = "route";
32809 const vmap = _nsi.kvt.get(osmkey);
32811 if (vmap.get(osmvalue)) {
32812 primary.add(`${osmkey}/${osmvalue}`);
32813 } else if (osmvalue === "yes") {
32814 alternate.add(`${osmkey}/${osmvalue}`);
32817 const preset = _mainPresetIndex.matchTags(tags, "area");
32818 if (buildingPreset[preset.id]) {
32819 alternate.add("building/yes");
32821 return { primary, alternate };
32823 function identifyTree(tags) {
32826 Object.keys(tags).forEach((osmkey) => {
32828 const osmvalue = tags[osmkey];
32829 if (!osmvalue) return;
32830 if (osmkey === "route_master") osmkey = "route";
32831 const vmap = _nsi.kvt.get(osmkey);
32833 if (osmvalue === "yes") {
32834 unknown = "unknown";
32836 t2 = vmap.get(osmvalue);
32839 return t2 || unknown || null;
32841 function gatherNames(tags) {
32842 const empty2 = { primary: /* @__PURE__ */ new Set(), alternate: /* @__PURE__ */ new Set() };
32843 let primary = /* @__PURE__ */ new Set();
32844 let alternate = /* @__PURE__ */ new Set();
32845 let foundSemi = false;
32846 let testNameFragments = false;
32848 let t2 = identifyTree(tags);
32849 if (!t2) return empty2;
32850 if (t2 === "transit") {
32852 primary: /^network$/i,
32853 alternate: /^(operator|operator:\w+|network:\w+|\w+_name|\w+_name:\w+)$/i
32855 } else if (t2 === "flags") {
32857 primary: /^(flag:name|flag:name:\w+)$/i,
32858 alternate: /^(flag|flag:\w+|subject|subject:\w+)$/i
32859 // note: no `country`, we special-case it below
32861 } else if (t2 === "brands") {
32862 testNameFragments = true;
32864 primary: /^(name|name:\w+)$/i,
32865 alternate: /^(brand|brand:\w+|operator|operator:\w+|\w+_name|\w+_name:\w+)/i
32867 } else if (t2 === "operators") {
32868 testNameFragments = true;
32870 primary: /^(name|name:\w+|operator|operator:\w+)$/i,
32871 alternate: /^(brand|brand:\w+|\w+_name|\w+_name:\w+)/i
32874 testNameFragments = true;
32876 primary: /^(name|name:\w+)$/i,
32877 alternate: /^(brand|brand:\w+|network|network:\w+|operator|operator:\w+|\w+_name|\w+_name:\w+)/i
32880 if (tags.name && testNameFragments) {
32881 const nameParts = tags.name.split(/[\s\-\/,.]/);
32882 for (let split = nameParts.length; split > 0; split--) {
32883 const name = nameParts.slice(0, split).join(" ");
32887 Object.keys(tags).forEach((osmkey) => {
32888 const osmvalue = tags[osmkey];
32889 if (!osmvalue) return;
32890 if (isNamelike(osmkey, "primary")) {
32891 if (/;/.test(osmvalue)) {
32894 primary.add(osmvalue);
32895 alternate.delete(osmvalue);
32897 } else if (!primary.has(osmvalue) && isNamelike(osmkey, "alternate")) {
32898 if (/;/.test(osmvalue)) {
32901 alternate.add(osmvalue);
32905 if (tags.man_made === "flagpole" && !primary.size && !alternate.size && !!tags.country) {
32906 const osmvalue = tags.country;
32907 if (/;/.test(osmvalue)) {
32910 alternate.add(osmvalue);
32916 return { primary, alternate };
32918 function isNamelike(osmkey, which) {
32919 if (osmkey === "old_name") return false;
32920 return patterns2[which].test(osmkey) && !notNames.test(osmkey);
32923 function gatherTuples(tryKVs, tryNames) {
32925 ["primary", "alternate"].forEach((whichName) => {
32926 const arr = Array.from(tryNames[whichName]).sort((a2, b3) => b3.length - a2.length);
32927 arr.forEach((n3) => {
32928 ["primary", "alternate"].forEach((whichKV) => {
32929 tryKVs[whichKV].forEach((kv) => {
32930 const parts = kv.split("/", 2);
32931 const k2 = parts[0];
32932 const v3 = parts[1];
32933 tuples.push({ k: k2, v: v3, n: n3 });
32940 function _upgradeTags(tags, loc) {
32941 let newTags = Object.assign({}, tags);
32942 let changed = false;
32943 Object.keys(newTags).forEach((osmkey) => {
32944 const matchTag = osmkey.match(/^(\w+:)?wikidata$/);
32946 const prefix = matchTag[1] || "";
32947 const wd = newTags[osmkey];
32948 const replace = _nsi.replacements[wd];
32949 if (replace && replace.wikidata !== void 0) {
32951 if (replace.wikidata) {
32952 newTags[osmkey] = replace.wikidata;
32954 delete newTags[osmkey];
32957 if (replace && replace.wikipedia !== void 0) {
32959 const wpkey = `${prefix}wikipedia`;
32960 if (replace.wikipedia) {
32961 newTags[wpkey] = replace.wikipedia;
32963 delete newTags[wpkey];
32968 const isRouteMaster = tags.type === "route_master";
32969 const tryKVs = gatherKVs(tags);
32970 if (!tryKVs.primary.size && !tryKVs.alternate.size) {
32971 return changed ? { newTags, matched: null } : null;
32973 const tryNames = gatherNames(tags);
32974 const foundQID = _nsi.qids.get(tags.wikidata) || _nsi.qids.get(tags.wikipedia);
32975 if (foundQID) tryNames.primary.add(foundQID);
32976 if (!tryNames.primary.size && !tryNames.alternate.size) {
32977 return changed ? { newTags, matched: null } : null;
32979 const tuples = gatherTuples(tryKVs, tryNames);
32980 for (let i3 = 0; i3 < tuples.length; i3++) {
32981 const tuple = tuples[i3];
32982 const hits = _nsi.matcher.match(tuple.k, tuple.v, tuple.n, loc);
32983 if (!hits || !hits.length) continue;
32984 if (hits[0].match !== "primary" && hits[0].match !== "alternate") break;
32986 for (let j3 = 0; j3 < hits.length; j3++) {
32987 const hit = hits[j3];
32988 itemID = hit.itemID;
32989 if (_nsi.dissolved[itemID]) continue;
32990 item = _nsi.ids.get(itemID);
32991 if (!item) continue;
32992 const mainTag = item.mainTag;
32993 const itemQID = item.tags[mainTag];
32994 const notQID = newTags[`not:${mainTag}`];
32996 // Exceptions, skip this hit
32997 !itemQID || itemQID === notQID || // No `*:wikidata` or matched a `not:*:wikidata`
32998 newTags.office && !item.tags.office
33006 if (!item) continue;
33007 item = JSON.parse(JSON.stringify(item));
33008 const tkv = item.tkv;
33009 const parts = tkv.split("/", 3);
33010 const k2 = parts[1];
33011 const v3 = parts[2];
33012 const category = _nsi.data[tkv];
33013 const properties = category.properties || {};
33014 let preserveTags = item.preserveTags || properties.preserveTags || [];
33015 ["building", "emergency", "internet_access", "opening_hours", "takeaway"].forEach((osmkey) => {
33016 if (k2 !== osmkey) preserveTags.push(`^${osmkey}$`);
33018 const regexes = preserveTags.map((s2) => new RegExp(s2, "i"));
33020 Object.keys(newTags).forEach((osmkey) => {
33021 if (regexes.some((regex) => regex.test(osmkey))) {
33022 keepTags[osmkey] = newTags[osmkey];
33025 _nsi.kvt.forEach((vmap, k3) => {
33026 if (newTags[k3] === "yes") delete newTags[k3];
33029 delete newTags.wikipedia;
33030 delete newTags.wikidata;
33032 Object.assign(newTags, item.tags, keepTags);
33033 if (isRouteMaster) {
33034 newTags.route_master = newTags.route;
33035 delete newTags.route;
33037 const origName = tags.name;
33038 const newName = newTags.name;
33039 if (newName && origName && newName !== origName && !newTags.branch) {
33040 const newNames = gatherNames(newTags);
33041 const newSet = /* @__PURE__ */ new Set([...newNames.primary, ...newNames.alternate]);
33042 const isMoved = newSet.has(origName);
33044 const nameParts = origName.split(/[\s\-\/,.]/);
33045 for (let split = nameParts.length; split > 0; split--) {
33046 const name = nameParts.slice(0, split).join(" ");
33047 const branch = nameParts.slice(split).join(" ");
33048 const nameHits = _nsi.matcher.match(k2, v3, name, loc);
33049 if (!nameHits || !nameHits.length) continue;
33050 if (nameHits.some((hit) => hit.itemID === itemID)) {
33052 if (notBranches.test(branch)) {
33053 newTags.name = origName;
33055 const branchHits = _nsi.matcher.match(k2, v3, branch, loc);
33056 if (branchHits && branchHits.length) {
33057 if (branchHits[0].match === "primary" || branchHits[0].match === "alternate") {
33061 newTags.branch = branch;
33070 return { newTags, matched: item };
33072 return changed ? { newTags, matched: null } : null;
33074 function _isGenericName(tags) {
33075 const n3 = tags.name;
33076 if (!n3) return false;
33077 const tryNames = { primary: /* @__PURE__ */ new Set([n3]), alternate: /* @__PURE__ */ new Set() };
33078 const tryKVs = gatherKVs(tags);
33079 if (!tryKVs.primary.size && !tryKVs.alternate.size) return false;
33080 const tuples = gatherTuples(tryKVs, tryNames);
33081 for (let i3 = 0; i3 < tuples.length; i3++) {
33082 const tuple = tuples[i3];
33083 const hits = _nsi.matcher.match(tuple.k, tuple.v, tuple.n);
33084 if (hits && hits.length && hits[0].match === "excludeGeneric") return true;
33088 var import_vparse, _nsiStatus, _nsi, buildingPreset, notNames, notBranches, nsi_default;
33089 var init_nsi = __esm({
33090 "modules/services/nsi.js"() {
33092 init_name_suggestion_index();
33093 import_vparse = __toESM(require_vparse(), 1);
33098 _nsiStatus = "loading";
33101 "building/commercial": true,
33102 "building/government": true,
33103 "building/hotel": true,
33104 "building/retail": true,
33105 "building/office": true,
33106 "building/supermarket": true,
33107 "building/yes": true
33109 notNames = /:(colou?r|type|forward|backward|left|right|etymology|pronunciation|wikipedia)$/i;
33110 notBranches = /(coop|express|wireless|factory|outlet)/i;
33113 // On init, start preparing the name-suggestion-index
33117 _mainPresetIndex.ensureLoaded().then(() => loadNsiPresets()).then(() => loadNsiData()).then(() => _nsiStatus = "ok").catch(() => _nsiStatus = "failed");
33120 // Reset is called when user saves data to OSM (does nothing here)
33125 // To let other code know how it's going...
33128 // `String`: 'loading', 'ok', 'failed'
33130 status: () => _nsiStatus,
33131 // `isGenericName()`
33132 // Is the `name` tag generic?
33135 // `tags`: `Object` containing the feature's OSM tags
33137 // `true` if it is generic, `false` if not
33139 isGenericName: (tags) => _isGenericName(tags),
33141 // Suggest tag upgrades.
33142 // This function will not modify the input tags, it makes a copy.
33145 // `tags`: `Object` containing the feature's OSM tags
33146 // `loc`: Location where this feature exists, as a [lon, lat]
33148 // `Object` containing the result, or `null` if no changes needed:
33150 // 'newTags': `Object` - The tags the the feature should have
33151 // 'matched': `Object` - The matched item
33154 upgradeTags: (tags, loc) => _upgradeTags(tags, loc),
33156 // Direct access to the NSI cache, useful for testing or breaking things
33159 // `Object`: the internal NSI cache
33166 // modules/services/kartaview.js
33167 var kartaview_exports = {};
33168 __export(kartaview_exports, {
33169 default: () => kartaview_default
33171 function abortRequest3(controller) {
33172 controller.abort();
33174 function maxPageAtZoom(z3) {
33175 if (z3 < 15) return 2;
33176 if (z3 === 15) return 5;
33177 if (z3 === 16) return 10;
33178 if (z3 === 17) return 20;
33179 if (z3 === 18) return 40;
33180 if (z3 > 18) return 80;
33182 function loadTiles2(which, url, projection2) {
33183 var currZoom = Math.floor(geoScaleToZoom(projection2.scale()));
33184 var tiles = tiler3.getTiles(projection2);
33185 var cache = _oscCache[which];
33186 Object.keys(cache.inflight).forEach(function(k2) {
33187 var wanted = tiles.find(function(tile) {
33188 return k2.indexOf(tile.id + ",") === 0;
33191 abortRequest3(cache.inflight[k2]);
33192 delete cache.inflight[k2];
33195 tiles.forEach(function(tile) {
33196 loadNextTilePage(which, currZoom, url, tile);
33199 function loadNextTilePage(which, currZoom, url, tile) {
33200 var cache = _oscCache[which];
33201 var bbox2 = tile.extent.bbox();
33202 var maxPages = maxPageAtZoom(currZoom);
33203 var nextPage = cache.nextPage[tile.id] || 1;
33204 var params = utilQsString({
33207 // client_id: clientId,
33208 bbTopLeft: [bbox2.maxY, bbox2.minX].join(","),
33209 bbBottomRight: [bbox2.minY, bbox2.maxX].join(",")
33211 if (nextPage > maxPages) return;
33212 var id2 = tile.id + "," + String(nextPage);
33213 if (cache.loaded[id2] || cache.inflight[id2]) return;
33214 var controller = new AbortController();
33215 cache.inflight[id2] = controller;
33218 signal: controller.signal,
33220 headers: { "Content-Type": "application/x-www-form-urlencoded" }
33222 json_default(url, options).then(function(data) {
33223 cache.loaded[id2] = true;
33224 delete cache.inflight[id2];
33225 if (!data || !data.currentPageItems || !data.currentPageItems.length) {
33226 throw new Error("No Data");
33228 var features = data.currentPageItems.map(function(item) {
33229 var loc = [+item.lng, +item.lat];
33231 if (which === "images") {
33237 captured_at: item.shot_date || item.date_added,
33238 captured_by: item.username,
33239 imagePath: item.name,
33240 sequence_id: item.sequence_id,
33241 sequence_index: +item.sequence_index
33243 var seq = _oscCache.sequences[d4.sequence_id];
33245 seq = { rotation: 0, images: [] };
33246 _oscCache.sequences[d4.sequence_id] = seq;
33248 seq.images[d4.sequence_index] = d4;
33249 _oscCache.images.forImageKey[d4.key] = d4;
33259 cache.rtree.load(features);
33260 if (data.currentPageItems.length === maxResults) {
33261 cache.nextPage[tile.id] = nextPage + 1;
33262 loadNextTilePage(which, currZoom, url, tile);
33264 cache.nextPage[tile.id] = Infinity;
33266 if (which === "images") {
33267 dispatch5.call("loadedImages");
33269 }).catch(function() {
33270 cache.loaded[id2] = true;
33271 delete cache.inflight[id2];
33274 function partitionViewport2(projection2) {
33275 var z3 = geoScaleToZoom(projection2.scale());
33276 var z22 = Math.ceil(z3 * 2) / 2 + 2.5;
33277 var tiler8 = utilTiler().zoomExtent([z22, z22]);
33278 return tiler8.getTiles(projection2).map(function(tile) {
33279 return tile.extent;
33282 function searchLimited2(limit, projection2, rtree) {
33283 limit = limit || 5;
33284 return partitionViewport2(projection2).reduce(function(result, extent) {
33285 var found = rtree.search(extent.bbox()).slice(0, limit).map(function(d4) {
33288 return found.length ? result.concat(found) : result;
33291 var apibase2, maxResults, tileZoom, tiler3, dispatch5, imgZoom, _oscCache, _oscSelectedImage, _loadViewerPromise2, kartaview_default;
33292 var init_kartaview = __esm({
33293 "modules/services/kartaview.js"() {
33303 apibase2 = "https://kartaview.org";
33306 tiler3 = utilTiler().zoomExtent([tileZoom, tileZoom]).skipNullIsland(true);
33307 dispatch5 = dispatch_default("loadedImages");
33308 imgZoom = zoom_default2().extent([[0, 0], [320, 240]]).translateExtent([[0, 0], [320, 240]]).scaleExtent([1, 15]);
33309 kartaview_default = {
33314 this.event = utilRebind(this, dispatch5, "on");
33316 reset: function() {
33318 Object.values(_oscCache.images.inflight).forEach(abortRequest3);
33321 images: { inflight: {}, loaded: {}, nextPage: {}, rtree: new RBush(), forImageKey: {} },
33325 images: function(projection2) {
33327 return searchLimited2(limit, projection2, _oscCache.images.rtree);
33329 sequences: function(projection2) {
33330 var viewport = projection2.clipExtent();
33331 var min3 = [viewport[0][0], viewport[1][1]];
33332 var max3 = [viewport[1][0], viewport[0][1]];
33333 var bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
33334 var sequenceKeys = {};
33335 _oscCache.images.rtree.search(bbox2).forEach(function(d4) {
33336 sequenceKeys[d4.data.sequence_id] = true;
33338 var lineStrings = [];
33339 Object.keys(sequenceKeys).forEach(function(sequenceKey) {
33340 var seq = _oscCache.sequences[sequenceKey];
33341 var images = seq && seq.images;
33344 type: "LineString",
33345 coordinates: images.map(function(d4) {
33347 }).filter(Boolean),
33349 captured_at: images[0] ? images[0].captured_at : null,
33350 captured_by: images[0] ? images[0].captured_by : null,
33356 return lineStrings;
33358 cachedImage: function(imageKey) {
33359 return _oscCache.images.forImageKey[imageKey];
33361 loadImages: function(projection2) {
33362 var url = apibase2 + "/1.0/list/nearby-photos/";
33363 loadTiles2("images", url, projection2);
33365 ensureViewerLoaded: function(context) {
33366 if (_loadViewerPromise2) return _loadViewerPromise2;
33367 var wrap2 = context.container().select(".photoviewer").selectAll(".kartaview-wrapper").data([0]);
33369 var wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper kartaview-wrapper").classed("hide", true).call(imgZoom.on("zoom", zoomPan2)).on("dblclick.zoom", null);
33370 wrapEnter.append("div").attr("class", "photo-attribution fillD");
33371 var controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
33372 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
33373 controlsEnter.append("button").on("click.rotate-ccw", rotate(-90)).text("\u293F");
33374 controlsEnter.append("button").on("click.rotate-cw", rotate(90)).text("\u293E");
33375 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
33376 wrapEnter.append("div").attr("class", "kartaview-image-wrap");
33377 context.ui().photoviewer.on("resize.kartaview", function(dimensions) {
33378 imgZoom.extent([[0, 0], dimensions]).translateExtent([[0, 0], dimensions]);
33380 function zoomPan2(d3_event) {
33381 var t2 = d3_event.transform;
33382 context.container().select(".photoviewer .kartaview-image-wrap").call(utilSetTransform, t2.x, t2.y, t2.k);
33384 function rotate(deg) {
33385 return function() {
33386 if (!_oscSelectedImage) return;
33387 var sequenceKey = _oscSelectedImage.sequence_id;
33388 var sequence = _oscCache.sequences[sequenceKey];
33389 if (!sequence) return;
33390 var r2 = sequence.rotation || 0;
33392 if (r2 > 180) r2 -= 360;
33393 if (r2 < -180) r2 += 360;
33394 sequence.rotation = r2;
33395 var wrap3 = context.container().select(".photoviewer .kartaview-wrapper");
33396 wrap3.transition().duration(100).call(imgZoom.transform, identity2);
33397 wrap3.selectAll(".kartaview-image").transition().duration(100).style("transform", "rotate(" + r2 + "deg)");
33400 function step(stepBy) {
33401 return function() {
33402 if (!_oscSelectedImage) return;
33403 var sequenceKey = _oscSelectedImage.sequence_id;
33404 var sequence = _oscCache.sequences[sequenceKey];
33405 if (!sequence) return;
33406 var nextIndex = _oscSelectedImage.sequence_index + stepBy;
33407 var nextImage = sequence.images[nextIndex];
33408 if (!nextImage) return;
33409 context.map().centerEase(nextImage.loc);
33410 that.selectImage(context, nextImage.key);
33413 _loadViewerPromise2 = Promise.resolve();
33414 return _loadViewerPromise2;
33416 showViewer: function(context) {
33417 const wrap2 = context.container().select(".photoviewer");
33418 const isHidden = wrap2.selectAll(".photo-wrapper.kartaview-wrapper.hide").size();
33420 for (const service of Object.values(services)) {
33421 if (service === this) continue;
33422 if (typeof service.hideViewer === "function") {
33423 service.hideViewer(context);
33426 wrap2.classed("hide", false).selectAll(".photo-wrapper.kartaview-wrapper").classed("hide", false);
33430 hideViewer: function(context) {
33431 _oscSelectedImage = null;
33432 this.updateUrlImage(null);
33433 var viewer = context.container().select(".photoviewer");
33434 if (!viewer.empty()) viewer.datum(null);
33435 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
33436 context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
33437 return this.setStyles(context, null, true);
33439 selectImage: function(context, imageKey) {
33440 var d4 = this.cachedImage(imageKey);
33441 _oscSelectedImage = d4;
33442 this.updateUrlImage(imageKey);
33443 var viewer = context.container().select(".photoviewer");
33444 if (!viewer.empty()) viewer.datum(d4);
33445 this.setStyles(context, null, true);
33446 context.container().selectAll(".icon-sign").classed("currentView", false);
33447 if (!d4) return this;
33448 var wrap2 = context.container().select(".photoviewer .kartaview-wrapper");
33449 var imageWrap = wrap2.selectAll(".kartaview-image-wrap");
33450 var attribution = wrap2.selectAll(".photo-attribution").text("");
33451 wrap2.transition().duration(100).call(imgZoom.transform, identity2);
33452 imageWrap.selectAll(".kartaview-image").remove();
33454 var sequence = _oscCache.sequences[d4.sequence_id];
33455 var r2 = sequence && sequence.rotation || 0;
33456 imageWrap.append("img").attr("class", "kartaview-image").attr("src", (apibase2 + "/" + d4.imagePath).replace(/^https:\/\/kartaview\.org\/storage(\d+)\//, "https://storage$1.openstreetcam.org/")).style("transform", "rotate(" + r2 + "deg)");
33457 if (d4.captured_by) {
33458 attribution.append("a").attr("class", "captured_by").attr("target", "_blank").attr("href", "https://kartaview.org/user/" + encodeURIComponent(d4.captured_by)).text("@" + d4.captured_by);
33459 attribution.append("span").text("|");
33461 if (d4.captured_at) {
33462 attribution.append("span").attr("class", "captured_at").text(localeDateString2(d4.captured_at));
33463 attribution.append("span").text("|");
33465 attribution.append("a").attr("class", "image-link").attr("target", "_blank").attr("href", "https://kartaview.org/details/" + d4.sequence_id + "/" + d4.sequence_index).text("kartaview.org");
33468 function localeDateString2(s2) {
33469 if (!s2) return null;
33470 var options = { day: "numeric", month: "short", year: "numeric" };
33471 var d5 = new Date(s2);
33472 if (isNaN(d5.getTime())) return null;
33473 return d5.toLocaleDateString(_mainLocalizer.localeCode(), options);
33476 getSelectedImage: function() {
33477 return _oscSelectedImage;
33479 getSequenceKeyForImage: function(d4) {
33480 return d4 && d4.sequence_id;
33482 // Updates the currently highlighted sequence and selected bubble.
33483 // Reset is only necessary when interacting with the viewport because
33484 // this implicitly changes the currently selected bubble/sequence
33485 setStyles: function(context, hovered, reset) {
33487 context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
33488 context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
33490 var hoveredImageId = hovered && hovered.key;
33491 var hoveredSequenceId = this.getSequenceKeyForImage(hovered);
33492 var viewer = context.container().select(".photoviewer");
33493 var selected = viewer.empty() ? void 0 : viewer.datum();
33494 var selectedImageId = selected && selected.key;
33495 var selectedSequenceId = this.getSequenceKeyForImage(selected);
33496 context.container().selectAll(".layer-kartaview .viewfield-group").classed("highlighted", function(d4) {
33497 return d4.sequence_id === selectedSequenceId || d4.id === hoveredImageId;
33498 }).classed("hovered", function(d4) {
33499 return d4.key === hoveredImageId;
33500 }).classed("currentView", function(d4) {
33501 return d4.key === selectedImageId;
33503 context.container().selectAll(".layer-kartaview .sequence").classed("highlighted", function(d4) {
33504 return d4.properties.key === hoveredSequenceId;
33505 }).classed("currentView", function(d4) {
33506 return d4.properties.key === selectedSequenceId;
33508 context.container().selectAll(".layer-kartaview .viewfield-group .viewfield").attr("d", viewfieldPath);
33509 function viewfieldPath() {
33510 var d4 = this.parentNode.__data__;
33511 if (d4.pano && d4.key !== selectedImageId) {
33512 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
33514 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
33519 updateUrlImage: function(imageKey) {
33520 const hash2 = utilStringQs(window.location.hash);
33522 hash2.photo = "kartaview/" + imageKey;
33524 delete hash2.photo;
33526 window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
33528 cache: function() {
33535 // node_modules/@rapideditor/country-coder/dist/country-coder.mjs
33536 function canonicalID(id2) {
33537 const s2 = id2 || "";
33538 if (s2.charAt(0) === ".") {
33539 return s2.toUpperCase();
33541 return s2.replace(idFilterRegex, "").toUpperCase();
33544 function loadDerivedDataAndCaches(borders2) {
33545 const identifierProps = ["iso1A2", "iso1A3", "m49", "wikidata", "emojiFlag", "ccTLD", "nameEn"];
33546 let geometryFeatures = [];
33547 for (const feature22 of borders2.features) {
33548 const props = feature22.properties;
33549 props.id = props.iso1A2 || props.m49 || props.wikidata;
33550 loadM49(feature22);
33551 loadTLD(feature22);
33552 loadIsoStatus(feature22);
33553 loadLevel(feature22);
33554 loadGroups(feature22);
33555 loadFlag(feature22);
33556 cacheFeatureByIDs(feature22);
33557 if (feature22.geometry) {
33558 geometryFeatures.push(feature22);
33561 for (const feature22 of borders2.features) {
33562 feature22.properties.groups = feature22.properties.groups.map((groupID) => {
33563 return _featuresByCode[groupID].properties.id;
33565 loadMembersForGroupsOf(feature22);
33567 for (const feature22 of borders2.features) {
33568 loadRoadSpeedUnit(feature22);
33569 loadRoadHeightUnit(feature22);
33570 loadDriveSide(feature22);
33571 loadCallingCodes(feature22);
33572 loadGroupGroups(feature22);
33574 for (const feature22 of borders2.features) {
33575 feature22.properties.groups.sort((groupID1, groupID2) => {
33576 return levels.indexOf(_featuresByCode[groupID1].properties.level) - levels.indexOf(_featuresByCode[groupID2].properties.level);
33578 if (feature22.properties.members) {
33579 feature22.properties.members.sort((id1, id2) => {
33580 const diff = levels.indexOf(_featuresByCode[id1].properties.level) - levels.indexOf(_featuresByCode[id2].properties.level);
33582 return borders2.features.indexOf(_featuresByCode[id1]) - borders2.features.indexOf(_featuresByCode[id2]);
33588 const geometryOnlyCollection = {
33589 type: "FeatureCollection",
33590 features: geometryFeatures
33592 _whichPolygon = (0, import_which_polygon2.default)(geometryOnlyCollection);
33593 function loadGroups(feature22) {
33594 const props = feature22.properties;
33595 if (!props.groups) {
33598 if (feature22.geometry && props.country) {
33599 props.groups.push(props.country);
33601 if (props.m49 !== "001") {
33602 props.groups.push("001");
33605 function loadM49(feature22) {
33606 const props = feature22.properties;
33607 if (!props.m49 && props.iso1N3) {
33608 props.m49 = props.iso1N3;
33611 function loadTLD(feature22) {
33612 const props = feature22.properties;
33613 if (props.level === "unitedNations") return;
33614 if (props.ccTLD === null) return;
33615 if (!props.ccTLD && props.iso1A2) {
33616 props.ccTLD = "." + props.iso1A2.toLowerCase();
33619 function loadIsoStatus(feature22) {
33620 const props = feature22.properties;
33621 if (!props.isoStatus && props.iso1A2) {
33622 props.isoStatus = "official";
33625 function loadLevel(feature22) {
33626 const props = feature22.properties;
33627 if (props.level) return;
33628 if (!props.country) {
33629 props.level = "country";
33630 } else if (!props.iso1A2 || props.isoStatus === "official") {
33631 props.level = "territory";
33633 props.level = "subterritory";
33636 function loadGroupGroups(feature22) {
33637 const props = feature22.properties;
33638 if (feature22.geometry || !props.members) return;
33639 const featureLevelIndex = levels.indexOf(props.level);
33640 let sharedGroups = [];
33641 props.members.forEach((memberID, index) => {
33642 const member = _featuresByCode[memberID];
33643 const memberGroups = member.properties.groups.filter((groupID) => {
33644 return groupID !== feature22.properties.id && featureLevelIndex < levels.indexOf(_featuresByCode[groupID].properties.level);
33647 sharedGroups = memberGroups;
33649 sharedGroups = sharedGroups.filter((groupID) => memberGroups.indexOf(groupID) !== -1);
33652 props.groups = props.groups.concat(
33653 sharedGroups.filter((groupID) => props.groups.indexOf(groupID) === -1)
33655 for (const groupID of sharedGroups) {
33656 const groupFeature = _featuresByCode[groupID];
33657 if (groupFeature.properties.members.indexOf(props.id) === -1) {
33658 groupFeature.properties.members.push(props.id);
33662 function loadRoadSpeedUnit(feature22) {
33663 const props = feature22.properties;
33664 if (feature22.geometry) {
33665 if (!props.roadSpeedUnit) props.roadSpeedUnit = "km/h";
33666 } else if (props.members) {
33667 const vals = Array.from(
33669 props.members.map((id2) => {
33670 const member = _featuresByCode[id2];
33671 if (member.geometry) return member.properties.roadSpeedUnit || "km/h";
33675 if (vals.length === 1) props.roadSpeedUnit = vals[0];
33678 function loadRoadHeightUnit(feature22) {
33679 const props = feature22.properties;
33680 if (feature22.geometry) {
33681 if (!props.roadHeightUnit) props.roadHeightUnit = "m";
33682 } else if (props.members) {
33683 const vals = Array.from(
33685 props.members.map((id2) => {
33686 const member = _featuresByCode[id2];
33687 if (member.geometry) return member.properties.roadHeightUnit || "m";
33691 if (vals.length === 1) props.roadHeightUnit = vals[0];
33694 function loadDriveSide(feature22) {
33695 const props = feature22.properties;
33696 if (feature22.geometry) {
33697 if (!props.driveSide) props.driveSide = "right";
33698 } else if (props.members) {
33699 const vals = Array.from(
33701 props.members.map((id2) => {
33702 const member = _featuresByCode[id2];
33703 if (member.geometry) return member.properties.driveSide || "right";
33707 if (vals.length === 1) props.driveSide = vals[0];
33710 function loadCallingCodes(feature22) {
33711 const props = feature22.properties;
33712 if (!feature22.geometry && props.members) {
33713 props.callingCodes = Array.from(
33715 props.members.reduce((array2, id2) => {
33716 const member = _featuresByCode[id2];
33717 if (member.geometry && member.properties.callingCodes) {
33718 return array2.concat(member.properties.callingCodes);
33726 function loadFlag(feature22) {
33728 const country = feature22.properties.iso1A2;
33729 if (country && country !== "FX") {
33730 flag = _toEmojiCountryFlag(country);
33732 const regionStrings = {
33734 // GB-ENG (England)
33736 // GB-SCT (Scotland)
33740 const region = regionStrings[feature22.properties.wikidata];
33742 flag = _toEmojiRegionFlag(region);
33745 feature22.properties.emojiFlag = flag;
33747 function _toEmojiCountryFlag(s2) {
33748 return s2.replace(/./g, (c2) => String.fromCodePoint(c2.charCodeAt(0) + 127397));
33750 function _toEmojiRegionFlag(s2) {
33751 const codepoints = [127988];
33752 for (const c2 of [...s2]) {
33753 codepoints.push(c2.codePointAt(0) + 917504);
33755 codepoints.push(917631);
33756 return String.fromCodePoint.apply(null, codepoints);
33759 function loadMembersForGroupsOf(feature22) {
33760 for (const groupID of feature22.properties.groups) {
33761 const groupFeature = _featuresByCode[groupID];
33762 if (!groupFeature.properties.members) {
33763 groupFeature.properties.members = [];
33765 groupFeature.properties.members.push(feature22.properties.id);
33768 function cacheFeatureByIDs(feature22) {
33770 for (const prop of identifierProps) {
33771 const id2 = feature22.properties[prop];
33776 for (const alias of feature22.properties.aliases || []) {
33779 for (const id2 of ids) {
33780 const cid = canonicalID(id2);
33781 _featuresByCode[cid] = feature22;
33785 function locArray(loc) {
33786 if (Array.isArray(loc)) {
33788 } else if (loc.coordinates) {
33789 return loc.coordinates;
33791 return loc.geometry.coordinates;
33793 function smallestFeature(loc) {
33794 const query = locArray(loc);
33795 const featureProperties = _whichPolygon(query);
33796 if (!featureProperties) return null;
33797 return _featuresByCode[featureProperties.id];
33799 function countryFeature(loc) {
33800 const feature22 = smallestFeature(loc);
33801 if (!feature22) return null;
33802 const countryCode = feature22.properties.country || feature22.properties.iso1A2;
33803 return _featuresByCode[countryCode] || null;
33805 function featureForLoc(loc, opts) {
33806 const targetLevel = opts.level || "country";
33807 const maxLevel = opts.maxLevel || "world";
33808 const withProp = opts.withProp;
33809 const targetLevelIndex = levels.indexOf(targetLevel);
33810 if (targetLevelIndex === -1) return null;
33811 const maxLevelIndex = levels.indexOf(maxLevel);
33812 if (maxLevelIndex === -1) return null;
33813 if (maxLevelIndex < targetLevelIndex) return null;
33814 if (targetLevel === "country") {
33815 const fastFeature = countryFeature(loc);
33817 if (!withProp || fastFeature.properties[withProp]) {
33818 return fastFeature;
33822 const features = featuresContaining(loc);
33823 const match = features.find((feature22) => {
33824 let levelIndex = levels.indexOf(feature22.properties.level);
33825 if (feature22.properties.level === targetLevel || // if no feature exists at the target level, return the first feature at the next level up
33826 levelIndex > targetLevelIndex && levelIndex <= maxLevelIndex) {
33827 if (!withProp || feature22.properties[withProp]) {
33833 return match || null;
33835 function featureForID(id2) {
33837 if (typeof id2 === "number") {
33838 stringID = id2.toString();
33839 if (stringID.length === 1) {
33840 stringID = "00" + stringID;
33841 } else if (stringID.length === 2) {
33842 stringID = "0" + stringID;
33845 stringID = canonicalID(id2);
33847 return _featuresByCode[stringID] || null;
33849 function smallestFeaturesForBbox(bbox2) {
33850 return _whichPolygon.bbox(bbox2).map((props) => _featuresByCode[props.id]);
33852 function smallestOrMatchingFeature(query) {
33853 if (typeof query === "object") {
33854 return smallestFeature(query);
33856 return featureForID(query);
33858 function feature(query, opts = defaultOpts) {
33859 if (typeof query === "object") {
33860 return featureForLoc(query, opts);
33862 return featureForID(query);
33864 function iso1A2Code(query, opts = defaultOpts) {
33865 opts.withProp = "iso1A2";
33866 const match = feature(query, opts);
33867 if (!match) return null;
33868 return match.properties.iso1A2 || null;
33870 function propertiesForQuery(query, property) {
33871 const features = featuresContaining(query, false);
33872 return features.map((feature22) => feature22.properties[property]).filter(Boolean);
33874 function iso1A2Codes(query) {
33875 return propertiesForQuery(query, "iso1A2");
33877 function featuresContaining(query, strict) {
33878 let matchingFeatures;
33879 if (Array.isArray(query) && query.length === 4) {
33880 matchingFeatures = smallestFeaturesForBbox(query);
33882 const smallestOrMatching = smallestOrMatchingFeature(query);
33883 matchingFeatures = smallestOrMatching ? [smallestOrMatching] : [];
33885 if (!matchingFeatures.length) return [];
33886 let returnFeatures;
33887 if (!strict || typeof query === "object") {
33888 returnFeatures = matchingFeatures.slice();
33890 returnFeatures = [];
33892 for (const feature22 of matchingFeatures) {
33893 const properties = feature22.properties;
33894 for (const groupID of properties.groups) {
33895 const groupFeature = _featuresByCode[groupID];
33896 if (returnFeatures.indexOf(groupFeature) === -1) {
33897 returnFeatures.push(groupFeature);
33901 return returnFeatures;
33903 function featuresIn(id2, strict) {
33904 const feature22 = featureForID(id2);
33905 if (!feature22) return [];
33908 features.push(feature22);
33910 const properties = feature22.properties;
33911 for (const memberID of properties.members || []) {
33912 features.push(_featuresByCode[memberID]);
33916 function aggregateFeature(id2) {
33918 const features = featuresIn(id2, false);
33919 if (features.length === 0) return null;
33920 let aggregateCoordinates = [];
33921 for (const feature22 of features) {
33922 if (((_a4 = feature22.geometry) == null ? void 0 : _a4.type) === "MultiPolygon" && feature22.geometry.coordinates) {
33923 aggregateCoordinates = aggregateCoordinates.concat(feature22.geometry.coordinates);
33928 properties: features[0].properties,
33930 type: "MultiPolygon",
33931 coordinates: aggregateCoordinates
33935 function roadSpeedUnit(query) {
33936 const feature22 = smallestOrMatchingFeature(query);
33937 return feature22 && feature22.properties.roadSpeedUnit || null;
33939 function roadHeightUnit(query) {
33940 const feature22 = smallestOrMatchingFeature(query);
33941 return feature22 && feature22.properties.roadHeightUnit || null;
33943 var import_which_polygon2, borders_default, borders, _whichPolygon, _featuresByCode, idFilterRegex, levels, defaultOpts;
33944 var init_country_coder = __esm({
33945 "node_modules/@rapideditor/country-coder/dist/country-coder.mjs"() {
33946 import_which_polygon2 = __toESM(require_which_polygon(), 1);
33947 borders_default = { type: "FeatureCollection", features: [
33948 { type: "Feature", properties: { wikidata: "Q21", nameEn: "England", aliases: ["GB-ENG"], country: "GB", groups: ["Q23666", "Q3336843", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-6.03913, 51.13217], [-7.74976, 48.64773], [1.17405, 50.74239], [2.18458, 51.52087], [2.56575, 51.85301], [0.792, 57.56437], [-2.30613, 55.62698], [-2.17058, 55.45916], [-2.6095, 55.28488], [-2.63532, 55.19452], [-3.02906, 55.04606], [-3.09361, 54.94924], [-3.38407, 54.94278], [-4.1819, 54.57861], [-3.5082, 53.54318], [-3.08228, 53.25526], [-3.03675, 53.25092], [-2.92329, 53.19383], [-2.92022, 53.17685], [-2.98598, 53.15589], [-2.90649, 53.10964], [-2.87469, 53.12337], [-2.89131, 53.09374], [-2.83133, 52.99184], [-2.7251, 52.98389], [-2.72221, 52.92969], [-2.80549, 52.89428], [-2.85897, 52.94487], [-2.92401, 52.93836], [-2.97243, 52.9651], [-3.13576, 52.895], [-3.15744, 52.84947], [-3.16105, 52.79599], [-3.08734, 52.77504], [-3.01001, 52.76636], [-2.95581, 52.71794], [-3.01724, 52.72083], [-3.04398, 52.65435], [-3.13648, 52.58208], [-3.12926, 52.5286], [-3.09746, 52.53077], [-3.08662, 52.54811], [-3.00929, 52.57774], [-2.99701, 52.551], [-3.03603, 52.49969], [-3.13359, 52.49174], [-3.22971, 52.45344], [-3.22754, 52.42526], [-3.04687, 52.34504], [-2.95364, 52.3501], [-2.99701, 52.323], [-3.00785, 52.2753], [-3.09289, 52.20546], [-3.12638, 52.08114], [-2.97111, 51.90456], [-2.8818, 51.93196], [-2.78742, 51.88833], [-2.74277, 51.84367], [-2.66234, 51.83555], [-2.66336, 51.59504], [-3.20563, 51.31615], [-6.03913, 51.13217]]]] } },
33949 { type: "Feature", properties: { wikidata: "Q22", nameEn: "Scotland", aliases: ["GB-SCT"], country: "GB", groups: ["Q23666", "Q3336843", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44"] }, geometry: { type: "MultiPolygon", coordinates: [[[[0.792, 57.56437], [-0.3751, 61.32236], [-14.78497, 57.60709], [-6.82333, 55.83103], [-4.69044, 54.3629], [-3.38407, 54.94278], [-3.09361, 54.94924], [-3.02906, 55.04606], [-2.63532, 55.19452], [-2.6095, 55.28488], [-2.17058, 55.45916], [-2.30613, 55.62698], [0.792, 57.56437]]]] } },
33950 { type: "Feature", properties: { wikidata: "Q25", nameEn: "Wales", aliases: ["GB-WLS"], country: "GB", groups: ["Q23666", "Q3336843", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-3.5082, 53.54318], [-5.37267, 53.63269], [-6.03913, 51.13217], [-3.20563, 51.31615], [-2.66336, 51.59504], [-2.66234, 51.83555], [-2.74277, 51.84367], [-2.78742, 51.88833], [-2.8818, 51.93196], [-2.97111, 51.90456], [-3.12638, 52.08114], [-3.09289, 52.20546], [-3.00785, 52.2753], [-2.99701, 52.323], [-2.95364, 52.3501], [-3.04687, 52.34504], [-3.22754, 52.42526], [-3.22971, 52.45344], [-3.13359, 52.49174], [-3.03603, 52.49969], [-2.99701, 52.551], [-3.00929, 52.57774], [-3.08662, 52.54811], [-3.09746, 52.53077], [-3.12926, 52.5286], [-3.13648, 52.58208], [-3.04398, 52.65435], [-3.01724, 52.72083], [-2.95581, 52.71794], [-3.01001, 52.76636], [-3.08734, 52.77504], [-3.16105, 52.79599], [-3.15744, 52.84947], [-3.13576, 52.895], [-2.97243, 52.9651], [-2.92401, 52.93836], [-2.85897, 52.94487], [-2.80549, 52.89428], [-2.72221, 52.92969], [-2.7251, 52.98389], [-2.83133, 52.99184], [-2.89131, 53.09374], [-2.87469, 53.12337], [-2.90649, 53.10964], [-2.98598, 53.15589], [-2.92022, 53.17685], [-2.92329, 53.19383], [-3.03675, 53.25092], [-3.08228, 53.25526], [-3.5082, 53.54318]]]] } },
33951 { type: "Feature", properties: { wikidata: "Q26", nameEn: "Northern Ireland", aliases: ["GB-NIR"], country: "GB", groups: ["Q22890", "Q3336843", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-6.34755, 55.49206], [-7.2471, 55.06933], [-7.34464, 55.04688], [-7.4033, 55.00391], [-7.40004, 54.94498], [-7.44404, 54.9403], [-7.4473, 54.87003], [-7.47626, 54.83084], [-7.54508, 54.79401], [-7.54671, 54.74606], [-7.64449, 54.75265], [-7.75041, 54.7103], [-7.83352, 54.73854], [-7.93293, 54.66603], [-7.70315, 54.62077], [-7.8596, 54.53671], [-7.99812, 54.54427], [-8.04538, 54.48941], [-8.179, 54.46763], [-8.04555, 54.36292], [-7.87101, 54.29299], [-7.8596, 54.21779], [-7.81397, 54.20159], [-7.69501, 54.20731], [-7.55812, 54.12239], [-7.4799, 54.12239], [-7.44567, 54.1539], [-7.32834, 54.11475], [-7.30553, 54.11869], [-7.34005, 54.14698], [-7.29157, 54.17191], [-7.28017, 54.16714], [-7.29687, 54.1354], [-7.29493, 54.12013], [-7.26316, 54.13863], [-7.25012, 54.20063], [-7.14908, 54.22732], [-7.19145, 54.31296], [-7.02034, 54.4212], [-6.87775, 54.34682], [-6.85179, 54.29176], [-6.81583, 54.22791], [-6.74575, 54.18788], [-6.70175, 54.20218], [-6.6382, 54.17071], [-6.66264, 54.0666], [-6.62842, 54.03503], [-6.47849, 54.06947], [-6.36605, 54.07234], [-6.36279, 54.11248], [-6.32694, 54.09337], [-6.29003, 54.11278], [-6.26218, 54.09785], [-5.83481, 53.87749], [-4.69044, 54.3629], [-6.34755, 55.49206]]]] } },
33952 { type: "Feature", properties: { wikidata: "Q35", nameEn: "Denmark", country: "DK", groups: ["EU", "154", "150", "UN"], callingCodes: ["45"] }, geometry: { type: "MultiPolygon", coordinates: [[[[12.16597, 56.60205], [10.40861, 58.38489], [7.28637, 57.35913], [8.02459, 55.09613], [8.45719, 55.06747], [8.55769, 54.91837], [8.63979, 54.91069], [8.76387, 54.8948], [8.81178, 54.90518], [8.92795, 54.90452], [9.04629, 54.87249], [9.14275, 54.87421], [9.20571, 54.85841], [9.24631, 54.84726], [9.23445, 54.83432], [9.2474, 54.8112], [9.32771, 54.80602], [9.33849, 54.80233], [9.36496, 54.81749], [9.38532, 54.83968], [9.41213, 54.84254], [9.43155, 54.82586], [9.4659, 54.83131], [9.58937, 54.88785], [9.62734, 54.88057], [9.61187, 54.85548], [9.73563, 54.8247], [9.89314, 54.84171], [10.16755, 54.73883], [10.31111, 54.65968], [11.00303, 54.63689], [11.90309, 54.38543], [12.85844, 54.82438], [13.93395, 54.84044], [15.36991, 54.73263], [15.79951, 55.54655], [14.89259, 55.5623], [14.28399, 55.1553], [12.84405, 55.13257], [12.60345, 55.42675], [12.88472, 55.63369], [12.6372, 55.91371], [12.65312, 56.04345], [12.07466, 56.29488], [12.16597, 56.60205]]]] } },
33953 { type: "Feature", properties: { wikidata: "Q55", nameEn: "Netherlands", country: "NL", groups: ["EU", "155", "150", "UN"], callingCodes: ["31"] }, geometry: { type: "MultiPolygon", coordinates: [[[[5.45168, 54.20039], [2.56575, 51.85301], [3.36263, 51.37112], [3.38696, 51.33436], [3.35847, 51.31572], [3.38289, 51.27331], [3.41704, 51.25933], [3.43488, 51.24135], [3.52698, 51.2458], [3.51502, 51.28697], [3.58939, 51.30064], [3.78999, 51.25766], [3.78783, 51.2151], [3.90125, 51.20371], [3.97889, 51.22537], [4.01957, 51.24504], [4.05165, 51.24171], [4.16721, 51.29348], [4.24024, 51.35371], [4.21923, 51.37443], [4.33265, 51.37687], [4.34086, 51.35738], [4.39292, 51.35547], [4.43777, 51.36989], [4.38064, 51.41965], [4.39747, 51.43316], [4.38122, 51.44905], [4.47736, 51.4778], [4.5388, 51.48184], [4.54675, 51.47265], [4.52846, 51.45002], [4.53521, 51.4243], [4.57489, 51.4324], [4.65442, 51.42352], [4.72935, 51.48424], [4.74578, 51.48937], [4.77321, 51.50529], [4.78803, 51.50284], [4.84139, 51.4799], [4.82409, 51.44736], [4.82946, 51.4213], [4.78314, 51.43319], [4.76577, 51.43046], [4.77229, 51.41337], [4.78941, 51.41102], [4.84988, 51.41502], [4.90016, 51.41404], [4.92152, 51.39487], [5.00393, 51.44406], [5.0106, 51.47167], [5.03281, 51.48679], [5.04774, 51.47022], [5.07891, 51.4715], [5.10456, 51.43163], [5.07102, 51.39469], [5.13105, 51.34791], [5.13377, 51.31592], [5.16222, 51.31035], [5.2002, 51.32243], [5.24244, 51.30495], [5.22542, 51.26888], [5.23814, 51.26064], [5.26461, 51.26693], [5.29716, 51.26104], [5.33886, 51.26314], [5.347, 51.27502], [5.41672, 51.26248], [5.4407, 51.28169], [5.46519, 51.2849], [5.48476, 51.30053], [5.515, 51.29462], [5.5569, 51.26544], [5.5603, 51.22249], [5.65145, 51.19788], [5.65528, 51.18736], [5.70344, 51.1829], [5.74617, 51.18928], [5.77735, 51.17845], [5.77697, 51.1522], [5.82564, 51.16753], [5.85508, 51.14445], [5.80798, 51.11661], [5.8109, 51.10861], [5.83226, 51.10585], [5.82921, 51.09328], [5.79903, 51.09371], [5.79835, 51.05834], [5.77258, 51.06196], [5.75961, 51.03113], [5.77688, 51.02483], [5.76242, 50.99703], [5.71864, 50.96092], [5.72875, 50.95428], [5.74752, 50.96202], [5.75927, 50.95601], [5.74644, 50.94723], [5.72545, 50.92312], [5.72644, 50.91167], [5.71626, 50.90796], [5.69858, 50.91046], [5.67886, 50.88142], [5.64504, 50.87107], [5.64009, 50.84742], [5.65259, 50.82309], [5.70118, 50.80764], [5.68995, 50.79641], [5.70107, 50.7827], [5.68091, 50.75804], [5.69469, 50.75529], [5.72216, 50.76398], [5.73904, 50.75674], [5.74356, 50.7691], [5.76533, 50.78159], [5.77513, 50.78308], [5.80673, 50.7558], [5.84548, 50.76542], [5.84888, 50.75448], [5.88734, 50.77092], [5.89129, 50.75125], [5.89132, 50.75124], [5.95942, 50.7622], [5.97545, 50.75441], [6.01976, 50.75398], [6.02624, 50.77453], [5.97497, 50.79992], [5.98404, 50.80988], [6.00462, 50.80065], [6.02328, 50.81694], [6.01921, 50.84435], [6.05623, 50.8572], [6.05702, 50.85179], [6.07431, 50.84674], [6.07693, 50.86025], [6.08805, 50.87223], [6.07486, 50.89307], [6.09297, 50.92066], [6.01615, 50.93367], [6.02697, 50.98303], [5.95282, 50.98728], [5.90296, 50.97356], [5.90493, 51.00198], [5.87849, 51.01969], [5.86735, 51.05182], [5.9134, 51.06736], [5.9541, 51.03496], [5.98292, 51.07469], [6.16706, 51.15677], [6.17384, 51.19589], [6.07889, 51.17038], [6.07889, 51.24432], [6.16977, 51.33169], [6.22674, 51.36135], [6.22641, 51.39948], [6.20654, 51.40049], [6.21724, 51.48568], [6.18017, 51.54096], [6.09055, 51.60564], [6.11759, 51.65609], [6.02767, 51.6742], [6.04091, 51.71821], [5.95003, 51.7493], [5.98665, 51.76944], [5.94568, 51.82786], [5.99848, 51.83195], [6.06705, 51.86136], [6.10337, 51.84829], [6.16902, 51.84094], [6.11551, 51.89769], [6.15349, 51.90439], [6.21443, 51.86801], [6.29872, 51.86801], [6.30593, 51.84998], [6.40704, 51.82771], [6.38815, 51.87257], [6.47179, 51.85395], [6.50231, 51.86313], [6.58556, 51.89386], [6.68386, 51.91861], [6.72319, 51.89518], [6.82357, 51.96711], [6.83035, 51.9905], [6.68128, 52.05052], [6.76117, 52.11895], [6.83984, 52.11728], [6.97189, 52.20329], [6.9897, 52.2271], [7.03729, 52.22695], [7.06365, 52.23789], [7.02703, 52.27941], [7.07044, 52.37805], [7.03417, 52.40237], [6.99041, 52.47235], [6.94293, 52.43597], [6.69507, 52.488], [6.71641, 52.62905], [6.77307, 52.65375], [7.04557, 52.63318], [7.07253, 52.81083], [7.21694, 53.00742], [7.17898, 53.13817], [7.22681, 53.18165], [7.21679, 53.20058], [7.19052, 53.31866], [7.00198, 53.32672], [6.91025, 53.44221], [5.45168, 54.20039]], [[4.93295, 51.44945], [4.95244, 51.45207], [4.9524, 51.45014], [4.93909, 51.44632], [4.93295, 51.44945]], [[4.91493, 51.4353], [4.91935, 51.43634], [4.92227, 51.44252], [4.91811, 51.44621], [4.92287, 51.44741], [4.92811, 51.4437], [4.92566, 51.44273], [4.92815, 51.43856], [4.92879, 51.44161], [4.93544, 51.44634], [4.94025, 51.44193], [4.93416, 51.44185], [4.93471, 51.43861], [4.94265, 51.44003], [4.93986, 51.43064], [4.92952, 51.42984], [4.92652, 51.43329], [4.91493, 51.4353]]]] } },
33954 { type: "Feature", properties: { wikidata: "Q782", nameEn: "Hawaii", aliases: ["US-HI"], country: "US", groups: ["Q35657", "061", "009", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-177.8563, 29.18961], [-179.49839, 27.86265], [-151.6784, 9.55515], [-154.05867, 45.51124], [-177.5224, 27.7635], [-177.8563, 29.18961]]]] } },
33955 { type: "Feature", properties: { wikidata: "Q797", nameEn: "Alaska", aliases: ["US-AK"], country: "US", groups: ["Q35657", "021", "003", "019", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[169.34848, 52.47228], [180, 51.0171], [179.84401, 55.10087], [169.34848, 52.47228]]], [[[-168.95635, 65.98512], [-169.03888, 65.48473], [-172.76104, 63.77445], [-179.55295, 57.62081], [-179.55295, 50.81807], [-133.92876, 54.62289], [-130.61931, 54.70835], [-130.64499, 54.76912], [-130.44184, 54.85377], [-130.27203, 54.97174], [-130.18765, 55.07744], [-130.08035, 55.21556], [-129.97513, 55.28029], [-130.15373, 55.74895], [-130.00857, 55.91344], [-130.00093, 56.00325], [-130.10173, 56.12178], [-130.33965, 56.10849], [-130.77769, 56.36185], [-131.8271, 56.62247], [-133.38523, 58.42773], [-133.84645, 58.73543], [-134.27175, 58.8634], [-134.48059, 59.13231], [-134.55699, 59.1297], [-134.7047, 59.2458], [-135.00267, 59.28745], [-135.03069, 59.56208], [-135.48007, 59.79937], [-136.31566, 59.59083], [-136.22381, 59.55526], [-136.33727, 59.44466], [-136.47323, 59.46617], [-136.52365, 59.16752], [-136.82619, 59.16198], [-137.4925, 58.89415], [-137.60623, 59.24465], [-138.62145, 59.76431], [-138.71149, 59.90728], [-139.05365, 59.99655], [-139.20603, 60.08896], [-139.05831, 60.35205], [-139.68991, 60.33693], [-139.98024, 60.18027], [-140.45648, 60.30919], [-140.5227, 60.22077], [-141.00116, 60.30648], [-140.97446, 84.39275], [-168.25765, 71.99091], [-168.95635, 65.98512]]]] } },
33956 { type: "Feature", properties: { wikidata: "Q3492", nameEn: "Sumatra", aliases: ["ID-SM"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[109.82788, 2.86812], [110.90339, 7.52694], [105.01437, 3.24936], [104.56723, 1.44271], [104.34728, 1.33529], [104.12282, 1.27714], [104.03085, 1.26954], [103.74084, 1.12902], [103.66049, 1.18825], [103.56591, 1.19719], [103.03657, 1.30383], [96.11174, 6.69841], [74.28481, -3.17525], [102.92489, -8.17146], [106.32259, -5.50116], [106.38511, -5.16715], [109.17017, -4.07401], [109.3962, -2.07276], [108.50935, -2.01066], [107.94791, 1.06924], [109.82788, 2.86812]]]] } },
33957 { type: "Feature", properties: { wikidata: "Q3757", nameEn: "Java", aliases: ["ID-JW"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[109.17017, -4.07401], [106.38511, -5.16715], [106.32259, -5.50116], [102.92489, -8.17146], [116.22542, -10.49172], [114.39575, -8.2889], [114.42235, -8.09762], [114.92859, -7.49253], [116.33992, -7.56171], [116.58433, -5.30385], [109.17017, -4.07401]]]] } },
33958 { type: "Feature", properties: { wikidata: "Q3795", nameEn: "Kalimantan", aliases: ["ID-KA"], country: "ID", groups: ["Q36117", "035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[120.02464, 2.83703], [118.06469, 4.16638], [117.67641, 4.16535], [117.47313, 4.18857], [117.25801, 4.35108], [115.90217, 4.37708], [115.58276, 3.93499], [115.53713, 3.14776], [115.11343, 2.82879], [115.1721, 2.49671], [114.80706, 2.21665], [114.80706, 1.92351], [114.57892, 1.5], [114.03788, 1.44787], [113.64677, 1.23933], [113.01448, 1.42832], [113.021, 1.57819], [112.48648, 1.56516], [112.2127, 1.44135], [112.15679, 1.17004], [111.94553, 1.12016], [111.82846, 0.99349], [111.55434, 0.97864], [111.22979, 1.08326], [110.62374, 0.873], [110.49182, 0.88088], [110.35354, 0.98869], [109.66397, 1.60425], [109.66397, 1.79972], [109.57923, 1.80624], [109.53794, 1.91771], [109.62558, 1.99182], [109.82788, 2.86812], [107.94791, 1.06924], [108.50935, -2.01066], [109.3962, -2.07276], [109.17017, -4.07401], [116.58433, -5.30385], [120.02464, 2.83703]]]] } },
33959 { type: "Feature", properties: { wikidata: "Q3803", nameEn: "Lesser Sunda Islands", aliases: ["ID-NU"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[116.96967, -8.01483], [114.92859, -7.49253], [114.42235, -8.09762], [114.39575, -8.2889], [116.22542, -10.49172], [122.14954, -11.52517], [125.68138, -9.85176], [125.09025, -9.46406], [124.97892, -9.19281], [125.04044, -9.17093], [125.09434, -9.19669], [125.18907, -9.16434], [125.18632, -9.03142], [125.11764, -8.96359], [124.97742, -9.08128], [124.94011, -8.85617], [124.46701, -9.13002], [124.45971, -9.30263], [124.38554, -9.3582], [124.35258, -9.43002], [124.3535, -9.48493], [124.28115, -9.50453], [124.28115, -9.42189], [124.21247, -9.36904], [124.14517, -9.42324], [124.10539, -9.41206], [124.04286, -9.34243], [124.04628, -9.22671], [124.33472, -9.11416], [124.92337, -8.75859], [125.87688, -7.49892], [116.96967, -8.01483]]]] } },
33960 { type: "Feature", properties: { wikidata: "Q3812", nameEn: "Sulawesi", aliases: ["ID-SL"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[128.34321, 3.90322], [126.69413, 6.02692], [119.56457, 0.90759], [116.58433, -5.30385], [116.33992, -7.56171], [116.96967, -8.01483], [125.87688, -7.49892], [123.78965, -0.86805], [128.34321, 3.90322]]]] } },
33961 { type: "Feature", properties: { wikidata: "Q3827", nameEn: "Maluku Islands", aliases: ["ID-ML"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[129.63187, 2.21409], [128.34321, 3.90322], [123.78965, -0.86805], [125.87688, -7.49892], [125.58506, -7.95311], [125.87691, -8.31789], [127.42116, -8.22471], [127.55165, -9.05052], [135.49042, -9.2276], [135.35517, -5.01442], [132.8312, -4.70282], [130.8468, -2.61103], [128.40647, -2.30349], [129.71519, -0.24692], [129.63187, 2.21409]]]] } },
33962 { type: "Feature", properties: { wikidata: "Q3845", nameEn: "Western New Guinea", aliases: ["ID-PP"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[135.49042, -9.2276], [141.01842, -9.35091], [141.01763, -6.90181], [140.90448, -6.85033], [140.85295, -6.72996], [140.99813, -6.3233], [141.02352, 0.08993], [129.63187, 2.21409], [129.71519, -0.24692], [128.40647, -2.30349], [130.8468, -2.61103], [132.8312, -4.70282], [135.35517, -5.01442], [135.49042, -9.2276]]]] } },
33963 { type: "Feature", properties: { wikidata: "Q5765", nameEn: "Balearic Islands", aliases: ["ES-IB"], country: "ES", groups: ["EU", "039", "150", "UN"], callingCodes: ["34 971"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.27707, 35.35051], [5.10072, 39.89531], [3.75438, 42.33445], [-2.27707, 35.35051]]]] } },
33964 { type: "Feature", properties: { wikidata: "Q5823", nameEn: "Ceuta", aliases: ["ES-CE"], country: "ES", groups: ["EA", "EU", "015", "002", "UN"], level: "subterritory", callingCodes: ["34"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-5.38491, 35.92591], [-5.37338, 35.88417], [-5.35844, 35.87375], [-5.34379, 35.8711], [-5.21179, 35.90091], [-5.38491, 35.92591]]]] } },
33965 { type: "Feature", properties: { wikidata: "Q5831", nameEn: "Melilla", aliases: ["ES-ML"], country: "ES", groups: ["EA", "EU", "015", "002", "UN"], level: "subterritory", callingCodes: ["34"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.91909, 35.33927], [-2.96038, 35.31609], [-2.96648, 35.30475], [-2.96978, 35.29459], [-2.97035, 35.28852], [-2.96507, 35.28801], [-2.96826, 35.28296], [-2.96516, 35.27967], [-2.95431, 35.2728], [-2.95065, 35.26576], [-2.93893, 35.26737], [-2.92272, 35.27509], [-2.91909, 35.33927]]]] } },
33966 { type: "Feature", properties: { wikidata: "Q7835", nameEn: "Crimea", country: "RU", groups: ["151", "150", "UN"], level: "subterritory", callingCodes: ["7"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.5, 44], [33.59378, 44.0332], [36.4883, 45.0488], [36.475, 45.2411], [36.5049, 45.3136], [36.6545, 45.3417], [36.6645, 45.4514], [35.04991, 45.76827], [34.9601, 45.7563], [34.79905, 45.81009], [34.8015, 45.9005], [34.75479, 45.90705], [34.66679, 45.97136], [34.60861, 45.99347], [34.55889, 45.99347], [34.52011, 45.95097], [34.48729, 45.94267], [34.4415, 45.9599], [34.41221, 46.00245], [34.3391, 46.0611], [34.2511, 46.0532], [34.181, 46.068], [34.1293, 46.1049], [34.07311, 46.11769], [34.05272, 46.10838], [33.91549, 46.15938], [33.8523, 46.1986], [33.7972, 46.2048], [33.7405, 46.1855], [33.646, 46.23028], [33.6152, 46.2261], [33.63854, 46.14147], [33.6147, 46.1356], [33.57318, 46.10317], [33.5909, 46.0601], [33.54017, 46.0123], [31.52705, 45.47997], [33.5, 44]]]] } },
33967 { type: "Feature", properties: { wikidata: "Q12837", nameEn: "Iberia", level: "sharedLandform" }, geometry: null },
33968 { type: "Feature", properties: { wikidata: "Q14056", nameEn: "Jan Mayen", aliases: ["NO-22"], country: "NO", groups: ["SJ", "154", "150", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[-9.18243, 72.23144], [-10.71459, 70.09565], [-5.93364, 70.76368], [-9.18243, 72.23144]]]] } },
33969 { type: "Feature", properties: { wikidata: "Q19188", nameEn: "Mainland China", country: "CN", groups: ["030", "142", "UN"], callingCodes: ["86"] }, geometry: { type: "MultiPolygon", coordinates: [[[[125.6131, 53.07229], [125.17522, 53.20225], [124.46078, 53.21881], [123.86158, 53.49391], [123.26989, 53.54843], [122.85966, 53.47395], [122.35063, 53.49565], [121.39213, 53.31888], [120.85633, 53.28499], [120.0451, 52.7359], [120.04049, 52.58773], [120.46454, 52.63811], [120.71673, 52.54099], [120.61346, 52.32447], [120.77337, 52.20805], [120.65907, 51.93544], [120.10963, 51.671], [119.13553, 50.37412], [119.38598, 50.35162], [119.27996, 50.13348], [119.11003, 50.00276], [118.61623, 49.93809], [117.82343, 49.52696], [117.48208, 49.62324], [117.27597, 49.62544], [116.71193, 49.83813], [116.03781, 48.87014], [116.06565, 48.81716], [115.78876, 48.51781], [115.811, 48.25699], [115.52082, 48.15367], [115.57128, 47.91988], [115.94296, 47.67741], [116.21879, 47.88505], [116.4465, 47.83662], [116.67405, 47.89039], [116.9723, 47.87285], [117.37875, 47.63627], [117.50181, 47.77216], [117.80196, 48.01661], [118.03676, 48.00982], [118.11009, 48.04], [118.22677, 48.03853], [118.29654, 48.00246], [118.55766, 47.99277], [118.7564, 47.76947], [119.12343, 47.66458], [119.13995, 47.53997], [119.35892, 47.48104], [119.31964, 47.42617], [119.54918, 47.29505], [119.56019, 47.24874], [119.62403, 47.24575], [119.71209, 47.19192], [119.85518, 46.92196], [119.91242, 46.90091], [119.89261, 46.66423], [119.80455, 46.67631], [119.77373, 46.62947], [119.68127, 46.59015], [119.65265, 46.62342], [119.42827, 46.63783], [119.32827, 46.61433], [119.24978, 46.64761], [119.10448, 46.65516], [119.00541, 46.74273], [118.92616, 46.72765], [118.89974, 46.77139], [118.8337, 46.77742], [118.78747, 46.68689], [118.30534, 46.73519], [117.69554, 46.50991], [117.60748, 46.59771], [117.41782, 46.57862], [117.36609, 46.36335], [116.83166, 46.38637], [116.75551, 46.33083], [116.58612, 46.30211], [116.26678, 45.96479], [116.24012, 45.8778], [116.27366, 45.78637], [116.16989, 45.68603], [115.60329, 45.44717], [114.94546, 45.37377], [114.74612, 45.43585], [114.54801, 45.38337], [114.5166, 45.27189], [113.70918, 44.72891], [112.74662, 44.86297], [112.4164, 45.06858], [111.98695, 45.09074], [111.76275, 44.98032], [111.40498, 44.3461], [111.96289, 43.81596], [111.93776, 43.68709], [111.79758, 43.6637], [111.59087, 43.51207], [111.0149, 43.3289], [110.4327, 42.78293], [110.08401, 42.6411], [109.89402, 42.63111], [109.452, 42.44842], [109.00679, 42.45302], [108.84489, 42.40246], [107.57258, 42.40898], [107.49681, 42.46221], [107.29755, 42.41395], [107.24774, 42.36107], [106.76517, 42.28741], [105.0123, 41.63188], [104.51667, 41.66113], [104.52258, 41.8706], [103.92804, 41.78246], [102.72403, 42.14675], [102.07645, 42.22519], [101.80515, 42.50074], [100.84979, 42.67087], [100.33297, 42.68231], [99.50671, 42.56535], [97.1777, 42.7964], [96.37926, 42.72055], [96.35658, 42.90363], [95.89543, 43.2528], [95.52594, 43.99353], [95.32891, 44.02407], [95.39772, 44.2805], [95.01191, 44.25274], [94.71959, 44.35284], [94.10003, 44.71016], [93.51161, 44.95964], [91.64048, 45.07408], [90.89169, 45.19667], [90.65114, 45.49314], [90.70907, 45.73437], [91.03026, 46.04194], [90.99672, 46.14207], [90.89639, 46.30711], [91.07696, 46.57315], [91.0147, 46.58171], [91.03649, 46.72916], [90.84035, 46.99525], [90.76108, 46.99399], [90.48542, 47.30438], [90.48854, 47.41826], [90.33598, 47.68303], [90.10871, 47.7375], [90.06512, 47.88177], [89.76624, 47.82745], [89.55453, 48.0423], [89.0711, 47.98528], [88.93186, 48.10263], [88.8011, 48.11302], [88.58316, 48.21893], [88.58939, 48.34531], [87.96361, 48.58478], [88.0788, 48.71436], [87.73822, 48.89582], [87.88171, 48.95853], [87.81333, 49.17354], [87.48983, 49.13794], [87.478, 49.07403], [87.28386, 49.11626], [86.87238, 49.12432], [86.73568, 48.99918], [86.75343, 48.70331], [86.38069, 48.46064], [85.73581, 48.3939], [85.5169, 48.05493], [85.61067, 47.49753], [85.69696, 47.2898], [85.54294, 47.06171], [85.22443, 47.04816], [84.93995, 46.87399], [84.73077, 47.01394], [83.92184, 46.98912], [83.04622, 47.19053], [82.21792, 45.56619], [82.58474, 45.40027], [82.51374, 45.1755], [81.73278, 45.3504], [80.11169, 45.03352], [79.8987, 44.89957], [80.38384, 44.63073], [80.40229, 44.23319], [80.40031, 44.10986], [80.75156, 43.44948], [80.69718, 43.32589], [80.77771, 43.30065], [80.78817, 43.14235], [80.62913, 43.141], [80.3735, 43.01557], [80.58999, 42.9011], [80.38169, 42.83142], [80.26886, 42.8366], [80.16892, 42.61137], [80.26841, 42.23797], [80.17807, 42.21166], [80.17842, 42.03211], [79.92977, 42.04113], [78.3732, 41.39603], [78.15757, 41.38565], [78.12873, 41.23091], [77.81287, 41.14307], [77.76206, 41.01574], [77.52723, 41.00227], [77.3693, 41.0375], [77.28004, 41.0033], [76.99302, 41.0696], [76.75681, 40.95354], [76.5261, 40.46114], [76.33659, 40.3482], [75.96168, 40.38064], [75.91361, 40.2948], [75.69663, 40.28642], [75.5854, 40.66874], [75.22834, 40.45382], [75.08243, 40.43945], [74.82013, 40.52197], [74.78168, 40.44886], [74.85996, 40.32857], [74.69875, 40.34668], [74.35063, 40.09742], [74.25533, 40.13191], [73.97049, 40.04378], [73.83006, 39.76136], [73.9051, 39.75073], [73.92354, 39.69565], [73.94683, 39.60733], [73.87018, 39.47879], [73.59831, 39.46425], [73.59241, 39.40843], [73.5004, 39.38402], [73.55396, 39.3543], [73.54572, 39.27567], [73.60638, 39.24534], [73.75823, 39.023], [73.81728, 39.04007], [73.82964, 38.91517], [73.7445, 38.93867], [73.7033, 38.84782], [73.80656, 38.66449], [73.79806, 38.61106], [73.97933, 38.52945], [74.17022, 38.65504], [74.51217, 38.47034], [74.69619, 38.42947], [74.69894, 38.22155], [74.80331, 38.19889], [74.82665, 38.07359], [74.9063, 38.03033], [74.92416, 37.83428], [75.00935, 37.77486], [74.8912, 37.67576], [74.94338, 37.55501], [75.06011, 37.52779], [75.15899, 37.41443], [75.09719, 37.37297], [75.12328, 37.31839], [74.88887, 37.23275], [74.80605, 37.21565], [74.49981, 37.24518], [74.56453, 37.03023], [75.13839, 37.02622], [75.40481, 36.95382], [75.45562, 36.71971], [75.72737, 36.7529], [75.92391, 36.56986], [76.0324, 36.41198], [76.00906, 36.17511], [75.93028, 36.13136], [76.15325, 35.9264], [76.14913, 35.82848], [76.33453, 35.84296], [76.50961, 35.8908], [76.77323, 35.66062], [76.84539, 35.67356], [76.96624, 35.5932], [77.44277, 35.46132], [77.70232, 35.46244], [77.80532, 35.52058], [78.11664, 35.48022], [78.03466, 35.3785], [78.00033, 35.23954], [78.22692, 34.88771], [78.18435, 34.7998], [78.27781, 34.61484], [78.54964, 34.57283], [78.56475, 34.50835], [78.74465, 34.45174], [79.05364, 34.32482], [78.99802, 34.3027], [78.91769, 34.15452], [78.66225, 34.08858], [78.65657, 34.03195], [78.73367, 34.01121], [78.77349, 33.73871], [78.67599, 33.66445], [78.73636, 33.56521], [79.15252, 33.17156], [79.14016, 33.02545], [79.46562, 32.69668], [79.26768, 32.53277], [79.13174, 32.47766], [79.0979, 32.38051], [78.99322, 32.37948], [78.96713, 32.33655], [78.7831, 32.46873], [78.73916, 32.69438], [78.38897, 32.53938], [78.4645, 32.45367], [78.49609, 32.2762], [78.68754, 32.10256], [78.74404, 32.00384], [78.78036, 31.99478], [78.69933, 31.78723], [78.84516, 31.60631], [78.71032, 31.50197], [78.77898, 31.31209], [78.89344, 31.30481], [79.01931, 31.42817], [79.14016, 31.43403], [79.30694, 31.17357], [79.59884, 30.93943], [79.93255, 30.88288], [80.20721, 30.58541], [80.54504, 30.44936], [80.83343, 30.32023], [81.03953, 30.20059], [81.12842, 30.01395], [81.24362, 30.0126], [81.29032, 30.08806], [81.2623, 30.14596], [81.33355, 30.15303], [81.39928, 30.21862], [81.41018, 30.42153], [81.5459, 30.37688], [81.62033, 30.44703], [81.99082, 30.33423], [82.10135, 30.35439], [82.10757, 30.23745], [82.19475, 30.16884], [82.16984, 30.0692], [82.38622, 30.02608], [82.5341, 29.9735], [82.73024, 29.81695], [83.07116, 29.61957], [83.28131, 29.56813], [83.44787, 29.30513], [83.63156, 29.16249], [83.82303, 29.30513], [83.97559, 29.33091], [84.18107, 29.23451], [84.24801, 29.02783], [84.2231, 28.89571], [84.47528, 28.74023], [84.62317, 28.73887], [84.85511, 28.58041], [85.06059, 28.68562], [85.19135, 28.62825], [85.18668, 28.54076], [85.10729, 28.34092], [85.38127, 28.28336], [85.4233, 28.32996], [85.59765, 28.30529], [85.60854, 28.25045], [85.69105, 28.38475], [85.71907, 28.38064], [85.74864, 28.23126], [85.84672, 28.18187], [85.90743, 28.05144], [85.97813, 27.99023], [85.94946, 27.9401], [86.06309, 27.90021], [86.12069, 27.93047], [86.08333, 28.02121], [86.088, 28.09264], [86.18607, 28.17364], [86.22966, 27.9786], [86.42736, 27.91122], [86.51609, 27.96623], [86.56265, 28.09569], [86.74181, 28.10638], [86.75582, 28.04182], [87.03757, 27.94835], [87.11696, 27.84104], [87.56996, 27.84517], [87.72718, 27.80938], [87.82681, 27.95248], [88.13378, 27.88015], [88.1278, 27.95417], [88.25332, 27.9478], [88.54858, 28.06057], [88.63235, 28.12356], [88.83559, 28.01936], [88.88091, 27.85192], [88.77517, 27.45415], [88.82981, 27.38814], [88.91901, 27.32483], [88.93678, 27.33777], [88.96947, 27.30319], [89.00216, 27.32532], [88.95355, 27.4106], [88.97213, 27.51671], [89.0582, 27.60985], [89.12825, 27.62502], [89.59525, 28.16433], [89.79762, 28.23979], [90.13387, 28.19178], [90.58842, 28.02838], [90.69894, 28.07784], [91.20019, 27.98715], [91.25779, 28.07509], [91.46327, 28.0064], [91.48973, 27.93903], [91.5629, 27.84823], [91.6469, 27.76358], [91.84722, 27.76325], [91.87057, 27.7195], [92.27432, 27.89077], [92.32101, 27.79363], [92.42538, 27.80092], [92.7275, 27.98662], [92.73025, 28.05814], [92.65472, 28.07632], [92.67486, 28.15018], [92.93075, 28.25671], [93.14635, 28.37035], [93.18069, 28.50319], [93.44621, 28.67189], [93.72797, 28.68821], [94.35897, 29.01965], [94.2752, 29.11687], [94.69318, 29.31739], [94.81353, 29.17804], [95.0978, 29.14446], [95.11291, 29.09527], [95.2214, 29.10727], [95.26122, 29.07727], [95.3038, 29.13847], [95.41091, 29.13007], [95.50842, 29.13487], [95.72086, 29.20797], [95.75149, 29.32063], [95.84899, 29.31464], [96.05361, 29.38167], [96.31316, 29.18643], [96.18682, 29.11087], [96.20467, 29.02325], [96.3626, 29.10607], [96.61391, 28.72742], [96.40929, 28.51526], [96.48895, 28.42955], [96.6455, 28.61657], [96.85561, 28.4875], [96.88445, 28.39452], [96.98882, 28.32564], [97.1289, 28.3619], [97.34547, 28.21385], [97.41729, 28.29783], [97.47085, 28.2688], [97.50518, 28.49716], [97.56835, 28.55628], [97.70705, 28.5056], [97.79632, 28.33168], [97.90069, 28.3776], [98.15337, 28.12114], [98.13964, 27.9478], [98.32641, 27.51385], [98.42529, 27.55404], [98.43353, 27.67086], [98.69582, 27.56499], [98.7333, 26.85615], [98.77547, 26.61994], [98.72741, 26.36183], [98.67797, 26.24487], [98.7329, 26.17218], [98.66884, 26.09165], [98.63128, 26.15492], [98.57085, 26.11547], [98.60763, 26.01512], [98.70818, 25.86241], [98.63128, 25.79937], [98.54064, 25.85129], [98.40606, 25.61129], [98.31268, 25.55307], [98.25774, 25.6051], [98.16848, 25.62739], [98.18084, 25.56298], [98.12591, 25.50722], [98.14925, 25.41547], [97.92541, 25.20815], [97.83614, 25.2715], [97.77023, 25.11492], [97.72216, 25.08508], [97.72903, 24.91332], [97.79949, 24.85655], [97.76481, 24.8289], [97.73127, 24.83015], [97.70181, 24.84557], [97.64354, 24.79171], [97.56648, 24.76475], [97.56383, 24.75535], [97.5542, 24.74943], [97.54675, 24.74202], [97.56525, 24.72838], [97.56286, 24.54535], [97.52757, 24.43748], [97.60029, 24.4401], [97.66998, 24.45288], [97.7098, 24.35658], [97.65624, 24.33781], [97.66723, 24.30027], [97.71941, 24.29652], [97.76799, 24.26365], [97.72998, 24.2302], [97.72799, 24.18883], [97.75305, 24.16902], [97.72903, 24.12606], [97.62363, 24.00506], [97.5247, 23.94032], [97.64667, 23.84574], [97.72302, 23.89288], [97.79456, 23.94836], [97.79416, 23.95663], [97.84328, 23.97603], [97.86545, 23.97723], [97.88811, 23.97446], [97.8955, 23.97758], [97.89676, 23.97931], [97.89683, 23.98389], [97.88814, 23.98605], [97.88414, 23.99405], [97.88616, 24.00463], [97.90998, 24.02094], [97.93951, 24.01953], [97.98691, 24.03897], [97.99583, 24.04932], [98.04709, 24.07616], [98.05302, 24.07408], [98.05671, 24.07961], [98.0607, 24.07812], [98.06703, 24.08028], [98.07806, 24.07988], [98.20666, 24.11406], [98.54476, 24.13119], [98.59256, 24.08371], [98.85319, 24.13042], [98.87998, 24.15624], [98.89632, 24.10612], [98.67797, 23.9644], [98.68209, 23.80492], [98.79607, 23.77947], [98.82933, 23.72921], [98.81775, 23.694], [98.88396, 23.59555], [98.80294, 23.5345], [98.82877, 23.47908], [98.87683, 23.48995], [98.92104, 23.36946], [98.87573, 23.33038], [98.93958, 23.31414], [98.92515, 23.29535], [98.88597, 23.18656], [99.05975, 23.16382], [99.04601, 23.12215], [99.25741, 23.09025], [99.34127, 23.13099], [99.52214, 23.08218], [99.54218, 22.90014], [99.43537, 22.94086], [99.45654, 22.85726], [99.31243, 22.73893], [99.38247, 22.57544], [99.37972, 22.50188], [99.28771, 22.4105], [99.17318, 22.18025], [99.19176, 22.16983], [99.1552, 22.15874], [99.33166, 22.09656], [99.47585, 22.13345], [99.85351, 22.04183], [99.96612, 22.05965], [99.99084, 21.97053], [99.94003, 21.82782], [99.98654, 21.71064], [100.04956, 21.66843], [100.12679, 21.70539], [100.17486, 21.65306], [100.10757, 21.59945], [100.12542, 21.50365], [100.1625, 21.48704], [100.18447, 21.51898], [100.25863, 21.47043], [100.35201, 21.53176], [100.42892, 21.54325], [100.4811, 21.46148], [100.57861, 21.45637], [100.72143, 21.51898], [100.87265, 21.67396], [101.11744, 21.77659], [101.15156, 21.56129], [101.2124, 21.56422], [101.19349, 21.41959], [101.26912, 21.36482], [101.2229, 21.23271], [101.29326, 21.17254], [101.54563, 21.25668], [101.6068, 21.23329], [101.59491, 21.18621], [101.60886, 21.17947], [101.66977, 21.20004], [101.70548, 21.14911], [101.7622, 21.14813], [101.79266, 21.19025], [101.76745, 21.21571], [101.83887, 21.20983], [101.84412, 21.25291], [101.74014, 21.30967], [101.74224, 21.48276], [101.7727, 21.51794], [101.7475, 21.5873], [101.80001, 21.57461], [101.83257, 21.61562], [101.74555, 21.72852], [101.7791, 21.83019], [101.62566, 21.96574], [101.57525, 22.13026], [101.60675, 22.13513], [101.53638, 22.24794], [101.56789, 22.28876], [101.61306, 22.27515], [101.68973, 22.46843], [101.7685, 22.50337], [101.86828, 22.38397], [101.90714, 22.38688], [101.91344, 22.44417], [101.98487, 22.42766], [102.03633, 22.46164], [102.1245, 22.43372], [102.14099, 22.40092], [102.16621, 22.43336], [102.26428, 22.41321], [102.25339, 22.4607], [102.41061, 22.64184], [102.38415, 22.67919], [102.42618, 22.69212], [102.46665, 22.77108], [102.51802, 22.77969], [102.57095, 22.7036], [102.60675, 22.73376], [102.8636, 22.60735], [102.9321, 22.48659], [103.0722, 22.44775], [103.07843, 22.50097], [103.17961, 22.55705], [103.15782, 22.59873], [103.18895, 22.64471], [103.28079, 22.68063], [103.32282, 22.8127], [103.43179, 22.75816], [103.43646, 22.70648], [103.52675, 22.59155], [103.57812, 22.65764], [103.56255, 22.69499], [103.64506, 22.79979], [103.87904, 22.56683], [103.93286, 22.52703], [103.94513, 22.52553], [103.95191, 22.5134], [103.96352, 22.50584], [103.96783, 22.51173], [103.97384, 22.50634], [103.99247, 22.51958], [104.01088, 22.51823], [104.03734, 22.72945], [104.11384, 22.80363], [104.27084, 22.8457], [104.25683, 22.76534], [104.35593, 22.69353], [104.47225, 22.75813], [104.58122, 22.85571], [104.60457, 22.81841], [104.65283, 22.83419], [104.72755, 22.81984], [104.77114, 22.90017], [104.84942, 22.93631], [104.86765, 22.95178], [104.8334, 23.01484], [104.79478, 23.12934], [104.87382, 23.12854], [104.87992, 23.17141], [104.91435, 23.18666], [104.9486, 23.17235], [104.96532, 23.20463], [104.98712, 23.19176], [105.07002, 23.26248], [105.11672, 23.25247], [105.17276, 23.28679], [105.22569, 23.27249], [105.32376, 23.39684], [105.40782, 23.28107], [105.42805, 23.30824], [105.49966, 23.20669], [105.56037, 23.16806], [105.57594, 23.075], [105.72382, 23.06641], [105.8726, 22.92756], [105.90119, 22.94168], [105.99568, 22.94178], [106.00179, 22.99049], [106.19705, 22.98475], [106.27022, 22.87722], [106.34961, 22.86718], [106.49749, 22.91164], [106.51306, 22.94891], [106.55976, 22.92311], [106.60179, 22.92884], [106.6516, 22.86862], [106.6734, 22.89587], [106.71387, 22.88296], [106.71128, 22.85982], [106.78422, 22.81532], [106.81271, 22.8226], [106.83685, 22.8098], [106.82404, 22.7881], [106.76293, 22.73491], [106.72321, 22.63606], [106.71698, 22.58432], [106.65316, 22.5757], [106.61269, 22.60301], [106.58395, 22.474], [106.55665, 22.46498], [106.57221, 22.37], [106.55976, 22.34841], [106.6516, 22.33977], [106.69986, 22.22309], [106.67495, 22.1885], [106.6983, 22.15102], [106.70142, 22.02409], [106.68274, 21.99811], [106.69276, 21.96013], [106.72551, 21.97923], [106.74345, 22.00965], [106.81038, 21.97934], [106.9178, 21.97357], [106.92714, 21.93459], [106.97228, 21.92592], [106.99252, 21.95191], [107.05634, 21.92303], [107.06101, 21.88982], [107.00964, 21.85948], [107.02615, 21.81981], [107.10771, 21.79879], [107.20734, 21.71493], [107.24625, 21.7077], [107.29296, 21.74674], [107.35834, 21.6672], [107.35989, 21.60063], [107.38636, 21.59774], [107.41593, 21.64839], [107.47197, 21.6672], [107.49532, 21.62958], [107.49065, 21.59774], [107.54047, 21.5934], [107.56537, 21.61945], [107.66967, 21.60787], [107.80355, 21.66141], [107.86114, 21.65128], [107.90006, 21.5905], [107.92652, 21.58906], [107.95232, 21.5388], [107.96774, 21.53601], [107.97074, 21.54072], [107.97383, 21.53961], [107.97932, 21.54503], [108.02926, 21.54997], [108.0569, 21.53604], [108.10003, 21.47338], [108.00365, 17.98159], [111.60491, 13.57105], [118.41371, 24.06775], [118.11703, 24.39734], [118.28244, 24.51231], [118.35291, 24.51645], [118.42453, 24.54644], [118.6333, 24.46259], [119.42295, 25.0886], [119.98511, 25.37624], [119.78816, 26.2348], [120.0693, 26.3959], [120.5128, 26.536], [121.03532, 26.8787], [123.5458, 31.01942], [122.29378, 31.76513], [122.80525, 33.30571], [123.85601, 37.49093], [123.90497, 38.79949], [124.17532, 39.8232], [124.23201, 39.9248], [124.35029, 39.95639], [124.37089, 40.03004], [124.3322, 40.05573], [124.38556, 40.11047], [124.40719, 40.13655], [124.86913, 40.45387], [125.71172, 40.85223], [125.76869, 40.87908], [126.00335, 40.92835], [126.242, 41.15454], [126.53189, 41.35206], [126.60631, 41.65565], [126.90729, 41.79955], [127.17841, 41.59714], [127.29712, 41.49473], [127.92943, 41.44291], [128.02633, 41.42103], [128.03311, 41.39232], [128.12967, 41.37931], [128.18546, 41.41279], [128.20061, 41.40895], [128.30716, 41.60322], [128.15119, 41.74568], [128.04487, 42.01769], [128.94007, 42.03537], [128.96068, 42.06657], [129.15178, 42.17224], [129.22285, 42.26491], [129.22423, 42.3553], [129.28541, 42.41574], [129.42882, 42.44702], [129.54701, 42.37254], [129.60482, 42.44461], [129.72541, 42.43739], [129.75294, 42.59409], [129.77183, 42.69435], [129.7835, 42.76521], [129.80719, 42.79218], [129.83277, 42.86746], [129.85261, 42.96494], [129.8865, 43.00395], [129.95082, 43.01051], [129.96409, 42.97306], [130.12957, 42.98361], [130.09764, 42.91425], [130.26095, 42.9027], [130.23068, 42.80125], [130.2385, 42.71127], [130.41826, 42.6011], [130.44361, 42.54849], [130.50123, 42.61636], [130.55143, 42.52158], [130.62107, 42.58413], [130.56576, 42.68925], [130.40213, 42.70788], [130.44361, 42.76205], [130.66524, 42.84753], [131.02438, 42.86518], [131.02668, 42.91246], [131.135, 42.94114], [131.10274, 43.04734], [131.20414, 43.13654], [131.19031, 43.21385], [131.30324, 43.39498], [131.29402, 43.46695], [131.19492, 43.53047], [131.21105, 43.82383], [131.26176, 43.94011], [131.23583, 43.96085], [131.25484, 44.03131], [131.30365, 44.04262], [131.1108, 44.70266], [130.95639, 44.85154], [131.48415, 44.99513], [131.68466, 45.12374], [131.66852, 45.2196], [131.76532, 45.22609], [131.86903, 45.33636], [131.99417, 45.2567], [132.83978, 45.05916], [132.96373, 45.0212], [133.12293, 45.1332], [133.09279, 45.25693], [133.19419, 45.51913], [133.41083, 45.57723], [133.48457, 45.86203], [133.60442, 45.90053], [133.67569, 45.9759], [133.72695, 46.05576], [133.68047, 46.14697], [133.88097, 46.25066], [133.91496, 46.4274], [133.84104, 46.46681], [134.03538, 46.75668], [134.20016, 47.33458], [134.50898, 47.4812], [134.7671, 47.72051], [134.55508, 47.98651], [134.67098, 48.1564], [134.75328, 48.36763], [134.49516, 48.42884], [132.66989, 47.96491], [132.57309, 47.71741], [131.90448, 47.68011], [131.2635, 47.73325], [131.09871, 47.6852], [130.95985, 47.6957], [130.90915, 47.90623], [130.65103, 48.10052], [130.84462, 48.30942], [130.52147, 48.61745], [130.66946, 48.88251], [130.43232, 48.90844], [130.2355, 48.86741], [129.85416, 49.11067], [129.67598, 49.29596], [129.50685, 49.42398], [129.40398, 49.44194], [129.35317, 49.3481], [129.23232, 49.40353], [129.11153, 49.36813], [128.72896, 49.58676], [127.83476, 49.5748], [127.53516, 49.84306], [127.49299, 50.01251], [127.60515, 50.23503], [127.37384, 50.28393], [127.36009, 50.43787], [127.28765, 50.46585], [127.36335, 50.58306], [127.28165, 50.72075], [127.14586, 50.91152], [126.93135, 51.0841], [126.90369, 51.3238], [126.68349, 51.70607], [126.44606, 51.98254], [126.558, 52.13738], [125.6131, 53.07229]], [[113.56865, 22.20973], [113.57123, 22.20416], [113.60504, 22.20464], [113.63011, 22.10782], [113.57191, 22.07696], [113.54839, 22.10909], [113.54942, 22.14519], [113.54093, 22.15497], [113.52659, 22.18271], [113.53552, 22.20607], [113.53301, 22.21235], [113.53591, 22.21369], [113.54093, 22.21314], [113.54333, 22.21688], [113.5508, 22.21672], [113.56865, 22.20973]], [[114.50148, 22.15017], [113.92195, 22.13873], [113.83338, 22.1826], [113.81621, 22.2163], [113.86771, 22.42972], [114.03113, 22.5065], [114.05438, 22.5026], [114.05729, 22.51104], [114.06272, 22.51617], [114.07267, 22.51855], [114.07817, 22.52997], [114.08606, 22.53276], [114.09048, 22.53716], [114.09692, 22.53435], [114.1034, 22.5352], [114.11181, 22.52878], [114.11656, 22.53415], [114.12665, 22.54003], [114.13823, 22.54319], [114.1482, 22.54091], [114.15123, 22.55163], [114.1597, 22.56041], [114.17247, 22.55944], [114.18338, 22.55444], [114.20655, 22.55706], [114.22185, 22.55343], [114.22888, 22.5436], [114.25154, 22.55977], [114.44998, 22.55977], [114.50148, 22.15017]]]] } },
33970 { type: "Feature", properties: { wikidata: "Q22890", nameEn: "Ireland", level: "sharedLandform" }, geometry: null },
33971 { type: "Feature", properties: { wikidata: "Q23666", nameEn: "Great Britain", country: "GB", level: "sharedLandform" }, geometry: null },
33972 { type: "Feature", properties: { wikidata: "Q23681", nameEn: "Northern Cyprus", groups: ["Q644636", "145", "142"], driveSide: "left", callingCodes: ["90 392"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.67678, 35.03866], [33.67742, 35.05963], [33.68474, 35.06602], [33.69095, 35.06237], [33.70861, 35.07644], [33.7161, 35.07279], [33.70209, 35.04882], [33.71482, 35.03722], [33.73824, 35.05321], [33.76106, 35.04253], [33.78581, 35.05104], [33.82067, 35.07826], [33.84168, 35.06823], [33.8541, 35.07201], [33.87479, 35.08881], [33.87097, 35.09389], [33.87622, 35.10457], [33.87224, 35.12293], [33.88561, 35.12449], [33.88943, 35.12007], [33.88737, 35.11408], [33.89853, 35.11377], [33.91789, 35.08688], [33.90247, 35.07686], [33.92495, 35.06789], [33.94869, 35.07277], [33.99999, 35.07016], [34.23164, 35.1777], [35.51152, 36.10954], [32.82353, 35.70297], [32.46489, 35.48584], [32.60361, 35.16647], [32.64864, 35.19967], [32.70947, 35.18328], [32.70779, 35.14127], [32.85733, 35.07742], [32.86406, 35.1043], [32.94471, 35.09422], [33.01192, 35.15639], [33.08249, 35.17319], [33.11105, 35.15639], [33.15138, 35.19504], [33.27068, 35.16815], [33.3072, 35.16816], [33.31955, 35.18096], [33.35056, 35.18328], [33.34964, 35.17803], [33.35596, 35.17942], [33.35612, 35.17402], [33.36569, 35.17479], [33.3717, 35.1788], [33.37248, 35.18698], [33.38575, 35.2018], [33.4076, 35.20062], [33.41675, 35.16325], [33.46813, 35.10564], [33.48136, 35.0636], [33.47825, 35.04103], [33.45178, 35.02078], [33.45256, 35.00288], [33.47666, 35.00701], [33.48915, 35.06594], [33.53975, 35.08151], [33.57478, 35.06049], [33.567, 35.04803], [33.59658, 35.03635], [33.61215, 35.0527], [33.63765, 35.03869], [33.67678, 35.03866]]]] } },
33973 { type: "Feature", properties: { wikidata: "Q25231", nameEn: "Svalbard", aliases: ["NO-21"], country: "NO", groups: ["SJ", "154", "150", "UN"], level: "subterritory", callingCodes: ["47 79"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-7.49892, 77.24208], [32.07813, 72.01005], [36.85549, 84.09565], [-7.49892, 77.24208]]]] } },
33974 { type: "Feature", properties: { wikidata: "Q25263", nameEn: "Azores", aliases: ["PT-20"], country: "PT", groups: ["Q3320166", "Q2914565", "Q105472", "EU", "039", "150", "UN"], callingCodes: ["351"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-23.12984, 40.26428], [-36.43765, 41.39418], [-22.54767, 33.34416], [-23.12984, 40.26428]]]] } },
33975 { type: "Feature", properties: { wikidata: "Q25359", nameEn: "Navassa Island", aliases: ["UM-76"], country: "US", groups: ["UM", "Q1352230", "029", "003", "419", "019", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft" }, geometry: { type: "MultiPolygon", coordinates: [[[[-74.7289, 18.71009], [-75.71816, 18.46438], [-74.76465, 18.06252], [-74.7289, 18.71009]]]] } },
33976 { type: "Feature", properties: { wikidata: "Q25396", nameEn: "Bonaire", aliases: ["BQ-BO", "NL-BQ1"], country: "NL", groups: ["Q1451600", "BQ", "029", "003", "419", "019", "UN"], level: "subterritory", callingCodes: ["599 7"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-67.89186, 12.4116], [-68.90012, 12.62309], [-68.33524, 11.78151], [-68.01417, 11.77722], [-67.89186, 12.4116]]]] } },
33977 { type: "Feature", properties: { wikidata: "Q25528", nameEn: "Saba", aliases: ["BQ-SA", "NL-BQ2"], country: "NL", groups: ["Q1451600", "BQ", "029", "003", "419", "019", "UN"], level: "subterritory", callingCodes: ["599 4"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.07669, 17.79659], [-63.81314, 17.95045], [-63.22932, 17.32592], [-63.07669, 17.79659]]]] } },
33978 { type: "Feature", properties: { wikidata: "Q26180", nameEn: "Sint Eustatius", aliases: ["BQ-SE", "NL-BQ3"], country: "NL", groups: ["Q1451600", "BQ", "029", "003", "419", "019", "UN"], level: "subterritory", callingCodes: ["599 3"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.07669, 17.79659], [-63.34999, 16.94218], [-62.76692, 17.64353], [-63.07669, 17.79659]]]] } },
33979 { type: "Feature", properties: { wikidata: "Q26253", nameEn: "Madeira", aliases: ["PT-30"], country: "PT", groups: ["Q3320166", "Q2914565", "Q105472", "EU", "039", "150", "UN"], callingCodes: ["351"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-19.30302, 33.65304], [-16.04789, 29.65076], [-11.68307, 33.12333], [-19.30302, 33.65304]]]] } },
33980 { type: "Feature", properties: { wikidata: "Q26927", nameEn: "Lakshadweep", aliases: ["IN-LD"], country: "IN", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["91"] }, geometry: { type: "MultiPolygon", coordinates: [[[[67.64074, 11.57295], [76.59015, 5.591], [72.67494, 13.58102], [67.64074, 11.57295]]]] } },
33981 { type: "Feature", properties: { wikidata: "Q27329", nameEn: "Asian Russia", country: "RU", groups: ["142", "UN"], callingCodes: ["7"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-179.99933, 64.74703], [-172.76104, 63.77445], [-169.03888, 65.48473], [-168.95635, 65.98512], [-168.25765, 71.99091], [-179.9843, 71.90735], [-179.99933, 64.74703]]], [[[59.99809, 51.98263], [60.19925, 51.99173], [60.48915, 52.15175], [60.72581, 52.15538], [60.78201, 52.22067], [61.05417, 52.35096], [60.98021, 52.50068], [60.84709, 52.52228], [60.84118, 52.63912], [60.71693, 52.66245], [60.71989, 52.75923], [61.05842, 52.92217], [61.23462, 53.03227], [62.0422, 52.96105], [62.12799, 52.99133], [62.14574, 53.09626], [61.19024, 53.30536], [61.14291, 53.41481], [61.29082, 53.50992], [61.37957, 53.45887], [61.57185, 53.50112], [61.55706, 53.57144], [60.90626, 53.62937], [61.22574, 53.80268], [61.14283, 53.90063], [60.99796, 53.93699], [61.26863, 53.92797], [61.3706, 54.08464], [61.47603, 54.08048], [61.56941, 53.95703], [61.65318, 54.02445], [62.03913, 53.94768], [62.00966, 54.04134], [62.38535, 54.03961], [62.45931, 53.90737], [62.56876, 53.94047], [62.58651, 54.05871], [63.80604, 54.27079], [63.91224, 54.20013], [64.02715, 54.22679], [63.97686, 54.29763], [64.97216, 54.4212], [65.11033, 54.33028], [65.24663, 54.35721], [65.20174, 54.55216], [68.21308, 54.98645], [68.26661, 55.09226], [68.19206, 55.18823], [68.90865, 55.38148], [69.34224, 55.36344], [69.74917, 55.35545], [70.19179, 55.1476], [70.76493, 55.3027], [70.96009, 55.10558], [71.08288, 54.71253], [71.24185, 54.64965], [71.08706, 54.33376], [71.10379, 54.13326], [71.96141, 54.17736], [72.17477, 54.36303], [72.43415, 53.92685], [72.71026, 54.1161], [73.37963, 53.96132], [73.74778, 54.07194], [73.68921, 53.86522], [73.25412, 53.61532], [73.39218, 53.44623], [75.07405, 53.80831], [75.43398, 53.98652], [75.3668, 54.07439], [76.91052, 54.4677], [76.82266, 54.1798], [76.44076, 54.16017], [76.54243, 53.99329], [77.90383, 53.29807], [79.11255, 52.01171], [80.08138, 50.77658], [80.4127, 50.95581], [80.44819, 51.20855], [80.80318, 51.28262], [81.16999, 51.15662], [81.06091, 50.94833], [81.41248, 50.97524], [81.46581, 50.77658], [81.94999, 50.79307], [82.55443, 50.75412], [83.14607, 51.00796], [83.8442, 50.87375], [84.29385, 50.27257], [84.99198, 50.06793], [85.24047, 49.60239], [86.18709, 49.50259], [86.63674, 49.80136], [86.79056, 49.74787], [86.61307, 49.60239], [86.82606, 49.51796], [87.03071, 49.25142], [87.31465, 49.23603], [87.28386, 49.11626], [87.478, 49.07403], [87.48983, 49.13794], [87.81333, 49.17354], [87.98977, 49.18147], [88.15543, 49.30314], [88.17223, 49.46934], [88.42449, 49.48821], [88.82499, 49.44808], [89.70687, 49.72535], [89.59711, 49.90851], [91.86048, 50.73734], [92.07173, 50.69585], [92.44714, 50.78762], [93.01109, 50.79001], [92.99595, 50.63183], [94.30823, 50.57498], [94.39258, 50.22193], [94.49477, 50.17832], [94.6121, 50.04239], [94.97166, 50.04725], [95.02465, 49.96941], [95.74757, 49.97915], [95.80056, 50.04239], [96.97388, 49.88413], [97.24639, 49.74737], [97.56811, 49.84265], [97.56432, 49.92801], [97.76871, 49.99861], [97.85197, 49.91339], [98.29481, 50.33561], [98.31373, 50.4996], [98.06393, 50.61262], [97.9693, 50.78044], [98.01472, 50.86652], [97.83305, 51.00248], [98.05257, 51.46696], [98.22053, 51.46579], [98.33222, 51.71832], [98.74142, 51.8637], [98.87768, 52.14563], [99.27888, 51.96876], [99.75578, 51.90108], [99.89203, 51.74903], [100.61116, 51.73028], [101.39085, 51.45753], [101.5044, 51.50467], [102.14032, 51.35566], [102.32194, 50.67982], [102.71178, 50.38873], [103.70343, 50.13952], [105.32528, 50.4648], [106.05562, 50.40582], [106.07865, 50.33474], [106.47156, 50.31909], [106.49628, 50.32436], [106.51122, 50.34408], [106.58373, 50.34044], [106.80326, 50.30177], [107.00007, 50.1977], [107.1174, 50.04239], [107.36407, 49.97612], [107.96116, 49.93191], [107.95387, 49.66659], [108.27937, 49.53167], [108.53969, 49.32325], [109.18017, 49.34709], [109.51325, 49.22859], [110.24373, 49.16676], [110.39891, 49.25083], [110.64493, 49.1816], [113.02647, 49.60772], [113.20216, 49.83356], [114.325, 50.28098], [114.9703, 50.19254], [115.26068, 49.97367], [115.73602, 49.87688], [116.22402, 50.04477], [116.62502, 49.92919], [116.71193, 49.83813], [117.27597, 49.62544], [117.48208, 49.62324], [117.82343, 49.52696], [118.61623, 49.93809], [119.11003, 50.00276], [119.27996, 50.13348], [119.38598, 50.35162], [119.13553, 50.37412], [120.10963, 51.671], [120.65907, 51.93544], [120.77337, 52.20805], [120.61346, 52.32447], [120.71673, 52.54099], [120.46454, 52.63811], [120.04049, 52.58773], [120.0451, 52.7359], [120.85633, 53.28499], [121.39213, 53.31888], [122.35063, 53.49565], [122.85966, 53.47395], [123.26989, 53.54843], [123.86158, 53.49391], [124.46078, 53.21881], [125.17522, 53.20225], [125.6131, 53.07229], [126.558, 52.13738], [126.44606, 51.98254], [126.68349, 51.70607], [126.90369, 51.3238], [126.93135, 51.0841], [127.14586, 50.91152], [127.28165, 50.72075], [127.36335, 50.58306], [127.28765, 50.46585], [127.36009, 50.43787], [127.37384, 50.28393], [127.60515, 50.23503], [127.49299, 50.01251], [127.53516, 49.84306], [127.83476, 49.5748], [128.72896, 49.58676], [129.11153, 49.36813], [129.23232, 49.40353], [129.35317, 49.3481], [129.40398, 49.44194], [129.50685, 49.42398], [129.67598, 49.29596], [129.85416, 49.11067], [130.2355, 48.86741], [130.43232, 48.90844], [130.66946, 48.88251], [130.52147, 48.61745], [130.84462, 48.30942], [130.65103, 48.10052], [130.90915, 47.90623], [130.95985, 47.6957], [131.09871, 47.6852], [131.2635, 47.73325], [131.90448, 47.68011], [132.57309, 47.71741], [132.66989, 47.96491], [134.49516, 48.42884], [134.75328, 48.36763], [134.67098, 48.1564], [134.55508, 47.98651], [134.7671, 47.72051], [134.50898, 47.4812], [134.20016, 47.33458], [134.03538, 46.75668], [133.84104, 46.46681], [133.91496, 46.4274], [133.88097, 46.25066], [133.68047, 46.14697], [133.72695, 46.05576], [133.67569, 45.9759], [133.60442, 45.90053], [133.48457, 45.86203], [133.41083, 45.57723], [133.19419, 45.51913], [133.09279, 45.25693], [133.12293, 45.1332], [132.96373, 45.0212], [132.83978, 45.05916], [131.99417, 45.2567], [131.86903, 45.33636], [131.76532, 45.22609], [131.66852, 45.2196], [131.68466, 45.12374], [131.48415, 44.99513], [130.95639, 44.85154], [131.1108, 44.70266], [131.30365, 44.04262], [131.25484, 44.03131], [131.23583, 43.96085], [131.26176, 43.94011], [131.21105, 43.82383], [131.19492, 43.53047], [131.29402, 43.46695], [131.30324, 43.39498], [131.19031, 43.21385], [131.20414, 43.13654], [131.10274, 43.04734], [131.135, 42.94114], [131.02668, 42.91246], [131.02438, 42.86518], [130.66524, 42.84753], [130.44361, 42.76205], [130.40213, 42.70788], [130.56576, 42.68925], [130.62107, 42.58413], [130.55143, 42.52158], [130.56835, 42.43281], [130.60805, 42.4317], [130.64181, 42.41422], [130.66367, 42.38024], [130.65022, 42.32281], [131.95041, 41.5445], [140.9182, 45.92937], [145.82343, 44.571], [145.23667, 43.76813], [153.94307, 38.42848], [180, 62.52334], [180, 71.53642], [155.31937, 81.93282], [76.13964, 83.37843], [64.18965, 69.94255], [66.1708, 67.61252], [61.98014, 65.72191], [60.74386, 64.95767], [59.63945, 64.78384], [59.80579, 64.13948], [59.24834, 63.01859], [59.61398, 62.44915], [59.36223, 61.3882], [59.50685, 60.91162], [58.3853, 59.487], [59.15636, 59.14682], [59.40376, 58.45822], [58.71104, 58.07475], [58.81412, 57.71602], [58.13789, 57.68097], [58.07604, 57.08308], [57.28024, 56.87898], [57.51527, 56.08729], [59.28419, 56.15739], [59.49035, 55.60486], [58.81825, 55.03378], [57.25137, 55.26262], [57.14829, 54.84204], [57.95234, 54.39672], [59.95217, 54.85853], [59.70487, 54.14846], [58.94336, 53.953], [58.79644, 52.43392], [59.22409, 52.28437], [59.25033, 52.46803], [60.17516, 52.39457], [60.17253, 52.25814], [59.91279, 52.06924], [59.99809, 51.98263]]]] } },
33982 { type: "Feature", properties: { wikidata: "Q34366", nameEn: "Tasmania", aliases: ["AU-TAS"], country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[123.64533, -39.13605], [159.69067, -56.28945], [159.74028, -39.1978], [123.64533, -39.13605]]]] } },
33983 { type: "Feature", properties: { wikidata: "Q34497", nameEn: "Saint Helena", aliases: ["SH-HL"], country: "GB", groups: ["SH", "BOTS", "011", "202", "002", "UN"], level: "subterritory", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["290"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-8.3824, -13.9131], [-6.17428, -19.07236], [-3.29308, -15.22647], [-8.3824, -13.9131]]]] } },
33984 { type: "Feature", properties: { wikidata: "Q35657", nameEn: "US States", country: "US", level: "subcountryGroup" }, geometry: null },
33985 { type: "Feature", properties: { wikidata: "Q36117", nameEn: "Borneo", level: "sharedLandform" }, geometry: null },
33986 { type: "Feature", properties: { wikidata: "Q36678", nameEn: "West Bank", country: "PS", groups: ["145", "142"], callingCodes: ["970"] }, geometry: { type: "MultiPolygon", coordinates: [[[[35.47672, 31.49578], [35.55941, 31.76535], [35.52758, 31.9131], [35.54375, 31.96587], [35.52012, 32.04076], [35.57111, 32.21877], [35.55807, 32.38674], [35.42078, 32.41562], [35.41048, 32.43706], [35.41598, 32.45593], [35.42034, 32.46009], [35.40224, 32.50136], [35.35212, 32.52047], [35.30685, 32.51024], [35.29306, 32.50947], [35.25049, 32.52453], [35.2244, 32.55289], [35.15937, 32.50466], [35.10882, 32.4757], [35.10024, 32.47856], [35.09236, 32.47614], [35.08564, 32.46948], [35.07059, 32.4585], [35.05423, 32.41754], [35.05311, 32.4024], [35.0421, 32.38242], [35.05142, 32.3667], [35.04243, 32.35008], [35.01772, 32.33863], [35.01119, 32.28684], [35.02939, 32.2671], [35.01841, 32.23981], [34.98885, 32.20758], [34.95703, 32.19522], [34.96009, 32.17503], [34.99039, 32.14626], [34.98507, 32.12606], [34.99437, 32.10962], [34.9863, 32.09551], [35.00261, 32.027], [34.98682, 31.96935], [35.00124, 31.93264], [35.03489, 31.92448], [35.03978, 31.89276], [35.03489, 31.85919], [34.99712, 31.85569], [34.9724, 31.83352], [35.01978, 31.82944], [35.05617, 31.85685], [35.07677, 31.85627], [35.14174, 31.81325], [35.18603, 31.80901], [35.18169, 31.82542], [35.19461, 31.82687], [35.21469, 31.81835], [35.216, 31.83894], [35.21128, 31.863], [35.20381, 31.86716], [35.20673, 31.88151], [35.20791, 31.8821], [35.20945, 31.8815], [35.21016, 31.88237], [35.21276, 31.88153], [35.2136, 31.88241], [35.22014, 31.88264], [35.22294, 31.87889], [35.22567, 31.86745], [35.22817, 31.8638], [35.2249, 31.85433], [35.2304, 31.84222], [35.24816, 31.8458], [35.25753, 31.8387], [35.251, 31.83085], [35.26404, 31.82567], [35.25573, 31.81362], [35.26058, 31.79064], [35.25225, 31.7678], [35.26319, 31.74846], [35.25182, 31.73945], [35.24981, 31.72543], [35.2438, 31.7201], [35.24315, 31.71244], [35.23972, 31.70896], [35.22392, 31.71899], [35.21937, 31.71578], [35.20538, 31.72388], [35.18023, 31.72067], [35.16478, 31.73242], [35.15474, 31.73352], [35.15119, 31.73634], [35.13931, 31.73012], [35.12933, 31.7325], [35.11895, 31.71454], [35.10782, 31.71594], [35.08226, 31.69107], [35.00879, 31.65426], [34.95249, 31.59813], [34.9415, 31.55601], [34.94356, 31.50743], [34.93258, 31.47816], [34.89756, 31.43891], [34.87833, 31.39321], [34.88932, 31.37093], [34.92571, 31.34337], [35.02459, 31.35979], [35.13033, 31.3551], [35.22921, 31.37445], [35.39675, 31.49572], [35.47672, 31.49578]]]] } },
33987 { type: "Feature", properties: { wikidata: "Q37362", nameEn: "Akrotiri and Dhekelia", aliases: ["SBA"], country: "GB" }, geometry: null },
33988 { type: "Feature", properties: { wikidata: "Q38095", nameEn: "Gal\xE1pagos Islands", aliases: ["EC-W"], country: "EC", groups: ["005", "419", "019", "UN"], callingCodes: ["593"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-93.12365, 2.64343], [-92.46744, -2.52874], [-87.07749, -0.8849], [-93.12365, 2.64343]]]] } },
33989 { type: "Feature", properties: { wikidata: "Q39760", nameEn: "Gaza Strip", country: "PS", groups: ["145", "142"], callingCodes: ["970"] }, geometry: { type: "MultiPolygon", coordinates: [[[[34.052, 31.46619], [34.21853, 31.32363], [34.23572, 31.2966], [34.24012, 31.29591], [34.26742, 31.21998], [34.29417, 31.24194], [34.36523, 31.28963], [34.37381, 31.30598], [34.36505, 31.36404], [34.40077, 31.40926], [34.48892, 31.48365], [34.56797, 31.54197], [34.48681, 31.59711], [34.29262, 31.70393], [34.052, 31.46619]]]] } },
33990 { type: "Feature", properties: { wikidata: "Q40888", nameEn: "Andaman and Nicobar Islands", aliases: ["IN-AN"], country: "IN", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["91"] }, geometry: { type: "MultiPolygon", coordinates: [[[[94.42132, 5.96581], [94.6371, 13.81803], [86.7822, 13.41052], [94.42132, 5.96581]]]] } },
33991 { type: "Feature", properties: { wikidata: "Q41684", nameEn: "Stewart Island", country: "NZ", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[166.59185, -47.61313], [169.70504, -47.56021], [167.52103, -46.41337], [166.59185, -47.61313]]]] } },
33992 { type: "Feature", properties: { wikidata: "Q43296", nameEn: "Wake Island", aliases: ["WK", "WAK", "WKUM", "872", "UM-79"], country: "US", groups: ["UM", "Q1352230", "057", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[167.34779, 18.97692], [166.67967, 20.14834], [165.82549, 18.97692], [167.34779, 18.97692]]]] } },
33993 { type: "Feature", properties: { wikidata: "Q46275", nameEn: "New Zealand Subantarctic Islands", country: "NZ", groups: ["Q851132", "053", "009", "UN"], driveSide: "left" }, geometry: { type: "MultiPolygon", coordinates: [[[[164.30551, -47.88072], [161.96603, -56.07661], [179.49541, -50.04657], [179.49541, -47.2902], [169.91032, -47.66283], [164.30551, -47.88072]]]] } },
33994 { type: "Feature", properties: { wikidata: "Q46395", nameEn: "British Overseas Territories", aliases: ["BOTS", "UKOTS"], country: "GB", level: "subcountryGroup" }, geometry: null },
33995 { type: "Feature", properties: { wikidata: "Q46772", nameEn: "Kerguelen Islands", country: "FR", groups: ["EU", "TF", "Q1451600", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[61.9216, -49.39746], [70.67507, -51.14192], [74.25129, -45.45074], [61.9216, -49.39746]]]] } },
33996 { type: "Feature", properties: { wikidata: "Q46879", nameEn: "Baker Island", aliases: ["UM-81"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft" }, geometry: { type: "MultiPolygon", coordinates: [[[[-175.33482, -1.40631], [-175.31323, 0.5442], [-177.91421, 0.39582], [-175.33482, -1.40631]]]] } },
33997 { type: "Feature", properties: { wikidata: "Q47863", nameEn: "Midway Atoll", aliases: ["MI", "MID", "MIUM", "488", "UM-71"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-176.29741, 29.09786], [-177.77531, 29.29793], [-177.5224, 27.7635], [-176.29741, 29.09786]]]] } },
33998 { type: "Feature", properties: { wikidata: "Q62218", nameEn: "Jarvis Island", aliases: ["UM-86"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft" }, geometry: { type: "MultiPolygon", coordinates: [[[[-160.42921, -1.4364], [-159.12443, 0.19975], [-160.38779, 0.30331], [-160.42921, -1.4364]]]] } },
33999 { type: "Feature", properties: { wikidata: "Q105472", nameEn: "Macaronesia", level: "sharedLandform" }, geometry: null },
34000 { type: "Feature", properties: { wikidata: "Q114935", nameEn: "Kermadec Islands", country: "NZ", groups: ["Q851132", "053", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-174.40891, -29.09438], [-180, -24.21376], [-179.96512, -35.00791], [-174.40891, -29.09438]]]] } },
34001 { type: "Feature", properties: { wikidata: "Q115459", nameEn: "Chatham Islands", aliases: ["NZ-CIT"], country: "NZ", groups: ["Q851132", "053", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-179.93224, -45.18423], [-172.47015, -45.17912], [-176.30998, -41.38382], [-179.93224, -45.18423]]]] } },
34002 { type: "Feature", properties: { wikidata: "Q118863", nameEn: "North Island", country: "NZ", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[179.49541, -47.2902], [179.49541, -36.79303], [174.17679, -32.62487], [170.27492, -36.38133], [174.58663, -40.80446], [174.46634, -41.55028], [179.49541, -47.2902]]]] } },
34003 { type: "Feature", properties: { wikidata: "Q120755", nameEn: "South Island", country: "NZ", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[169.70504, -47.56021], [179.49541, -47.2902], [174.46634, -41.55028], [174.58663, -40.80446], [170.27492, -36.38133], [166.56976, -39.94841], [164.8365, -46.0205], [167.52103, -46.41337], [169.70504, -47.56021]]]] } },
34004 { type: "Feature", properties: { wikidata: "Q123076", nameEn: "Palmyra Atoll", aliases: ["UM-95"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-161.06795, 5.2462], [-161.0731, 7.1291], [-163.24478, 5.24198], [-161.06795, 5.2462]]]] } },
34005 { type: "Feature", properties: { wikidata: "Q130574", nameEn: "Chafarinas Islands", country: "ES", groups: ["EU", "Q191011", "015", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.40316, 35.16893], [-2.43262, 35.20652], [-2.45965, 35.16527], [-2.40316, 35.16893]]]] } },
34006 { type: "Feature", properties: { wikidata: "Q130895", nameEn: "Kingman Reef", aliases: ["UM-89"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft" }, geometry: { type: "MultiPolygon", coordinates: [[[[-161.0731, 7.1291], [-163.16627, 7.15036], [-163.24478, 5.24198], [-161.0731, 7.1291]]]] } },
34007 { type: "Feature", properties: { wikidata: "Q131008", nameEn: "Johnston Atoll", aliases: ["JT", "JTN", "JTUM", "396", "UM-67"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-170.65691, 16.57199], [-168.87689, 16.01159], [-169.2329, 17.4933], [-170.65691, 16.57199]]]] } },
34008 { type: "Feature", properties: { wikidata: "Q131305", nameEn: "Howland Island", aliases: ["UM-84"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft" }, geometry: { type: "MultiPolygon", coordinates: [[[[-177.91421, 0.39582], [-175.31323, 0.5442], [-176.74464, 2.28109], [-177.91421, 0.39582]]]] } },
34009 { type: "Feature", properties: { wikidata: "Q133888", nameEn: "Ashmore and Cartier Islands", country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[123.7463, -11.1783], [120.6877, -13.59408], [125.29076, -12.33139], [123.7463, -11.1783]]]] } },
34010 { type: "Feature", properties: { wikidata: "Q153732", nameEn: "Mariana Islands", level: "sharedLandform" }, geometry: null },
34011 { type: "Feature", properties: { wikidata: "Q172216", nameEn: "Coral Sea Islands", country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[159.77159, -28.41151], [156.73836, -14.50464], [145.2855, -9.62524], [147.69992, -17.5933], [152.93188, -20.92631], [154.02855, -24.43238], [159.77159, -28.41151]]]] } },
34012 { type: "Feature", properties: { wikidata: "Q179313", nameEn: "Alderney", country: "GB", groups: ["GG", "830", "Q185086", "154", "150", "UN"], level: "subterritory", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44 01481"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.36485, 49.48223], [-2.09454, 49.46288], [-2.02963, 49.91866], [-2.49556, 49.79012], [-2.36485, 49.48223]]]] } },
34013 { type: "Feature", properties: { wikidata: "Q185086", nameEn: "Crown Dependencies", country: "GB", level: "subcountryGroup" }, geometry: null },
34014 { type: "Feature", properties: { wikidata: "Q190571", nameEn: "Scattered Islands", country: "FR", groups: ["EU", "TF", "Q1451600", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[53.53458, -16.36909], [54.96649, -16.28353], [54.61476, -15.02273], [53.53458, -16.36909]]], [[[38.55969, -20.75596], [40.68027, -23.38889], [43.52893, -15.62903], [38.55969, -20.75596]]], [[[47.03092, -11.05648], [47.11593, -12.08552], [47.96702, -11.46447], [47.03092, -11.05648]]]] } },
34015 { type: "Feature", properties: { wikidata: "Q191011", nameEn: "Plazas de soberan\xEDa", country: "ES" }, geometry: null },
34016 { type: "Feature", properties: { wikidata: "Q191146", nameEn: "Pe\xF1\xF3n de V\xE9lez de la Gomera", country: "ES", groups: ["EU", "Q191011", "015", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[-4.30191, 35.17419], [-4.30112, 35.17058], [-4.29436, 35.17149], [-4.30191, 35.17419]]]] } },
34017 { type: "Feature", properties: { wikidata: "Q201698", nameEn: "Crozet Islands", country: "FR", groups: ["EU", "TF", "Q1451600", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[55.03425, -43.65017], [46.31615, -46.28749], [54.5587, -47.93013], [55.03425, -43.65017]]]] } },
34018 { type: "Feature", properties: { wikidata: "Q578170", nameEn: "Contiguous United States", aliases: ["CONUS"], country: "US", groups: ["Q35657", "021", "003", "019", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-97.13927, 25.96583], [-96.92418, 25.97377], [-80.57035, 24.0565], [-78.91214, 27.76553], [-61.98255, 37.34815], [-67.16117, 44.20069], [-66.93432, 44.82597], [-66.96824, 44.83078], [-66.98249, 44.87071], [-66.96824, 44.90965], [-67.0216, 44.95333], [-67.11316, 45.11176], [-67.15965, 45.16179], [-67.19603, 45.16771], [-67.20349, 45.1722], [-67.22751, 45.16344], [-67.27039, 45.1934], [-67.29748, 45.18173], [-67.29754, 45.14865], [-67.34927, 45.122], [-67.48201, 45.27351], [-67.42394, 45.37969], [-67.50578, 45.48971], [-67.42144, 45.50584], [-67.43815, 45.59162], [-67.6049, 45.60725], [-67.80705, 45.69528], [-67.80653, 45.80022], [-67.75654, 45.82324], [-67.80961, 45.87531], [-67.75196, 45.91814], [-67.78111, 45.9392], [-67.78578, 47.06473], [-67.87993, 47.10377], [-67.94843, 47.1925], [-68.23244, 47.35712], [-68.37458, 47.35851], [-68.38332, 47.28723], [-68.57914, 47.28431], [-68.60575, 47.24659], [-68.70125, 47.24399], [-68.89222, 47.1807], [-69.05039, 47.2456], [-69.05073, 47.30076], [-69.05148, 47.42012], [-69.22119, 47.46461], [-69.99966, 46.69543], [-70.05812, 46.41768], [-70.18547, 46.35357], [-70.29078, 46.18832], [-70.23855, 46.1453], [-70.31025, 45.96424], [-70.24694, 45.95138], [-70.25976, 45.89675], [-70.41523, 45.79497], [-70.38934, 45.73215], [-70.54019, 45.67291], [-70.68516, 45.56964], [-70.72651, 45.49771], [-70.62518, 45.42286], [-70.65383, 45.37592], [-70.78372, 45.43269], [-70.82638, 45.39828], [-70.80236, 45.37444], [-70.84816, 45.22698], [-70.89864, 45.2398], [-70.91169, 45.29849], [-70.95193, 45.33895], [-71.0107, 45.34819], [-71.01866, 45.31573], [-71.08364, 45.30623], [-71.14568, 45.24128], [-71.19723, 45.25438], [-71.22338, 45.25184], [-71.29371, 45.29996], [-71.37133, 45.24624], [-71.44252, 45.2361], [-71.40364, 45.21382], [-71.42778, 45.12624], [-71.48735, 45.07784], [-71.50067, 45.01357], [-71.75113, 45.0114], [-72.09934, 45.00571], [-72.17312, 45.00587], [-72.71867, 45.01551], [-73.35025, 45.00942], [-74.32699, 44.99029], [-74.47782, 44.99747], [-74.7163, 45.00017], [-74.73876, 44.98856], [-74.76044, 44.99491], [-74.76308, 45.00624], [-74.8447, 45.00606], [-74.99101, 44.98051], [-75.01363, 44.95608], [-75.2193, 44.87821], [-75.41441, 44.76614], [-75.76813, 44.51537], [-75.8217, 44.43176], [-75.95947, 44.34463], [-76.00018, 44.34896], [-76.16285, 44.28262], [-76.1664, 44.23051], [-76.244, 44.19643], [-76.31222, 44.19894], [-76.35324, 44.13493], [-76.43859, 44.09393], [-76.79706, 43.63099], [-79.25796, 43.54052], [-79.06921, 43.26183], [-79.05512, 43.25375], [-79.05544, 43.21224], [-79.05002, 43.20133], [-79.05384, 43.17418], [-79.04652, 43.16396], [-79.0427, 43.13934], [-79.06881, 43.12029], [-79.05671, 43.10937], [-79.07486, 43.07845], [-79.01055, 43.06659], [-78.99941, 43.05612], [-79.02424, 43.01983], [-79.02074, 42.98444], [-78.98126, 42.97], [-78.96312, 42.95509], [-78.93224, 42.95229], [-78.90905, 42.93022], [-78.90712, 42.89733], [-78.93684, 42.82887], [-82.67862, 41.67615], [-83.11184, 41.95671], [-83.14962, 42.04089], [-83.12724, 42.2376], [-83.09837, 42.28877], [-83.07837, 42.30978], [-83.02253, 42.33045], [-82.82964, 42.37355], [-82.64242, 42.55594], [-82.58873, 42.54984], [-82.57583, 42.5718], [-82.51858, 42.611], [-82.51063, 42.66025], [-82.46613, 42.76615], [-82.4826, 42.8068], [-82.45331, 42.93139], [-82.4253, 42.95423], [-82.4146, 42.97626], [-82.42469, 42.992], [-82.48419, 45.30225], [-83.59589, 45.82131], [-83.43746, 45.99749], [-83.57017, 46.105], [-83.83329, 46.12169], [-83.90453, 46.05922], [-83.95399, 46.05634], [-84.1096, 46.23987], [-84.09756, 46.25512], [-84.11615, 46.2681], [-84.11254, 46.32329], [-84.13451, 46.39218], [-84.11196, 46.50248], [-84.12885, 46.53068], [-84.17723, 46.52753], [-84.1945, 46.54061], [-84.2264, 46.53337], [-84.26351, 46.49508], [-84.29893, 46.49127], [-84.34174, 46.50683], [-84.42101, 46.49853], [-84.4481, 46.48972], [-84.47607, 46.45225], [-84.55635, 46.45974], [-84.85871, 46.88881], [-88.37033, 48.30586], [-89.48837, 48.01412], [-89.57972, 48.00023], [-89.77248, 48.02607], [-89.89974, 47.98109], [-90.07418, 48.11043], [-90.56312, 48.09488], [-90.56444, 48.12184], [-90.75045, 48.09143], [-90.87588, 48.2484], [-91.08016, 48.18096], [-91.25025, 48.08522], [-91.43248, 48.04912], [-91.45829, 48.07454], [-91.58025, 48.04339], [-91.55649, 48.10611], [-91.70451, 48.11805], [-91.71231, 48.19875], [-91.86125, 48.21278], [-91.98929, 48.25409], [-92.05339, 48.35958], [-92.14732, 48.36578], [-92.202, 48.35252], [-92.26662, 48.35651], [-92.30939, 48.31251], [-92.27167, 48.25046], [-92.37185, 48.22259], [-92.48147, 48.36609], [-92.45588, 48.40624], [-92.50712, 48.44921], [-92.65606, 48.43471], [-92.71323, 48.46081], [-92.69927, 48.49573], [-92.62747, 48.50278], [-92.6342, 48.54133], [-92.7287, 48.54005], [-92.94973, 48.60866], [-93.25391, 48.64266], [-93.33946, 48.62787], [-93.3712, 48.60599], [-93.39758, 48.60364], [-93.40693, 48.60948], [-93.44472, 48.59147], [-93.47022, 48.54357], [-93.66382, 48.51845], [-93.79267, 48.51631], [-93.80939, 48.52439], [-93.80676, 48.58232], [-93.83288, 48.62745], [-93.85769, 48.63284], [-94.23215, 48.65202], [-94.25104, 48.65729], [-94.25172, 48.68404], [-94.27153, 48.70232], [-94.4174, 48.71049], [-94.44258, 48.69223], [-94.53826, 48.70216], [-94.54885, 48.71543], [-94.58903, 48.71803], [-94.69335, 48.77883], [-94.69669, 48.80918], [-94.70486, 48.82365], [-94.70087, 48.8339], [-94.687, 48.84077], [-94.75017, 49.09931], [-94.77355, 49.11998], [-94.82487, 49.29483], [-94.8159, 49.32299], [-94.85381, 49.32492], [-94.95681, 49.37035], [-94.99532, 49.36579], [-95.01419, 49.35647], [-95.05825, 49.35311], [-95.12903, 49.37056], [-95.15357, 49.384], [-95.15355, 48.9996], [-123.32163, 49.00419], [-123.0093, 48.83186], [-123.0093, 48.76586], [-123.26565, 48.6959], [-123.15614, 48.35395], [-123.50039, 48.21223], [-125.03842, 48.53282], [-133.98258, 38.06389], [-118.48109, 32.5991], [-117.1243, 32.53427], [-115.88053, 32.63624], [-114.71871, 32.71894], [-114.76736, 32.64094], [-114.80584, 32.62028], [-114.81141, 32.55543], [-114.79524, 32.55731], [-114.82011, 32.49609], [-111.07523, 31.33232], [-108.20979, 31.33316], [-108.20899, 31.78534], [-106.529, 31.784], [-106.52266, 31.77509], [-106.51251, 31.76922], [-106.50962, 31.76155], [-106.50111, 31.75714], [-106.48815, 31.74769], [-106.47298, 31.75054], [-106.46726, 31.75998], [-106.45244, 31.76523], [-106.43419, 31.75478], [-106.41773, 31.75196], [-106.38003, 31.73151], [-106.3718, 31.71165], [-106.34864, 31.69663], [-106.33419, 31.66303], [-106.30305, 31.62154], [-106.28084, 31.56173], [-106.24612, 31.54193], [-106.23711, 31.51262], [-106.20346, 31.46305], [-106.09025, 31.40569], [-106.00363, 31.39181], [-104.77674, 30.4236], [-104.5171, 29.64671], [-104.3969, 29.57105], [-104.39363, 29.55396], [-104.37752, 29.54255], [-103.15787, 28.93865], [-102.60596, 29.8192], [-101.47277, 29.7744], [-101.05686, 29.44738], [-101.01128, 29.36947], [-100.96725, 29.3477], [-100.94579, 29.34523], [-100.94056, 29.33371], [-100.87982, 29.296], [-100.79696, 29.24688], [-100.67294, 29.09744], [-100.63689, 28.90812], [-100.59809, 28.88197], [-100.52313, 28.75598], [-100.5075, 28.74066], [-100.51222, 28.70679], [-100.50029, 28.66117], [-99.55409, 27.61314], [-99.51478, 27.55836], [-99.52955, 27.49747], [-99.50208, 27.50021], [-99.48045, 27.49016], [-99.482, 27.47128], [-99.49744, 27.43746], [-99.53573, 27.30926], [-99.08477, 26.39849], [-99.03053, 26.41249], [-99.00546, 26.3925], [-98.35126, 26.15129], [-98.30491, 26.10475], [-98.27075, 26.09457], [-98.24603, 26.07191], [-97.97017, 26.05232], [-97.95155, 26.0625], [-97.66511, 26.01708], [-97.52025, 25.88518], [-97.49828, 25.89877], [-97.45669, 25.86874], [-97.42511, 25.83969], [-97.37332, 25.83854], [-97.35946, 25.92189], [-97.13927, 25.96583]]]] } },
34019 { type: "Feature", properties: { wikidata: "Q620634", nameEn: "Bir Tawil", groups: ["015", "002"], level: "territory" }, geometry: { type: "MultiPolygon", coordinates: [[[[33.17563, 22.00405], [33.57251, 21.72406], [33.99686, 21.76784], [34.0765, 22.00501], [33.17563, 22.00405]]]] } },
34020 { type: "Feature", properties: { wikidata: "Q639185", nameEn: "Peros Banhos", country: "GB", groups: ["IO", "BOTS", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[72.12587, -4.02588], [70.1848, -6.37445], [72.09518, -5.61768], [72.12587, -4.02588]]]] } },
34021 { type: "Feature", properties: { wikidata: "Q644636", nameEn: "Cyprus", level: "sharedLandform" }, geometry: null },
34022 { type: "Feature", properties: { wikidata: "Q851132", nameEn: "New Zealand Outlying Islands", country: "NZ", level: "subcountryGroup" }, geometry: null },
34023 { type: "Feature", properties: { wikidata: "Q875134", nameEn: "European Russia", country: "RU", groups: ["151", "150", "UN"], callingCodes: ["7"] }, geometry: { type: "MultiPolygon", coordinates: [[[[18.57853, 55.25302], [19.64312, 54.45423], [19.8038, 54.44203], [20.63871, 54.3706], [21.41123, 54.32395], [22.79705, 54.36264], [22.7253, 54.41732], [22.70208, 54.45312], [22.67788, 54.532], [22.71293, 54.56454], [22.68021, 54.58486], [22.7522, 54.63525], [22.74225, 54.64339], [22.75467, 54.6483], [22.73397, 54.66604], [22.73631, 54.72952], [22.87317, 54.79492], [22.85083, 54.88711], [22.76422, 54.92521], [22.68723, 54.9811], [22.65451, 54.97037], [22.60075, 55.01863], [22.58907, 55.07085], [22.47688, 55.04408], [22.31562, 55.0655], [22.14267, 55.05345], [22.11697, 55.02131], [22.06087, 55.02935], [22.02582, 55.05078], [22.03984, 55.07888], [21.99543, 55.08691], [21.96505, 55.07353], [21.85521, 55.09493], [21.64954, 55.1791], [21.55605, 55.20311], [21.51095, 55.18507], [21.46766, 55.21115], [21.38446, 55.29348], [21.35465, 55.28427], [21.26425, 55.24456], [20.95181, 55.27994], [20.60454, 55.40986], [18.57853, 55.25302]]], [[[26.32936, 60.00121], [26.90044, 59.63819], [27.85643, 59.58538], [28.04187, 59.47017], [28.19061, 59.39962], [28.21137, 59.38058], [28.20537, 59.36491], [28.19284, 59.35791], [28.14215, 59.28934], [28.00689, 59.28351], [27.90911, 59.24353], [27.87978, 59.18097], [27.80482, 59.1116], [27.74429, 58.98351], [27.36366, 58.78381], [27.55489, 58.39525], [27.48541, 58.22615], [27.62393, 58.09462], [27.67282, 57.92627], [27.81841, 57.89244], [27.78526, 57.83963], [27.56689, 57.83356], [27.50171, 57.78842], [27.52615, 57.72843], [27.3746, 57.66834], [27.40393, 57.62125], [27.31919, 57.57672], [27.34698, 57.52242], [27.56832, 57.53728], [27.52453, 57.42826], [27.86101, 57.29402], [27.66511, 56.83921], [27.86101, 56.88204], [28.04768, 56.59004], [28.13526, 56.57989], [28.10069, 56.524], [28.19057, 56.44637], [28.16599, 56.37806], [28.23716, 56.27588], [28.15217, 56.16964], [28.30571, 56.06035], [28.36888, 56.05805], [28.37987, 56.11399], [28.43068, 56.09407], [28.5529, 56.11705], [28.68337, 56.10173], [28.63668, 56.07262], [28.73418, 55.97131], [29.08299, 56.03427], [29.21717, 55.98971], [29.44692, 55.95978], [29.3604, 55.75862], [29.51283, 55.70294], [29.61446, 55.77716], [29.80672, 55.79569], [29.97975, 55.87281], [30.12136, 55.8358], [30.27776, 55.86819], [30.30987, 55.83592], [30.48257, 55.81066], [30.51346, 55.78982], [30.51037, 55.76568], [30.63344, 55.73079], [30.67464, 55.64176], [30.72957, 55.66268], [30.7845, 55.58514], [30.86003, 55.63169], [30.93419, 55.6185], [30.95204, 55.50667], [30.90123, 55.46621], [30.93144, 55.3914], [30.8257, 55.3313], [30.81946, 55.27931], [30.87944, 55.28223], [30.97369, 55.17134], [31.02071, 55.06167], [31.00972, 55.02783], [30.94243, 55.03964], [30.9081, 55.02232], [30.95754, 54.98609], [30.93144, 54.9585], [30.81759, 54.94064], [30.8264, 54.90062], [30.75165, 54.80699], [30.95479, 54.74346], [30.97127, 54.71967], [31.0262, 54.70698], [30.98226, 54.68872], [30.99187, 54.67046], [31.19339, 54.66947], [31.21399, 54.63113], [31.08543, 54.50361], [31.22945, 54.46585], [31.3177, 54.34067], [31.30791, 54.25315], [31.57002, 54.14535], [31.89599, 54.0837], [31.88744, 54.03653], [31.85019, 53.91801], [31.77028, 53.80015], [31.89137, 53.78099], [32.12621, 53.81586], [32.36663, 53.7166], [32.45717, 53.74039], [32.50112, 53.68594], [32.40499, 53.6656], [32.47777, 53.5548], [32.74968, 53.45597], [32.73257, 53.33494], [32.51725, 53.28431], [32.40773, 53.18856], [32.15368, 53.07594], [31.82373, 53.10042], [31.787, 53.18033], [31.62496, 53.22886], [31.56316, 53.19432], [31.40523, 53.21406], [31.36403, 53.13504], [31.3915, 53.09712], [31.33519, 53.08805], [31.32283, 53.04101], [31.24147, 53.031], [31.35667, 52.97854], [31.592, 52.79011], [31.57277, 52.71613], [31.50406, 52.69707], [31.63869, 52.55361], [31.56316, 52.51518], [31.61397, 52.48843], [31.62084, 52.33849], [31.57971, 52.32146], [31.70735, 52.26711], [31.6895, 52.1973], [31.77877, 52.18636], [31.7822, 52.11406], [31.81722, 52.09955], [31.85018, 52.11305], [31.96141, 52.08015], [31.92159, 52.05144], [32.08813, 52.03319], [32.23331, 52.08085], [32.2777, 52.10266], [32.34044, 52.1434], [32.33083, 52.23685], [32.38988, 52.24946], [32.3528, 52.32842], [32.54781, 52.32423], [32.69475, 52.25535], [32.85405, 52.27888], [32.89937, 52.2461], [33.18913, 52.3754], [33.51323, 52.35779], [33.48027, 52.31499], [33.55718, 52.30324], [33.78789, 52.37204], [34.05239, 52.20132], [34.11199, 52.14087], [34.09413, 52.00835], [34.41136, 51.82793], [34.42922, 51.72852], [34.07765, 51.67065], [34.17599, 51.63253], [34.30562, 51.5205], [34.22048, 51.4187], [34.33446, 51.363], [34.23009, 51.26429], [34.31661, 51.23936], [34.38802, 51.2746], [34.6613, 51.25053], [34.6874, 51.18], [34.82472, 51.17483], [34.97304, 51.2342], [35.14058, 51.23162], [35.12685, 51.16191], [35.20375, 51.04723], [35.31774, 51.08434], [35.40837, 51.04119], [35.32598, 50.94524], [35.39307, 50.92145], [35.41367, 50.80227], [35.47704, 50.77274], [35.48116, 50.66405], [35.39464, 50.64751], [35.47463, 50.49247], [35.58003, 50.45117], [35.61711, 50.35707], [35.73659, 50.35489], [35.80388, 50.41356], [35.8926, 50.43829], [36.06893, 50.45205], [36.20763, 50.3943], [36.30101, 50.29088], [36.47817, 50.31457], [36.58371, 50.28563], [36.56655, 50.2413], [36.64571, 50.218], [36.69377, 50.26982], [36.91762, 50.34963], [37.08468, 50.34935], [37.48204, 50.46079], [37.47243, 50.36277], [37.62486, 50.29966], [37.62879, 50.24481], [37.61113, 50.21976], [37.75807, 50.07896], [37.79515, 50.08425], [37.90776, 50.04194], [38.02999, 49.94482], [38.02999, 49.90592], [38.21675, 49.98104], [38.18517, 50.08161], [38.32524, 50.08866], [38.35408, 50.00664], [38.65688, 49.97176], [38.68677, 50.00904], [38.73311, 49.90238], [38.90477, 49.86787], [38.9391, 49.79524], [39.1808, 49.88911], [39.27968, 49.75976], [39.44496, 49.76067], [39.59142, 49.73758], [39.65047, 49.61761], [39.84548, 49.56064], [40.13249, 49.61672], [40.16683, 49.56865], [40.03636, 49.52321], [40.03087, 49.45452], [40.1141, 49.38798], [40.14912, 49.37681], [40.18331, 49.34996], [40.22176, 49.25683], [40.01988, 49.1761], [39.93437, 49.05709], [39.6836, 49.05121], [39.6683, 48.99454], [39.71353, 48.98959], [39.72649, 48.9754], [39.74874, 48.98675], [39.78368, 48.91596], [39.98967, 48.86901], [40.03636, 48.91957], [40.08168, 48.87443], [39.97182, 48.79398], [39.79466, 48.83739], [39.73104, 48.7325], [39.71765, 48.68673], [39.67226, 48.59368], [39.79764, 48.58668], [39.84548, 48.57821], [39.86196, 48.46633], [39.88794, 48.44226], [39.94847, 48.35055], [39.84136, 48.33321], [39.84273, 48.30947], [39.90041, 48.3049], [39.91465, 48.26743], [39.95248, 48.29972], [39.9693, 48.29904], [39.97325, 48.31399], [39.99241, 48.31768], [40.00752, 48.22445], [39.94847, 48.22811], [39.83724, 48.06501], [39.88256, 48.04482], [39.77544, 48.04206], [39.82213, 47.96396], [39.73935, 47.82876], [38.87979, 47.87719], [38.79628, 47.81109], [38.76379, 47.69346], [38.35062, 47.61631], [38.28679, 47.53552], [38.28954, 47.39255], [38.22225, 47.30788], [38.33074, 47.30508], [38.32112, 47.2585], [38.23049, 47.2324], [38.22955, 47.12069], [38.3384, 46.98085], [38.12112, 46.86078], [37.62608, 46.82615], [35.23066, 45.79231], [35.04991, 45.76827], [36.6645, 45.4514], [36.6545, 45.3417], [36.5049, 45.3136], [36.475, 45.2411], [36.4883, 45.0488], [33.59378, 44.0332], [39.81147, 43.06294], [40.0078, 43.38551], [40.00853, 43.40578], [40.01552, 43.42025], [40.01007, 43.42411], [40.03312, 43.44262], [40.04445, 43.47776], [40.10657, 43.57344], [40.65957, 43.56212], [41.64935, 43.22331], [42.40563, 43.23226], [42.66667, 43.13917], [42.75889, 43.19651], [43.03322, 43.08883], [43.0419, 43.02413], [43.81453, 42.74297], [43.73119, 42.62043], [43.95517, 42.55396], [44.54202, 42.75699], [44.70002, 42.74679], [44.80941, 42.61277], [44.88754, 42.74934], [45.15318, 42.70598], [45.36501, 42.55268], [45.78692, 42.48358], [45.61676, 42.20768], [46.42738, 41.91323], [46.5332, 41.87389], [46.58924, 41.80547], [46.75269, 41.8623], [46.8134, 41.76252], [47.00955, 41.63583], [46.99554, 41.59743], [47.03757, 41.55434], [47.10762, 41.59044], [47.34579, 41.27884], [47.49004, 41.26366], [47.54504, 41.20275], [47.62288, 41.22969], [47.75831, 41.19455], [47.87973, 41.21798], [48.07587, 41.49957], [48.22064, 41.51472], [48.2878, 41.56221], [48.40277, 41.60441], [48.42301, 41.65444], [48.55078, 41.77917], [48.5867, 41.84306], [48.80971, 41.95365], [49.2134, 44.84989], [49.88945, 46.04554], [49.32259, 46.26944], [49.16518, 46.38542], [48.54988, 46.56267], [48.51142, 46.69268], [49.01136, 46.72716], [48.52326, 47.4102], [48.45173, 47.40818], [48.15348, 47.74545], [47.64973, 47.76559], [47.41689, 47.83687], [47.38731, 47.68176], [47.12107, 47.83687], [47.11516, 48.27188], [46.49011, 48.43019], [46.78392, 48.95352], [47.00857, 49.04921], [47.04658, 49.19834], [46.78398, 49.34026], [46.9078, 49.86707], [47.18319, 49.93721], [47.34589, 50.09308], [47.30448, 50.30894], [47.58551, 50.47867], [48.10044, 50.09242], [48.24519, 49.86099], [48.42564, 49.82283], [48.68352, 49.89546], [48.90782, 50.02281], [48.57946, 50.63278], [48.86936, 50.61589], [49.12673, 50.78639], [49.41959, 50.85927], [49.39001, 51.09396], [49.76866, 51.11067], [49.97277, 51.2405], [50.26859, 51.28677], [50.59695, 51.61859], [51.26254, 51.68466], [51.301, 51.48799], [51.77431, 51.49536], [51.8246, 51.67916], [52.36119, 51.74161], [52.54329, 51.48444], [53.46165, 51.49445], [53.69299, 51.23466], [54.12248, 51.11542], [54.46331, 50.85554], [54.41894, 50.61214], [54.55797, 50.52006], [54.71476, 50.61214], [54.56685, 51.01958], [54.72067, 51.03261], [55.67774, 50.54508], [56.11398, 50.7471], [56.17906, 50.93204], [57.17302, 51.11253], [57.44221, 50.88354], [57.74986, 50.93017], [57.75578, 51.13852], [58.3208, 51.15151], [58.87974, 50.70852], [59.48928, 50.64216], [59.51886, 50.49937], [59.81172, 50.54451], [60.01288, 50.8163], [60.17262, 50.83312], [60.31914, 50.67705], [60.81833, 50.6629], [61.4431, 50.80679], [61.56889, 51.23679], [61.6813, 51.25716], [61.55114, 51.32746], [61.50677, 51.40687], [60.95655, 51.48615], [60.92401, 51.61124], [60.5424, 51.61675], [60.36787, 51.66815], [60.50986, 51.7964], [60.09867, 51.87135], [59.99809, 51.98263], [59.91279, 52.06924], [60.17253, 52.25814], [60.17516, 52.39457], [59.25033, 52.46803], [59.22409, 52.28437], [58.79644, 52.43392], [58.94336, 53.953], [59.70487, 54.14846], [59.95217, 54.85853], [57.95234, 54.39672], [57.14829, 54.84204], [57.25137, 55.26262], [58.81825, 55.03378], [59.49035, 55.60486], [59.28419, 56.15739], [57.51527, 56.08729], [57.28024, 56.87898], [58.07604, 57.08308], [58.13789, 57.68097], [58.81412, 57.71602], [58.71104, 58.07475], [59.40376, 58.45822], [59.15636, 59.14682], [58.3853, 59.487], [59.50685, 60.91162], [59.36223, 61.3882], [59.61398, 62.44915], [59.24834, 63.01859], [59.80579, 64.13948], [59.63945, 64.78384], [60.74386, 64.95767], [61.98014, 65.72191], [66.1708, 67.61252], [64.18965, 69.94255], [76.13964, 83.37843], [36.85549, 84.09565], [32.07813, 72.01005], [31.59909, 70.16571], [30.84095, 69.80584], [30.95011, 69.54699], [30.52662, 69.54699], [30.16363, 69.65244], [29.97205, 69.41623], [29.27631, 69.2811], [29.26623, 69.13794], [29.0444, 69.0119], [28.91738, 69.04774], [28.45957, 68.91417], [28.78224, 68.86696], [28.43941, 68.53366], [28.62982, 68.19816], [29.34179, 68.06655], [29.66955, 67.79872], [30.02041, 67.67523], [29.91155, 67.51507], [28.9839, 66.94139], [29.91155, 66.13863], [30.16363, 65.66935], [29.97205, 65.70256], [29.74013, 65.64025], [29.84096, 65.56945], [29.68972, 65.31803], [29.61914, 65.23791], [29.8813, 65.22101], [29.84096, 65.1109], [29.61914, 65.05993], [29.68972, 64.80789], [30.05271, 64.79072], [30.12329, 64.64862], [30.01238, 64.57513], [30.06279, 64.35782], [30.4762, 64.25728], [30.55687, 64.09036], [30.25437, 63.83364], [29.98213, 63.75795], [30.49637, 63.46666], [31.23244, 63.22239], [31.29294, 63.09035], [31.58535, 62.91642], [31.38369, 62.66284], [31.10136, 62.43042], [29.01829, 61.17448], [28.82816, 61.1233], [28.47974, 60.93365], [27.77352, 60.52722], [27.71177, 60.3893], [27.44953, 60.22766], [26.32936, 60.00121]]]] } },
34024 { type: "Feature", properties: { wikidata: "Q1083368", nameEn: "Mainland Finland", country: "FI", groups: ["EU", "154", "150", "UN"], callingCodes: ["358"] }, geometry: { type: "MultiPolygon", coordinates: [[[[29.12697, 69.69193], [28.36883, 69.81658], [28.32849, 69.88605], [27.97558, 69.99671], [27.95542, 70.0965], [27.57226, 70.06215], [27.05802, 69.92069], [26.64461, 69.96565], [26.40261, 69.91377], [25.96904, 69.68397], [25.69679, 69.27039], [25.75729, 68.99383], [25.61613, 68.89602], [25.42455, 68.90328], [25.12206, 68.78684], [25.10189, 68.63307], [24.93048, 68.61102], [24.90023, 68.55579], [24.74898, 68.65143], [24.18432, 68.73936], [24.02299, 68.81601], [23.781, 68.84514], [23.68017, 68.70276], [23.13064, 68.64684], [22.53321, 68.74393], [22.38367, 68.71561], [22.27276, 68.89514], [21.63833, 69.27485], [21.27827, 69.31281], [21.00732, 69.22755], [20.98641, 69.18809], [21.11099, 69.10291], [21.05775, 69.0356], [20.72171, 69.11874], [20.55258, 69.06069], [20.78802, 69.03087], [20.91658, 68.96764], [20.85104, 68.93142], [20.90649, 68.89696], [21.03001, 68.88969], [22.00429, 68.50692], [22.73028, 68.40881], [23.10336, 68.26551], [23.15377, 68.14759], [23.26469, 68.15134], [23.40081, 68.05545], [23.65793, 67.9497], [23.45627, 67.85297], [23.54701, 67.59306], [23.39577, 67.46974], [23.75372, 67.43688], [23.75372, 67.29914], [23.54701, 67.25435], [23.58735, 67.20752], [23.56214, 67.17038], [23.98563, 66.84149], [23.98059, 66.79585], [23.89488, 66.772], [23.85959, 66.56434], [23.63776, 66.43568], [23.67591, 66.3862], [23.64982, 66.30603], [23.71339, 66.21299], [23.90497, 66.15802], [24.15791, 65.85385], [24.14798, 65.83466], [24.15107, 65.81427], [24.14112, 65.39731], [20.15877, 63.06556], [19.23413, 60.61414], [20.96741, 60.71528], [21.15143, 60.54555], [21.08159, 60.20167], [21.02509, 60.12142], [21.35468, 59.67511], [20.5104, 59.15546], [26.32936, 60.00121], [27.44953, 60.22766], [27.71177, 60.3893], [27.77352, 60.52722], [28.47974, 60.93365], [28.82816, 61.1233], [29.01829, 61.17448], [31.10136, 62.43042], [31.38369, 62.66284], [31.58535, 62.91642], [31.29294, 63.09035], [31.23244, 63.22239], [30.49637, 63.46666], [29.98213, 63.75795], [30.25437, 63.83364], [30.55687, 64.09036], [30.4762, 64.25728], [30.06279, 64.35782], [30.01238, 64.57513], [30.12329, 64.64862], [30.05271, 64.79072], [29.68972, 64.80789], [29.61914, 65.05993], [29.84096, 65.1109], [29.8813, 65.22101], [29.61914, 65.23791], [29.68972, 65.31803], [29.84096, 65.56945], [29.74013, 65.64025], [29.97205, 65.70256], [30.16363, 65.66935], [29.91155, 66.13863], [28.9839, 66.94139], [29.91155, 67.51507], [30.02041, 67.67523], [29.66955, 67.79872], [29.34179, 68.06655], [28.62982, 68.19816], [28.43941, 68.53366], [28.78224, 68.86696], [28.45957, 68.91417], [28.91738, 69.04774], [28.81248, 69.11997], [28.8629, 69.22395], [29.31664, 69.47994], [29.12697, 69.69193]]]] } },
34025 { type: "Feature", properties: { wikidata: "Q1184963", nameEn: "Alhucemas Islands", country: "ES", groups: ["EU", "Q191011", "015", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[-3.90602, 35.21494], [-3.88372, 35.20767], [-3.89343, 35.22728], [-3.90602, 35.21494]]]] } },
34026 { type: "Feature", properties: { wikidata: "Q1298289", nameEn: "Egmont Islands", country: "GB", groups: ["IO", "BOTS", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[70.1848, -6.37445], [70.67958, -8.2663], [72.17991, -6.68509], [70.1848, -6.37445]]]] } },
34027 { type: "Feature", properties: { wikidata: "Q1352230", nameEn: "US Territories", country: "US", level: "subcountryGroup" }, geometry: null },
34028 { type: "Feature", properties: { wikidata: "Q1451600", nameEn: "Overseas Countries and Territories of the EU", aliases: ["OCT"], level: "subunion" }, geometry: null },
34029 { type: "Feature", properties: { wikidata: "Q1544253", nameEn: "Great Chagos Bank", country: "GB", groups: ["IO", "BOTS", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[70.1848, -6.37445], [72.17991, -6.68509], [73.20573, -5.20727], [70.1848, -6.37445]]]] } },
34030 { type: "Feature", properties: { wikidata: "Q1585511", nameEn: "Salomon Atoll", country: "GB", groups: ["IO", "BOTS", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[72.09518, -5.61768], [73.20573, -5.20727], [72.12587, -4.02588], [72.09518, -5.61768]]]] } },
34031 { type: "Feature", properties: { wikidata: "Q1681727", nameEn: "Saint-Paul and Amsterdam", country: "FR", groups: ["EU", "TF", "Q1451600", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[76.31747, -42.16264], [80.15867, -36.04977], [71.22311, -38.75287], [76.31747, -42.16264]]]] } },
34032 { type: "Feature", properties: { wikidata: "Q1901211", nameEn: "East Malaysia", country: "MY", groups: ["Q36117", "035", "142", "UN"], driveSide: "left", callingCodes: ["60"] }, geometry: { type: "MultiPolygon", coordinates: [[[[110.90339, 7.52694], [109.82788, 2.86812], [109.62558, 1.99182], [109.53794, 1.91771], [109.57923, 1.80624], [109.66397, 1.79972], [109.66397, 1.60425], [110.35354, 0.98869], [110.49182, 0.88088], [110.62374, 0.873], [111.22979, 1.08326], [111.55434, 0.97864], [111.82846, 0.99349], [111.94553, 1.12016], [112.15679, 1.17004], [112.2127, 1.44135], [112.48648, 1.56516], [113.021, 1.57819], [113.01448, 1.42832], [113.64677, 1.23933], [114.03788, 1.44787], [114.57892, 1.5], [114.80706, 1.92351], [114.80706, 2.21665], [115.1721, 2.49671], [115.11343, 2.82879], [115.53713, 3.14776], [115.58276, 3.93499], [115.90217, 4.37708], [117.25801, 4.35108], [117.47313, 4.18857], [117.67641, 4.16535], [118.06469, 4.16638], [118.93936, 4.09009], [118.99941, 4.76678], [119.52945, 5.35672], [118.33378, 5.99991], [117.96674, 6.28383], [117.93857, 6.89845], [117.17735, 7.52841], [116.79524, 7.43869], [115.02521, 5.35005], [115.16236, 5.01011], [115.15092, 4.87604], [115.20737, 4.8256], [115.27819, 4.63661], [115.2851, 4.42295], [115.36346, 4.33563], [115.31275, 4.30806], [115.09978, 4.39123], [115.07737, 4.53418], [115.04064, 4.63706], [115.02278, 4.74137], [115.02955, 4.82087], [115.05038, 4.90275], [114.99417, 4.88201], [114.96982, 4.81146], [114.88841, 4.81905], [114.8266, 4.75062], [114.77303, 4.72871], [114.83189, 4.42387], [114.88039, 4.4257], [114.78539, 4.12205], [114.64211, 4.00694], [114.49922, 4.13108], [114.4416, 4.27588], [114.32176, 4.2552], [114.32176, 4.34942], [114.26876, 4.49878], [114.15813, 4.57], [114.07448, 4.58441], [114.10166, 4.76112], [110.90339, 7.52694]]]] } },
34033 { type: "Feature", properties: { wikidata: "Q1973345", nameEn: "Peninsular Malaysia", country: "MY", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["60"] }, geometry: { type: "MultiPolygon", coordinates: [[[[102.46318, 7.22462], [102.09086, 6.23546], [102.08127, 6.22679], [102.07732, 6.193], [102.09182, 6.14161], [102.01835, 6.05407], [101.99209, 6.04075], [101.97114, 6.01992], [101.9714, 6.00575], [101.94712, 5.98421], [101.92819, 5.85511], [101.91776, 5.84269], [101.89188, 5.8386], [101.80144, 5.74505], [101.75074, 5.79091], [101.69773, 5.75881], [101.58019, 5.93534], [101.25524, 5.78633], [101.25755, 5.71065], [101.14062, 5.61613], [100.98815, 5.79464], [101.02708, 5.91013], [101.087, 5.9193], [101.12388, 6.11411], [101.06165, 6.14161], [101.12618, 6.19431], [101.10313, 6.25617], [100.85884, 6.24929], [100.81045, 6.45086], [100.74822, 6.46231], [100.74361, 6.50811], [100.66986, 6.45086], [100.43027, 6.52389], [100.42351, 6.51762], [100.41791, 6.5189], [100.41152, 6.52299], [100.35413, 6.54932], [100.31929, 6.65413], [100.32607, 6.65933], [100.32671, 6.66526], [100.31884, 6.66423], [100.31618, 6.66781], [100.30828, 6.66462], [100.29651, 6.68439], [100.19511, 6.72559], [100.12, 6.42105], [100.0756, 6.4045], [99.91873, 6.50233], [99.50117, 6.44501], [99.31854, 5.99868], [99.75778, 3.86466], [103.03657, 1.30383], [103.56591, 1.19719], [103.62738, 1.35255], [103.67468, 1.43166], [103.7219, 1.46108], [103.74161, 1.4502], [103.76395, 1.45183], [103.81181, 1.47953], [103.86383, 1.46288], [103.89565, 1.42841], [103.93384, 1.42926], [104.00131, 1.42405], [104.02277, 1.4438], [104.04622, 1.44691], [104.07348, 1.43322], [104.08871, 1.42015], [104.09162, 1.39694], [104.08072, 1.35998], [104.12282, 1.27714], [104.34728, 1.33529], [104.56723, 1.44271], [105.01437, 3.24936], [102.46318, 7.22462]]]] } },
34034 { type: "Feature", properties: { wikidata: "Q2093907", nameEn: "Three Kings Islands", country: "NZ", groups: ["Q851132", "053", "009", "UN"], driveSide: "left" }, geometry: { type: "MultiPolygon", coordinates: [[[[174.17679, -32.62487], [170.93268, -32.97889], [171.97383, -34.64644], [174.17679, -32.62487]]]] } },
34035 { type: "Feature", properties: { wikidata: "Q2298216", nameEn: "Solander Islands", country: "NZ", groups: ["Q851132", "053", "009", "UN"], driveSide: "left" }, geometry: { type: "MultiPolygon", coordinates: [[[[167.39068, -46.49187], [166.5534, -46.39484], [166.84561, -46.84889], [167.39068, -46.49187]]]] } },
34036 { type: "Feature", properties: { wikidata: "Q2872203", nameEn: "Mainland Australia", country: "AU", groups: ["053", "009", "UN"], level: "subcountryGroup", driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[88.16419, -23.49578], [123.64533, -39.13605], [159.74028, -39.1978], [159.76765, -29.76946], [154.02855, -24.43238], [152.93188, -20.92631], [147.69992, -17.5933], [145.2855, -9.62524], [143.87386, -9.02382], [143.29772, -9.33993], [142.48658, -9.36754], [142.19246, -9.15378], [141.88934, -9.36111], [141.01842, -9.35091], [135.49042, -9.2276], [127.55165, -9.05052], [125.29076, -12.33139], [88.16419, -23.49578]]]] } },
34037 { type: "Feature", properties: { wikidata: "Q2914565", nameEn: "Autonomous Regions of Portugal", country: "PT", level: "subcountryGroup" }, geometry: null },
34038 { type: "Feature", properties: { wikidata: "Q2915956", nameEn: "Mainland Portugal", country: "PT", groups: ["Q12837", "EU", "039", "150", "UN"], level: "subcountryGroup", callingCodes: ["351"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-10.39881, 36.12218], [-7.37282, 36.96896], [-7.39769, 37.16868], [-7.41133, 37.20314], [-7.41854, 37.23813], [-7.43227, 37.25152], [-7.43974, 37.38913], [-7.46878, 37.47127], [-7.51759, 37.56119], [-7.41981, 37.75729], [-7.33441, 37.81193], [-7.27314, 37.90145], [-7.24544, 37.98884], [-7.12648, 38.00296], [-7.10366, 38.04404], [-7.05966, 38.01966], [-7.00375, 38.01914], [-6.93418, 38.21454], [-7.09389, 38.17227], [-7.15581, 38.27597], [-7.32529, 38.44336], [-7.265, 38.61674], [-7.26174, 38.72107], [-7.03848, 38.87221], [-7.051, 38.907], [-6.95211, 39.0243], [-6.97004, 39.07619], [-7.04011, 39.11919], [-7.10692, 39.10275], [-7.14929, 39.11287], [-7.12811, 39.17101], [-7.23566, 39.20132], [-7.23403, 39.27579], [-7.3149, 39.34857], [-7.2927, 39.45847], [-7.49477, 39.58794], [-7.54121, 39.66717], [-7.33507, 39.64569], [-7.24707, 39.66576], [-7.01613, 39.66877], [-6.97492, 39.81488], [-6.91463, 39.86618], [-6.86737, 40.01986], [-6.94233, 40.10716], [-7.00589, 40.12087], [-7.02544, 40.18564], [-7.00426, 40.23169], [-6.86085, 40.26776], [-6.86085, 40.2976], [-6.80218, 40.33239], [-6.78426, 40.36468], [-6.84618, 40.42177], [-6.84944, 40.46394], [-6.7973, 40.51723], [-6.80218, 40.55067], [-6.84292, 40.56801], [-6.79567, 40.65955], [-6.82826, 40.74603], [-6.82337, 40.84472], [-6.79892, 40.84842], [-6.80707, 40.88047], [-6.84292, 40.89771], [-6.8527, 40.93958], [-6.9357, 41.02888], [-6.913, 41.03922], [-6.88843, 41.03027], [-6.84781, 41.02692], [-6.80942, 41.03629], [-6.79241, 41.05397], [-6.75655, 41.10187], [-6.77319, 41.13049], [-6.69711, 41.1858], [-6.68286, 41.21641], [-6.65046, 41.24725], [-6.55937, 41.24417], [-6.38551, 41.35274], [-6.38553, 41.38655], [-6.3306, 41.37677], [-6.26777, 41.48796], [-6.19128, 41.57638], [-6.29863, 41.66432], [-6.44204, 41.68258], [-6.49907, 41.65823], [-6.54633, 41.68623], [-6.56426, 41.74219], [-6.51374, 41.8758], [-6.56752, 41.88429], [-6.5447, 41.94371], [-6.58544, 41.96674], [-6.61967, 41.94008], [-6.75004, 41.94129], [-6.76959, 41.98734], [-6.81196, 41.99097], [-6.82174, 41.94493], [-6.94396, 41.94403], [-6.95537, 41.96553], [-6.98144, 41.9728], [-7.01078, 41.94977], [-7.07596, 41.94977], [-7.08574, 41.97401], [-7.14115, 41.98855], [-7.18549, 41.97515], [-7.18677, 41.88793], [-7.32366, 41.8406], [-7.37092, 41.85031], [-7.42864, 41.80589], [-7.42854, 41.83262], [-7.44759, 41.84451], [-7.45566, 41.86488], [-7.49803, 41.87095], [-7.52737, 41.83939], [-7.62188, 41.83089], [-7.58603, 41.87944], [-7.65774, 41.88308], [-7.69848, 41.90977], [-7.84188, 41.88065], [-7.88055, 41.84571], [-7.88751, 41.92553], [-7.90707, 41.92432], [-7.92336, 41.8758], [-7.9804, 41.87337], [-8.01136, 41.83453], [-8.0961, 41.81024], [-8.16455, 41.81753], [-8.16944, 41.87944], [-8.19551, 41.87459], [-8.2185, 41.91237], [-8.16232, 41.9828], [-8.08796, 42.01398], [-8.08847, 42.05767], [-8.11729, 42.08537], [-8.18178, 42.06436], [-8.19406, 42.12141], [-8.18947, 42.13853], [-8.1986, 42.15402], [-8.22406, 42.1328], [-8.24681, 42.13993], [-8.2732, 42.12396], [-8.29809, 42.106], [-8.32161, 42.10218], [-8.33912, 42.08358], [-8.36353, 42.09065], [-8.38323, 42.07683], [-8.40143, 42.08052], [-8.42512, 42.07199], [-8.44123, 42.08218], [-8.48185, 42.0811], [-8.52837, 42.07658], [-8.5252, 42.06264], [-8.54563, 42.0537], [-8.58086, 42.05147], [-8.59493, 42.05708], [-8.63791, 42.04691], [-8.64626, 42.03668], [-8.65832, 42.02972], [-8.6681, 41.99703], [-8.69071, 41.98862], [-8.7478, 41.96282], [-8.74606, 41.9469], [-8.75712, 41.92833], [-8.81794, 41.90375], [-8.87157, 41.86488], [-11.19304, 41.83075], [-10.39881, 36.12218]]]] } },
34039 { type: "Feature", properties: { wikidata: "Q3311985", nameEn: "Guernsey", country: "GB", groups: ["GG", "830", "Q185086", "154", "150", "UN"], level: "subterritory", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44 01481"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.49556, 49.79012], [-3.28154, 49.57329], [-2.65349, 49.15373], [-2.36485, 49.48223], [-2.49556, 49.79012]]]] } },
34040 { type: "Feature", properties: { wikidata: "Q3320166", nameEn: "Outermost Regions of the EU", aliases: ["OMR"], level: "subunion" }, geometry: null },
34041 { type: "Feature", properties: { wikidata: "Q3336843", nameEn: "Countries of the United Kingdom", aliases: ["GB-UKM"], country: "GB", level: "subcountryGroup" }, geometry: null },
34042 { type: "Feature", properties: { wikidata: "Q6736667", nameEn: "Mainland India", country: "IN", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["91"] }, geometry: { type: "MultiPolygon", coordinates: [[[[89.08044, 21.41871], [89.07114, 22.15335], [88.9367, 22.58527], [88.94614, 22.66941], [88.9151, 22.75228], [88.96713, 22.83346], [88.87063, 22.95235], [88.88327, 23.03885], [88.86377, 23.08759], [88.99148, 23.21134], [88.71133, 23.2492], [88.79254, 23.46028], [88.79351, 23.50535], [88.74841, 23.47361], [88.56507, 23.64044], [88.58087, 23.87105], [88.66189, 23.87607], [88.73743, 23.91751], [88.6976, 24.14703], [88.74841, 24.1959], [88.68801, 24.31464], [88.50934, 24.32474], [88.12296, 24.51301], [88.08786, 24.63232], [88.00683, 24.66477], [88.15515, 24.85806], [88.14004, 24.93529], [88.21832, 24.96642], [88.27325, 24.88796], [88.33917, 24.86803], [88.46277, 25.07468], [88.44766, 25.20149], [88.94067, 25.18534], [89.00463, 25.26583], [89.01105, 25.30303], [88.85278, 25.34679], [88.81296, 25.51546], [88.677, 25.46959], [88.4559, 25.59227], [88.45103, 25.66245], [88.242, 25.80811], [88.13138, 25.78773], [88.08804, 25.91334], [88.16581, 26.0238], [88.1844, 26.14417], [88.34757, 26.22216], [88.35153, 26.29123], [88.51649, 26.35923], [88.48749, 26.45855], [88.36938, 26.48683], [88.35153, 26.45241], [88.33093, 26.48929], [88.41196, 26.63837], [88.4298, 26.54489], [88.62144, 26.46783], [88.69485, 26.38353], [88.67837, 26.26291], [88.78961, 26.31093], [88.85004, 26.23211], [89.05328, 26.2469], [88.91321, 26.37984], [88.92357, 26.40711], [88.95612, 26.4564], [89.08899, 26.38845], [89.15869, 26.13708], [89.35953, 26.0077], [89.53515, 26.00382], [89.57101, 25.9682], [89.63968, 26.22595], [89.70201, 26.15138], [89.73581, 26.15818], [89.77865, 26.08387], [89.77728, 26.04254], [89.86592, 25.93115], [89.80585, 25.82489], [89.84388, 25.70042], [89.86129, 25.61714], [89.81208, 25.37244], [89.84086, 25.31854], [89.83371, 25.29548], [89.87629, 25.28337], [89.90478, 25.31038], [90.1155, 25.22686], [90.40034, 25.1534], [90.65042, 25.17788], [90.87427, 25.15799], [91.25517, 25.20677], [91.63648, 25.12846], [92.0316, 25.1834], [92.33957, 25.07593], [92.39147, 25.01471], [92.49887, 24.88796], [92.38626, 24.86055], [92.25854, 24.9191], [92.15796, 24.54435], [92.11662, 24.38997], [91.96603, 24.3799], [91.89258, 24.14674], [91.82596, 24.22345], [91.76004, 24.23848], [91.73257, 24.14703], [91.65292, 24.22095], [91.63782, 24.1132], [91.55542, 24.08687], [91.37414, 24.10693], [91.35741, 23.99072], [91.29587, 24.0041], [91.22308, 23.89616], [91.25192, 23.83463], [91.15579, 23.6599], [91.28293, 23.37538], [91.36453, 23.06612], [91.40848, 23.07117], [91.4035, 23.27522], [91.46615, 23.2328], [91.54993, 23.01051], [91.61571, 22.93929], [91.7324, 23.00043], [91.81634, 23.08001], [91.76417, 23.26619], [91.84789, 23.42235], [91.95642, 23.47361], [91.95093, 23.73284], [92.04706, 23.64229], [92.15417, 23.73409], [92.26541, 23.70392], [92.38214, 23.28705], [92.37665, 22.9435], [92.5181, 22.71441], [92.60029, 22.1522], [92.56616, 22.13554], [92.60949, 21.97638], [92.67532, 22.03547], [92.70416, 22.16017], [92.86208, 22.05456], [92.89504, 21.95143], [92.93899, 22.02656], [92.99804, 21.98964], [92.99255, 22.05965], [93.04885, 22.20595], [93.15734, 22.18687], [93.14224, 22.24535], [93.19991, 22.25425], [93.18206, 22.43716], [93.13537, 22.45873], [93.11477, 22.54374], [93.134, 22.59573], [93.09417, 22.69459], [93.134, 22.92498], [93.12988, 23.05772], [93.2878, 23.00464], [93.38478, 23.13698], [93.36862, 23.35426], [93.38781, 23.36139], [93.39981, 23.38828], [93.38805, 23.4728], [93.43475, 23.68299], [93.3908, 23.7622], [93.3908, 23.92925], [93.36059, 23.93176], [93.32351, 24.04468], [93.34735, 24.10151], [93.41415, 24.07854], [93.46633, 23.97067], [93.50616, 23.94432], [93.62871, 24.00922], [93.75952, 24.0003], [93.80279, 23.92549], [93.92089, 23.95812], [94.14081, 23.83333], [94.30215, 24.23752], [94.32362, 24.27692], [94.45279, 24.56656], [94.50729, 24.59281], [94.5526, 24.70764], [94.60204, 24.70889], [94.73937, 25.00545], [94.74212, 25.13606], [94.57458, 25.20318], [94.68032, 25.47003], [94.80117, 25.49359], [95.18556, 26.07338], [95.11428, 26.1019], [95.12801, 26.38397], [95.05798, 26.45408], [95.23513, 26.68499], [95.30339, 26.65372], [95.437, 26.7083], [95.81603, 27.01335], [95.93002, 27.04149], [96.04949, 27.19428], [96.15591, 27.24572], [96.40779, 27.29818], [96.55761, 27.29928], [96.73888, 27.36638], [96.88445, 27.25046], [96.85287, 27.2065], [96.89132, 27.17474], [97.14675, 27.09041], [97.17422, 27.14052], [96.91431, 27.45752], [96.90112, 27.62149], [97.29919, 27.92233], [97.35824, 27.87256], [97.38845, 28.01329], [97.35412, 28.06663], [97.31292, 28.06784], [97.34547, 28.21385], [97.1289, 28.3619], [96.98882, 28.32564], [96.88445, 28.39452], [96.85561, 28.4875], [96.6455, 28.61657], [96.48895, 28.42955], [96.40929, 28.51526], [96.61391, 28.72742], [96.3626, 29.10607], [96.20467, 29.02325], [96.18682, 29.11087], [96.31316, 29.18643], [96.05361, 29.38167], [95.84899, 29.31464], [95.75149, 29.32063], [95.72086, 29.20797], [95.50842, 29.13487], [95.41091, 29.13007], [95.3038, 29.13847], [95.26122, 29.07727], [95.2214, 29.10727], [95.11291, 29.09527], [95.0978, 29.14446], [94.81353, 29.17804], [94.69318, 29.31739], [94.2752, 29.11687], [94.35897, 29.01965], [93.72797, 28.68821], [93.44621, 28.67189], [93.18069, 28.50319], [93.14635, 28.37035], [92.93075, 28.25671], [92.67486, 28.15018], [92.65472, 28.07632], [92.73025, 28.05814], [92.7275, 27.98662], [92.42538, 27.80092], [92.32101, 27.79363], [92.27432, 27.89077], [91.87057, 27.7195], [91.84722, 27.76325], [91.6469, 27.76358], [91.55819, 27.6144], [91.65007, 27.48287], [92.01132, 27.47352], [92.12019, 27.27829], [92.04702, 27.26861], [92.03457, 27.07334], [92.11863, 26.893], [92.05523, 26.8692], [91.83181, 26.87318], [91.50067, 26.79223], [90.67715, 26.77215], [90.48504, 26.8594], [90.39271, 26.90704], [90.30402, 26.85098], [90.04535, 26.72422], [89.86124, 26.73307], [89.63369, 26.74402], [89.42349, 26.83727], [89.3901, 26.84225], [89.38319, 26.85963], [89.37913, 26.86224], [89.1926, 26.81329], [89.12825, 26.81661], [89.09554, 26.89089], [88.95807, 26.92668], [88.92301, 26.99286], [88.8714, 26.97488], [88.86984, 27.10937], [88.74219, 27.144], [88.91901, 27.32483], [88.82981, 27.38814], [88.77517, 27.45415], [88.88091, 27.85192], [88.83559, 28.01936], [88.63235, 28.12356], [88.54858, 28.06057], [88.25332, 27.9478], [88.1278, 27.95417], [88.13378, 27.88015], [88.1973, 27.85067], [88.19107, 27.79285], [88.04008, 27.49223], [88.07277, 27.43007], [88.01646, 27.21612], [88.01587, 27.21388], [87.9887, 27.11045], [88.11719, 26.98758], [88.13422, 26.98705], [88.12302, 26.95324], [88.19107, 26.75516], [88.1659, 26.68177], [88.16452, 26.64111], [88.09963, 26.54195], [88.09414, 26.43732], [88.00895, 26.36029], [87.90115, 26.44923], [87.89085, 26.48565], [87.84193, 26.43663], [87.7918, 26.46737], [87.76004, 26.40711], [87.67893, 26.43501], [87.66803, 26.40294], [87.59175, 26.38342], [87.55274, 26.40596], [87.51571, 26.43106], [87.46566, 26.44058], [87.37314, 26.40815], [87.34568, 26.34787], [87.26568, 26.37294], [87.26587, 26.40592], [87.24682, 26.4143], [87.18863, 26.40558], [87.14751, 26.40542], [87.09147, 26.45039], [87.0707, 26.58571], [87.04691, 26.58685], [87.01559, 26.53228], [86.95912, 26.52076], [86.94543, 26.52076], [86.82898, 26.43919], [86.76797, 26.45892], [86.74025, 26.42386], [86.69124, 26.45169], [86.62686, 26.46891], [86.61313, 26.48658], [86.57073, 26.49825], [86.54258, 26.53819], [86.49726, 26.54218], [86.31564, 26.61925], [86.26235, 26.61886], [86.22513, 26.58863], [86.13596, 26.60651], [86.02729, 26.66756], [85.8492, 26.56667], [85.85126, 26.60866], [85.83126, 26.61134], [85.76907, 26.63076], [85.72315, 26.67471], [85.73483, 26.79613], [85.66239, 26.84822], [85.61621, 26.86721], [85.59461, 26.85161], [85.5757, 26.85955], [85.56471, 26.84133], [85.47752, 26.79292], [85.34302, 26.74954], [85.21159, 26.75933], [85.18046, 26.80519], [85.19291, 26.86909], [85.15883, 26.86966], [85.02635, 26.85381], [85.05592, 26.88991], [85.00536, 26.89523], [84.97186, 26.9149], [84.96687, 26.95599], [84.85754, 26.98984], [84.82913, 27.01989], [84.793, 26.9968], [84.64496, 27.04669], [84.69166, 27.21294], [84.62161, 27.33885], [84.29315, 27.39], [84.25735, 27.44941], [84.21376, 27.45218], [84.10791, 27.52399], [84.02229, 27.43836], [83.93306, 27.44939], [83.86182, 27.4241], [83.85595, 27.35797], [83.61288, 27.47013], [83.39495, 27.4798], [83.38872, 27.39276], [83.35136, 27.33885], [83.29999, 27.32778], [83.2673, 27.36235], [83.27197, 27.38309], [83.19413, 27.45632], [82.94938, 27.46036], [82.93261, 27.50328], [82.74119, 27.49838], [82.70378, 27.72122], [82.46405, 27.6716], [82.06554, 27.92222], [81.97214, 27.93322], [81.91223, 27.84995], [81.47867, 28.08303], [81.48179, 28.12148], [81.38683, 28.17638], [81.32923, 28.13521], [81.19847, 28.36284], [81.03471, 28.40054], [80.55142, 28.69182], [80.50575, 28.6706], [80.52443, 28.54897], [80.44504, 28.63098], [80.37188, 28.63371], [80.12125, 28.82346], [80.06957, 28.82763], [80.05743, 28.91479], [80.18085, 29.13649], [80.23178, 29.11626], [80.26602, 29.13938], [80.24112, 29.21414], [80.28626, 29.20327], [80.31428, 29.30784], [80.24322, 29.44299], [80.37939, 29.57098], [80.41858, 29.63581], [80.38428, 29.68513], [80.36803, 29.73865], [80.41554, 29.79451], [80.43458, 29.80466], [80.48997, 29.79566], [80.56247, 29.86661], [80.57179, 29.91422], [80.60226, 29.95732], [80.67076, 29.95732], [80.8778, 30.13384], [80.86673, 30.17321], [80.91143, 30.22173], [80.92547, 30.17193], [81.03953, 30.20059], [80.83343, 30.32023], [80.54504, 30.44936], [80.20721, 30.58541], [79.93255, 30.88288], [79.59884, 30.93943], [79.30694, 31.17357], [79.14016, 31.43403], [79.01931, 31.42817], [78.89344, 31.30481], [78.77898, 31.31209], [78.71032, 31.50197], [78.84516, 31.60631], [78.69933, 31.78723], [78.78036, 31.99478], [78.74404, 32.00384], [78.68754, 32.10256], [78.49609, 32.2762], [78.4645, 32.45367], [78.38897, 32.53938], [78.73916, 32.69438], [78.7831, 32.46873], [78.96713, 32.33655], [78.99322, 32.37948], [79.0979, 32.38051], [79.13174, 32.47766], [79.26768, 32.53277], [79.46562, 32.69668], [79.14016, 33.02545], [79.15252, 33.17156], [78.73636, 33.56521], [78.67599, 33.66445], [78.77349, 33.73871], [78.73367, 34.01121], [78.65657, 34.03195], [78.66225, 34.08858], [78.91769, 34.15452], [78.99802, 34.3027], [79.05364, 34.32482], [78.74465, 34.45174], [78.56475, 34.50835], [78.54964, 34.57283], [78.27781, 34.61484], [78.18435, 34.7998], [78.22692, 34.88771], [78.00033, 35.23954], [78.03466, 35.3785], [78.11664, 35.48022], [77.80532, 35.52058], [77.70232, 35.46244], [77.44277, 35.46132], [76.96624, 35.5932], [76.84539, 35.67356], [76.77323, 35.66062], [76.75475, 35.52617], [76.85088, 35.39754], [76.93465, 35.39866], [77.11796, 35.05419], [76.99251, 34.93349], [76.87193, 34.96906], [76.74514, 34.92488], [76.74377, 34.84039], [76.67648, 34.76371], [76.47186, 34.78965], [76.15463, 34.6429], [76.04614, 34.67566], [75.75438, 34.51827], [75.38009, 34.55021], [75.01479, 34.64629], [74.6663, 34.703], [74.58083, 34.77386], [74.31239, 34.79626], [74.12897, 34.70073], [73.96423, 34.68244], [73.93401, 34.63386], [73.93951, 34.57169], [73.89419, 34.54568], [73.88732, 34.48911], [73.74999, 34.3781], [73.74862, 34.34183], [73.8475, 34.32935], [73.90517, 34.35317], [73.98208, 34.2522], [73.90677, 34.10504], [73.88732, 34.05105], [73.91341, 34.01235], [74.21554, 34.03853], [74.25262, 34.01577], [74.26086, 33.92237], [74.14001, 33.83002], [74.05898, 33.82089], [74.00891, 33.75437], [73.96423, 33.73071], [73.98968, 33.66155], [73.97367, 33.64061], [74.03576, 33.56718], [74.10115, 33.56392], [74.18121, 33.4745], [74.17983, 33.3679], [74.08782, 33.26232], [74.01366, 33.25199], [74.02144, 33.18908], [74.15374, 33.13477], [74.17571, 33.07495], [74.31854, 33.02891], [74.34875, 32.97823], [74.31227, 32.92795], [74.41467, 32.90563], [74.45312, 32.77755], [74.6289, 32.75561], [74.64675, 32.82604], [74.7113, 32.84219], [74.65345, 32.71225], [74.69542, 32.66792], [74.64424, 32.60985], [74.65251, 32.56416], [74.67431, 32.56676], [74.68362, 32.49298], [74.84725, 32.49075], [74.97634, 32.45367], [75.03265, 32.49538], [75.28259, 32.36556], [75.38046, 32.26836], [75.25649, 32.10187], [75.00793, 32.03786], [74.9269, 32.0658], [74.86236, 32.04485], [74.79919, 31.95983], [74.58907, 31.87824], [74.47771, 31.72227], [74.57498, 31.60382], [74.61517, 31.55698], [74.59319, 31.50197], [74.64713, 31.45605], [74.59773, 31.4136], [74.53223, 31.30321], [74.51629, 31.13829], [74.56023, 31.08303], [74.60281, 31.10419], [74.60006, 31.13711], [74.6852, 31.12771], [74.67971, 31.05479], [74.5616, 31.04153], [73.88993, 30.36305], [73.95736, 30.28466], [73.97225, 30.19829], [73.80299, 30.06969], [73.58665, 30.01848], [73.3962, 29.94707], [73.28094, 29.56646], [73.05886, 29.1878], [73.01337, 29.16422], [72.94272, 29.02487], [72.40402, 28.78283], [72.29495, 28.66367], [72.20329, 28.3869], [71.9244, 28.11555], [71.89921, 27.96035], [70.79054, 27.68423], [70.60927, 28.02178], [70.37307, 28.01208], [70.12502, 27.8057], [70.03136, 27.56627], [69.58519, 27.18109], [69.50904, 26.74892], [69.88555, 26.56836], [70.05584, 26.60398], [70.17532, 26.55362], [70.17532, 26.24118], [70.08193, 26.08094], [70.0985, 25.93238], [70.2687, 25.71156], [70.37444, 25.67443], [70.53649, 25.68928], [70.60378, 25.71898], [70.67382, 25.68186], [70.66695, 25.39314], [70.89148, 25.15064], [70.94002, 24.92843], [71.09405, 24.69017], [70.97594, 24.60904], [71.00341, 24.46038], [71.12838, 24.42662], [71.04461, 24.34657], [70.94985, 24.3791], [70.85784, 24.30903], [70.88393, 24.27398], [70.71502, 24.23517], [70.57906, 24.27774], [70.5667, 24.43787], [70.11712, 24.30915], [70.03428, 24.172], [69.73335, 24.17007], [69.59579, 24.29777], [69.29778, 24.28712], [69.19341, 24.25646], [69.07806, 24.29777], [68.97781, 24.26021], [68.90914, 24.33156], [68.7416, 24.31904], [68.74643, 23.97027], [68.39339, 23.96838], [68.20763, 23.85849], [68.11329, 23.53945], [76.59015, 5.591], [79.50447, 8.91876], [79.42124, 9.80115], [80.48418, 10.20786], [89.08044, 21.41871]]]] } },
34043 { type: "Feature", properties: { wikidata: "Q9143535", nameEn: "Akrotiri", country: "GB", groups: ["Q644636", "Q37362", "BOTS", "145", "142", "UN"], level: "subterritory", driveSide: "left", callingCodes: ["357"] }, geometry: { type: "MultiPolygon", coordinates: [[[[32.86014, 34.70585], [32.82717, 34.70622], [32.79433, 34.67883], [32.76136, 34.68318], [32.75515, 34.64985], [32.74412, 34.43926], [33.26744, 34.49942], [33.0138, 34.64424], [32.96968, 34.64046], [32.96718, 34.63446], [32.96312, 34.63236], [32.95516, 34.63541], [32.95323, 34.64075], [32.95471, 34.64528], [32.95277, 34.65104], [32.96154, 34.65587], [32.9639, 34.65866], [32.969, 34.6549], [32.98046, 34.65336], [32.99014, 34.65518], [32.98668, 34.67268], [32.98967, 34.67981], [32.95567, 34.6839], [32.94127, 34.67426], [32.93989, 34.67034], [32.93756, 34.67072], [32.93535, 34.66317], [32.92824, 34.66821], [32.93043, 34.67091], [32.91398, 34.67343], [32.9068, 34.66102], [32.86167, 34.68734], [32.86014, 34.70585]]]] } },
34044 { type: "Feature", properties: { wikidata: "Q9206745", nameEn: "Dhekelia", country: "GB", groups: ["Q644636", "Q37362", "BOTS", "145", "142", "UN"], level: "subterritory", driveSide: "left", callingCodes: ["357"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.70575, 34.97947], [33.83531, 34.73974], [33.98684, 34.76642], [33.90146, 34.96458], [33.86018, 34.97381], [33.84741, 34.97167], [33.84028, 34.97179], [33.83459, 34.97448], [33.84616, 34.98511], [33.85488, 34.98462], [33.85891, 35.001], [33.85216, 35.00579], [33.84045, 35.00616], [33.82875, 35.01685], [33.83055, 35.02865], [33.81524, 35.04192], [33.8012, 35.04786], [33.82051, 35.0667], [33.8355, 35.05777], [33.85261, 35.0574], [33.87438, 35.08118], [33.89322, 35.06789], [33.90247, 35.07686], [33.91789, 35.08688], [33.89853, 35.11377], [33.88737, 35.11408], [33.88943, 35.12007], [33.88561, 35.12449], [33.87224, 35.12293], [33.87622, 35.10457], [33.87097, 35.09389], [33.87479, 35.08881], [33.8541, 35.07201], [33.84168, 35.06823], [33.82067, 35.07826], [33.78581, 35.05104], [33.76106, 35.04253], [33.73824, 35.05321], [33.71482, 35.03722], [33.70209, 35.04882], [33.7161, 35.07279], [33.70861, 35.07644], [33.69095, 35.06237], [33.68474, 35.06602], [33.67742, 35.05963], [33.67678, 35.03866], [33.69938, 35.03123], [33.69731, 35.01754], [33.71514, 35.00294], [33.70639, 34.99303], [33.70575, 34.97947]], [[33.77312, 34.9976], [33.77553, 34.99518], [33.78516, 34.99582], [33.79191, 34.98914], [33.78917, 34.98854], [33.78571, 34.98951], [33.78318, 34.98699], [33.78149, 34.98854], [33.77843, 34.988], [33.7778, 34.98981], [33.76738, 34.99188], [33.76605, 34.99543], [33.75682, 34.99916], [33.75994, 35.00113], [33.77312, 34.9976]], [[33.74144, 35.01053], [33.7343, 35.01178], [33.73781, 35.02181], [33.74265, 35.02329], [33.74983, 35.02274], [33.7492, 35.01319], [33.74144, 35.01053]]]] } },
34045 { type: "Feature", properties: { wikidata: "Q16390686", nameEn: "Peninsular Spain", country: "ES", groups: ["Q12837", "EU", "039", "150", "UN"], callingCodes: ["34"] }, geometry: { type: "MultiPolygon", coordinates: [[[[3.75438, 42.33445], [3.17156, 42.43545], [3.11379, 42.43646], [3.10027, 42.42621], [3.08167, 42.42748], [3.03734, 42.47363], [2.96518, 42.46692], [2.94283, 42.48174], [2.92107, 42.4573], [2.88413, 42.45938], [2.86983, 42.46843], [2.85675, 42.45444], [2.84335, 42.45724], [2.77464, 42.41046], [2.75497, 42.42578], [2.72056, 42.42298], [2.65311, 42.38771], [2.6747, 42.33974], [2.57934, 42.35808], [2.55516, 42.35351], [2.54382, 42.33406], [2.48457, 42.33933], [2.43508, 42.37568], [2.43299, 42.39423], [2.38504, 42.39977], [2.25551, 42.43757], [2.20578, 42.41633], [2.16599, 42.42314], [2.12789, 42.41291], [2.11621, 42.38393], [2.06241, 42.35906], [2.00488, 42.35399], [1.96482, 42.37787], [1.9574, 42.42401], [1.94084, 42.43039], [1.94061, 42.43333], [1.94292, 42.44316], [1.93663, 42.45439], [1.88853, 42.4501], [1.83037, 42.48395], [1.76335, 42.48863], [1.72515, 42.50338], [1.70571, 42.48867], [1.66826, 42.50779], [1.65674, 42.47125], [1.58933, 42.46275], [1.57953, 42.44957], [1.55937, 42.45808], [1.55073, 42.43299], [1.5127, 42.42959], [1.44529, 42.43724], [1.43838, 42.47848], [1.41648, 42.48315], [1.46661, 42.50949], [1.44759, 42.54431], [1.41245, 42.53539], [1.4234, 42.55959], [1.44529, 42.56722], [1.42512, 42.58292], [1.44197, 42.60217], [1.35562, 42.71944], [1.15928, 42.71407], [1.0804, 42.78569], [0.98292, 42.78754], [0.96166, 42.80629], [0.93089, 42.79154], [0.711, 42.86372], [0.66121, 42.84021], [0.65421, 42.75872], [0.67873, 42.69458], [0.40214, 42.69779], [0.36251, 42.72282], [0.29407, 42.67431], [0.25336, 42.7174], [0.17569, 42.73424], [-0.02468, 42.68513], [-0.10519, 42.72761], [-0.16141, 42.79535], [-0.17939, 42.78974], [-0.3122, 42.84788], [-0.38833, 42.80132], [-0.41319, 42.80776], [-0.44334, 42.79939], [-0.50863, 42.82713], [-0.55497, 42.77846], [-0.67637, 42.88303], [-0.69837, 42.87945], [-0.72608, 42.89318], [-0.73422, 42.91228], [-0.72037, 42.92541], [-0.75478, 42.96916], [-0.81652, 42.95166], [-0.97133, 42.96239], [-1.00963, 42.99279], [-1.10333, 43.0059], [-1.22881, 43.05534], [-1.25244, 43.04164], [-1.30823, 43.07102], [-1.29765, 43.09427], [-1.2879, 43.10494], [-1.27038, 43.11712], [-1.26996, 43.11832], [-1.28008, 43.11842], [-1.32209, 43.1127], [-1.34419, 43.09665], [-1.35272, 43.02658], [-1.44067, 43.047], [-1.47555, 43.08372], [-1.41562, 43.12815], [-1.3758, 43.24511], [-1.40942, 43.27272], [-1.45289, 43.27049], [-1.50992, 43.29481], [-1.55963, 43.28828], [-1.57674, 43.25269], [-1.61341, 43.25269], [-1.63052, 43.28591], [-1.62481, 43.30726], [-1.69407, 43.31378], [-1.73074, 43.29481], [-1.7397, 43.32979], [-1.75079, 43.3317], [-1.75334, 43.34107], [-1.75913, 43.34422], [-1.77307, 43.342], [-1.78829, 43.35192], [-1.78184, 43.36235], [-1.79319, 43.37497], [-1.77289, 43.38957], [-1.81005, 43.59738], [-10.14298, 44.17365], [-11.19304, 41.83075], [-8.87157, 41.86488], [-8.81794, 41.90375], [-8.75712, 41.92833], [-8.74606, 41.9469], [-8.7478, 41.96282], [-8.69071, 41.98862], [-8.6681, 41.99703], [-8.65832, 42.02972], [-8.64626, 42.03668], [-8.63791, 42.04691], [-8.59493, 42.05708], [-8.58086, 42.05147], [-8.54563, 42.0537], [-8.5252, 42.06264], [-8.52837, 42.07658], [-8.48185, 42.0811], [-8.44123, 42.08218], [-8.42512, 42.07199], [-8.40143, 42.08052], [-8.38323, 42.07683], [-8.36353, 42.09065], [-8.33912, 42.08358], [-8.32161, 42.10218], [-8.29809, 42.106], [-8.2732, 42.12396], [-8.24681, 42.13993], [-8.22406, 42.1328], [-8.1986, 42.15402], [-8.18947, 42.13853], [-8.19406, 42.12141], [-8.18178, 42.06436], [-8.11729, 42.08537], [-8.08847, 42.05767], [-8.08796, 42.01398], [-8.16232, 41.9828], [-8.2185, 41.91237], [-8.19551, 41.87459], [-8.16944, 41.87944], [-8.16455, 41.81753], [-8.0961, 41.81024], [-8.01136, 41.83453], [-7.9804, 41.87337], [-7.92336, 41.8758], [-7.90707, 41.92432], [-7.88751, 41.92553], [-7.88055, 41.84571], [-7.84188, 41.88065], [-7.69848, 41.90977], [-7.65774, 41.88308], [-7.58603, 41.87944], [-7.62188, 41.83089], [-7.52737, 41.83939], [-7.49803, 41.87095], [-7.45566, 41.86488], [-7.44759, 41.84451], [-7.42854, 41.83262], [-7.42864, 41.80589], [-7.37092, 41.85031], [-7.32366, 41.8406], [-7.18677, 41.88793], [-7.18549, 41.97515], [-7.14115, 41.98855], [-7.08574, 41.97401], [-7.07596, 41.94977], [-7.01078, 41.94977], [-6.98144, 41.9728], [-6.95537, 41.96553], [-6.94396, 41.94403], [-6.82174, 41.94493], [-6.81196, 41.99097], [-6.76959, 41.98734], [-6.75004, 41.94129], [-6.61967, 41.94008], [-6.58544, 41.96674], [-6.5447, 41.94371], [-6.56752, 41.88429], [-6.51374, 41.8758], [-6.56426, 41.74219], [-6.54633, 41.68623], [-6.49907, 41.65823], [-6.44204, 41.68258], [-6.29863, 41.66432], [-6.19128, 41.57638], [-6.26777, 41.48796], [-6.3306, 41.37677], [-6.38553, 41.38655], [-6.38551, 41.35274], [-6.55937, 41.24417], [-6.65046, 41.24725], [-6.68286, 41.21641], [-6.69711, 41.1858], [-6.77319, 41.13049], [-6.75655, 41.10187], [-6.79241, 41.05397], [-6.80942, 41.03629], [-6.84781, 41.02692], [-6.88843, 41.03027], [-6.913, 41.03922], [-6.9357, 41.02888], [-6.8527, 40.93958], [-6.84292, 40.89771], [-6.80707, 40.88047], [-6.79892, 40.84842], [-6.82337, 40.84472], [-6.82826, 40.74603], [-6.79567, 40.65955], [-6.84292, 40.56801], [-6.80218, 40.55067], [-6.7973, 40.51723], [-6.84944, 40.46394], [-6.84618, 40.42177], [-6.78426, 40.36468], [-6.80218, 40.33239], [-6.86085, 40.2976], [-6.86085, 40.26776], [-7.00426, 40.23169], [-7.02544, 40.18564], [-7.00589, 40.12087], [-6.94233, 40.10716], [-6.86737, 40.01986], [-6.91463, 39.86618], [-6.97492, 39.81488], [-7.01613, 39.66877], [-7.24707, 39.66576], [-7.33507, 39.64569], [-7.54121, 39.66717], [-7.49477, 39.58794], [-7.2927, 39.45847], [-7.3149, 39.34857], [-7.23403, 39.27579], [-7.23566, 39.20132], [-7.12811, 39.17101], [-7.14929, 39.11287], [-7.10692, 39.10275], [-7.04011, 39.11919], [-6.97004, 39.07619], [-6.95211, 39.0243], [-7.051, 38.907], [-7.03848, 38.87221], [-7.26174, 38.72107], [-7.265, 38.61674], [-7.32529, 38.44336], [-7.15581, 38.27597], [-7.09389, 38.17227], [-6.93418, 38.21454], [-7.00375, 38.01914], [-7.05966, 38.01966], [-7.10366, 38.04404], [-7.12648, 38.00296], [-7.24544, 37.98884], [-7.27314, 37.90145], [-7.33441, 37.81193], [-7.41981, 37.75729], [-7.51759, 37.56119], [-7.46878, 37.47127], [-7.43974, 37.38913], [-7.43227, 37.25152], [-7.41854, 37.23813], [-7.41133, 37.20314], [-7.39769, 37.16868], [-7.37282, 36.96896], [-7.2725, 35.73269], [-5.10878, 36.05227], [-2.27707, 35.35051], [3.75438, 42.33445]], [[-5.27801, 36.14942], [-5.34064, 36.03744], [-5.40526, 36.15488], [-5.34536, 36.15501], [-5.33822, 36.15272], [-5.27801, 36.14942]]], [[[1.99838, 42.44682], [2.01564, 42.45171], [1.99216, 42.46208], [1.98579, 42.47486], [1.99766, 42.4858], [1.98916, 42.49351], [1.98022, 42.49569], [1.97697, 42.48568], [1.97227, 42.48487], [1.97003, 42.48081], [1.96215, 42.47854], [1.95606, 42.45785], [1.96125, 42.45364], [1.98378, 42.44697], [1.99838, 42.44682]]]] } },
34046 { type: "Feature", properties: { wikidata: "Q98059339", nameEn: "Mainland Norway", country: "NO", groups: ["154", "150", "UN"], callingCodes: ["47"] }, geometry: { type: "MultiPolygon", coordinates: [[[[10.40861, 58.38489], [10.64958, 58.89391], [11.08911, 58.98745], [11.15367, 59.07862], [11.34459, 59.11672], [11.4601, 58.99022], [11.45199, 58.89604], [11.65732, 58.90177], [11.8213, 59.24985], [11.69297, 59.59442], [11.92112, 59.69531], [11.87121, 59.86039], [12.15641, 59.8926], [12.36317, 59.99259], [12.52003, 60.13846], [12.59133, 60.50559], [12.2277, 61.02442], [12.69115, 61.06584], [12.86939, 61.35427], [12.57707, 61.56547], [12.40595, 61.57226], [12.14746, 61.7147], [12.29187, 62.25699], [12.07085, 62.6297], [12.19919, 63.00104], [11.98529, 63.27487], [12.19919, 63.47935], [12.14928, 63.59373], [12.74105, 64.02171], [13.23411, 64.09087], [13.98222, 64.00953], [14.16051, 64.18725], [14.11117, 64.46674], [13.64276, 64.58402], [14.50926, 65.31786], [14.53778, 66.12399], [15.05113, 66.15572], [15.49318, 66.28509], [15.37197, 66.48217], [16.35589, 67.06419], [16.39154, 67.21653], [16.09922, 67.4364], [16.12774, 67.52106], [16.38441, 67.52923], [16.7409, 67.91037], [17.30416, 68.11591], [17.90787, 67.96537], [18.13836, 68.20874], [18.1241, 68.53721], [18.39503, 68.58672], [18.63032, 68.50849], [18.97255, 68.52416], [19.93508, 68.35911], [20.22027, 68.48759], [19.95647, 68.55546], [20.22027, 68.67246], [20.33435, 68.80174], [20.28444, 68.93283], [20.0695, 69.04469], [20.55258, 69.06069], [20.72171, 69.11874], [21.05775, 69.0356], [21.11099, 69.10291], [20.98641, 69.18809], [21.00732, 69.22755], [21.27827, 69.31281], [21.63833, 69.27485], [22.27276, 68.89514], [22.38367, 68.71561], [22.53321, 68.74393], [23.13064, 68.64684], [23.68017, 68.70276], [23.781, 68.84514], [24.02299, 68.81601], [24.18432, 68.73936], [24.74898, 68.65143], [24.90023, 68.55579], [24.93048, 68.61102], [25.10189, 68.63307], [25.12206, 68.78684], [25.42455, 68.90328], [25.61613, 68.89602], [25.75729, 68.99383], [25.69679, 69.27039], [25.96904, 69.68397], [26.40261, 69.91377], [26.64461, 69.96565], [27.05802, 69.92069], [27.57226, 70.06215], [27.95542, 70.0965], [27.97558, 69.99671], [28.32849, 69.88605], [28.36883, 69.81658], [29.12697, 69.69193], [29.31664, 69.47994], [28.8629, 69.22395], [28.81248, 69.11997], [28.91738, 69.04774], [29.0444, 69.0119], [29.26623, 69.13794], [29.27631, 69.2811], [29.97205, 69.41623], [30.16363, 69.65244], [30.52662, 69.54699], [30.95011, 69.54699], [30.84095, 69.80584], [31.59909, 70.16571], [32.07813, 72.01005], [-11.60274, 67.73467], [7.28637, 57.35913], [10.40861, 58.38489]]]] } },
34047 { type: "Feature", properties: { wikidata: "Q98543636", nameEn: "Mainland Ecuador", country: "EC", groups: ["005", "419", "019", "UN"], callingCodes: ["593"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-84.52388, -3.36941], [-80.30602, -3.39149], [-80.20647, -3.431], [-80.24123, -3.46124], [-80.24586, -3.48677], [-80.23651, -3.48652], [-80.22629, -3.501], [-80.20535, -3.51667], [-80.21642, -3.5888], [-80.19848, -3.59249], [-80.18741, -3.63994], [-80.19926, -3.68894], [-80.13232, -3.90317], [-80.46386, -4.01342], [-80.4822, -4.05477], [-80.45023, -4.20938], [-80.32114, -4.21323], [-80.46386, -4.41516], [-80.39256, -4.48269], [-80.13945, -4.29786], [-79.79722, -4.47558], [-79.59402, -4.46848], [-79.26248, -4.95167], [-79.1162, -4.97774], [-79.01659, -5.01481], [-78.85149, -4.66795], [-78.68394, -4.60754], [-78.34362, -3.38633], [-78.24589, -3.39907], [-78.22642, -3.51113], [-78.14324, -3.47653], [-78.19369, -3.36431], [-77.94147, -3.05454], [-76.6324, -2.58397], [-76.05203, -2.12179], [-75.57429, -1.55961], [-75.3872, -0.9374], [-75.22862, -0.95588], [-75.22862, -0.60048], [-75.53615, -0.19213], [-75.60169, -0.18708], [-75.61997, -0.10012], [-75.40192, -0.17196], [-75.25764, -0.11943], [-75.82927, 0.09578], [-76.23441, 0.42294], [-76.41215, 0.38228], [-76.4094, 0.24015], [-76.89177, 0.24736], [-77.52001, 0.40782], [-77.49984, 0.64476], [-77.67815, 0.73863], [-77.66416, 0.81604], [-77.68613, 0.83029], [-77.7148, 0.85003], [-77.85677, 0.80197], [-78.42749, 1.15389], [-78.87137, 1.47457], [-82.12561, 4.00341], [-84.52388, -3.36941]]]] } },
34048 { type: "Feature", properties: { m49: "001", wikidata: "Q2", nameEn: "World", aliases: ["Earth", "Planet"], level: "world" }, geometry: null },
34049 { type: "Feature", properties: { m49: "002", wikidata: "Q15", nameEn: "Africa", level: "region" }, geometry: null },
34050 { type: "Feature", properties: { m49: "003", wikidata: "Q49", nameEn: "North America", level: "subregion" }, geometry: null },
34051 { type: "Feature", properties: { m49: "005", wikidata: "Q18", nameEn: "South America", level: "intermediateRegion" }, geometry: null },
34052 { type: "Feature", properties: { m49: "009", wikidata: "Q538", nameEn: "Oceania", level: "region" }, geometry: null },
34053 { type: "Feature", properties: { m49: "011", wikidata: "Q4412", nameEn: "Western Africa", level: "intermediateRegion" }, geometry: null },
34054 { type: "Feature", properties: { m49: "013", wikidata: "Q27611", nameEn: "Central America", level: "intermediateRegion" }, geometry: null },
34055 { type: "Feature", properties: { m49: "014", wikidata: "Q27407", nameEn: "Eastern Africa", level: "intermediateRegion" }, geometry: null },
34056 { type: "Feature", properties: { m49: "015", wikidata: "Q27381", nameEn: "Northern Africa", level: "subregion" }, geometry: null },
34057 { type: "Feature", properties: { m49: "017", wikidata: "Q27433", nameEn: "Middle Africa", level: "intermediateRegion" }, geometry: null },
34058 { type: "Feature", properties: { m49: "018", wikidata: "Q27394", nameEn: "Southern Africa", level: "intermediateRegion" }, geometry: null },
34059 { type: "Feature", properties: { m49: "019", wikidata: "Q828", nameEn: "Americas", level: "region" }, geometry: null },
34060 { type: "Feature", properties: { m49: "021", wikidata: "Q2017699", nameEn: "Northern America", level: "subregion" }, geometry: null },
34061 { type: "Feature", properties: { m49: "029", wikidata: "Q664609", nameEn: "Caribbean", level: "intermediateRegion" }, geometry: null },
34062 { type: "Feature", properties: { m49: "030", wikidata: "Q27231", nameEn: "Eastern Asia", level: "subregion" }, geometry: null },
34063 { type: "Feature", properties: { m49: "034", wikidata: "Q771405", nameEn: "Southern Asia", level: "subregion" }, geometry: null },
34064 { type: "Feature", properties: { m49: "035", wikidata: "Q11708", nameEn: "South-eastern Asia", level: "subregion" }, geometry: null },
34065 { type: "Feature", properties: { m49: "039", wikidata: "Q27449", nameEn: "Southern Europe", level: "subregion" }, geometry: null },
34066 { type: "Feature", properties: { m49: "053", wikidata: "Q45256", nameEn: "Australia and New Zealand", aliases: ["Australasia"], level: "subregion" }, geometry: null },
34067 { type: "Feature", properties: { m49: "054", wikidata: "Q37394", nameEn: "Melanesia", level: "subregion" }, geometry: null },
34068 { type: "Feature", properties: { m49: "057", wikidata: "Q3359409", nameEn: "Micronesia", level: "subregion" }, geometry: null },
34069 { type: "Feature", properties: { m49: "061", wikidata: "Q35942", nameEn: "Polynesia", level: "subregion" }, geometry: null },
34070 { type: "Feature", properties: { m49: "142", wikidata: "Q48", nameEn: "Asia", level: "region" }, geometry: null },
34071 { type: "Feature", properties: { m49: "143", wikidata: "Q27275", nameEn: "Central Asia", level: "subregion" }, geometry: null },
34072 { type: "Feature", properties: { m49: "145", wikidata: "Q27293", nameEn: "Western Asia", level: "subregion" }, geometry: null },
34073 { type: "Feature", properties: { m49: "150", wikidata: "Q46", nameEn: "Europe", level: "region" }, geometry: null },
34074 { type: "Feature", properties: { m49: "151", wikidata: "Q27468", nameEn: "Eastern Europe", level: "subregion" }, geometry: null },
34075 { type: "Feature", properties: { m49: "154", wikidata: "Q27479", nameEn: "Northern Europe", level: "subregion" }, geometry: null },
34076 { type: "Feature", properties: { m49: "155", wikidata: "Q27496", nameEn: "Western Europe", level: "subregion" }, geometry: null },
34077 { type: "Feature", properties: { m49: "202", wikidata: "Q132959", nameEn: "Sub-Saharan Africa", level: "subregion" }, geometry: null },
34078 { type: "Feature", properties: { m49: "419", wikidata: "Q72829598", nameEn: "Latin America and the Caribbean", level: "subregion" }, geometry: null },
34079 { type: "Feature", properties: { m49: "830", wikidata: "Q42314", nameEn: "Channel Islands", level: "intermediateRegion" }, geometry: null },
34080 { type: "Feature", properties: { iso1A2: "AC", iso1A3: "ASC", wikidata: "Q46197", nameEn: "Ascension Island", aliases: ["SH-AC"], country: "GB", groups: ["SH", "BOTS", "011", "202", "002", "UN"], isoStatus: "excRes", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["247"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-14.82771, -8.70814], [-13.33271, -8.07391], [-14.91926, -6.63386], [-14.82771, -8.70814]]]] } },
34081 { type: "Feature", properties: { iso1A2: "AD", iso1A3: "AND", iso1N3: "020", wikidata: "Q228", nameEn: "Andorra", groups: ["Q12837", "039", "150", "UN"], callingCodes: ["376"] }, geometry: { type: "MultiPolygon", coordinates: [[[[1.72515, 42.50338], [1.73683, 42.55492], [1.7858, 42.57698], [1.72588, 42.59098], [1.73452, 42.61515], [1.68267, 42.62533], [1.6625, 42.61982], [1.63485, 42.62957], [1.60085, 42.62703], [1.55418, 42.65669], [1.50867, 42.64483], [1.48043, 42.65203], [1.46718, 42.63296], [1.47986, 42.61346], [1.44197, 42.60217], [1.42512, 42.58292], [1.44529, 42.56722], [1.4234, 42.55959], [1.41245, 42.53539], [1.44759, 42.54431], [1.46661, 42.50949], [1.41648, 42.48315], [1.43838, 42.47848], [1.44529, 42.43724], [1.5127, 42.42959], [1.55073, 42.43299], [1.55937, 42.45808], [1.57953, 42.44957], [1.58933, 42.46275], [1.65674, 42.47125], [1.66826, 42.50779], [1.70571, 42.48867], [1.72515, 42.50338]]]] } },
34082 { type: "Feature", properties: { iso1A2: "AE", iso1A3: "ARE", iso1N3: "784", wikidata: "Q878", nameEn: "United Arab Emirates", groups: ["145", "142", "UN"], callingCodes: ["971"] }, geometry: { type: "MultiPolygon", coordinates: [[[[56.26534, 25.62825], [56.25341, 25.61443], [56.26636, 25.60643], [56.25365, 25.60211], [56.20473, 25.61119], [56.18363, 25.65508], [56.14826, 25.66351], [56.13579, 25.73524], [56.17416, 25.77239], [56.13963, 25.82765], [56.19334, 25.9795], [56.15498, 26.06828], [56.08666, 26.05038], [55.81777, 26.18798], [55.14145, 25.62624], [53.97892, 24.64436], [52.82259, 25.51697], [52.35509, 25.00368], [52.02277, 24.75635], [51.83108, 24.71675], [51.58834, 24.66608], [51.41644, 24.39615], [51.58871, 24.27256], [51.59617, 24.12041], [52.56622, 22.94341], [55.13599, 22.63334], [55.2137, 22.71065], [55.22634, 23.10378], [55.57358, 23.669], [55.48677, 23.94946], [55.73301, 24.05994], [55.8308, 24.01633], [56.01799, 24.07426], [55.95472, 24.2172], [55.83367, 24.20193], [55.77658, 24.23476], [55.76558, 24.23227], [55.75257, 24.23466], [55.75382, 24.2466], [55.75939, 24.26114], [55.76781, 24.26209], [55.79145, 24.27914], [55.80747, 24.31069], [55.83395, 24.32776], [55.83271, 24.41521], [55.76461, 24.5287], [55.83271, 24.68567], [55.83408, 24.77858], [55.81348, 24.80102], [55.81116, 24.9116], [55.85094, 24.96858], [55.90849, 24.96771], [55.96316, 25.00857], [56.05715, 24.95727], [56.05106, 24.87461], [55.97467, 24.89639], [55.97836, 24.87673], [56.03535, 24.81161], [56.06128, 24.74457], [56.13684, 24.73699], [56.20062, 24.78565], [56.20568, 24.85063], [56.30269, 24.88334], [56.34873, 24.93205], [56.3227, 24.97284], [56.86325, 25.03856], [56.82555, 25.7713], [56.26534, 25.62825]], [[56.26062, 25.33108], [56.3005, 25.31815], [56.3111, 25.30107], [56.35172, 25.30681], [56.34438, 25.26653], [56.27628, 25.23404], [56.24341, 25.22867], [56.20872, 25.24104], [56.20838, 25.25668], [56.24465, 25.27505], [56.25008, 25.28843], [56.23362, 25.31253], [56.26062, 25.33108]]], [[[56.28423, 25.26344], [56.29379, 25.2754], [56.28102, 25.28486], [56.2716, 25.27916], [56.27086, 25.26128], [56.28423, 25.26344]]]] } },
34083 { type: "Feature", properties: { iso1A2: "AF", iso1A3: "AFG", iso1N3: "004", wikidata: "Q889", nameEn: "Afghanistan", groups: ["034", "142", "UN"], callingCodes: ["93"] }, geometry: { type: "MultiPolygon", coordinates: [[[[70.61526, 38.34774], [70.60407, 38.28046], [70.54673, 38.24541], [70.4898, 38.12546], [70.17206, 37.93276], [70.1863, 37.84296], [70.27694, 37.81258], [70.28243, 37.66706], [70.15015, 37.52519], [69.95971, 37.5659], [69.93362, 37.61378], [69.84435, 37.60616], [69.80041, 37.5746], [69.51888, 37.5844], [69.44954, 37.4869], [69.36645, 37.40462], [69.45022, 37.23315], [69.39529, 37.16752], [69.25152, 37.09426], [69.03274, 37.25174], [68.96407, 37.32603], [68.88168, 37.33368], [68.91189, 37.26704], [68.80889, 37.32494], [68.81438, 37.23862], [68.6798, 37.27906], [68.61851, 37.19815], [68.41888, 37.13906], [68.41201, 37.10402], [68.29253, 37.10621], [68.27605, 37.00977], [68.18542, 37.02074], [68.02194, 36.91923], [67.87917, 37.0591], [67.7803, 37.08978], [67.78329, 37.1834], [67.51868, 37.26102], [67.2581, 37.17216], [67.2224, 37.24545], [67.13039, 37.27168], [67.08232, 37.35469], [66.95598, 37.40162], [66.64699, 37.32958], [66.55743, 37.35409], [66.30993, 37.32409], [65.72274, 37.55438], [65.64137, 37.45061], [65.64263, 37.34388], [65.51778, 37.23881], [64.97945, 37.21913], [64.61141, 36.6351], [64.62514, 36.44311], [64.57295, 36.34362], [64.43288, 36.24401], [64.05385, 36.10433], [63.98519, 36.03773], [63.56496, 35.95106], [63.53475, 35.90881], [63.29579, 35.85985], [63.12276, 35.86208], [63.10318, 35.81782], [63.23262, 35.67487], [63.10079, 35.63024], [63.12276, 35.53196], [63.0898, 35.43131], [62.90853, 35.37086], [62.74098, 35.25432], [62.62288, 35.22067], [62.48006, 35.28796], [62.29878, 35.13312], [62.29191, 35.25964], [62.15871, 35.33278], [62.05709, 35.43803], [61.97743, 35.4604], [61.77693, 35.41341], [61.58742, 35.43803], [61.27371, 35.61482], [61.18187, 35.30249], [61.0991, 35.27845], [61.12831, 35.09938], [61.06926, 34.82139], [61.00197, 34.70631], [60.99922, 34.63064], [60.72316, 34.52857], [60.91321, 34.30411], [60.66502, 34.31539], [60.50209, 34.13992], [60.5838, 33.80793], [60.5485, 33.73422], [60.57762, 33.59772], [60.69573, 33.56054], [60.91133, 33.55596], [60.88908, 33.50219], [60.56485, 33.12944], [60.86191, 32.22565], [60.84541, 31.49561], [61.70929, 31.37391], [61.80569, 31.16167], [61.80957, 31.12576], [61.83257, 31.0452], [61.8335, 30.97669], [61.78268, 30.92724], [61.80829, 30.84224], [60.87231, 29.86514], [62.47751, 29.40782], [63.5876, 29.50456], [64.12966, 29.39157], [64.19796, 29.50407], [64.62116, 29.58903], [65.04005, 29.53957], [66.24175, 29.85181], [66.36042, 29.9583], [66.23609, 30.06321], [66.34869, 30.404], [66.28413, 30.57001], [66.39194, 30.9408], [66.42645, 30.95309], [66.58175, 30.97532], [66.68166, 31.07597], [66.72561, 31.20526], [66.83273, 31.26867], [67.04147, 31.31561], [67.03323, 31.24519], [67.29964, 31.19586], [67.78854, 31.33203], [67.7748, 31.4188], [67.62374, 31.40473], [67.58323, 31.52772], [67.72056, 31.52304], [67.86887, 31.63536], [68.00071, 31.6564], [68.1655, 31.82691], [68.25614, 31.80357], [68.27605, 31.75863], [68.44222, 31.76446], [68.57475, 31.83158], [68.6956, 31.75687], [68.79997, 31.61665], [68.91078, 31.59687], [68.95995, 31.64822], [69.00939, 31.62249], [69.11514, 31.70782], [69.20577, 31.85957], [69.3225, 31.93186], [69.27032, 32.14141], [69.27932, 32.29119], [69.23599, 32.45946], [69.2868, 32.53938], [69.38155, 32.56601], [69.44747, 32.6678], [69.43649, 32.7302], [69.38018, 32.76601], [69.47082, 32.85834], [69.5436, 32.8768], [69.49854, 32.88843], [69.49004, 33.01509], [69.57656, 33.09911], [69.71526, 33.09911], [69.79766, 33.13247], [69.85259, 33.09451], [70.02563, 33.14282], [70.07369, 33.22557], [70.13686, 33.21064], [70.32775, 33.34496], [70.17062, 33.53535], [70.20141, 33.64387], [70.14785, 33.6553], [70.14236, 33.71701], [70.00503, 33.73528], [69.85671, 33.93719], [69.87307, 33.9689], [69.90203, 34.04194], [70.54336, 33.9463], [70.88119, 33.97933], [71.07345, 34.06242], [71.06933, 34.10564], [71.09307, 34.11961], [71.09453, 34.13524], [71.13078, 34.16503], [71.12815, 34.26619], [71.17662, 34.36769], [71.02401, 34.44835], [71.0089, 34.54568], [71.11602, 34.63047], [71.08718, 34.69034], [71.28356, 34.80882], [71.29472, 34.87728], [71.50329, 34.97328], [71.49917, 35.00478], [71.55273, 35.02615], [71.52938, 35.09023], [71.67495, 35.21262], [71.5541, 35.28776], [71.54294, 35.31037], [71.65435, 35.4479], [71.49917, 35.6267], [71.55273, 35.71483], [71.37969, 35.95865], [71.19505, 36.04134], [71.60491, 36.39429], [71.80267, 36.49924], [72.18135, 36.71838], [72.6323, 36.84601], [73.82685, 36.91421], [74.04856, 36.82648], [74.43389, 37.00977], [74.53739, 36.96224], [74.56453, 37.03023], [74.49981, 37.24518], [74.80605, 37.21565], [74.88887, 37.23275], [74.8294, 37.3435], [74.68383, 37.3948], [74.56161, 37.37734], [74.41055, 37.3948], [74.23339, 37.41116], [74.20308, 37.34208], [73.8564, 37.26158], [73.82552, 37.22659], [73.64974, 37.23643], [73.61129, 37.27469], [73.76647, 37.33913], [73.77197, 37.4417], [73.29633, 37.46495], [73.06884, 37.31729], [72.79693, 37.22222], [72.66381, 37.02014], [72.54095, 37.00007], [72.31676, 36.98115], [71.83229, 36.68084], [71.67083, 36.67346], [71.57195, 36.74943], [71.51502, 36.89128], [71.48481, 36.93218], [71.46923, 36.99925], [71.45578, 37.03094], [71.43097, 37.05855], [71.44127, 37.11856], [71.4494, 37.18137], [71.4555, 37.21418], [71.47386, 37.2269], [71.48339, 37.23937], [71.4824, 37.24921], [71.48536, 37.26017], [71.50674, 37.31502], [71.49821, 37.31975], [71.4862, 37.33405], [71.47685, 37.40281], [71.49612, 37.4279], [71.5256, 37.47971], [71.50616, 37.50733], [71.49693, 37.53527], [71.5065, 37.60912], [71.51972, 37.61945], [71.54186, 37.69691], [71.55234, 37.73209], [71.53053, 37.76534], [71.54324, 37.77104], [71.55752, 37.78677], [71.59255, 37.79956], [71.58843, 37.92425], [71.51565, 37.95349], [71.32871, 37.88564], [71.296, 37.93403], [71.2809, 37.91995], [71.24969, 37.93031], [71.27278, 37.96496], [71.27622, 37.99946], [71.28922, 38.01272], [71.29878, 38.04429], [71.36444, 38.15358], [71.37803, 38.25641], [71.33869, 38.27335], [71.33114, 38.30339], [71.21291, 38.32797], [71.1451, 38.40106], [71.10957, 38.40671], [71.10592, 38.42077], [71.09542, 38.42517], [71.0556, 38.40176], [71.03545, 38.44779], [70.98693, 38.48862], [70.92728, 38.43021], [70.88719, 38.46826], [70.84376, 38.44688], [70.82538, 38.45394], [70.81697, 38.44507], [70.80521, 38.44447], [70.79766, 38.44944], [70.78702, 38.45031], [70.78581, 38.45502], [70.77132, 38.45548], [70.75455, 38.4252], [70.72485, 38.4131], [70.69807, 38.41861], [70.67438, 38.40597], [70.6761, 38.39144], [70.69189, 38.37031], [70.64966, 38.34999], [70.61526, 38.34774]]]] } },
34084 { type: "Feature", properties: { iso1A2: "AG", iso1A3: "ATG", iso1N3: "028", wikidata: "Q781", nameEn: "Antigua and Barbuda", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 268"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-61.66959, 18.6782], [-62.58307, 16.68909], [-62.1023, 16.97277], [-61.23098, 16.62484], [-61.66959, 18.6782]]]] } },
34085 { type: "Feature", properties: { iso1A2: "AI", iso1A3: "AIA", iso1N3: "660", wikidata: "Q25228", nameEn: "Anguilla", country: "GB", groups: ["BOTS", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 264"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.79029, 19.11219], [-63.35989, 18.06012], [-62.62718, 18.26185], [-63.79029, 19.11219]]]] } },
34086 { type: "Feature", properties: { iso1A2: "AL", iso1A3: "ALB", iso1N3: "008", wikidata: "Q222", nameEn: "Albania", groups: ["039", "150", "UN"], callingCodes: ["355"] }, geometry: { type: "MultiPolygon", coordinates: [[[[20.07761, 42.55582], [20.01834, 42.54622], [20.00842, 42.5109], [19.9324, 42.51699], [19.82333, 42.46581], [19.76549, 42.50237], [19.74731, 42.57422], [19.77375, 42.58517], [19.73244, 42.66299], [19.65972, 42.62774], [19.4836, 42.40831], [19.42352, 42.36546], [19.42, 42.33019], [19.28623, 42.17745], [19.40687, 42.10024], [19.37548, 42.06835], [19.36867, 42.02564], [19.37691, 41.96977], [19.34601, 41.95675], [19.33812, 41.90669], [19.37451, 41.8842], [19.37597, 41.84849], [19.26406, 41.74971], [19.0384, 40.35325], [19.95905, 39.82857], [19.97622, 39.78684], [19.92466, 39.69533], [19.98042, 39.6504], [20.00957, 39.69227], [20.05189, 39.69112], [20.12956, 39.65805], [20.15988, 39.652], [20.22376, 39.64532], [20.22707, 39.67459], [20.27412, 39.69884], [20.31961, 39.72799], [20.29152, 39.80421], [20.30804, 39.81563], [20.38572, 39.78516], [20.41475, 39.81437], [20.41546, 39.82832], [20.31135, 39.99438], [20.37911, 39.99058], [20.42373, 40.06777], [20.48487, 40.06271], [20.51297, 40.08168], [20.55593, 40.06524], [20.61081, 40.07866], [20.62566, 40.0897], [20.67162, 40.09433], [20.71789, 40.27739], [20.78234, 40.35803], [20.7906, 40.42726], [20.83688, 40.47882], [20.94925, 40.46625], [20.96908, 40.51526], [21.03932, 40.56299], [21.05833, 40.66586], [20.98134, 40.76046], [20.95752, 40.76982], [20.98396, 40.79109], [20.97887, 40.85475], [20.97693, 40.90103], [20.94305, 40.92399], [20.83671, 40.92752], [20.81567, 40.89662], [20.73504, 40.9081], [20.71634, 40.91781], [20.65558, 41.08009], [20.63454, 41.0889], [20.59832, 41.09066], [20.58546, 41.11179], [20.59715, 41.13644], [20.51068, 41.2323], [20.49432, 41.33679], [20.52119, 41.34381], [20.55976, 41.4087], [20.51301, 41.442], [20.49039, 41.49277], [20.45331, 41.51436], [20.45809, 41.5549], [20.52103, 41.56473], [20.55508, 41.58113], [20.51769, 41.65975], [20.52937, 41.69292], [20.51301, 41.72433], [20.53405, 41.78099], [20.57144, 41.7897], [20.55976, 41.87068], [20.59524, 41.8818], [20.57946, 41.91593], [20.63069, 41.94913], [20.59434, 42.03879], [20.55633, 42.08173], [20.56955, 42.12097], [20.48857, 42.25444], [20.3819, 42.3029], [20.34479, 42.32656], [20.24399, 42.32168], [20.21797, 42.41237], [20.17127, 42.50469], [20.07761, 42.55582]]]] } },
34087 { type: "Feature", properties: { iso1A2: "AM", iso1A3: "ARM", iso1N3: "051", wikidata: "Q399", nameEn: "Armenia", groups: ["145", "142", "UN"], callingCodes: ["374"] }, geometry: { type: "MultiPolygon", coordinates: [[[[45.0133, 41.29747], [44.93493, 41.25685], [44.81437, 41.30371], [44.80053, 41.25949], [44.81749, 41.23488], [44.84358, 41.23088], [44.89911, 41.21366], [44.87887, 41.20195], [44.82084, 41.21513], [44.72814, 41.20338], [44.61462, 41.24018], [44.59322, 41.1933], [44.46791, 41.18204], [44.34417, 41.2382], [44.34337, 41.20312], [44.32139, 41.2079], [44.18148, 41.24644], [44.16591, 41.19141], [43.84835, 41.16329], [43.74717, 41.1117], [43.67712, 41.13398], [43.4717, 41.12611], [43.44984, 41.0988], [43.47319, 41.02251], [43.58683, 40.98961], [43.67712, 40.93084], [43.67712, 40.84846], [43.74872, 40.7365], [43.7425, 40.66805], [43.63664, 40.54159], [43.54791, 40.47413], [43.60862, 40.43267], [43.59928, 40.34019], [43.71136, 40.16673], [43.65221, 40.14889], [43.65688, 40.11199], [43.92307, 40.01787], [44.1057, 40.03555], [44.1778, 40.02845], [44.26973, 40.04866], [44.46635, 39.97733], [44.61845, 39.8281], [44.75779, 39.7148], [44.88354, 39.74432], [44.92869, 39.72157], [45.06604, 39.79277], [45.18554, 39.67846], [45.17464, 39.58614], [45.21784, 39.58074], [45.23535, 39.61373], [45.30385, 39.61373], [45.29606, 39.57654], [45.46992, 39.49888], [45.70547, 39.60174], [45.80804, 39.56716], [45.83, 39.46487], [45.79225, 39.3695], [45.99774, 39.28931], [46.02303, 39.09978], [46.06973, 39.0744], [46.14785, 38.84206], [46.20601, 38.85262], [46.34059, 38.92076], [46.53497, 38.86548], [46.51805, 38.94982], [46.54296, 39.07078], [46.44022, 39.19636], [46.52584, 39.18912], [46.54141, 39.15895], [46.58032, 39.21204], [46.63481, 39.23013], [46.56476, 39.24942], [46.50093, 39.33736], [46.43244, 39.35181], [46.37795, 39.42039], [46.4013, 39.45405], [46.53051, 39.47809], [46.51027, 39.52373], [46.57721, 39.54414], [46.57098, 39.56694], [46.52117, 39.58734], [46.42465, 39.57534], [46.40286, 39.63651], [46.18493, 39.60533], [45.96543, 39.78859], [45.82533, 39.82925], [45.7833, 39.9475], [45.60895, 39.97733], [45.59806, 40.0131], [45.78642, 40.03218], [45.83779, 39.98925], [45.97944, 40.181], [45.95609, 40.27846], [45.65098, 40.37696], [45.42994, 40.53804], [45.45484, 40.57707], [45.35366, 40.65979], [45.4206, 40.7424], [45.55914, 40.78366], [45.60584, 40.87436], [45.40814, 40.97904], [45.44083, 41.01663], [45.39725, 41.02603], [45.35677, 40.99784], [45.28859, 41.03757], [45.26162, 41.0228], [45.25897, 41.0027], [45.1994, 41.04518], [45.16493, 41.05068], [45.1634, 41.08082], [45.1313, 41.09369], [45.12923, 41.06059], [45.06784, 41.05379], [45.08028, 41.10917], [45.19942, 41.13299], [45.1969, 41.168], [45.11811, 41.19967], [45.05201, 41.19211], [45.02932, 41.2101], [45.05497, 41.2464], [45.0133, 41.29747]], [[45.21324, 40.9817], [45.21219, 40.99001], [45.20518, 40.99348], [45.19312, 40.98998], [45.18382, 41.0066], [45.20625, 41.01484], [45.23487, 41.00226], [45.23095, 40.97828], [45.21324, 40.9817]], [[45.00864, 41.03411], [44.9903, 41.05657], [44.96031, 41.06345], [44.95383, 41.07553], [44.97169, 41.09176], [45.00864, 41.09407], [45.03406, 41.07931], [45.04517, 41.06653], [45.03792, 41.03938], [45.00864, 41.03411]]], [[[45.50279, 40.58424], [45.56071, 40.64765], [45.51825, 40.67382], [45.47927, 40.65023], [45.50279, 40.58424]]]] } },
34088 { type: "Feature", properties: { iso1A2: "AO", iso1A3: "AGO", iso1N3: "024", wikidata: "Q916", nameEn: "Angola", groups: ["017", "202", "002", "UN"], callingCodes: ["244"] }, geometry: { type: "MultiPolygon", coordinates: [[[[16.55507, -5.85631], [13.04371, -5.87078], [12.42245, -6.07585], [11.95767, -5.94705], [12.20376, -5.76338], [12.26557, -5.74031], [12.52318, -5.74353], [12.52301, -5.17481], [12.53599, -5.1618], [12.53586, -5.14658], [12.51589, -5.1332], [12.49815, -5.14058], [12.46297, -5.09408], [12.60251, -5.01715], [12.63465, -4.94632], [12.70868, -4.95505], [12.8733, -4.74346], [13.11195, -4.67745], [13.09648, -4.63739], [12.91489, -4.47907], [12.87096, -4.40315], [12.76844, -4.38709], [12.64835, -4.55937], [12.40964, -4.60609], [12.32324, -4.78415], [12.25587, -4.79437], [12.20901, -4.75642], [12.16068, -4.90089], [12.00924, -5.02627], [11.50888, -5.33417], [10.5065, -17.25284], [11.75063, -17.25013], [12.07076, -17.15165], [12.52111, -17.24495], [12.97145, -16.98567], [13.36212, -16.98048], [13.95896, -17.43141], [14.28743, -17.38814], [18.39229, -17.38927], [18.84226, -17.80375], [21.14283, -17.94318], [21.42741, -18.02787], [23.47474, -17.62877], [23.20038, -17.47563], [22.17217, -16.50269], [22.00323, -16.18028], [21.97988, -13.00148], [24.03339, -12.99091], [23.90937, -12.844], [24.06672, -12.29058], [23.98804, -12.13149], [24.02603, -11.15368], [24.00027, -10.89356], [23.86868, -11.02856], [23.45631, -10.946], [23.16602, -11.10577], [22.54205, -11.05784], [22.25951, -11.24911], [22.17954, -10.85884], [22.32604, -10.76291], [22.19039, -9.94628], [21.84856, -9.59871], [21.79824, -7.29628], [20.56263, -7.28566], [20.61689, -6.90876], [20.31846, -6.91953], [20.30218, -6.98955], [19.5469, -7.00195], [19.33698, -7.99743], [18.33635, -8.00126], [17.5828, -8.13784], [16.96282, -7.21787], [16.55507, -5.85631]]]] } },
34089 { type: "Feature", properties: { iso1A2: "AQ", iso1A3: "ATA", iso1N3: "010", wikidata: "Q51", nameEn: "Antarctica", level: "region", callingCodes: ["672"] }, geometry: { type: "MultiPolygon", coordinates: [[[[180, -60], [-180, -60], [-180, -90], [180, -90], [180, -60]]]] } },
34090 { type: "Feature", properties: { iso1A2: "AR", iso1A3: "ARG", iso1N3: "032", wikidata: "Q414", nameEn: "Argentina", aliases: ["RA"], groups: ["005", "419", "019", "UN"], callingCodes: ["54"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-72.31343, -50.58411], [-72.33873, -51.59954], [-71.99889, -51.98018], [-69.97824, -52.00845], [-68.41683, -52.33516], [-68.60702, -52.65781], [-68.60733, -54.9125], [-68.01394, -54.8753], [-67.46182, -54.92205], [-67.11046, -54.94199], [-66.07313, -55.19618], [-63.67376, -55.11859], [-54.78916, -36.21945], [-57.83001, -34.69099], [-58.34425, -34.15035], [-58.44442, -33.84033], [-58.40475, -33.11777], [-58.1224, -32.98842], [-58.22362, -32.52416], [-58.10036, -32.25338], [-58.20252, -31.86966], [-58.00076, -31.65016], [-58.0023, -31.53084], [-58.07569, -31.44916], [-57.98127, -31.3872], [-57.9908, -31.34924], [-57.86729, -31.06352], [-57.89476, -30.95994], [-57.8024, -30.77193], [-57.89115, -30.49572], [-57.64859, -30.35095], [-57.61478, -30.25165], [-57.65132, -30.19229], [-57.09386, -29.74211], [-56.81251, -29.48154], [-56.62789, -29.18073], [-56.57295, -29.11357], [-56.54171, -29.11447], [-56.05265, -28.62651], [-56.00458, -28.60421], [-56.01729, -28.51223], [-55.65418, -28.18304], [-55.6262, -28.17124], [-55.33303, -27.94661], [-55.16872, -27.86224], [-55.1349, -27.89759], [-54.90805, -27.73149], [-54.90159, -27.63132], [-54.67657, -27.57214], [-54.50416, -27.48232], [-54.41888, -27.40882], [-54.19268, -27.30751], [-54.19062, -27.27639], [-54.15978, -27.2889], [-53.80144, -27.09844], [-53.73372, -26.6131], [-53.68269, -26.33359], [-53.64505, -26.28089], [-53.64186, -26.25976], [-53.64632, -26.24798], [-53.63881, -26.25075], [-53.63739, -26.2496], [-53.65237, -26.23289], [-53.65018, -26.19501], [-53.73968, -26.10012], [-53.73391, -26.07006], [-53.7264, -26.0664], [-53.73086, -26.05842], [-53.73511, -26.04211], [-53.83691, -25.94849], [-53.90831, -25.55513], [-54.52926, -25.62846], [-54.5502, -25.58915], [-54.59398, -25.59224], [-54.62063, -25.91213], [-54.60664, -25.9691], [-54.67359, -25.98607], [-54.69333, -26.37705], [-54.70732, -26.45099], [-54.80868, -26.55669], [-55.00584, -26.78754], [-55.06351, -26.80195], [-55.16948, -26.96068], [-55.25243, -26.93808], [-55.39611, -26.97679], [-55.62322, -27.1941], [-55.59094, -27.32444], [-55.74475, -27.44485], [-55.89195, -27.3467], [-56.18313, -27.29851], [-56.85337, -27.5165], [-58.04205, -27.2387], [-58.59549, -27.29973], [-58.65321, -27.14028], [-58.3198, -26.83443], [-58.1188, -26.16704], [-57.87176, -25.93604], [-57.57431, -25.47269], [-57.80821, -25.13863], [-58.25492, -24.92528], [-58.33055, -24.97099], [-59.33886, -24.49935], [-59.45482, -24.34787], [-60.03367, -24.00701], [-60.28163, -24.04436], [-60.99754, -23.80934], [-61.0782, -23.62932], [-61.9756, -23.0507], [-62.22768, -22.55807], [-62.51761, -22.37684], [-62.64455, -22.25091], [-62.8078, -22.12534], [-62.81124, -21.9987], [-63.66482, -21.99918], [-63.68113, -22.0544], [-63.70963, -21.99934], [-63.93287, -21.99934], [-64.22918, -22.55807], [-64.31489, -22.88824], [-64.35108, -22.73282], [-64.4176, -22.67692], [-64.58888, -22.25035], [-64.67174, -22.18957], [-64.90014, -22.12136], [-64.99524, -22.08255], [-65.47435, -22.08908], [-65.57743, -22.07675], [-65.58694, -22.09794], [-65.61166, -22.09504], [-65.7467, -22.10105], [-65.9261, -21.93335], [-66.04832, -21.9187], [-66.03836, -21.84829], [-66.24077, -21.77837], [-66.29714, -22.08741], [-66.7298, -22.23644], [-67.18382, -22.81525], [-66.99632, -22.99839], [-67.33563, -24.04237], [-68.24825, -24.42596], [-68.56909, -24.69831], [-68.38372, -25.08636], [-68.57622, -25.32505], [-68.38372, -26.15353], [-68.56909, -26.28146], [-68.59048, -26.49861], [-68.27677, -26.90626], [-68.43363, -27.08414], [-68.77586, -27.16029], [-69.22504, -27.95042], [-69.66709, -28.44055], [-69.80969, -29.07185], [-69.99507, -29.28351], [-69.8596, -30.26131], [-70.14479, -30.36595], [-70.55832, -31.51559], [-69.88099, -33.34489], [-69.87386, -34.13344], [-70.49416, -35.24145], [-70.38008, -36.02375], [-70.95047, -36.4321], [-71.24279, -37.20264], [-70.89532, -38.6923], [-71.37826, -38.91474], [-71.92726, -40.72714], [-71.74901, -42.11711], [-72.15541, -42.15941], [-72.14828, -42.85321], [-71.64206, -43.64774], [-71.81318, -44.38097], [-71.16436, -44.46244], [-71.26418, -44.75684], [-72.06985, -44.81756], [-71.35687, -45.22075], [-71.75614, -45.61611], [-71.68577, -46.55385], [-71.94152, -47.13595], [-72.50478, -47.80586], [-72.27662, -48.28727], [-72.54042, -48.52392], [-72.56894, -48.81116], [-73.09655, -49.14342], [-73.45156, -49.79461], [-73.55259, -49.92488], [-73.15765, -50.78337], [-72.31343, -50.58411]]]] } },
34091 { type: "Feature", properties: { iso1A2: "AS", iso1A3: "ASM", iso1N3: "016", wikidata: "Q16641", nameEn: "American Samoa", aliases: ["US-AS"], country: "US", groups: ["Q1352230", "061", "009", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 684"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-171.39864, -10.21587], [-170.99605, -15.1275], [-166.32598, -15.26169], [-171.39864, -10.21587]]]] } },
34092 { type: "Feature", properties: { iso1A2: "AT", iso1A3: "AUT", iso1N3: "040", wikidata: "Q40", nameEn: "Austria", groups: ["EU", "155", "150", "UN"], callingCodes: ["43"] }, geometry: { type: "MultiPolygon", coordinates: [[[[15.34823, 48.98444], [15.28305, 48.98831], [15.26177, 48.95766], [15.16358, 48.94278], [15.15534, 48.99056], [14.99878, 49.01444], [14.97612, 48.96983], [14.98917, 48.90082], [14.95072, 48.79101], [14.98032, 48.77959], [14.9782, 48.7766], [14.98112, 48.77524], [14.9758, 48.76857], [14.95641, 48.75915], [14.94773, 48.76268], [14.81545, 48.7874], [14.80821, 48.77711], [14.80584, 48.73489], [14.72756, 48.69502], [14.71794, 48.59794], [14.66762, 48.58215], [14.60808, 48.62881], [14.56139, 48.60429], [14.4587, 48.64695], [14.43076, 48.58855], [14.33909, 48.55852], [14.20691, 48.5898], [14.09104, 48.5943], [14.01482, 48.63788], [14.06151, 48.66873], [13.84023, 48.76988], [13.82266, 48.75544], [13.81863, 48.73257], [13.79337, 48.71375], [13.81791, 48.69832], [13.81283, 48.68426], [13.81901, 48.6761], [13.82609, 48.62345], [13.82208, 48.6151], [13.80038, 48.59487], [13.80519, 48.58026], [13.76921, 48.55324], [13.7513, 48.5624], [13.74816, 48.53058], [13.72802, 48.51208], [13.66113, 48.53558], [13.65186, 48.55092], [13.62508, 48.55501], [13.59705, 48.57013], [13.57535, 48.55912], [13.51291, 48.59023], [13.50131, 48.58091], [13.50663, 48.57506], [13.46967, 48.55157], [13.45214, 48.56472], [13.43695, 48.55776], [13.45727, 48.51092], [13.42527, 48.45711], [13.43929, 48.43386], [13.40656, 48.3719], [13.31419, 48.31643], [13.26039, 48.29422], [13.18093, 48.29577], [13.126, 48.27867], [13.0851, 48.27711], [13.02083, 48.25689], [12.95306, 48.20629], [12.87126, 48.20318], [12.84475, 48.16556], [12.836, 48.1647], [12.8362, 48.15876], [12.82673, 48.15245], [12.80676, 48.14979], [12.78595, 48.12445], [12.7617, 48.12796], [12.74973, 48.10885], [12.76141, 48.07373], [12.8549, 48.01122], [12.87476, 47.96195], [12.91683, 47.95647], [12.9211, 47.95135], [12.91985, 47.94069], [12.92668, 47.93879], [12.93419, 47.94063], [12.93642, 47.94436], [12.93886, 47.94046], [12.94163, 47.92927], [13.00588, 47.84374], [12.98543, 47.82896], [12.96311, 47.79957], [12.93202, 47.77302], [12.94371, 47.76281], [12.9353, 47.74788], [12.91711, 47.74026], [12.90274, 47.72513], [12.91333, 47.7178], [12.92969, 47.71094], [12.98578, 47.7078], [13.01382, 47.72116], [13.07692, 47.68814], [13.09562, 47.63304], [13.06407, 47.60075], [13.06641, 47.58577], [13.04537, 47.58183], [13.05355, 47.56291], [13.03252, 47.53373], [13.04537, 47.49426], [12.9998, 47.46267], [12.98344, 47.48716], [12.9624, 47.47452], [12.85256, 47.52741], [12.84672, 47.54556], [12.80699, 47.54477], [12.77427, 47.58025], [12.82101, 47.61493], [12.76492, 47.64485], [12.77435, 47.66102], [12.7357, 47.6787], [12.6071, 47.6741], [12.57438, 47.63238], [12.53816, 47.63553], [12.50076, 47.62293], [12.44117, 47.6741], [12.44018, 47.6952], [12.40137, 47.69215], [12.37222, 47.68433], [12.336, 47.69534], [12.27991, 47.68827], [12.26004, 47.67725], [12.24017, 47.69534], [12.26238, 47.73544], [12.2542, 47.7433], [12.22571, 47.71776], [12.18303, 47.70065], [12.16217, 47.70105], [12.16769, 47.68167], [12.18347, 47.66663], [12.18507, 47.65984], [12.19895, 47.64085], [12.20801, 47.61082], [12.20398, 47.60667], [12.18568, 47.6049], [12.17737, 47.60121], [12.18145, 47.61019], [12.17824, 47.61506], [12.13734, 47.60639], [12.05788, 47.61742], [12.02282, 47.61033], [12.0088, 47.62451], [11.85572, 47.60166], [11.84052, 47.58354], [11.63934, 47.59202], [11.60681, 47.57881], [11.58811, 47.55515], [11.58578, 47.52281], [11.52618, 47.50939], [11.4362, 47.51413], [11.38128, 47.47465], [11.4175, 47.44621], [11.33804, 47.44937], [11.29597, 47.42566], [11.27844, 47.39956], [11.22002, 47.3964], [11.25157, 47.43277], [11.20482, 47.43198], [11.12536, 47.41222], [11.11835, 47.39719], [10.97111, 47.39561], [10.97111, 47.41617], [10.98513, 47.42882], [10.92437, 47.46991], [10.93839, 47.48018], [10.90918, 47.48571], [10.87061, 47.4786], [10.86945, 47.5015], [10.91268, 47.51334], [10.88814, 47.53701], [10.77596, 47.51729], [10.7596, 47.53228], [10.6965, 47.54253], [10.68832, 47.55752], [10.63456, 47.5591], [10.60337, 47.56755], [10.56912, 47.53584], [10.48849, 47.54057], [10.45444, 47.5558], [10.48202, 47.58434], [10.43892, 47.58408], [10.42973, 47.57752], [10.45145, 47.55472], [10.4324, 47.50111], [10.44291, 47.48453], [10.46278, 47.47901], [10.47446, 47.43318], [10.4359, 47.41183], [10.4324, 47.38494], [10.39851, 47.37623], [10.33424, 47.30813], [10.23257, 47.27088], [10.17531, 47.27167], [10.17648, 47.29149], [10.2147, 47.31014], [10.19998, 47.32832], [10.23757, 47.37609], [10.22774, 47.38904], [10.2127, 47.38019], [10.17648, 47.38889], [10.16362, 47.36674], [10.11805, 47.37228], [10.09819, 47.35724], [10.06897, 47.40709], [10.1052, 47.4316], [10.09001, 47.46005], [10.07131, 47.45531], [10.03859, 47.48927], [10.00003, 47.48216], [9.97837, 47.51314], [9.97173, 47.51551], [9.96229, 47.53612], [9.92407, 47.53111], [9.87733, 47.54688], [9.87499, 47.52953], [9.8189, 47.54688], [9.82591, 47.58158], [9.80254, 47.59419], [9.77612, 47.59359], [9.75798, 47.57982], [9.73528, 47.54527], [9.73683, 47.53564], [9.72564, 47.53282], [9.55125, 47.53629], [9.56312, 47.49495], [9.58208, 47.48344], [9.59482, 47.46305], [9.60205, 47.46165], [9.60484, 47.46358], [9.60841, 47.47178], [9.62158, 47.45858], [9.62475, 47.45685], [9.6423, 47.45599], [9.65728, 47.45383], [9.65863, 47.44847], [9.64483, 47.43842], [9.6446, 47.43233], [9.65043, 47.41937], [9.65136, 47.40504], [9.6629, 47.39591], [9.67334, 47.39191], [9.67445, 47.38429], [9.6711, 47.37824], [9.66243, 47.37136], [9.65427, 47.36824], [9.62476, 47.36639], [9.59978, 47.34671], [9.58513, 47.31334], [9.55857, 47.29919], [9.54773, 47.2809], [9.53116, 47.27029], [9.56766, 47.24281], [9.55176, 47.22585], [9.56981, 47.21926], [9.58264, 47.20673], [9.56539, 47.17124], [9.62623, 47.14685], [9.63395, 47.08443], [9.61216, 47.07732], [9.60717, 47.06091], [9.87935, 47.01337], [9.88266, 46.93343], [9.98058, 46.91434], [10.10715, 46.84296], [10.22675, 46.86942], [10.24128, 46.93147], [10.30031, 46.92093], [10.36933, 47.00212], [10.42715, 46.97495], [10.42211, 46.96019], [10.48376, 46.93891], [10.47197, 46.85698], [10.54783, 46.84505], [10.66405, 46.87614], [10.75753, 46.82258], [10.72974, 46.78972], [11.00764, 46.76896], [11.10618, 46.92966], [11.33355, 46.99862], [11.50739, 47.00644], [11.74789, 46.98484], [12.19254, 47.09331], [12.21781, 47.03996], [12.11675, 47.01241], [12.2006, 46.88854], [12.27591, 46.88651], [12.38708, 46.71529], [12.59992, 46.6595], [12.94445, 46.60401], [13.27627, 46.56059], [13.64088, 46.53438], [13.7148, 46.5222], [13.89837, 46.52331], [14.00422, 46.48474], [14.04002, 46.49117], [14.12097, 46.47724], [14.15989, 46.43327], [14.28326, 46.44315], [14.314, 46.43327], [14.42608, 46.44614], [14.45877, 46.41717], [14.52176, 46.42617], [14.56463, 46.37208], [14.5942, 46.43434], [14.66892, 46.44936], [14.72185, 46.49974], [14.81836, 46.51046], [14.83549, 46.56614], [14.86419, 46.59411], [14.87129, 46.61], [14.92283, 46.60848], [14.96002, 46.63459], [14.98024, 46.6009], [15.01451, 46.641], [15.14215, 46.66131], [15.23711, 46.63994], [15.41235, 46.65556], [15.45514, 46.63697], [15.46906, 46.61321], [15.54431, 46.6312], [15.55333, 46.64988], [15.54533, 46.66985], [15.59826, 46.68908], [15.62317, 46.67947], [15.63255, 46.68069], [15.6365, 46.6894], [15.6543, 46.69228], [15.6543, 46.70616], [15.67411, 46.70735], [15.69523, 46.69823], [15.72279, 46.69548], [15.73823, 46.70011], [15.76771, 46.69863], [15.78518, 46.70712], [15.8162, 46.71897], [15.87691, 46.7211], [15.94864, 46.68769], [15.98512, 46.68463], [15.99988, 46.67947], [16.04036, 46.6549], [16.04347, 46.68694], [16.02808, 46.71094], [15.99769, 46.7266], [15.98432, 46.74991], [15.99126, 46.78199], [15.99054, 46.82772], [16.05786, 46.83927], [16.10983, 46.867], [16.19904, 46.94134], [16.22403, 46.939], [16.27594, 46.9643], [16.28202, 47.00159], [16.51369, 47.00084], [16.43936, 47.03548], [16.52176, 47.05747], [16.46134, 47.09395], [16.52863, 47.13974], [16.44932, 47.14418], [16.46442, 47.16845], [16.4523, 47.18812], [16.42801, 47.18422], [16.41739, 47.20649], [16.43663, 47.21127], [16.44142, 47.25079], [16.47782, 47.25918], [16.45104, 47.41181], [16.49908, 47.39416], [16.52414, 47.41007], [16.57152, 47.40868], [16.66203, 47.45571], [16.67049, 47.47426], [16.64821, 47.50155], [16.71059, 47.52692], [16.64193, 47.63114], [16.58699, 47.61772], [16.51643, 47.64538], [16.41442, 47.65936], [16.55129, 47.72268], [16.53514, 47.73837], [16.54779, 47.75074], [16.61183, 47.76171], [16.65679, 47.74197], [16.72089, 47.73469], [16.7511, 47.67878], [16.82938, 47.68432], [16.86509, 47.72268], [16.87538, 47.68895], [17.08893, 47.70928], [17.05048, 47.79377], [17.07039, 47.81129], [17.00995, 47.85836], [17.01645, 47.8678], [17.08275, 47.87719], [17.11269, 47.92736], [17.09786, 47.97336], [17.16001, 48.00636], [17.07039, 48.0317], [17.09168, 48.09366], [17.05735, 48.14179], [17.02919, 48.13996], [16.97701, 48.17385], [16.89461, 48.31332], [16.90903, 48.32519], [16.84243, 48.35258], [16.83317, 48.38138], [16.83588, 48.3844], [16.8497, 48.38321], [16.85204, 48.44968], [16.94611, 48.53614], [16.93955, 48.60371], [16.90354, 48.71541], [16.79779, 48.70998], [16.71883, 48.73806], [16.68518, 48.7281], [16.67008, 48.77699], [16.46134, 48.80865], [16.40915, 48.74576], [16.37345, 48.729], [16.06034, 48.75436], [15.84404, 48.86921], [15.78087, 48.87644], [15.75341, 48.8516], [15.6921, 48.85973], [15.61622, 48.89541], [15.51357, 48.91549], [15.48027, 48.94481], [15.34823, 48.98444]]]] } },
34093 { type: "Feature", properties: { iso1A2: "AU", iso1A3: "AUS", iso1N3: "036", wikidata: "Q408", nameEn: "Australia" }, geometry: null },
34094 { type: "Feature", properties: { iso1A2: "AW", iso1A3: "ABW", iso1N3: "533", wikidata: "Q21203", nameEn: "Aruba", aliases: ["NL-AW"], country: "NL", groups: ["Q1451600", "029", "003", "419", "019", "UN"], callingCodes: ["297"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-70.00823, 12.98375], [-70.35625, 12.58277], [-69.60231, 12.17], [-70.00823, 12.98375]]]] } },
34095 { type: "Feature", properties: { iso1A2: "AX", iso1A3: "ALA", iso1N3: "248", wikidata: "Q5689", nameEn: "\xC5land Islands", country: "FI", groups: ["EU", "154", "150", "UN"], callingCodes: ["358 18", "358 457"] }, geometry: { type: "MultiPolygon", coordinates: [[[[19.08191, 60.19152], [20.5104, 59.15546], [21.35468, 59.67511], [21.02509, 60.12142], [21.08159, 60.20167], [21.15143, 60.54555], [20.96741, 60.71528], [19.23413, 60.61414], [19.08191, 60.19152]]]] } },
34096 { type: "Feature", properties: { iso1A2: "AZ", iso1A3: "AZE", iso1N3: "031", wikidata: "Q227", nameEn: "Azerbaijan", groups: ["145", "142", "UN"], callingCodes: ["994"] }, geometry: { type: "MultiPolygon", coordinates: [[[[46.42738, 41.91323], [46.3984, 41.84399], [46.30863, 41.79133], [46.23962, 41.75811], [46.20538, 41.77205], [46.17891, 41.72094], [46.19759, 41.62327], [46.24429, 41.59883], [46.26531, 41.63339], [46.28182, 41.60089], [46.3253, 41.60912], [46.34039, 41.5947], [46.34126, 41.57454], [46.29794, 41.5724], [46.33925, 41.4963], [46.40307, 41.48464], [46.4669, 41.43331], [46.63658, 41.37727], [46.72375, 41.28609], [46.66148, 41.20533], [46.63969, 41.09515], [46.55096, 41.1104], [46.48558, 41.0576], [46.456, 41.09984], [46.37661, 41.10805], [46.27698, 41.19011], [46.13221, 41.19479], [45.95786, 41.17956], [45.80842, 41.2229], [45.69946, 41.29545], [45.75705, 41.35157], [45.71035, 41.36208], [45.68389, 41.3539], [45.45973, 41.45898], [45.4006, 41.42402], [45.31352, 41.47168], [45.26285, 41.46433], [45.1797, 41.42231], [45.09867, 41.34065], [45.0133, 41.29747], [45.05497, 41.2464], [45.02932, 41.2101], [45.05201, 41.19211], [45.11811, 41.19967], [45.1969, 41.168], [45.19942, 41.13299], [45.08028, 41.10917], [45.06784, 41.05379], [45.12923, 41.06059], [45.1313, 41.09369], [45.1634, 41.08082], [45.16493, 41.05068], [45.1994, 41.04518], [45.25897, 41.0027], [45.26162, 41.0228], [45.28859, 41.03757], [45.35677, 40.99784], [45.39725, 41.02603], [45.44083, 41.01663], [45.40814, 40.97904], [45.60584, 40.87436], [45.55914, 40.78366], [45.4206, 40.7424], [45.35366, 40.65979], [45.45484, 40.57707], [45.42994, 40.53804], [45.65098, 40.37696], [45.95609, 40.27846], [45.97944, 40.181], [45.83779, 39.98925], [45.78642, 40.03218], [45.59806, 40.0131], [45.60895, 39.97733], [45.7833, 39.9475], [45.82533, 39.82925], [45.96543, 39.78859], [46.18493, 39.60533], [46.40286, 39.63651], [46.42465, 39.57534], [46.52117, 39.58734], [46.57098, 39.56694], [46.57721, 39.54414], [46.51027, 39.52373], [46.53051, 39.47809], [46.4013, 39.45405], [46.37795, 39.42039], [46.43244, 39.35181], [46.50093, 39.33736], [46.56476, 39.24942], [46.63481, 39.23013], [46.58032, 39.21204], [46.54141, 39.15895], [46.52584, 39.18912], [46.44022, 39.19636], [46.54296, 39.07078], [46.51805, 38.94982], [46.53497, 38.86548], [46.75752, 39.03231], [46.83822, 39.13143], [46.92539, 39.16644], [46.95341, 39.13505], [47.05771, 39.20143], [47.05927, 39.24846], [47.31301, 39.37492], [47.38978, 39.45999], [47.50099, 39.49615], [47.84774, 39.66285], [47.98977, 39.70999], [48.34264, 39.42935], [48.37385, 39.37584], [48.15984, 39.30028], [48.12404, 39.25208], [48.15361, 39.19419], [48.31239, 39.09278], [48.33884, 39.03022], [48.28437, 38.97186], [48.08627, 38.94434], [48.07734, 38.91616], [48.01409, 38.90333], [48.02581, 38.82705], [48.24773, 38.71883], [48.3146, 38.59958], [48.45084, 38.61013], [48.58793, 38.45076], [48.62217, 38.40198], [48.70001, 38.40564], [48.78979, 38.45026], [48.81072, 38.44853], [48.84969, 38.45015], [48.88288, 38.43975], [52.39847, 39.43556], [48.80971, 41.95365], [48.5867, 41.84306], [48.55078, 41.77917], [48.42301, 41.65444], [48.40277, 41.60441], [48.2878, 41.56221], [48.22064, 41.51472], [48.07587, 41.49957], [47.87973, 41.21798], [47.75831, 41.19455], [47.62288, 41.22969], [47.54504, 41.20275], [47.49004, 41.26366], [47.34579, 41.27884], [47.10762, 41.59044], [47.03757, 41.55434], [46.99554, 41.59743], [47.00955, 41.63583], [46.8134, 41.76252], [46.75269, 41.8623], [46.58924, 41.80547], [46.5332, 41.87389], [46.42738, 41.91323]], [[45.50279, 40.58424], [45.47927, 40.65023], [45.51825, 40.67382], [45.56071, 40.64765], [45.50279, 40.58424]]], [[[45.00864, 41.03411], [45.03792, 41.03938], [45.04517, 41.06653], [45.03406, 41.07931], [45.00864, 41.09407], [44.97169, 41.09176], [44.95383, 41.07553], [44.96031, 41.06345], [44.9903, 41.05657], [45.00864, 41.03411]]], [[[45.21324, 40.9817], [45.23095, 40.97828], [45.23487, 41.00226], [45.20625, 41.01484], [45.18382, 41.0066], [45.19312, 40.98998], [45.20518, 40.99348], [45.21219, 40.99001], [45.21324, 40.9817]]], [[[45.46992, 39.49888], [45.29606, 39.57654], [45.30385, 39.61373], [45.23535, 39.61373], [45.21784, 39.58074], [45.17464, 39.58614], [45.18554, 39.67846], [45.06604, 39.79277], [44.92869, 39.72157], [44.88354, 39.74432], [44.75779, 39.7148], [44.80977, 39.65768], [44.81043, 39.62677], [44.88916, 39.59653], [44.96746, 39.42998], [45.05932, 39.36435], [45.08751, 39.35052], [45.16168, 39.21952], [45.30489, 39.18333], [45.40148, 39.09007], [45.40452, 39.07224], [45.44811, 39.04927], [45.44966, 38.99243], [45.6131, 38.964], [45.6155, 38.94304], [45.65172, 38.95199], [45.83883, 38.90768], [45.90266, 38.87739], [45.94624, 38.89072], [46.00228, 38.87376], [46.06766, 38.87861], [46.14785, 38.84206], [46.06973, 39.0744], [46.02303, 39.09978], [45.99774, 39.28931], [45.79225, 39.3695], [45.83, 39.46487], [45.80804, 39.56716], [45.70547, 39.60174], [45.46992, 39.49888]]]] } },
34097 { type: "Feature", properties: { iso1A2: "BA", iso1A3: "BIH", iso1N3: "070", wikidata: "Q225", nameEn: "Bosnia and Herzegovina", groups: ["039", "150", "UN"], callingCodes: ["387"] }, geometry: { type: "MultiPolygon", coordinates: [[[[17.84826, 45.04489], [17.66571, 45.13408], [17.59104, 45.10816], [17.51469, 45.10791], [17.47589, 45.12656], [17.45615, 45.12523], [17.4498, 45.16119], [17.41229, 45.13335], [17.33573, 45.14521], [17.32092, 45.16246], [17.26815, 45.18444], [17.25131, 45.14957], [17.24325, 45.146], [17.18438, 45.14764], [17.0415, 45.20759], [16.9385, 45.22742], [16.92405, 45.27607], [16.83804, 45.18951], [16.81137, 45.18434], [16.78219, 45.19002], [16.74845, 45.20393], [16.64962, 45.20714], [16.60194, 45.23042], [16.56559, 45.22307], [16.5501, 45.2212], [16.52982, 45.22713], [16.49155, 45.21153], [16.4634, 45.14522], [16.40023, 45.1147], [16.38309, 45.05955], [16.38219, 45.05139], [16.3749, 45.05206], [16.35863, 45.03529], [16.35404, 45.00241], [16.29036, 44.99732], [16.12153, 45.09616], [15.98412, 45.23088], [15.83512, 45.22459], [15.76371, 45.16508], [15.78842, 45.11519], [15.74585, 45.0638], [15.78568, 44.97401], [15.74723, 44.96818], [15.76096, 44.87045], [15.79472, 44.8455], [15.72584, 44.82334], [15.8255, 44.71501], [15.89348, 44.74964], [16.05828, 44.61538], [16.00884, 44.58605], [16.03012, 44.55572], [16.10566, 44.52586], [16.16814, 44.40679], [16.12969, 44.38275], [16.21346, 44.35231], [16.18688, 44.27012], [16.36864, 44.08263], [16.43662, 44.07523], [16.43629, 44.02826], [16.50528, 44.0244], [16.55472, 43.95326], [16.70922, 43.84887], [16.75316, 43.77157], [16.80736, 43.76011], [17.00585, 43.58037], [17.15828, 43.49376], [17.24411, 43.49376], [17.29699, 43.44542], [17.25579, 43.40353], [17.286, 43.33065], [17.46986, 43.16559], [17.64268, 43.08595], [17.70879, 42.97223], [17.5392, 42.92787], [17.6444, 42.88641], [17.68151, 42.92725], [17.7948, 42.89556], [17.80854, 42.9182], [17.88201, 42.83668], [18.24318, 42.6112], [18.36197, 42.61423], [18.43735, 42.55921], [18.49778, 42.58409], [18.53751, 42.57376], [18.55504, 42.58409], [18.52232, 42.62279], [18.57373, 42.64429], [18.54841, 42.68328], [18.54603, 42.69171], [18.55221, 42.69045], [18.56789, 42.72074], [18.47324, 42.74992], [18.45921, 42.81682], [18.47633, 42.85829], [18.4935, 42.86433], [18.49661, 42.89306], [18.49076, 42.95553], [18.52232, 43.01451], [18.66254, 43.03928], [18.64735, 43.14766], [18.66605, 43.2056], [18.71747, 43.2286], [18.6976, 43.25243], [18.76538, 43.29838], [18.85342, 43.32426], [18.84794, 43.33735], [18.83912, 43.34795], [18.90911, 43.36383], [18.95819, 43.32899], [18.95001, 43.29327], [19.00844, 43.24988], [19.04233, 43.30008], [19.08206, 43.29668], [19.08673, 43.31453], [19.04071, 43.397], [19.01078, 43.43854], [18.96053, 43.45042], [18.95469, 43.49367], [18.91379, 43.50299], [19.01078, 43.55806], [19.04934, 43.50384], [19.13933, 43.5282], [19.15685, 43.53943], [19.22807, 43.5264], [19.24774, 43.53061], [19.2553, 43.5938], [19.33426, 43.58833], [19.36653, 43.60921], [19.41941, 43.54056], [19.42696, 43.57987], [19.50455, 43.58385], [19.5176, 43.71403], [19.3986, 43.79668], [19.23465, 43.98764], [19.24363, 44.01502], [19.38439, 43.96611], [19.52515, 43.95573], [19.56498, 43.99922], [19.61836, 44.01464], [19.61991, 44.05254], [19.57467, 44.04716], [19.55999, 44.06894], [19.51167, 44.08158], [19.47321, 44.1193], [19.48386, 44.14332], [19.47338, 44.15034], [19.43905, 44.13088], [19.40927, 44.16722], [19.3588, 44.18353], [19.34773, 44.23244], [19.32464, 44.27185], [19.26945, 44.26957], [19.23306, 44.26097], [19.20508, 44.2917], [19.18328, 44.28383], [19.16741, 44.28648], [19.13332, 44.31492], [19.13556, 44.338], [19.11547, 44.34218], [19.1083, 44.3558], [19.11865, 44.36712], [19.10298, 44.36924], [19.10365, 44.37795], [19.10704, 44.38249], [19.10749, 44.39421], [19.11785, 44.40313], [19.14681, 44.41463], [19.14837, 44.45253], [19.12278, 44.50132], [19.13369, 44.52521], [19.16699, 44.52197], [19.26388, 44.65412], [19.32543, 44.74058], [19.36722, 44.88164], [19.18183, 44.92055], [19.01994, 44.85493], [18.8704, 44.85097], [18.76347, 44.90669], [18.76369, 44.93707], [18.80661, 44.93561], [18.78357, 44.97741], [18.65723, 45.07544], [18.47939, 45.05871], [18.41896, 45.11083], [18.32077, 45.1021], [18.24387, 45.13699], [18.1624, 45.07654], [18.03121, 45.12632], [18.01594, 45.15163], [17.99479, 45.14958], [17.97834, 45.13831], [17.97336, 45.12245], [17.93706, 45.08016], [17.87148, 45.04645], [17.84826, 45.04489]]]] } },
34098 { type: "Feature", properties: { iso1A2: "BB", iso1A3: "BRB", iso1N3: "052", wikidata: "Q244", nameEn: "Barbados", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", callingCodes: ["1 246"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-58.56442, 13.24471], [-59.80731, 13.87556], [-59.82929, 12.70644], [-58.56442, 13.24471]]]] } },
34099 { type: "Feature", properties: { iso1A2: "BD", iso1A3: "BGD", iso1N3: "050", wikidata: "Q902", nameEn: "Bangladesh", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["880"] }, geometry: { type: "MultiPolygon", coordinates: [[[[89.15869, 26.13708], [89.08899, 26.38845], [88.95612, 26.4564], [88.92357, 26.40711], [88.91321, 26.37984], [89.05328, 26.2469], [88.85004, 26.23211], [88.78961, 26.31093], [88.67837, 26.26291], [88.69485, 26.38353], [88.62144, 26.46783], [88.4298, 26.54489], [88.41196, 26.63837], [88.33093, 26.48929], [88.35153, 26.45241], [88.36938, 26.48683], [88.48749, 26.45855], [88.51649, 26.35923], [88.35153, 26.29123], [88.34757, 26.22216], [88.1844, 26.14417], [88.16581, 26.0238], [88.08804, 25.91334], [88.13138, 25.78773], [88.242, 25.80811], [88.45103, 25.66245], [88.4559, 25.59227], [88.677, 25.46959], [88.81296, 25.51546], [88.85278, 25.34679], [89.01105, 25.30303], [89.00463, 25.26583], [88.94067, 25.18534], [88.44766, 25.20149], [88.46277, 25.07468], [88.33917, 24.86803], [88.27325, 24.88796], [88.21832, 24.96642], [88.14004, 24.93529], [88.15515, 24.85806], [88.00683, 24.66477], [88.08786, 24.63232], [88.12296, 24.51301], [88.50934, 24.32474], [88.68801, 24.31464], [88.74841, 24.1959], [88.6976, 24.14703], [88.73743, 23.91751], [88.66189, 23.87607], [88.58087, 23.87105], [88.56507, 23.64044], [88.74841, 23.47361], [88.79351, 23.50535], [88.79254, 23.46028], [88.71133, 23.2492], [88.99148, 23.21134], [88.86377, 23.08759], [88.88327, 23.03885], [88.87063, 22.95235], [88.96713, 22.83346], [88.9151, 22.75228], [88.94614, 22.66941], [88.9367, 22.58527], [89.07114, 22.15335], [89.08044, 21.41871], [92.47409, 20.38654], [92.26071, 21.05697], [92.17752, 21.17445], [92.20087, 21.337], [92.37939, 21.47764], [92.43158, 21.37025], [92.55105, 21.3856], [92.60187, 21.24615], [92.68152, 21.28454], [92.59775, 21.6092], [92.62187, 21.87037], [92.60949, 21.97638], [92.56616, 22.13554], [92.60029, 22.1522], [92.5181, 22.71441], [92.37665, 22.9435], [92.38214, 23.28705], [92.26541, 23.70392], [92.15417, 23.73409], [92.04706, 23.64229], [91.95093, 23.73284], [91.95642, 23.47361], [91.84789, 23.42235], [91.76417, 23.26619], [91.81634, 23.08001], [91.7324, 23.00043], [91.61571, 22.93929], [91.54993, 23.01051], [91.46615, 23.2328], [91.4035, 23.27522], [91.40848, 23.07117], [91.36453, 23.06612], [91.28293, 23.37538], [91.15579, 23.6599], [91.25192, 23.83463], [91.22308, 23.89616], [91.29587, 24.0041], [91.35741, 23.99072], [91.37414, 24.10693], [91.55542, 24.08687], [91.63782, 24.1132], [91.65292, 24.22095], [91.73257, 24.14703], [91.76004, 24.23848], [91.82596, 24.22345], [91.89258, 24.14674], [91.96603, 24.3799], [92.11662, 24.38997], [92.15796, 24.54435], [92.25854, 24.9191], [92.38626, 24.86055], [92.49887, 24.88796], [92.39147, 25.01471], [92.33957, 25.07593], [92.0316, 25.1834], [91.63648, 25.12846], [91.25517, 25.20677], [90.87427, 25.15799], [90.65042, 25.17788], [90.40034, 25.1534], [90.1155, 25.22686], [89.90478, 25.31038], [89.87629, 25.28337], [89.83371, 25.29548], [89.84086, 25.31854], [89.81208, 25.37244], [89.86129, 25.61714], [89.84388, 25.70042], [89.80585, 25.82489], [89.86592, 25.93115], [89.77728, 26.04254], [89.77865, 26.08387], [89.73581, 26.15818], [89.70201, 26.15138], [89.63968, 26.22595], [89.57101, 25.9682], [89.53515, 26.00382], [89.35953, 26.0077], [89.15869, 26.13708]]]] } },
34100 { type: "Feature", properties: { iso1A2: "BE", iso1A3: "BEL", iso1N3: "056", wikidata: "Q31", nameEn: "Belgium", groups: ["EU", "155", "150", "UN"], callingCodes: ["32"] }, geometry: { type: "MultiPolygon", coordinates: [[[[4.93295, 51.44945], [4.93909, 51.44632], [4.9524, 51.45014], [4.95244, 51.45207], [4.93295, 51.44945]]], [[[4.91493, 51.4353], [4.92652, 51.43329], [4.92952, 51.42984], [4.93986, 51.43064], [4.94265, 51.44003], [4.93471, 51.43861], [4.93416, 51.44185], [4.94025, 51.44193], [4.93544, 51.44634], [4.92879, 51.44161], [4.92815, 51.43856], [4.92566, 51.44273], [4.92811, 51.4437], [4.92287, 51.44741], [4.91811, 51.44621], [4.92227, 51.44252], [4.91935, 51.43634], [4.91493, 51.4353]]], [[[4.82946, 51.4213], [4.82409, 51.44736], [4.84139, 51.4799], [4.78803, 51.50284], [4.77321, 51.50529], [4.74578, 51.48937], [4.72935, 51.48424], [4.65442, 51.42352], [4.57489, 51.4324], [4.53521, 51.4243], [4.52846, 51.45002], [4.54675, 51.47265], [4.5388, 51.48184], [4.47736, 51.4778], [4.38122, 51.44905], [4.39747, 51.43316], [4.38064, 51.41965], [4.43777, 51.36989], [4.39292, 51.35547], [4.34086, 51.35738], [4.33265, 51.37687], [4.21923, 51.37443], [4.24024, 51.35371], [4.16721, 51.29348], [4.05165, 51.24171], [4.01957, 51.24504], [3.97889, 51.22537], [3.90125, 51.20371], [3.78783, 51.2151], [3.78999, 51.25766], [3.58939, 51.30064], [3.51502, 51.28697], [3.52698, 51.2458], [3.43488, 51.24135], [3.41704, 51.25933], [3.38289, 51.27331], [3.35847, 51.31572], [3.38696, 51.33436], [3.36263, 51.37112], [2.56575, 51.85301], [2.18458, 51.52087], [2.55904, 51.07014], [2.57551, 51.00326], [2.63074, 50.94746], [2.59093, 50.91751], [2.63331, 50.81457], [2.71165, 50.81295], [2.81056, 50.71773], [2.8483, 50.72276], [2.86985, 50.7033], [2.87937, 50.70298], [2.88504, 50.70656], [2.90069, 50.69263], [2.91036, 50.6939], [2.90873, 50.702], [2.95019, 50.75138], [2.96778, 50.75242], [3.00537, 50.76588], [3.04314, 50.77674], [3.09163, 50.77717], [3.10614, 50.78303], [3.11206, 50.79416], [3.11987, 50.79188], [3.1257, 50.78603], [3.15017, 50.79031], [3.16476, 50.76843], [3.18339, 50.74981], [3.18811, 50.74025], [3.20064, 50.73547], [3.19017, 50.72569], [3.20845, 50.71662], [3.22042, 50.71019], [3.24593, 50.71389], [3.26063, 50.70086], [3.26141, 50.69151], [3.2536, 50.68977], [3.264, 50.67668], [3.23951, 50.6585], [3.2729, 50.60718], [3.28575, 50.52724], [3.37693, 50.49538], [3.44629, 50.51009], [3.47385, 50.53397], [3.51564, 50.5256], [3.49509, 50.48885], [3.5683, 50.50192], [3.58361, 50.49049], [3.61014, 50.49568], [3.64426, 50.46275], [3.66153, 50.45165], [3.67494, 50.40239], [3.67262, 50.38663], [3.65709, 50.36873], [3.66976, 50.34563], [3.71009, 50.30305], [3.70987, 50.3191], [3.73911, 50.34809], [3.84314, 50.35219], [3.90781, 50.32814], [3.96771, 50.34989], [4.0268, 50.35793], [4.0689, 50.3254], [4.10237, 50.31247], [4.10957, 50.30234], [4.11954, 50.30425], [4.13665, 50.25609], [4.16808, 50.25786], [4.15524, 50.2833], [4.17347, 50.28838], [4.17861, 50.27443], [4.20651, 50.27333], [4.21945, 50.25539], [4.15524, 50.21103], [4.16014, 50.19239], [4.13561, 50.13078], [4.20147, 50.13535], [4.23101, 50.06945], [4.16294, 50.04719], [4.13508, 50.01976], [4.14239, 49.98034], [4.20532, 49.95803], [4.31963, 49.97043], [4.35051, 49.95315], [4.43488, 49.94122], [4.51098, 49.94659], [4.5414, 49.96911], [4.68695, 49.99685], [4.70064, 50.09384], [4.75237, 50.11314], [4.82438, 50.16878], [4.83279, 50.15331], [4.88602, 50.15182], [4.8382, 50.06738], [4.78827, 49.95609], [4.88529, 49.9236], [4.85134, 49.86457], [4.86965, 49.82271], [4.85464, 49.78995], [4.96714, 49.79872], [5.09249, 49.76193], [5.14545, 49.70287], [5.26232, 49.69456], [5.31465, 49.66846], [5.33039, 49.6555], [5.30214, 49.63055], [5.3137, 49.61225], [5.33851, 49.61599], [5.34837, 49.62889], [5.3974, 49.61596], [5.43713, 49.5707], [5.46734, 49.52648], [5.46541, 49.49825], [5.55001, 49.52729], [5.60909, 49.51228], [5.64505, 49.55146], [5.75649, 49.54321], [5.7577, 49.55915], [5.77435, 49.56298], [5.79195, 49.55228], [5.81838, 49.54777], [5.84143, 49.5533], [5.84692, 49.55663], [5.8424, 49.56082], [5.87256, 49.57539], [5.86986, 49.58756], [5.84971, 49.58674], [5.84826, 49.5969], [5.8762, 49.60898], [5.87609, 49.62047], [5.88393, 49.62802], [5.88552, 49.63507], [5.90599, 49.63853], [5.90164, 49.6511], [5.9069, 49.66377], [5.86175, 49.67862], [5.86527, 49.69291], [5.88677, 49.70951], [5.86503, 49.72739], [5.84193, 49.72161], [5.82562, 49.72395], [5.83149, 49.74729], [5.82245, 49.75048], [5.78871, 49.7962], [5.75409, 49.79239], [5.74953, 49.81428], [5.74364, 49.82058], [5.74844, 49.82435], [5.7404, 49.83452], [5.74076, 49.83823], [5.74975, 49.83933], [5.74953, 49.84709], [5.75884, 49.84811], [5.74567, 49.85368], [5.75861, 49.85631], [5.75269, 49.8711], [5.78415, 49.87922], [5.73621, 49.89796], [5.77314, 49.93646], [5.77291, 49.96056], [5.80833, 49.96451], [5.81163, 49.97142], [5.83467, 49.97823], [5.83968, 49.9892], [5.82331, 49.99662], [5.81866, 50.01286], [5.8551, 50.02683], [5.86904, 50.04614], [5.85474, 50.06342], [5.8857, 50.07824], [5.89488, 50.11476], [5.95929, 50.13295], [5.96453, 50.17259], [6.02488, 50.18283], [6.03093, 50.16362], [6.06406, 50.15344], [6.08577, 50.17246], [6.12028, 50.16374], [6.1137, 50.13668], [6.1379, 50.12964], [6.15298, 50.14126], [6.14132, 50.14971], [6.14588, 50.17106], [6.18739, 50.1822], [6.18364, 50.20815], [6.16853, 50.2234], [6.208, 50.25179], [6.28797, 50.27458], [6.29949, 50.30887], [6.32488, 50.32333], [6.35701, 50.31139], [6.40641, 50.32425], [6.40785, 50.33557], [6.3688, 50.35898], [6.34406, 50.37994], [6.36852, 50.40776], [6.37219, 50.45397], [6.34005, 50.46083], [6.3465, 50.48833], [6.30809, 50.50058], [6.26637, 50.50272], [6.22335, 50.49578], [6.20599, 50.52089], [6.19193, 50.5212], [6.18716, 50.52653], [6.19579, 50.5313], [6.19735, 50.53576], [6.17802, 50.54179], [6.17739, 50.55875], [6.20281, 50.56952], [6.22581, 50.5907], [6.24005, 50.58732], [6.24888, 50.59869], [6.2476, 50.60392], [6.26957, 50.62444], [6.17852, 50.6245], [6.11707, 50.72231], [6.04428, 50.72861], [6.0406, 50.71848], [6.0326, 50.72647], [6.03889, 50.74618], [6.01976, 50.75398], [5.97545, 50.75441], [5.95942, 50.7622], [5.89132, 50.75124], [5.89129, 50.75125], [5.88734, 50.77092], [5.84888, 50.75448], [5.84548, 50.76542], [5.80673, 50.7558], [5.77513, 50.78308], [5.76533, 50.78159], [5.74356, 50.7691], [5.73904, 50.75674], [5.72216, 50.76398], [5.69469, 50.75529], [5.68091, 50.75804], [5.70107, 50.7827], [5.68995, 50.79641], [5.70118, 50.80764], [5.65259, 50.82309], [5.64009, 50.84742], [5.64504, 50.87107], [5.67886, 50.88142], [5.69858, 50.91046], [5.71626, 50.90796], [5.72644, 50.91167], [5.72545, 50.92312], [5.74644, 50.94723], [5.75927, 50.95601], [5.74752, 50.96202], [5.72875, 50.95428], [5.71864, 50.96092], [5.76242, 50.99703], [5.77688, 51.02483], [5.75961, 51.03113], [5.77258, 51.06196], [5.79835, 51.05834], [5.79903, 51.09371], [5.82921, 51.09328], [5.83226, 51.10585], [5.8109, 51.10861], [5.80798, 51.11661], [5.85508, 51.14445], [5.82564, 51.16753], [5.77697, 51.1522], [5.77735, 51.17845], [5.74617, 51.18928], [5.70344, 51.1829], [5.65528, 51.18736], [5.65145, 51.19788], [5.5603, 51.22249], [5.5569, 51.26544], [5.515, 51.29462], [5.48476, 51.30053], [5.46519, 51.2849], [5.4407, 51.28169], [5.41672, 51.26248], [5.347, 51.27502], [5.33886, 51.26314], [5.29716, 51.26104], [5.26461, 51.26693], [5.23814, 51.26064], [5.22542, 51.26888], [5.24244, 51.30495], [5.2002, 51.32243], [5.16222, 51.31035], [5.13377, 51.31592], [5.13105, 51.34791], [5.07102, 51.39469], [5.10456, 51.43163], [5.07891, 51.4715], [5.04774, 51.47022], [5.03281, 51.48679], [5.0106, 51.47167], [5.00393, 51.44406], [4.92152, 51.39487], [4.90016, 51.41404], [4.84988, 51.41502], [4.78941, 51.41102], [4.77229, 51.41337], [4.76577, 51.43046], [4.78314, 51.43319], [4.82946, 51.4213]]]] } },
34101 { type: "Feature", properties: { iso1A2: "BF", iso1A3: "BFA", iso1N3: "854", wikidata: "Q965", nameEn: "Burkina Faso", groups: ["011", "202", "002", "UN"], callingCodes: ["226"] }, geometry: { type: "MultiPolygon", coordinates: [[[[0.23859, 15.00135], [0.06588, 14.96961], [-0.24673, 15.07805], [-0.72004, 15.08655], [-1.05875, 14.7921], [-1.32166, 14.72774], [-1.68083, 14.50023], [-1.97945, 14.47709], [-1.9992, 14.19011], [-2.10223, 14.14878], [-2.47587, 14.29671], [-2.66175, 14.14713], [-2.84667, 14.05532], [-2.90831, 13.81174], [-2.88189, 13.64921], [-3.26407, 13.70699], [-3.28396, 13.5422], [-3.23599, 13.29035], [-3.43507, 13.27272], [-3.4313, 13.1588], [-3.54454, 13.1781], [-3.7911, 13.36665], [-3.96282, 13.38164], [-3.90558, 13.44375], [-3.96501, 13.49778], [-4.34477, 13.12927], [-4.21819, 12.95722], [-4.238, 12.71467], [-4.47356, 12.71252], [-4.41412, 12.31922], [-4.57703, 12.19875], [-4.54841, 12.1385], [-4.62546, 12.13204], [-4.62987, 12.06531], [-4.70692, 12.06746], [-4.72893, 12.01579], [-5.07897, 11.97918], [-5.26389, 11.84778], [-5.40258, 11.8327], [-5.26389, 11.75728], [-5.29251, 11.61715], [-5.22867, 11.60421], [-5.20665, 11.43811], [-5.25509, 11.36905], [-5.25949, 11.24816], [-5.32553, 11.21578], [-5.32994, 11.13371], [-5.49284, 11.07538], [-5.41579, 10.84628], [-5.47083, 10.75329], [-5.46643, 10.56074], [-5.51058, 10.43177], [-5.39602, 10.2929], [-5.12465, 10.29788], [-4.96453, 9.99923], [-4.96621, 9.89132], [-4.6426, 9.70696], [-4.31392, 9.60062], [-4.25999, 9.76012], [-3.69703, 9.94279], [-3.31779, 9.91125], [-3.27228, 9.84981], [-3.19306, 9.93781], [-3.16609, 9.85147], [-3.00765, 9.74019], [-2.93012, 9.57403], [-2.76494, 9.40778], [-2.68802, 9.49343], [-2.76534, 9.56589], [-2.74174, 9.83172], [-2.83108, 10.40252], [-2.94232, 10.64281], [-2.83373, 11.0067], [-0.67143, 10.99811], [-0.61937, 10.91305], [-0.44298, 11.04292], [-0.42391, 11.11661], [-0.38219, 11.12596], [-0.35955, 11.07801], [-0.28566, 11.12713], [-0.27374, 11.17157], [-0.13493, 11.14075], [0.50388, 11.01011], [0.48852, 10.98561], [0.50521, 10.98035], [0.4958, 10.93269], [0.66104, 10.99964], [0.91245, 10.99597], [0.9813, 11.08876], [1.03409, 11.04719], [1.42823, 11.46822], [2.00988, 11.42227], [2.29983, 11.68254], [2.39723, 11.89473], [2.05785, 12.35539], [2.26349, 12.41915], [0.99167, 13.10727], [0.99253, 13.37515], [1.18873, 13.31771], [1.21217, 13.37853], [1.24516, 13.33968], [1.28509, 13.35488], [1.24429, 13.39373], [1.20088, 13.38951], [1.02813, 13.46635], [0.99514, 13.5668], [0.77637, 13.64442], [0.77377, 13.6866], [0.61924, 13.68491], [0.38051, 14.05575], [0.16936, 14.51654], [0.23859, 15.00135]]]] } },
34102 { type: "Feature", properties: { iso1A2: "BG", iso1A3: "BGR", iso1N3: "100", wikidata: "Q219", nameEn: "Bulgaria", groups: ["EU", "151", "150", "UN"], callingCodes: ["359"] }, geometry: { type: "MultiPolygon", coordinates: [[[[23.05288, 43.79494], [22.85314, 43.84452], [22.83753, 43.88055], [22.87873, 43.9844], [23.01674, 44.01946], [23.04988, 44.07694], [22.67173, 44.21564], [22.61711, 44.16938], [22.61688, 44.06534], [22.41449, 44.00514], [22.35558, 43.81281], [22.41043, 43.69566], [22.47582, 43.6558], [22.53397, 43.47225], [22.82036, 43.33665], [22.89727, 43.22417], [23.00806, 43.19279], [22.98104, 43.11199], [22.89521, 43.03625], [22.78397, 42.98253], [22.74826, 42.88701], [22.54302, 42.87774], [22.43309, 42.82057], [22.4997, 42.74144], [22.43983, 42.56851], [22.55669, 42.50144], [22.51961, 42.3991], [22.47498, 42.3915], [22.45919, 42.33822], [22.34773, 42.31725], [22.38136, 42.30339], [22.47251, 42.20393], [22.50289, 42.19527], [22.51224, 42.15457], [22.67701, 42.06614], [22.86749, 42.02275], [22.90254, 41.87587], [22.96682, 41.77137], [23.01239, 41.76527], [23.03342, 41.71034], [22.95513, 41.63265], [22.96331, 41.35782], [22.93334, 41.34104], [23.1833, 41.31755], [23.21953, 41.33773], [23.22771, 41.37106], [23.31301, 41.40525], [23.33639, 41.36317], [23.40416, 41.39999], [23.52453, 41.40262], [23.63203, 41.37632], [23.67644, 41.41139], [23.76525, 41.40175], [23.80148, 41.43943], [23.89613, 41.45257], [23.91483, 41.47971], [23.96975, 41.44118], [24.06908, 41.46132], [24.06323, 41.53222], [24.10063, 41.54796], [24.18126, 41.51735], [24.27124, 41.57682], [24.30513, 41.51297], [24.52599, 41.56808], [24.61129, 41.42278], [24.71529, 41.41928], [24.8041, 41.34913], [24.82514, 41.4035], [24.86136, 41.39298], [24.90928, 41.40876], [24.942, 41.38685], [25.11611, 41.34212], [25.28322, 41.23411], [25.48187, 41.28506], [25.52394, 41.2798], [25.55082, 41.31667], [25.61042, 41.30614], [25.66183, 41.31316], [25.70507, 41.29209], [25.8266, 41.34563], [25.87919, 41.30526], [26.12926, 41.35878], [26.16548, 41.42278], [26.20288, 41.43943], [26.14796, 41.47533], [26.176, 41.50072], [26.17951, 41.55409], [26.14328, 41.55496], [26.15146, 41.60828], [26.07083, 41.64584], [26.06148, 41.70345], [26.16841, 41.74858], [26.21325, 41.73223], [26.22888, 41.74139], [26.2654, 41.71544], [26.30255, 41.70925], [26.35957, 41.71149], [26.32952, 41.73637], [26.33589, 41.76802], [26.36952, 41.82265], [26.53968, 41.82653], [26.57961, 41.90024], [26.56051, 41.92995], [26.62996, 41.97644], [26.79143, 41.97386], [26.95638, 42.00741], [27.03277, 42.0809], [27.08486, 42.08735], [27.19251, 42.06028], [27.22376, 42.10152], [27.27411, 42.10409], [27.45478, 41.96591], [27.52379, 41.93756], [27.55191, 41.90928], [27.69949, 41.97515], [27.81235, 41.94803], [27.83492, 41.99709], [27.91479, 41.97902], [28.02971, 41.98066], [28.32297, 41.98371], [29.24336, 43.70874], [28.23293, 43.76], [27.99558, 43.84193], [27.92008, 44.00761], [27.73468, 43.95326], [27.64542, 44.04958], [27.60834, 44.01206], [27.39757, 44.0141], [27.26845, 44.12602], [26.95141, 44.13555], [26.62712, 44.05698], [26.38764, 44.04356], [26.10115, 43.96908], [26.05584, 43.90925], [25.94911, 43.85745], [25.72792, 43.69263], [25.39528, 43.61866], [25.17144, 43.70261], [25.10718, 43.6831], [24.96682, 43.72693], [24.73542, 43.68523], [24.62281, 43.74082], [24.50264, 43.76314], [24.35364, 43.70211], [24.18149, 43.68218], [23.73978, 43.80627], [23.61687, 43.79289], [23.4507, 43.84936], [23.26772, 43.84843], [23.05288, 43.79494]]]] } },
34103 { type: "Feature", properties: { iso1A2: "BH", iso1A3: "BHR", iso1N3: "048", wikidata: "Q398", nameEn: "Bahrain", groups: ["145", "142", "UN"], callingCodes: ["973"] }, geometry: { type: "MultiPolygon", coordinates: [[[[50.93865, 26.30758], [50.71771, 26.73086], [50.38162, 26.53976], [50.26923, 26.08243], [50.302, 25.87592], [50.57069, 25.57887], [50.80824, 25.54641], [50.7801, 25.595], [50.86149, 25.6965], [50.81266, 25.88946], [50.93865, 26.30758]]]] } },
34104 { type: "Feature", properties: { iso1A2: "BI", iso1A3: "BDI", iso1N3: "108", wikidata: "Q967", nameEn: "Burundi", groups: ["014", "202", "002", "UN"], callingCodes: ["257"] }, geometry: { type: "MultiPolygon", coordinates: [[[[30.54501, -2.41404], [30.42933, -2.31064], [30.14034, -2.43626], [29.95911, -2.33348], [29.88237, -2.75105], [29.36805, -2.82933], [29.32234, -2.6483], [29.0562, -2.58632], [29.04081, -2.7416], [29.00167, -2.78523], [29.00404, -2.81978], [29.0505, -2.81774], [29.09119, -2.87871], [29.09797, -2.91935], [29.16037, -2.95457], [29.17258, -2.99385], [29.25633, -3.05471], [29.21463, -3.3514], [29.23708, -3.75856], [29.43673, -4.44845], [29.63827, -4.44681], [29.75109, -4.45836], [29.77289, -4.41733], [29.82885, -4.36153], [29.88172, -4.35743], [30.03323, -4.26631], [30.22042, -4.01738], [30.45915, -3.56532], [30.84165, -3.25152], [30.83823, -2.97837], [30.6675, -2.98987], [30.57926, -2.89791], [30.4987, -2.9573], [30.40662, -2.86151], [30.52747, -2.65841], [30.41789, -2.66266], [30.54501, -2.41404]]]] } },
34105 { type: "Feature", properties: { iso1A2: "BJ", iso1A3: "BEN", iso1N3: "204", wikidata: "Q962", nameEn: "Benin", aliases: ["DY"], groups: ["011", "202", "002", "UN"], callingCodes: ["229"] }, geometry: { type: "MultiPolygon", coordinates: [[[[3.59375, 11.70269], [3.48187, 11.86092], [3.31613, 11.88495], [3.25352, 12.01467], [2.83978, 12.40585], [2.6593, 12.30631], [2.37783, 12.24804], [2.39657, 12.10952], [2.45824, 11.98672], [2.39723, 11.89473], [2.29983, 11.68254], [2.00988, 11.42227], [1.42823, 11.46822], [1.03409, 11.04719], [0.9813, 11.08876], [0.91245, 10.99597], [0.8804, 10.803], [0.80358, 10.71459], [0.77666, 10.37665], [1.35507, 9.99525], [1.36624, 9.5951], [1.33675, 9.54765], [1.41746, 9.3226], [1.5649, 9.16941], [1.61838, 9.0527], [1.64249, 6.99562], [1.55877, 6.99737], [1.61812, 6.74843], [1.58105, 6.68619], [1.76906, 6.43189], [1.79826, 6.28221], [1.62913, 6.24075], [1.67336, 6.02702], [2.74181, 6.13349], [2.70566, 6.38038], [2.70464, 6.50831], [2.74334, 6.57291], [2.7325, 6.64057], [2.78204, 6.70514], [2.78823, 6.76356], [2.73405, 6.78508], [2.74024, 6.92802], [2.71702, 6.95722], [2.76965, 7.13543], [2.74489, 7.42565], [2.79442, 7.43486], [2.78668, 7.5116], [2.73405, 7.5423], [2.73095, 7.7755], [2.67523, 7.87825], [2.77907, 9.06924], [3.08017, 9.10006], [3.14147, 9.28375], [3.13928, 9.47167], [3.25093, 9.61632], [3.34726, 9.70696], [3.32099, 9.78032], [3.35383, 9.83641], [3.54429, 9.87739], [3.66908, 10.18136], [3.57275, 10.27185], [3.6844, 10.46351], [3.78292, 10.40538], [3.84243, 10.59316], [3.71505, 11.13015], [3.49175, 11.29765], [3.59375, 11.70269]]]] } },
34106 { type: "Feature", properties: { iso1A2: "BL", iso1A3: "BLM", iso1N3: "652", wikidata: "Q25362", nameEn: "Saint-Barth\xE9lemy", country: "FR", groups: ["EU", "Q1451600", "029", "003", "419", "019", "UN"], callingCodes: ["590"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-62.62718, 18.26185], [-63.1055, 17.86651], [-62.34423, 17.49165], [-62.62718, 18.26185]]]] } },
34107 { type: "Feature", properties: { iso1A2: "BM", iso1A3: "BMU", iso1N3: "060", wikidata: "Q23635", nameEn: "Bermuda", country: "GB", groups: ["BOTS", "021", "003", "019", "UN"], driveSide: "left", callingCodes: ["1 441"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.20987, 32.6953], [-65.31453, 32.68437], [-65.63955, 31.43417], [-63.20987, 32.6953]]]] } },
34108 { type: "Feature", properties: { iso1A2: "BN", iso1A3: "BRN", iso1N3: "096", wikidata: "Q921", nameEn: "Brunei", groups: ["Q36117", "035", "142", "UN"], driveSide: "left", callingCodes: ["673"] }, geometry: { type: "MultiPolygon", coordinates: [[[[115.16236, 5.01011], [115.02521, 5.35005], [114.10166, 4.76112], [114.07448, 4.58441], [114.15813, 4.57], [114.26876, 4.49878], [114.32176, 4.34942], [114.32176, 4.2552], [114.4416, 4.27588], [114.49922, 4.13108], [114.64211, 4.00694], [114.78539, 4.12205], [114.88039, 4.4257], [114.83189, 4.42387], [114.77303, 4.72871], [114.8266, 4.75062], [114.88841, 4.81905], [114.96982, 4.81146], [114.99417, 4.88201], [115.05038, 4.90275], [115.02955, 4.82087], [115.02278, 4.74137], [115.04064, 4.63706], [115.07737, 4.53418], [115.09978, 4.39123], [115.31275, 4.30806], [115.36346, 4.33563], [115.2851, 4.42295], [115.27819, 4.63661], [115.20737, 4.8256], [115.15092, 4.87604], [115.16236, 5.01011]]]] } },
34109 { type: "Feature", properties: { iso1A2: "BO", iso1A3: "BOL", iso1N3: "068", wikidata: "Q750", nameEn: "Bolivia", groups: ["005", "419", "019", "UN"], callingCodes: ["591"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.90248, -12.52544], [-64.22539, -12.45267], [-64.40519, -12.45065], [-64.99778, -11.98604], [-65.30027, -11.48749], [-65.28141, -10.86289], [-65.35402, -10.78685], [-65.37923, -10.35141], [-65.28979, -10.21932], [-65.32696, -10.06449], [-65.29019, -9.86253], [-65.40615, -9.63894], [-65.56244, -9.84266], [-65.68343, -9.75323], [-66.61289, -9.93233], [-67.12883, -10.31634], [-67.18847, -10.33951], [-67.1917, -10.32944], [-67.21325, -10.3208], [-67.67724, -10.60263], [-68.71533, -11.14749], [-68.7651, -11.0496], [-68.75179, -11.03688], [-68.75265, -11.02383], [-68.74802, -11.00891], [-68.75452, -11.00821], [-68.76092, -11.01726], [-68.7638, -11.01693], [-68.76291, -11.00728], [-69.42792, -10.93451], [-69.47839, -10.95254], [-69.57156, -10.94555], [-68.98115, -11.8979], [-68.65044, -12.50689], [-68.85615, -12.87769], [-68.8864, -13.40792], [-69.05265, -13.68546], [-68.88135, -14.18639], [-69.36254, -14.94634], [-69.14856, -15.23478], [-69.40336, -15.61358], [-69.20291, -16.16668], [-69.09986, -16.22693], [-68.96238, -16.194], [-68.79464, -16.33272], [-68.98358, -16.42165], [-69.04027, -16.57214], [-69.00853, -16.66769], [-69.16896, -16.72233], [-69.62883, -17.28142], [-69.46863, -17.37466], [-69.46897, -17.4988], [-69.46623, -17.60518], [-69.34126, -17.72753], [-69.28671, -17.94844], [-69.07496, -18.03715], [-69.14807, -18.16893], [-69.07432, -18.28259], [-68.94987, -18.93302], [-68.87082, -19.06003], [-68.80602, -19.08355], [-68.61989, -19.27584], [-68.41218, -19.40499], [-68.66761, -19.72118], [-68.54611, -19.84651], [-68.57132, -20.03134], [-68.74273, -20.08817], [-68.7276, -20.46178], [-68.44023, -20.62701], [-68.55383, -20.7355], [-68.53957, -20.91542], [-68.40403, -20.94562], [-68.18816, -21.28614], [-67.85114, -22.87076], [-67.54284, -22.89771], [-67.18382, -22.81525], [-66.7298, -22.23644], [-66.29714, -22.08741], [-66.24077, -21.77837], [-66.03836, -21.84829], [-66.04832, -21.9187], [-65.9261, -21.93335], [-65.7467, -22.10105], [-65.61166, -22.09504], [-65.58694, -22.09794], [-65.57743, -22.07675], [-65.47435, -22.08908], [-64.99524, -22.08255], [-64.90014, -22.12136], [-64.67174, -22.18957], [-64.58888, -22.25035], [-64.4176, -22.67692], [-64.35108, -22.73282], [-64.31489, -22.88824], [-64.22918, -22.55807], [-63.93287, -21.99934], [-63.70963, -21.99934], [-63.68113, -22.0544], [-63.66482, -21.99918], [-62.81124, -21.9987], [-62.8078, -22.12534], [-62.64455, -22.25091], [-62.2757, -21.06657], [-62.26883, -20.55311], [-61.93912, -20.10053], [-61.73723, -19.63958], [-60.00638, -19.2981], [-59.06965, -19.29148], [-58.23216, -19.80058], [-58.16225, -20.16193], [-57.8496, -19.98346], [-58.14215, -19.76276], [-57.78463, -19.03259], [-57.70971, -19.03489], [-57.70818, -19.02772], [-57.69134, -19.00544], [-57.71995, -18.97546], [-57.71901, -18.89907], [-57.76603, -18.89904], [-57.56807, -18.25655], [-57.48237, -18.24219], [-57.69877, -17.8431], [-57.73949, -17.56095], [-57.90082, -17.44555], [-57.99661, -17.5273], [-58.32935, -17.28195], [-58.5058, -16.80958], [-58.30918, -16.3699], [-58.32208, -16.26597], [-58.39179, -16.27715], [-58.43081, -16.32233], [-60.16069, -16.26479], [-60.23797, -15.50267], [-60.58224, -15.09887], [-60.23968, -15.09515], [-60.27887, -14.63021], [-60.46037, -14.22496], [-60.48053, -13.77981], [-61.05527, -13.50054], [-61.81151, -13.49564], [-63.76259, -12.42952], [-63.90248, -12.52544]]]] } },
34110 { type: "Feature", properties: { iso1A2: "BQ", iso1A3: "BES", iso1N3: "535", wikidata: "Q27561", nameEn: "Caribbean Netherlands", country: "NL" }, geometry: null },
34111 { type: "Feature", properties: { iso1A2: "BR", iso1A3: "BRA", iso1N3: "076", wikidata: "Q155", nameEn: "Brazil", groups: ["005", "419", "019", "UN"], callingCodes: ["55"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-59.69361, 4.34069], [-59.78878, 4.45637], [-60.15953, 4.53456], [-60.04189, 4.69801], [-59.98129, 5.07097], [-60.20944, 5.28754], [-60.32352, 5.21299], [-60.73204, 5.20931], [-60.5802, 4.94312], [-60.86539, 4.70512], [-60.98303, 4.54167], [-61.15703, 4.49839], [-61.31457, 4.54167], [-61.29675, 4.44216], [-61.48569, 4.43149], [-61.54629, 4.2822], [-62.13094, 4.08309], [-62.44822, 4.18621], [-62.57656, 4.04754], [-62.74411, 4.03331], [-62.7655, 3.73099], [-62.98296, 3.59935], [-63.21111, 3.96219], [-63.4464, 3.9693], [-63.42233, 3.89995], [-63.50611, 3.83592], [-63.67099, 4.01731], [-63.70218, 3.91417], [-63.86082, 3.94796], [-63.99183, 3.90172], [-64.14512, 4.12932], [-64.57648, 4.12576], [-64.72977, 4.28931], [-64.84028, 4.24665], [-64.48379, 3.7879], [-64.02908, 2.79797], [-64.0257, 2.48156], [-63.39114, 2.4317], [-63.39827, 2.16098], [-64.06135, 1.94722], [-64.08274, 1.64792], [-64.34654, 1.35569], [-64.38932, 1.5125], [-65.11657, 1.12046], [-65.57288, 0.62856], [-65.50158, 0.92086], [-65.6727, 1.01353], [-66.28507, 0.74585], [-66.85795, 1.22998], [-67.08222, 1.17441], [-67.15784, 1.80439], [-67.299, 1.87494], [-67.40488, 2.22258], [-67.9292, 1.82455], [-68.18632, 2.00091], [-68.26699, 1.83463], [-68.18183, 1.72948], [-69.39079, 1.72934], [-69.55722, 1.77158], [-69.84289, 1.69122], [-69.84259, 1.07881], [-69.26017, 1.06856], [-69.14422, 0.84172], [-69.20976, 0.57958], [-69.47696, 0.71065], [-69.82577, 0.59225], [-70.04708, 0.56194], [-70.04294, -0.19043], [-69.603, -0.51947], [-69.59796, -0.75136], [-69.4215, -1.01853], [-69.43395, -1.42219], [-69.93323, -4.21971], [-69.93571, -4.2195], [-69.94924, -4.23116], [-69.95836, -4.32881], [-69.99218, -4.32041], [-70.03272, -4.35441], [-70.02689, -4.37095], [-70.04593, -4.37554], [-70.0533, -4.2907], [-70.14422, -4.2714], [-70.19582, -4.3607], [-70.30567, -4.24361], [-70.27991, -4.23226], [-70.33236, -4.15214], [-70.73715, -4.17416], [-70.74728, -4.16112], [-70.78125, -4.16295], [-70.96814, -4.36915], [-71.87003, -4.51661], [-72.64391, -5.0391], [-72.83973, -5.14765], [-72.87086, -5.26346], [-73.24116, -6.07187], [-73.12983, -6.43852], [-73.73986, -6.87919], [-73.77011, -7.28944], [-73.96938, -7.58465], [-73.65485, -7.77897], [-73.76576, -7.89884], [-72.92886, -9.04074], [-73.21498, -9.40904], [-72.72216, -9.41397], [-72.31883, -9.5184], [-72.14742, -9.98049], [-71.23394, -9.9668], [-70.49706, -9.425], [-70.59272, -9.62142], [-70.55429, -9.76692], [-70.62487, -9.80666], [-70.64134, -11.0108], [-70.51395, -10.92249], [-70.38791, -11.07096], [-69.90896, -10.92744], [-69.57835, -10.94051], [-69.57156, -10.94555], [-69.47839, -10.95254], [-69.42792, -10.93451], [-68.76291, -11.00728], [-68.7638, -11.01693], [-68.76092, -11.01726], [-68.75452, -11.00821], [-68.74802, -11.00891], [-68.75265, -11.02383], [-68.75179, -11.03688], [-68.7651, -11.0496], [-68.71533, -11.14749], [-67.67724, -10.60263], [-67.21325, -10.3208], [-67.1917, -10.32944], [-67.18847, -10.33951], [-67.12883, -10.31634], [-66.61289, -9.93233], [-65.68343, -9.75323], [-65.56244, -9.84266], [-65.40615, -9.63894], [-65.29019, -9.86253], [-65.32696, -10.06449], [-65.28979, -10.21932], [-65.37923, -10.35141], [-65.35402, -10.78685], [-65.28141, -10.86289], [-65.30027, -11.48749], [-64.99778, -11.98604], [-64.40519, -12.45065], [-64.22539, -12.45267], [-63.90248, -12.52544], [-63.76259, -12.42952], [-61.81151, -13.49564], [-61.05527, -13.50054], [-60.48053, -13.77981], [-60.46037, -14.22496], [-60.27887, -14.63021], [-60.23968, -15.09515], [-60.58224, -15.09887], [-60.23797, -15.50267], [-60.16069, -16.26479], [-58.43081, -16.32233], [-58.39179, -16.27715], [-58.32208, -16.26597], [-58.30918, -16.3699], [-58.5058, -16.80958], [-58.32935, -17.28195], [-57.99661, -17.5273], [-57.90082, -17.44555], [-57.73949, -17.56095], [-57.69877, -17.8431], [-57.48237, -18.24219], [-57.56807, -18.25655], [-57.76603, -18.89904], [-57.71901, -18.89907], [-57.71995, -18.97546], [-57.69134, -19.00544], [-57.70818, -19.02772], [-57.70971, -19.03489], [-57.78463, -19.03259], [-58.14215, -19.76276], [-57.8496, -19.98346], [-58.16225, -20.16193], [-57.84536, -20.93155], [-57.93492, -21.65505], [-57.88239, -21.6868], [-57.94642, -21.73799], [-57.98625, -22.09157], [-56.6508, -22.28387], [-56.5212, -22.11556], [-56.45893, -22.08072], [-56.23206, -22.25347], [-55.8331, -22.29008], [-55.74691, -22.46966], [-55.75257, -22.47633], [-55.75128, -22.48165], [-55.74718, -22.48376], [-55.74715, -22.50567], [-55.74069, -22.51564], [-55.74032, -22.51928], [-55.73792, -22.52632], [-55.72399, -22.55131], [-55.71193, -22.55809], [-55.69863, -22.56307], [-55.69103, -22.57959], [-55.62493, -22.62765], [-55.63849, -22.95122], [-55.53614, -23.24524], [-55.5222, -23.26048], [-55.55496, -23.28366], [-55.47567, -23.67566], [-55.4471, -23.7602], [-55.43585, -23.87157], [-55.44117, -23.9185], [-55.41784, -23.9657], [-55.12292, -23.99669], [-55.0518, -23.98666], [-55.02691, -23.97317], [-54.6238, -23.83078], [-54.32807, -24.01865], [-54.28207, -24.07305], [-54.34579, -24.13058], [-54.31115, -24.26625], [-54.4423, -25.13381], [-54.62033, -25.46026], [-54.60196, -25.48397], [-54.59509, -25.53696], [-54.59398, -25.59224], [-54.5502, -25.58915], [-54.52926, -25.62846], [-53.90831, -25.55513], [-53.83691, -25.94849], [-53.73511, -26.04211], [-53.73086, -26.05842], [-53.7264, -26.0664], [-53.73391, -26.07006], [-53.73968, -26.10012], [-53.65018, -26.19501], [-53.65237, -26.23289], [-53.63739, -26.2496], [-53.63881, -26.25075], [-53.64632, -26.24798], [-53.64186, -26.25976], [-53.64505, -26.28089], [-53.68269, -26.33359], [-53.73372, -26.6131], [-53.80144, -27.09844], [-54.15978, -27.2889], [-54.19062, -27.27639], [-54.19268, -27.30751], [-54.41888, -27.40882], [-54.50416, -27.48232], [-54.67657, -27.57214], [-54.90159, -27.63132], [-54.90805, -27.73149], [-55.1349, -27.89759], [-55.16872, -27.86224], [-55.33303, -27.94661], [-55.6262, -28.17124], [-55.65418, -28.18304], [-56.01729, -28.51223], [-56.00458, -28.60421], [-56.05265, -28.62651], [-56.54171, -29.11447], [-56.57295, -29.11357], [-56.62789, -29.18073], [-56.81251, -29.48154], [-57.09386, -29.74211], [-57.65132, -30.19229], [-57.22502, -30.26121], [-56.90236, -30.02578], [-56.49267, -30.39471], [-56.4795, -30.3899], [-56.4619, -30.38457], [-55.87388, -31.05053], [-55.58866, -30.84117], [-55.5634, -30.8686], [-55.55373, -30.8732], [-55.55218, -30.88193], [-55.54572, -30.89051], [-55.53431, -30.89714], [-55.53276, -30.90218], [-55.52712, -30.89997], [-55.51862, -30.89828], [-55.50841, -30.9027], [-55.50823, -30.9145], [-54.45458, -31.65285], [-54.15721, -31.87458], [-53.76024, -32.0751], [-53.39572, -32.58596], [-53.37671, -32.57005], [-53.1111, -32.71147], [-53.53459, -33.16843], [-53.52794, -33.68908], [-53.44031, -33.69344], [-53.39593, -33.75169], [-53.37138, -33.74313], [-52.83257, -34.01481], [-28.34015, -20.99094], [-28.99601, 1.86593], [-51.35485, 4.8383], [-51.63798, 4.51394], [-51.61983, 4.14596], [-51.79599, 3.89336], [-51.82312, 3.85825], [-51.85573, 3.83427], [-52.31787, 3.17896], [-52.6906, 2.37298], [-52.96539, 2.1881], [-53.78743, 2.34412], [-54.16286, 2.10779], [-54.6084, 2.32856], [-55.01919, 2.564], [-55.71493, 2.40342], [-55.96292, 2.53188], [-56.13054, 2.27723], [-55.92159, 2.05236], [-55.89863, 1.89861], [-55.99278, 1.83137], [-56.47045, 1.95135], [-56.7659, 1.89509], [-57.07092, 1.95304], [-57.09109, 2.01854], [-57.23981, 1.95808], [-57.35073, 1.98327], [-57.55743, 1.69605], [-57.77281, 1.73344], [-57.97336, 1.64566], [-58.01873, 1.51966], [-58.33887, 1.58014], [-58.4858, 1.48399], [-58.53571, 1.29154], [-58.84229, 1.17749], [-58.92072, 1.31293], [-59.25583, 1.40559], [-59.74066, 1.87596], [-59.7264, 2.27497], [-59.91177, 2.36759], [-59.99733, 2.92312], [-59.80525, 3.35466], [-59.8041, 3.37027], [-59.81107, 3.38023], [-59.81484, 3.41955], [-59.86899, 3.57089], [-59.51963, 3.91951], [-59.73353, 4.20399], [-59.69361, 4.34069]]]] } },
34112 { type: "Feature", properties: { iso1A2: "BS", iso1A3: "BHS", iso1N3: "044", wikidata: "Q778", nameEn: "The Bahamas", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 242"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-72.98446, 20.4801], [-71.70065, 25.7637], [-78.91214, 27.76553], [-80.65727, 23.71953], [-72.98446, 20.4801]]]] } },
34113 { type: "Feature", properties: { iso1A2: "BT", iso1A3: "BTN", iso1N3: "064", wikidata: "Q917", nameEn: "Bhutan", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["975"] }, geometry: { type: "MultiPolygon", coordinates: [[[[91.6469, 27.76358], [91.5629, 27.84823], [91.48973, 27.93903], [91.46327, 28.0064], [91.25779, 28.07509], [91.20019, 27.98715], [90.69894, 28.07784], [90.58842, 28.02838], [90.13387, 28.19178], [89.79762, 28.23979], [89.59525, 28.16433], [89.12825, 27.62502], [89.0582, 27.60985], [88.97213, 27.51671], [88.95355, 27.4106], [89.00216, 27.32532], [88.96947, 27.30319], [88.93678, 27.33777], [88.91901, 27.32483], [88.74219, 27.144], [88.86984, 27.10937], [88.8714, 26.97488], [88.92301, 26.99286], [88.95807, 26.92668], [89.09554, 26.89089], [89.12825, 26.81661], [89.1926, 26.81329], [89.37913, 26.86224], [89.38319, 26.85963], [89.3901, 26.84225], [89.42349, 26.83727], [89.63369, 26.74402], [89.86124, 26.73307], [90.04535, 26.72422], [90.30402, 26.85098], [90.39271, 26.90704], [90.48504, 26.8594], [90.67715, 26.77215], [91.50067, 26.79223], [91.83181, 26.87318], [92.05523, 26.8692], [92.11863, 26.893], [92.03457, 27.07334], [92.04702, 27.26861], [92.12019, 27.27829], [92.01132, 27.47352], [91.65007, 27.48287], [91.55819, 27.6144], [91.6469, 27.76358]]]] } },
34114 { type: "Feature", properties: { iso1A2: "BV", iso1A3: "BVT", iso1N3: "074", wikidata: "Q23408", nameEn: "Bouvet Island", country: "NO", groups: ["005", "419", "019", "UN"] }, geometry: { type: "MultiPolygon", coordinates: [[[[4.54042, -54.0949], [2.28941, -54.13089], [3.35353, -55.17558], [4.54042, -54.0949]]]] } },
34115 { type: "Feature", properties: { iso1A2: "BW", iso1A3: "BWA", iso1N3: "072", wikidata: "Q963", nameEn: "Botswana", groups: ["018", "202", "002", "UN"], driveSide: "left", callingCodes: ["267"] }, geometry: { type: "MultiPolygon", coordinates: [[[[25.26433, -17.79571], [25.16882, -17.78253], [25.05895, -17.84452], [24.95586, -17.79674], [24.73364, -17.89338], [24.71887, -17.9218], [24.6303, -17.9863], [24.57485, -18.07151], [24.40577, -17.95726], [24.19416, -18.01919], [23.61088, -18.4881], [23.29618, -17.99855], [23.0996, -18.00075], [21.45556, -18.31795], [20.99904, -18.31743], [20.99751, -22.00026], [19.99912, -21.99991], [19.99817, -24.76768], [20.02809, -24.78725], [20.03678, -24.81004], [20.29826, -24.94869], [20.64795, -25.47827], [20.86081, -26.14892], [20.61754, -26.4692], [20.63275, -26.78181], [20.68596, -26.9039], [20.87031, -26.80047], [21.13353, -26.86661], [21.37869, -26.82083], [21.69322, -26.86152], [21.7854, -26.79199], [21.77114, -26.69015], [21.83291, -26.65959], [21.90703, -26.66808], [22.06192, -26.61882], [22.21206, -26.3773], [22.41921, -26.23078], [22.56365, -26.19668], [22.70808, -25.99186], [22.86012, -25.50572], [23.03497, -25.29971], [23.47588, -25.29971], [23.9244, -25.64286], [24.18287, -25.62916], [24.36531, -25.773], [24.44703, -25.73021], [24.67319, -25.81749], [24.8946, -25.80723], [25.01718, -25.72507], [25.12266, -25.75931], [25.33076, -25.76616], [25.58543, -25.6343], [25.6643, -25.4491], [25.69661, -25.29284], [25.72702, -25.25503], [25.88571, -24.87802], [25.84295, -24.78661], [25.8515, -24.75727], [26.39409, -24.63468], [26.46346, -24.60358], [26.51667, -24.47219], [26.84165, -24.24885], [26.99749, -23.65486], [27.33768, -23.40917], [27.52393, -23.37952], [27.6066, -23.21894], [27.74154, -23.2137], [27.93539, -23.04941], [27.93729, -22.96194], [28.04752, -22.90243], [28.04562, -22.8394], [28.34874, -22.5694], [28.63287, -22.55887], [28.91889, -22.44299], [29.0151, -22.22907], [29.10881, -22.21202], [29.15268, -22.21399], [29.18974, -22.18599], [29.21955, -22.17771], [29.37703, -22.19581], [29.3533, -22.18363], [29.24648, -22.05967], [29.1974, -22.07472], [29.14501, -22.07275], [29.08495, -22.04867], [29.04108, -22.00563], [29.02191, -21.95665], [29.02191, -21.90647], [29.04023, -21.85864], [29.07763, -21.81877], [28.58114, -21.63455], [28.49942, -21.66634], [28.29416, -21.59037], [28.01669, -21.57624], [27.91407, -21.31621], [27.69171, -21.08409], [27.72972, -20.51735], [27.69361, -20.48531], [27.28865, -20.49873], [27.29831, -20.28935], [27.21278, -20.08244], [26.72246, -19.92707], [26.17227, -19.53709], [25.96226, -19.08152], [25.99837, -19.02943], [25.94326, -18.90362], [25.82353, -18.82808], [25.79217, -18.6355], [25.68859, -18.56165], [25.53465, -18.39041], [25.39972, -18.12691], [25.31799, -18.07091], [25.23909, -17.90832], [25.26433, -17.79571]]]] } },
34116 { type: "Feature", properties: { iso1A2: "BY", iso1A3: "BLR", iso1N3: "112", wikidata: "Q184", nameEn: "Belarus", groups: ["151", "150", "UN"], callingCodes: ["375"] }, geometry: { type: "MultiPolygon", coordinates: [[[[28.15217, 56.16964], [27.97865, 56.11849], [27.63065, 55.89687], [27.61683, 55.78558], [27.3541, 55.8089], [27.27804, 55.78299], [27.1559, 55.85032], [26.97153, 55.8102], [26.87448, 55.7172], [26.76872, 55.67658], [26.71802, 55.70645], [26.64888, 55.70515], [26.63231, 55.67968], [26.63167, 55.57887], [26.55094, 55.5093], [26.5522, 55.40277], [26.44937, 55.34832], [26.5709, 55.32572], [26.6714, 55.33902], [26.80929, 55.31642], [26.83266, 55.30444], [26.835, 55.28182], [26.73017, 55.24226], [26.72983, 55.21788], [26.68075, 55.19787], [26.69243, 55.16718], [26.54753, 55.14181], [26.51481, 55.16051], [26.46249, 55.12814], [26.35121, 55.1525], [26.30628, 55.12536], [26.23202, 55.10439], [26.26941, 55.08032], [26.20397, 54.99729], [26.13386, 54.98924], [26.05907, 54.94631], [25.99129, 54.95705], [25.89462, 54.93438], [25.74122, 54.80108], [25.75977, 54.57252], [25.68045, 54.5321], [25.64813, 54.48704], [25.62203, 54.4656], [25.63371, 54.42075], [25.5376, 54.33158], [25.55425, 54.31591], [25.68513, 54.31727], [25.78553, 54.23327], [25.78563, 54.15747], [25.71084, 54.16704], [25.64875, 54.1259], [25.54724, 54.14925], [25.51452, 54.17799], [25.56823, 54.25212], [25.509, 54.30267], [25.35559, 54.26544], [25.22705, 54.26271], [25.19199, 54.219], [25.0728, 54.13419], [24.991, 54.14241], [24.96894, 54.17589], [24.77131, 54.11091], [24.85311, 54.02862], [24.74279, 53.96663], [24.69185, 53.96543], [24.69652, 54.01901], [24.62275, 54.00217], [24.44411, 53.90076], [24.34128, 53.90076], [24.19638, 53.96405], [23.98837, 53.92554], [23.95098, 53.9613], [23.81309, 53.94205], [23.80543, 53.89558], [23.71726, 53.93379], [23.61677, 53.92691], [23.51284, 53.95052], [23.62004, 53.60942], [23.81995, 53.24131], [23.85657, 53.22923], [23.91393, 53.16469], [23.87548, 53.0831], [23.92184, 53.02079], [23.94689, 52.95919], [23.91805, 52.94016], [23.93763, 52.71332], [23.73615, 52.6149], [23.58296, 52.59868], [23.45112, 52.53774], [23.34141, 52.44845], [23.18196, 52.28812], [23.20071, 52.22848], [23.47859, 52.18215], [23.54314, 52.12148], [23.61, 52.11264], [23.64066, 52.07626], [23.68733, 51.9906], [23.61523, 51.92066], [23.62691, 51.78208], [23.53198, 51.74298], [23.57053, 51.55938], [23.56236, 51.53673], [23.62751, 51.50512], [23.6736, 51.50255], [23.60906, 51.62122], [23.7766, 51.66809], [23.91118, 51.63316], [23.8741, 51.59734], [23.99907, 51.58369], [24.13075, 51.66979], [24.3163, 51.75063], [24.29021, 51.80841], [24.37123, 51.88222], [24.98784, 51.91273], [25.20228, 51.97143], [25.46163, 51.92205], [25.73673, 51.91973], [25.80574, 51.94556], [25.83217, 51.92587], [26.00408, 51.92967], [26.19084, 51.86781], [26.39367, 51.87315], [26.46962, 51.80501], [26.69759, 51.82284], [26.80043, 51.75777], [26.9489, 51.73788], [26.99422, 51.76933], [27.20602, 51.77291], [27.20948, 51.66713], [27.26613, 51.65957], [27.24828, 51.60161], [27.47212, 51.61184], [27.51058, 51.5854], [27.55727, 51.63486], [27.71932, 51.60672], [27.67125, 51.50854], [27.76052, 51.47604], [27.85253, 51.62293], [27.91844, 51.61952], [27.95827, 51.56065], [28.10658, 51.57857], [28.23452, 51.66988], [28.37592, 51.54505], [28.47051, 51.59734], [28.64429, 51.5664], [28.69161, 51.44695], [28.73143, 51.46236], [28.75615, 51.41442], [28.78224, 51.45294], [28.76027, 51.48802], [28.81795, 51.55552], [28.95528, 51.59222], [28.99098, 51.56833], [29.1187, 51.65872], [29.16402, 51.64679], [29.20659, 51.56918], [29.25603, 51.57089], [29.25191, 51.49828], [29.32881, 51.37843], [29.42357, 51.4187], [29.49773, 51.39814], [29.54372, 51.48372], [29.7408, 51.53417], [29.77376, 51.4461], [30.17888, 51.51025], [30.34642, 51.42555], [30.36153, 51.33984], [30.56203, 51.25655], [30.64992, 51.35014], [30.51946, 51.59649], [30.68804, 51.82806], [30.76443, 51.89739], [30.90897, 52.00699], [30.95589, 52.07775], [31.13332, 52.1004], [31.25142, 52.04131], [31.38326, 52.12991], [31.7822, 52.11406], [31.77877, 52.18636], [31.6895, 52.1973], [31.70735, 52.26711], [31.57971, 52.32146], [31.62084, 52.33849], [31.61397, 52.48843], [31.56316, 52.51518], [31.63869, 52.55361], [31.50406, 52.69707], [31.57277, 52.71613], [31.592, 52.79011], [31.35667, 52.97854], [31.24147, 53.031], [31.32283, 53.04101], [31.33519, 53.08805], [31.3915, 53.09712], [31.36403, 53.13504], [31.40523, 53.21406], [31.56316, 53.19432], [31.62496, 53.22886], [31.787, 53.18033], [31.82373, 53.10042], [32.15368, 53.07594], [32.40773, 53.18856], [32.51725, 53.28431], [32.73257, 53.33494], [32.74968, 53.45597], [32.47777, 53.5548], [32.40499, 53.6656], [32.50112, 53.68594], [32.45717, 53.74039], [32.36663, 53.7166], [32.12621, 53.81586], [31.89137, 53.78099], [31.77028, 53.80015], [31.85019, 53.91801], [31.88744, 54.03653], [31.89599, 54.0837], [31.57002, 54.14535], [31.30791, 54.25315], [31.3177, 54.34067], [31.22945, 54.46585], [31.08543, 54.50361], [31.21399, 54.63113], [31.19339, 54.66947], [30.99187, 54.67046], [30.98226, 54.68872], [31.0262, 54.70698], [30.97127, 54.71967], [30.95479, 54.74346], [30.75165, 54.80699], [30.8264, 54.90062], [30.81759, 54.94064], [30.93144, 54.9585], [30.95754, 54.98609], [30.9081, 55.02232], [30.94243, 55.03964], [31.00972, 55.02783], [31.02071, 55.06167], [30.97369, 55.17134], [30.87944, 55.28223], [30.81946, 55.27931], [30.8257, 55.3313], [30.93144, 55.3914], [30.90123, 55.46621], [30.95204, 55.50667], [30.93419, 55.6185], [30.86003, 55.63169], [30.7845, 55.58514], [30.72957, 55.66268], [30.67464, 55.64176], [30.63344, 55.73079], [30.51037, 55.76568], [30.51346, 55.78982], [30.48257, 55.81066], [30.30987, 55.83592], [30.27776, 55.86819], [30.12136, 55.8358], [29.97975, 55.87281], [29.80672, 55.79569], [29.61446, 55.77716], [29.51283, 55.70294], [29.3604, 55.75862], [29.44692, 55.95978], [29.21717, 55.98971], [29.08299, 56.03427], [28.73418, 55.97131], [28.63668, 56.07262], [28.68337, 56.10173], [28.5529, 56.11705], [28.43068, 56.09407], [28.37987, 56.11399], [28.36888, 56.05805], [28.30571, 56.06035], [28.15217, 56.16964]]]] } },
34117 { type: "Feature", properties: { iso1A2: "BZ", iso1A3: "BLZ", iso1N3: "084", wikidata: "Q242", nameEn: "Belize", groups: ["013", "003", "419", "019", "UN"], roadSpeedUnit: "mph", callingCodes: ["501"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-88.3268, 18.49048], [-88.48242, 18.49164], [-88.71505, 18.0707], [-88.8716, 17.89535], [-89.03839, 18.0067], [-89.15105, 17.95104], [-89.14985, 17.81563], [-89.15025, 17.04813], [-89.22683, 15.88619], [-89.17418, 15.90898], [-89.02415, 15.9063], [-88.95358, 15.88698], [-88.40779, 16.09624], [-86.92368, 17.61462], [-87.84815, 18.18511], [-87.85693, 18.18266], [-87.86657, 18.19971], [-87.87604, 18.18313], [-87.90671, 18.15213], [-88.03165, 18.16657], [-88.03238, 18.41778], [-88.26593, 18.47617], [-88.29909, 18.47591], [-88.3268, 18.49048]]]] } },
34118 { type: "Feature", properties: { iso1A2: "CA", iso1A3: "CAN", iso1N3: "124", wikidata: "Q16", nameEn: "Canada", groups: ["021", "003", "019", "UN"], callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-67.20349, 45.1722], [-67.19603, 45.16771], [-67.15965, 45.16179], [-67.11316, 45.11176], [-67.0216, 44.95333], [-66.96824, 44.90965], [-66.98249, 44.87071], [-66.96824, 44.83078], [-66.93432, 44.82597], [-67.16117, 44.20069], [-61.98255, 37.34815], [-56.27503, 47.39728], [-53.12387, 41.40385], [-46.37635, 57.3249], [-77.52957, 77.23408], [-68.21821, 80.48551], [-49.33696, 84.57952], [-140.97446, 84.39275], [-141.00116, 60.30648], [-140.5227, 60.22077], [-140.45648, 60.30919], [-139.98024, 60.18027], [-139.68991, 60.33693], [-139.05831, 60.35205], [-139.20603, 60.08896], [-139.05365, 59.99655], [-138.71149, 59.90728], [-138.62145, 59.76431], [-137.60623, 59.24465], [-137.4925, 58.89415], [-136.82619, 59.16198], [-136.52365, 59.16752], [-136.47323, 59.46617], [-136.33727, 59.44466], [-136.22381, 59.55526], [-136.31566, 59.59083], [-135.48007, 59.79937], [-135.03069, 59.56208], [-135.00267, 59.28745], [-134.7047, 59.2458], [-134.55699, 59.1297], [-134.48059, 59.13231], [-134.27175, 58.8634], [-133.84645, 58.73543], [-133.38523, 58.42773], [-131.8271, 56.62247], [-130.77769, 56.36185], [-130.33965, 56.10849], [-130.10173, 56.12178], [-130.00093, 56.00325], [-130.00857, 55.91344], [-130.15373, 55.74895], [-129.97513, 55.28029], [-130.08035, 55.21556], [-130.18765, 55.07744], [-130.27203, 54.97174], [-130.44184, 54.85377], [-130.64499, 54.76912], [-130.61931, 54.70835], [-133.92876, 54.62289], [-133.36909, 48.51151], [-125.03842, 48.53282], [-123.50039, 48.21223], [-123.15614, 48.35395], [-123.26565, 48.6959], [-123.0093, 48.76586], [-123.0093, 48.83186], [-123.32163, 49.00419], [-95.15355, 48.9996], [-95.15357, 49.384], [-95.12903, 49.37056], [-95.05825, 49.35311], [-95.01419, 49.35647], [-94.99532, 49.36579], [-94.95681, 49.37035], [-94.85381, 49.32492], [-94.8159, 49.32299], [-94.82487, 49.29483], [-94.77355, 49.11998], [-94.75017, 49.09931], [-94.687, 48.84077], [-94.70087, 48.8339], [-94.70486, 48.82365], [-94.69669, 48.80918], [-94.69335, 48.77883], [-94.58903, 48.71803], [-94.54885, 48.71543], [-94.53826, 48.70216], [-94.44258, 48.69223], [-94.4174, 48.71049], [-94.27153, 48.70232], [-94.25172, 48.68404], [-94.25104, 48.65729], [-94.23215, 48.65202], [-93.85769, 48.63284], [-93.83288, 48.62745], [-93.80676, 48.58232], [-93.80939, 48.52439], [-93.79267, 48.51631], [-93.66382, 48.51845], [-93.47022, 48.54357], [-93.44472, 48.59147], [-93.40693, 48.60948], [-93.39758, 48.60364], [-93.3712, 48.60599], [-93.33946, 48.62787], [-93.25391, 48.64266], [-92.94973, 48.60866], [-92.7287, 48.54005], [-92.6342, 48.54133], [-92.62747, 48.50278], [-92.69927, 48.49573], [-92.71323, 48.46081], [-92.65606, 48.43471], [-92.50712, 48.44921], [-92.45588, 48.40624], [-92.48147, 48.36609], [-92.37185, 48.22259], [-92.27167, 48.25046], [-92.30939, 48.31251], [-92.26662, 48.35651], [-92.202, 48.35252], [-92.14732, 48.36578], [-92.05339, 48.35958], [-91.98929, 48.25409], [-91.86125, 48.21278], [-91.71231, 48.19875], [-91.70451, 48.11805], [-91.55649, 48.10611], [-91.58025, 48.04339], [-91.45829, 48.07454], [-91.43248, 48.04912], [-91.25025, 48.08522], [-91.08016, 48.18096], [-90.87588, 48.2484], [-90.75045, 48.09143], [-90.56444, 48.12184], [-90.56312, 48.09488], [-90.07418, 48.11043], [-89.89974, 47.98109], [-89.77248, 48.02607], [-89.57972, 48.00023], [-89.48837, 48.01412], [-88.37033, 48.30586], [-84.85871, 46.88881], [-84.55635, 46.45974], [-84.47607, 46.45225], [-84.4481, 46.48972], [-84.42101, 46.49853], [-84.34174, 46.50683], [-84.29893, 46.49127], [-84.26351, 46.49508], [-84.2264, 46.53337], [-84.1945, 46.54061], [-84.17723, 46.52753], [-84.12885, 46.53068], [-84.11196, 46.50248], [-84.13451, 46.39218], [-84.11254, 46.32329], [-84.11615, 46.2681], [-84.09756, 46.25512], [-84.1096, 46.23987], [-83.95399, 46.05634], [-83.90453, 46.05922], [-83.83329, 46.12169], [-83.57017, 46.105], [-83.43746, 45.99749], [-83.59589, 45.82131], [-82.48419, 45.30225], [-82.42469, 42.992], [-82.4146, 42.97626], [-82.4253, 42.95423], [-82.45331, 42.93139], [-82.4826, 42.8068], [-82.46613, 42.76615], [-82.51063, 42.66025], [-82.51858, 42.611], [-82.57583, 42.5718], [-82.58873, 42.54984], [-82.64242, 42.55594], [-82.82964, 42.37355], [-83.02253, 42.33045], [-83.07837, 42.30978], [-83.09837, 42.28877], [-83.12724, 42.2376], [-83.14962, 42.04089], [-83.11184, 41.95671], [-82.67862, 41.67615], [-78.93684, 42.82887], [-78.90712, 42.89733], [-78.90905, 42.93022], [-78.93224, 42.95229], [-78.96312, 42.95509], [-78.98126, 42.97], [-79.02074, 42.98444], [-79.02424, 43.01983], [-78.99941, 43.05612], [-79.01055, 43.06659], [-79.07486, 43.07845], [-79.05671, 43.10937], [-79.06881, 43.12029], [-79.0427, 43.13934], [-79.04652, 43.16396], [-79.05384, 43.17418], [-79.05002, 43.20133], [-79.05544, 43.21224], [-79.05512, 43.25375], [-79.06921, 43.26183], [-79.25796, 43.54052], [-76.79706, 43.63099], [-76.43859, 44.09393], [-76.35324, 44.13493], [-76.31222, 44.19894], [-76.244, 44.19643], [-76.1664, 44.23051], [-76.16285, 44.28262], [-76.00018, 44.34896], [-75.95947, 44.34463], [-75.8217, 44.43176], [-75.76813, 44.51537], [-75.41441, 44.76614], [-75.2193, 44.87821], [-75.01363, 44.95608], [-74.99101, 44.98051], [-74.8447, 45.00606], [-74.76308, 45.00624], [-74.76044, 44.99491], [-74.73876, 44.98856], [-74.7163, 45.00017], [-74.47782, 44.99747], [-74.32699, 44.99029], [-73.35025, 45.00942], [-72.71867, 45.01551], [-72.17312, 45.00587], [-72.09934, 45.00571], [-71.75113, 45.0114], [-71.50067, 45.01357], [-71.48735, 45.07784], [-71.42778, 45.12624], [-71.40364, 45.21382], [-71.44252, 45.2361], [-71.37133, 45.24624], [-71.29371, 45.29996], [-71.22338, 45.25184], [-71.19723, 45.25438], [-71.14568, 45.24128], [-71.08364, 45.30623], [-71.01866, 45.31573], [-71.0107, 45.34819], [-70.95193, 45.33895], [-70.91169, 45.29849], [-70.89864, 45.2398], [-70.84816, 45.22698], [-70.80236, 45.37444], [-70.82638, 45.39828], [-70.78372, 45.43269], [-70.65383, 45.37592], [-70.62518, 45.42286], [-70.72651, 45.49771], [-70.68516, 45.56964], [-70.54019, 45.67291], [-70.38934, 45.73215], [-70.41523, 45.79497], [-70.25976, 45.89675], [-70.24694, 45.95138], [-70.31025, 45.96424], [-70.23855, 46.1453], [-70.29078, 46.18832], [-70.18547, 46.35357], [-70.05812, 46.41768], [-69.99966, 46.69543], [-69.22119, 47.46461], [-69.05148, 47.42012], [-69.05073, 47.30076], [-69.05039, 47.2456], [-68.89222, 47.1807], [-68.70125, 47.24399], [-68.60575, 47.24659], [-68.57914, 47.28431], [-68.38332, 47.28723], [-68.37458, 47.35851], [-68.23244, 47.35712], [-67.94843, 47.1925], [-67.87993, 47.10377], [-67.78578, 47.06473], [-67.78111, 45.9392], [-67.75196, 45.91814], [-67.80961, 45.87531], [-67.75654, 45.82324], [-67.80653, 45.80022], [-67.80705, 45.69528], [-67.6049, 45.60725], [-67.43815, 45.59162], [-67.42144, 45.50584], [-67.50578, 45.48971], [-67.42394, 45.37969], [-67.48201, 45.27351], [-67.34927, 45.122], [-67.29754, 45.14865], [-67.29748, 45.18173], [-67.27039, 45.1934], [-67.22751, 45.16344], [-67.20349, 45.1722]]]] } },
34119 { type: "Feature", properties: { iso1A2: "CC", iso1A3: "CCK", iso1N3: "166", wikidata: "Q36004", nameEn: "Cocos (Keeling) Islands", country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[96.61846, -10.82438], [96.02343, -12.68334], [97.93979, -12.33309], [96.61846, -10.82438]]]] } },
34120 { type: "Feature", properties: { iso1A2: "CD", iso1A3: "COD", iso1N3: "180", wikidata: "Q974", nameEn: "Democratic Republic of the Congo", aliases: ["ZR"], groups: ["017", "202", "002", "UN"], callingCodes: ["243"] }, geometry: { type: "MultiPolygon", coordinates: [[[[27.44012, 5.07349], [27.09575, 5.22305], [26.93064, 5.13535], [26.85579, 5.03887], [26.74572, 5.10685], [26.48595, 5.04984], [26.13371, 5.25594], [25.86073, 5.19455], [25.53271, 5.37431], [25.34558, 5.29101], [25.31256, 5.03668], [24.71816, 4.90509], [24.46719, 5.0915], [23.38847, 4.60013], [22.94817, 4.82392], [22.89094, 4.79321], [22.84691, 4.69887], [22.78526, 4.71423], [22.6928, 4.47285], [22.60915, 4.48821], [22.5431, 4.22041], [22.45504, 4.13039], [22.27682, 4.11347], [22.10721, 4.20723], [21.6405, 4.317], [21.55904, 4.25553], [21.25744, 4.33676], [21.21341, 4.29285], [21.11214, 4.33895], [21.08793, 4.39603], [20.90383, 4.44877], [20.60184, 4.42394], [18.62755, 3.47564], [18.63857, 3.19342], [18.10683, 2.26876], [18.08034, 1.58553], [17.85887, 1.04327], [17.86989, 0.58873], [17.95255, 0.48128], [17.93877, 0.32424], [17.81204, 0.23884], [17.66051, -0.26535], [17.72112, -0.52707], [17.32438, -0.99265], [16.97999, -1.12762], [16.70724, -1.45815], [16.50336, -1.8795], [16.16173, -2.16586], [16.22785, -2.59528], [16.1755, -3.25014], [16.21407, -3.2969], [15.89448, -3.9513], [15.53081, -4.042], [15.48121, -4.22062], [15.41785, -4.28381], [15.32693, -4.27282], [15.25411, -4.31121], [15.1978, -4.32388], [14.83101, -4.80838], [14.67948, -4.92093], [14.5059, -4.84956], [14.41499, -4.8825], [14.37366, -4.56125], [14.47284, -4.42941], [14.3957, -4.36623], [14.40672, -4.28381], [13.9108, -4.50906], [13.81162, -4.41842], [13.71794, -4.44864], [13.70417, -4.72601], [13.50305, -4.77818], [13.41764, -4.89897], [13.11182, -4.5942], [13.09648, -4.63739], [13.11195, -4.67745], [12.8733, -4.74346], [12.70868, -4.95505], [12.63465, -4.94632], [12.60251, -5.01715], [12.46297, -5.09408], [12.49815, -5.14058], [12.51589, -5.1332], [12.53586, -5.14658], [12.53599, -5.1618], [12.52301, -5.17481], [12.52318, -5.74353], [12.26557, -5.74031], [12.20376, -5.76338], [11.95767, -5.94705], [12.42245, -6.07585], [13.04371, -5.87078], [16.55507, -5.85631], [16.96282, -7.21787], [17.5828, -8.13784], [18.33635, -8.00126], [19.33698, -7.99743], [19.5469, -7.00195], [20.30218, -6.98955], [20.31846, -6.91953], [20.61689, -6.90876], [20.56263, -7.28566], [21.79824, -7.29628], [21.84856, -9.59871], [22.19039, -9.94628], [22.32604, -10.76291], [22.17954, -10.85884], [22.25951, -11.24911], [22.54205, -11.05784], [23.16602, -11.10577], [23.45631, -10.946], [23.86868, -11.02856], [24.00027, -10.89356], [24.34528, -11.06816], [24.42612, -11.44975], [25.34069, -11.19707], [25.33058, -11.65767], [26.01777, -11.91488], [26.88687, -12.01868], [27.04351, -11.61312], [27.22541, -11.60323], [27.21025, -11.76157], [27.59932, -12.22123], [28.33199, -12.41375], [29.01918, -13.41353], [29.60531, -13.21685], [29.65078, -13.41844], [29.81551, -13.44683], [29.8139, -12.14898], [29.48404, -12.23604], [29.4992, -12.43843], [29.18592, -12.37921], [28.48357, -11.87532], [28.37241, -11.57848], [28.65032, -10.65133], [28.62795, -9.92942], [28.68532, -9.78], [28.56208, -9.49122], [28.51627, -9.44726], [28.52636, -9.35379], [28.36562, -9.30091], [28.38526, -9.23393], [28.9711, -8.66935], [28.88917, -8.4831], [30.79243, -8.27382], [30.2567, -7.14121], [29.52552, -6.2731], [29.43673, -4.44845], [29.23708, -3.75856], [29.21463, -3.3514], [29.25633, -3.05471], [29.17258, -2.99385], [29.16037, -2.95457], [29.09797, -2.91935], [29.09119, -2.87871], [29.0505, -2.81774], [29.00404, -2.81978], [29.00167, -2.78523], [29.04081, -2.7416], [29.00357, -2.70596], [28.94346, -2.69124], [28.89793, -2.66111], [28.90226, -2.62385], [28.89288, -2.55848], [28.87943, -2.55165], [28.86193, -2.53185], [28.86209, -2.5231], [28.87497, -2.50887], [28.88846, -2.50493], [28.89342, -2.49017], [28.89132, -2.47557], [28.86846, -2.44866], [28.86826, -2.41888], [28.89601, -2.37321], [28.95642, -2.37321], [29.00051, -2.29001], [29.105, -2.27043], [29.17562, -2.12278], [29.11847, -1.90576], [29.24458, -1.69663], [29.24323, -1.66826], [29.36322, -1.50887], [29.45038, -1.5054], [29.53062, -1.40499], [29.59061, -1.39016], [29.58388, -0.89821], [29.63006, -0.8997], [29.62708, -0.71055], [29.67176, -0.55714], [29.67474, -0.47969], [29.65091, -0.46777], [29.72687, -0.08051], [29.7224, 0.07291], [29.77454, 0.16675], [29.81922, 0.16824], [29.87284, 0.39166], [29.97413, 0.52124], [29.95477, 0.64486], [29.98307, 0.84295], [30.1484, 0.89805], [30.22139, 0.99635], [30.24671, 1.14974], [30.48503, 1.21675], [31.30127, 2.11006], [31.28042, 2.17853], [31.20148, 2.2217], [31.1985, 2.29462], [31.12104, 2.27676], [31.07934, 2.30207], [31.06593, 2.35862], [30.96911, 2.41071], [30.91102, 2.33332], [30.83059, 2.42559], [30.74271, 2.43601], [30.75612, 2.5863], [30.8857, 2.83923], [30.8574, 2.9508], [30.77101, 3.04897], [30.84251, 3.26908], [30.93486, 3.40737], [30.94081, 3.50847], [30.85153, 3.48867], [30.85997, 3.5743], [30.80713, 3.60506], [30.78512, 3.67097], [30.56277, 3.62703], [30.57378, 3.74567], [30.55396, 3.84451], [30.47691, 3.83353], [30.27658, 3.95653], [30.22374, 3.93896], [30.1621, 4.10586], [30.06964, 4.13221], [29.79666, 4.37809], [29.82087, 4.56246], [29.49726, 4.7007], [29.43341, 4.50101], [29.22207, 4.34297], [29.03054, 4.48784], [28.8126, 4.48784], [28.6651, 4.42638], [28.20719, 4.35614], [27.79551, 4.59976], [27.76469, 4.79284], [27.65462, 4.89375], [27.56656, 4.89375], [27.44012, 5.07349]]]] } },
34121 { type: "Feature", properties: { iso1A2: "CF", iso1A3: "CAF", iso1N3: "140", wikidata: "Q929", nameEn: "Central African Republic", groups: ["017", "202", "002", "UN"], callingCodes: ["236"] }, geometry: { type: "MultiPolygon", coordinates: [[[[22.87758, 10.91915], [22.45889, 11.00246], [21.72139, 10.64136], [21.71479, 10.29932], [21.63553, 10.217], [21.52766, 10.2105], [21.34934, 9.95907], [21.26348, 9.97642], [20.82979, 9.44696], [20.36748, 9.11019], [19.06421, 9.00367], [18.86388, 8.87971], [19.11044, 8.68172], [18.79783, 8.25929], [18.67455, 8.22226], [18.62612, 8.14163], [18.64153, 8.08714], [18.6085, 8.05009], [18.02731, 8.01085], [17.93926, 7.95853], [17.67288, 7.98905], [16.8143, 7.53971], [16.6668, 7.67281], [16.658, 7.75353], [16.59415, 7.76444], [16.58315, 7.88657], [16.41583, 7.77971], [16.40703, 7.68809], [15.79942, 7.44149], [15.73118, 7.52006], [15.49743, 7.52179], [15.23397, 7.25135], [15.04717, 6.77085], [14.96311, 6.75693], [14.79966, 6.39043], [14.80122, 6.34866], [14.74206, 6.26356], [14.56149, 6.18928], [14.43073, 6.08867], [14.42917, 6.00508], [14.49455, 5.91683], [14.60974, 5.91838], [14.62375, 5.70466], [14.58951, 5.59777], [14.62531, 5.51411], [14.52724, 5.28319], [14.57083, 5.23979], [14.65489, 5.21343], [14.73383, 4.6135], [15.00825, 4.41458], [15.08609, 4.30282], [15.10644, 4.1362], [15.17482, 4.05131], [15.07686, 4.01805], [15.73522, 3.24348], [15.77725, 3.26835], [16.05449, 3.02306], [16.08252, 2.45708], [16.19357, 2.21537], [16.50126, 2.84739], [16.46701, 2.92512], [16.57598, 3.47999], [16.68283, 3.54257], [17.01746, 3.55136], [17.35649, 3.63045], [17.46876, 3.70515], [17.60966, 3.63705], [17.83421, 3.61068], [17.85842, 3.53378], [18.05656, 3.56893], [18.14902, 3.54476], [18.17323, 3.47665], [18.24148, 3.50302], [18.2723, 3.57992], [18.39558, 3.58212], [18.49245, 3.63924], [18.58711, 3.49423], [18.62755, 3.47564], [20.60184, 4.42394], [20.90383, 4.44877], [21.08793, 4.39603], [21.11214, 4.33895], [21.21341, 4.29285], [21.25744, 4.33676], [21.55904, 4.25553], [21.6405, 4.317], [22.10721, 4.20723], [22.27682, 4.11347], [22.45504, 4.13039], [22.5431, 4.22041], [22.60915, 4.48821], [22.6928, 4.47285], [22.78526, 4.71423], [22.84691, 4.69887], [22.89094, 4.79321], [22.94817, 4.82392], [23.38847, 4.60013], [24.46719, 5.0915], [24.71816, 4.90509], [25.31256, 5.03668], [25.34558, 5.29101], [25.53271, 5.37431], [25.86073, 5.19455], [26.13371, 5.25594], [26.48595, 5.04984], [26.74572, 5.10685], [26.85579, 5.03887], [26.93064, 5.13535], [27.09575, 5.22305], [27.44012, 5.07349], [27.26886, 5.25876], [27.23017, 5.37167], [27.28621, 5.56382], [27.22705, 5.62889], [27.22705, 5.71254], [26.51721, 6.09655], [26.58259, 6.1987], [26.32729, 6.36272], [26.38022, 6.63493], [25.90076, 7.09549], [25.37461, 7.33024], [25.35281, 7.42595], [25.20337, 7.50312], [25.20649, 7.61115], [25.29214, 7.66675], [25.25319, 7.8487], [24.98855, 7.96588], [24.85156, 8.16933], [24.35965, 8.26177], [24.13238, 8.36959], [24.25691, 8.69288], [23.51905, 8.71749], [23.59065, 8.99743], [23.44744, 8.99128], [23.4848, 9.16959], [23.56263, 9.19418], [23.64358, 9.28637], [23.64981, 9.44303], [23.62179, 9.53823], [23.69155, 9.67566], [23.67164, 9.86923], [23.3128, 10.45214], [23.02221, 10.69235], [22.87758, 10.91915]]]] } },
34122 { type: "Feature", properties: { iso1A2: "CG", iso1A3: "COG", iso1N3: "178", wikidata: "Q971", nameEn: "Republic of the Congo", groups: ["017", "202", "002", "UN"], callingCodes: ["242"] }, geometry: { type: "MultiPolygon", coordinates: [[[[18.62755, 3.47564], [18.58711, 3.49423], [18.49245, 3.63924], [18.39558, 3.58212], [18.2723, 3.57992], [18.24148, 3.50302], [18.17323, 3.47665], [18.14902, 3.54476], [18.05656, 3.56893], [17.85842, 3.53378], [17.83421, 3.61068], [17.60966, 3.63705], [17.46876, 3.70515], [17.35649, 3.63045], [17.01746, 3.55136], [16.68283, 3.54257], [16.57598, 3.47999], [16.46701, 2.92512], [16.50126, 2.84739], [16.19357, 2.21537], [16.15568, 2.18955], [16.08563, 2.19733], [16.05294, 1.9811], [16.14634, 1.70259], [16.02647, 1.65591], [16.02959, 1.76483], [15.48942, 1.98265], [15.34776, 1.91264], [15.22634, 2.03243], [15.00996, 1.98887], [14.61145, 2.17866], [13.29457, 2.16106], [13.13461, 1.57238], [13.25447, 1.32339], [13.15519, 1.23368], [13.89582, 1.4261], [14.25186, 1.39842], [14.48179, 0.9152], [14.26066, 0.57255], [14.10909, 0.58563], [13.88648, 0.26652], [13.90632, -0.2287], [14.06862, -0.20826], [14.2165, -0.38261], [14.41887, -0.44799], [14.52569, -0.57818], [14.41838, -1.89412], [14.25932, -1.97624], [14.23518, -2.15671], [14.16202, -2.23916], [14.23829, -2.33715], [14.10442, -2.49268], [13.85846, -2.46935], [13.92073, -2.35581], [13.75884, -2.09293], [13.47977, -2.43224], [13.02759, -2.33098], [12.82172, -1.91091], [12.61312, -1.8129], [12.44656, -1.92025], [12.47925, -2.32626], [12.04895, -2.41704], [11.96866, -2.33559], [11.74605, -2.39936], [11.57637, -2.33379], [11.64487, -2.61865], [11.5359, -2.85654], [11.64798, -2.81146], [11.80365, -3.00424], [11.70558, -3.0773], [11.70227, -3.17465], [11.96554, -3.30267], [11.8318, -3.5812], [11.92719, -3.62768], [11.87083, -3.71571], [11.68608, -3.68942], [11.57949, -3.52798], [11.48764, -3.51089], [11.22301, -3.69888], [11.12647, -3.94169], [10.75913, -4.39519], [11.50888, -5.33417], [12.00924, -5.02627], [12.16068, -4.90089], [12.20901, -4.75642], [12.25587, -4.79437], [12.32324, -4.78415], [12.40964, -4.60609], [12.64835, -4.55937], [12.76844, -4.38709], [12.87096, -4.40315], [12.91489, -4.47907], [13.09648, -4.63739], [13.11182, -4.5942], [13.41764, -4.89897], [13.50305, -4.77818], [13.70417, -4.72601], [13.71794, -4.44864], [13.81162, -4.41842], [13.9108, -4.50906], [14.40672, -4.28381], [14.3957, -4.36623], [14.47284, -4.42941], [14.37366, -4.56125], [14.41499, -4.8825], [14.5059, -4.84956], [14.67948, -4.92093], [14.83101, -4.80838], [15.1978, -4.32388], [15.25411, -4.31121], [15.32693, -4.27282], [15.41785, -4.28381], [15.48121, -4.22062], [15.53081, -4.042], [15.89448, -3.9513], [16.21407, -3.2969], [16.1755, -3.25014], [16.22785, -2.59528], [16.16173, -2.16586], [16.50336, -1.8795], [16.70724, -1.45815], [16.97999, -1.12762], [17.32438, -0.99265], [17.72112, -0.52707], [17.66051, -0.26535], [17.81204, 0.23884], [17.93877, 0.32424], [17.95255, 0.48128], [17.86989, 0.58873], [17.85887, 1.04327], [18.08034, 1.58553], [18.10683, 2.26876], [18.63857, 3.19342], [18.62755, 3.47564]]]] } },
34123 { type: "Feature", properties: { iso1A2: "CH", iso1A3: "CHE", iso1N3: "756", wikidata: "Q39", nameEn: "Switzerland", groups: ["155", "150", "UN"], callingCodes: ["41"] }, geometry: { type: "MultiPolygon", coordinates: [[[[8.72809, 47.69282], [8.72617, 47.69651], [8.73671, 47.7169], [8.70543, 47.73121], [8.74251, 47.75168], [8.71778, 47.76571], [8.68985, 47.75686], [8.68022, 47.78599], [8.65292, 47.80066], [8.64425, 47.76398], [8.62408, 47.7626], [8.61657, 47.79998], [8.56415, 47.80633], [8.56814, 47.78001], [8.48868, 47.77215], [8.45771, 47.7493], [8.44807, 47.72426], [8.40569, 47.69855], [8.4211, 47.68407], [8.40473, 47.67499], [8.41346, 47.66676], [8.42264, 47.66667], [8.44711, 47.65379], [8.4667, 47.65747], [8.46605, 47.64103], [8.49656, 47.64709], [8.5322, 47.64687], [8.52801, 47.66059], [8.56141, 47.67088], [8.57683, 47.66158], [8.60469, 47.67239], [8.60695, 47.66622], [8.62884, 47.65098], [8.62049, 47.63757], [8.60412, 47.63735], [8.61471, 47.64514], [8.60701, 47.65271], [8.59545, 47.64298], [8.60348, 47.61204], [8.57586, 47.59537], [8.57449, 47.61148], [8.55756, 47.62394], [8.51686, 47.63476], [8.50747, 47.61897], [8.45578, 47.60121], [8.46637, 47.58389], [8.48949, 47.588], [8.49431, 47.58107], [8.43235, 47.56617], [8.39477, 47.57826], [8.38273, 47.56608], [8.35512, 47.57014], [8.32735, 47.57133], [8.30277, 47.58607], [8.29524, 47.5919], [8.2973, 47.60647], [8.2824, 47.61225], [8.26313, 47.6103], [8.25863, 47.61571], [8.23809, 47.61204], [8.22577, 47.60385], [8.22011, 47.6181], [8.20617, 47.62141], [8.19378, 47.61636], [8.1652, 47.5945], [8.14947, 47.59558], [8.13823, 47.59147], [8.13662, 47.58432], [8.11543, 47.5841], [8.10395, 47.57918], [8.10002, 47.56504], [8.08557, 47.55768], [8.06689, 47.56398], [8.06017, 47.56351], [8.04692, 47.55561], [8.02136, 47.55096], [8.00113, 47.55616], [7.97581, 47.55493], [7.95494, 47.55764], [7.94828, 47.54408], [7.91554, 47.54765], [7.90773, 47.55738], [7.91159, 47.57185], [7.88664, 47.58854], [7.84412, 47.5841], [7.82174, 47.58757], [7.79716, 47.5575], [7.75261, 47.54599], [7.71961, 47.54219], [7.69642, 47.53297], [7.68101, 47.53232], [7.6656, 47.53752], [7.66174, 47.54554], [7.65083, 47.54662], [7.63432, 47.56171], [7.63604, 47.56387], [7.64859, 47.55996], [7.68229, 47.56754], [7.68904, 47.57133], [7.672, 47.58527], [7.67115, 47.5871], [7.68486, 47.59601], [7.69385, 47.60099], [7.68229, 47.59905], [7.67395, 47.59212], [7.64599, 47.59695], [7.64213, 47.5944], [7.64309, 47.59151], [7.61929, 47.57683], [7.60459, 47.57869], [7.60523, 47.58519], [7.58945, 47.59017], [7.58386, 47.57536], [7.56684, 47.57785], [7.56548, 47.57617], [7.55689, 47.57232], [7.55652, 47.56779], [7.53634, 47.55553], [7.52831, 47.55347], [7.51723, 47.54578], [7.50873, 47.54546], [7.49691, 47.53821], [7.50588, 47.52856], [7.51904, 47.53515], [7.53199, 47.5284], [7.5229, 47.51644], [7.50813, 47.51601], [7.50898, 47.49819], [7.49025, 47.48355], [7.47534, 47.47932], [7.43356, 47.49712], [7.42923, 47.48628], [7.4583, 47.47216], [7.4462, 47.46264], [7.43088, 47.45846], [7.41906, 47.44626], [7.40308, 47.43638], [7.38216, 47.433], [7.38122, 47.43208], [7.37349, 47.43399], [7.3527, 47.43426], [7.34123, 47.43873], [7.33818, 47.44256], [7.24669, 47.4205], [7.17026, 47.44312], [7.19583, 47.49455], [7.16249, 47.49025], [7.12781, 47.50371], [7.07425, 47.48863], [7.0231, 47.50522], [6.98425, 47.49432], [7.0024, 47.45264], [6.93953, 47.43388], [6.93744, 47.40714], [6.88542, 47.37262], [6.87959, 47.35335], [7.03125, 47.36996], [7.05198, 47.35634], [7.05302, 47.33131], [7.01, 47.32451], [7.00827, 47.3014], [6.94316, 47.28747], [6.95108, 47.26428], [6.95087, 47.24121], [6.86359, 47.18015], [6.85069, 47.15744], [6.76788, 47.1208], [6.68823, 47.06616], [6.71531, 47.0494], [6.69579, 47.0371], [6.68456, 47.03714], [6.65915, 47.02734], [6.64008, 47.00251], [6.61239, 46.99083], [6.50315, 46.96736], [6.43341, 46.92703], [6.46456, 46.88865], [6.43216, 46.80336], [6.45209, 46.77502], [6.38351, 46.73171], [6.27135, 46.68251], [6.11084, 46.57649], [6.1567, 46.54402], [6.07269, 46.46244], [6.08427, 46.44305], [6.06407, 46.41676], [6.09926, 46.40768], [6.15016, 46.3778], [6.15985, 46.37721], [6.16987, 46.36759], [6.15738, 46.3491], [6.13876, 46.33844], [6.1198, 46.31157], [6.11697, 46.29547], [6.1013, 46.28512], [6.11926, 46.2634], [6.12446, 46.25059], [6.10071, 46.23772], [6.08563, 46.24651], [6.07072, 46.24085], [6.0633, 46.24583], [6.05029, 46.23518], [6.04602, 46.23127], [6.03342, 46.2383], [6.02461, 46.23313], [5.97542, 46.21525], [5.96515, 46.19638], [5.99573, 46.18587], [5.98846, 46.17046], [5.98188, 46.17392], [5.97508, 46.15863], [5.9641, 46.14412], [5.95781, 46.12925], [5.97893, 46.13303], [5.9871, 46.14499], [6.01791, 46.14228], [6.03614, 46.13712], [6.04564, 46.14031], [6.05203, 46.15191], [6.07491, 46.14879], [6.09199, 46.15191], [6.09926, 46.14373], [6.13397, 46.1406], [6.15305, 46.15194], [6.18116, 46.16187], [6.18871, 46.16644], [6.18707, 46.17999], [6.19552, 46.18401], [6.19807, 46.18369], [6.20539, 46.19163], [6.21114, 46.1927], [6.21273, 46.19409], [6.21603, 46.19507], [6.21844, 46.19837], [6.22222, 46.19888], [6.22175, 46.20045], [6.23544, 46.20714], [6.23913, 46.20511], [6.24821, 46.20531], [6.26007, 46.21165], [6.27694, 46.21566], [6.29663, 46.22688], [6.31041, 46.24417], [6.29474, 46.26221], [6.26749, 46.24745], [6.24952, 46.26255], [6.23775, 46.27822], [6.25137, 46.29014], [6.24826, 46.30175], [6.21981, 46.31304], [6.25432, 46.3632], [6.53358, 46.45431], [6.82312, 46.42661], [6.8024, 46.39171], [6.77152, 46.34784], [6.86052, 46.28512], [6.78968, 46.14058], [6.89321, 46.12548], [6.87868, 46.03855], [6.93862, 46.06502], [7.00946, 45.9944], [7.04151, 45.92435], [7.10685, 45.85653], [7.56343, 45.97421], [7.85949, 45.91485], [7.9049, 45.99945], [7.98881, 45.99867], [8.02906, 46.10331], [8.11383, 46.11577], [8.16866, 46.17817], [8.08814, 46.26692], [8.31162, 46.38044], [8.30648, 46.41587], [8.42464, 46.46367], [8.46317, 46.43712], [8.45032, 46.26869], [8.62242, 46.12112], [8.75697, 46.10395], [8.80778, 46.10085], [8.85617, 46.0748], [8.79414, 46.00913], [8.78585, 45.98973], [8.79362, 45.99207], [8.8319, 45.9879], [8.85121, 45.97239], [8.86688, 45.96135], [8.88904, 45.95465], [8.93649, 45.86775], [8.94372, 45.86587], [8.93504, 45.86245], [8.91129, 45.8388], [8.94737, 45.84285], [8.9621, 45.83707], [8.99663, 45.83466], [9.00324, 45.82055], [9.0298, 45.82127], [9.03279, 45.82865], [9.03793, 45.83548], [9.03505, 45.83976], [9.04059, 45.8464], [9.04546, 45.84968], [9.06642, 45.8761], [9.09065, 45.89906], [8.99257, 45.9698], [9.01618, 46.04928], [9.24503, 46.23616], [9.29226, 46.32717], [9.25502, 46.43743], [9.28136, 46.49685], [9.36128, 46.5081], [9.40487, 46.46621], [9.45936, 46.50873], [9.46117, 46.37481], [9.57015, 46.2958], [9.71273, 46.29266], [9.73086, 46.35071], [9.95249, 46.38045], [10.07055, 46.21668], [10.14439, 46.22992], [10.17862, 46.25626], [10.10506, 46.3372], [10.165, 46.41051], [10.03715, 46.44479], [10.10307, 46.61003], [10.23674, 46.63484], [10.25309, 46.57432], [10.46136, 46.53164], [10.49375, 46.62049], [10.44686, 46.64162], [10.40475, 46.63671], [10.38659, 46.67847], [10.47197, 46.85698], [10.48376, 46.93891], [10.42211, 46.96019], [10.42715, 46.97495], [10.36933, 47.00212], [10.30031, 46.92093], [10.24128, 46.93147], [10.22675, 46.86942], [10.10715, 46.84296], [9.98058, 46.91434], [9.88266, 46.93343], [9.87935, 47.01337], [9.60717, 47.06091], [9.55721, 47.04762], [9.54041, 47.06495], [9.47548, 47.05257], [9.47139, 47.06402], [9.51362, 47.08505], [9.52089, 47.10019], [9.51044, 47.13727], [9.48774, 47.17402], [9.4891, 47.19346], [9.50318, 47.22153], [9.52406, 47.24959], [9.53116, 47.27029], [9.54773, 47.2809], [9.55857, 47.29919], [9.58513, 47.31334], [9.59978, 47.34671], [9.62476, 47.36639], [9.65427, 47.36824], [9.66243, 47.37136], [9.6711, 47.37824], [9.67445, 47.38429], [9.67334, 47.39191], [9.6629, 47.39591], [9.65136, 47.40504], [9.65043, 47.41937], [9.6446, 47.43233], [9.64483, 47.43842], [9.65863, 47.44847], [9.65728, 47.45383], [9.6423, 47.45599], [9.62475, 47.45685], [9.62158, 47.45858], [9.60841, 47.47178], [9.60484, 47.46358], [9.60205, 47.46165], [9.59482, 47.46305], [9.58208, 47.48344], [9.56312, 47.49495], [9.55125, 47.53629], [9.25619, 47.65939], [9.18203, 47.65598], [9.17593, 47.65399], [9.1755, 47.65584], [9.1705, 47.65513], [9.15181, 47.66904], [9.13845, 47.66389], [9.09891, 47.67801], [9.02093, 47.6868], [8.94093, 47.65596], [8.89946, 47.64769], [8.87625, 47.65441], [8.87383, 47.67045], [8.85148, 47.69769], [8.87474, 47.69425], [8.86881, 47.70524], [8.82002, 47.71458], [8.80663, 47.73821], [8.77309, 47.72059], [8.76965, 47.7075], [8.79966, 47.70222], [8.79511, 47.67462], [8.75856, 47.68969], [8.72809, 47.69282]], [[8.95861, 45.96485], [8.96668, 45.98436], [8.97741, 45.98317], [8.97604, 45.96151], [8.95861, 45.96485]], [[8.70847, 47.68904], [8.68985, 47.69552], [8.67538, 47.68629], [8.66837, 47.68437], [8.65769, 47.68928], [8.67508, 47.6979], [8.66416, 47.71367], [8.68571, 47.70954], [8.70237, 47.71453], [8.71773, 47.69088], [8.70847, 47.68904]]]] } },
34124 { type: "Feature", properties: { iso1A2: "CI", iso1A3: "CIV", iso1N3: "384", wikidata: "Q1008", nameEn: "C\xF4te d'Ivoire", groups: ["011", "202", "002", "UN"], callingCodes: ["225"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-7.52774, 3.7105], [-3.34019, 4.17519], [-3.10675, 5.08515], [-3.11073, 5.12675], [-3.063, 5.13665], [-2.96554, 5.10397], [-2.95261, 5.12477], [-2.75502, 5.10657], [-2.73074, 5.1364], [-2.77625, 5.34621], [-2.72737, 5.34789], [-2.76614, 5.60963], [-2.85378, 5.65156], [-2.93132, 5.62137], [-2.96671, 5.6415], [-2.95323, 5.71865], [-3.01896, 5.71697], [-3.25999, 6.62521], [-3.21954, 6.74407], [-3.23327, 6.81744], [-2.95438, 7.23737], [-2.97822, 7.27165], [-2.92339, 7.60847], [-2.79467, 7.86002], [-2.78395, 7.94974], [-2.74819, 7.92613], [-2.67787, 8.02055], [-2.61232, 8.02645], [-2.62901, 8.11495], [-2.49037, 8.20872], [-2.58243, 8.7789], [-2.66357, 9.01771], [-2.77799, 9.04949], [-2.69814, 9.22717], [-2.68802, 9.49343], [-2.76494, 9.40778], [-2.93012, 9.57403], [-3.00765, 9.74019], [-3.16609, 9.85147], [-3.19306, 9.93781], [-3.27228, 9.84981], [-3.31779, 9.91125], [-3.69703, 9.94279], [-4.25999, 9.76012], [-4.31392, 9.60062], [-4.6426, 9.70696], [-4.96621, 9.89132], [-4.96453, 9.99923], [-5.12465, 10.29788], [-5.39602, 10.2929], [-5.51058, 10.43177], [-5.65135, 10.46767], [-5.78124, 10.43952], [-5.99478, 10.19694], [-6.18851, 10.24244], [-6.1731, 10.46983], [-6.24795, 10.74248], [-6.325, 10.68624], [-6.40646, 10.69922], [-6.42847, 10.5694], [-6.52974, 10.59104], [-6.63541, 10.66893], [-6.68164, 10.35074], [-6.93921, 10.35291], [-7.01186, 10.25111], [-6.97444, 10.21644], [-7.00966, 10.15794], [-7.0603, 10.14711], [-7.13331, 10.24877], [-7.3707, 10.24677], [-7.44555, 10.44602], [-7.52261, 10.4655], [-7.54462, 10.40921], [-7.63048, 10.46334], [-7.92107, 10.15577], [-7.97971, 10.17117], [-8.01225, 10.1021], [-8.11921, 10.04577], [-8.15652, 9.94288], [-8.09434, 9.86936], [-8.14657, 9.55062], [-8.03463, 9.39604], [-7.85056, 9.41812], [-7.90777, 9.20456], [-7.73862, 9.08422], [-7.92518, 8.99332], [-7.95503, 8.81146], [-7.69882, 8.66148], [-7.65653, 8.36873], [-7.92518, 8.50652], [-8.22991, 8.48438], [-8.2411, 8.24196], [-8.062, 8.16071], [-7.98675, 8.20134], [-7.99919, 8.11023], [-7.94695, 8.00925], [-8.06449, 8.04989], [-8.13414, 7.87991], [-8.09931, 7.78626], [-8.21374, 7.54466], [-8.4003, 7.6285], [-8.47114, 7.55676], [-8.41935, 7.51203], [-8.37458, 7.25794], [-8.29249, 7.1691], [-8.31736, 6.82837], [-8.59456, 6.50612], [-8.48652, 6.43797], [-8.45666, 6.49977], [-8.38453, 6.35887], [-8.3298, 6.36381], [-8.17557, 6.28222], [-8.00642, 6.31684], [-7.90692, 6.27728], [-7.83478, 6.20309], [-7.8497, 6.08932], [-7.79747, 6.07696], [-7.78254, 5.99037], [-7.70294, 5.90625], [-7.67309, 5.94337], [-7.48155, 5.80974], [-7.46165, 5.84934], [-7.43677, 5.84687], [-7.43926, 5.74787], [-7.37209, 5.61173], [-7.43428, 5.42355], [-7.36463, 5.32944], [-7.46165, 5.26256], [-7.48901, 5.14118], [-7.55369, 5.08667], [-7.53876, 4.94294], [-7.59349, 4.8909], [-7.53259, 4.35145], [-7.52774, 3.7105]]]] } },
34125 { type: "Feature", properties: { iso1A2: "CK", iso1A3: "COK", iso1N3: "184", wikidata: "Q26988", nameEn: "Cook Islands", country: "NZ", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["682"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-168.15106, -10.26955], [-156.45576, -31.75456], [-156.48634, -15.52824], [-156.50903, -7.4975], [-168.15106, -10.26955]]]] } },
34126 { type: "Feature", properties: { iso1A2: "CL", iso1A3: "CHL", iso1N3: "152", wikidata: "Q298", nameEn: "Chile", groups: ["005", "419", "019", "UN"], callingCodes: ["56"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-68.60702, -52.65781], [-68.41683, -52.33516], [-69.97824, -52.00845], [-71.99889, -51.98018], [-72.33873, -51.59954], [-72.31343, -50.58411], [-73.15765, -50.78337], [-73.55259, -49.92488], [-73.45156, -49.79461], [-73.09655, -49.14342], [-72.56894, -48.81116], [-72.54042, -48.52392], [-72.27662, -48.28727], [-72.50478, -47.80586], [-71.94152, -47.13595], [-71.68577, -46.55385], [-71.75614, -45.61611], [-71.35687, -45.22075], [-72.06985, -44.81756], [-71.26418, -44.75684], [-71.16436, -44.46244], [-71.81318, -44.38097], [-71.64206, -43.64774], [-72.14828, -42.85321], [-72.15541, -42.15941], [-71.74901, -42.11711], [-71.92726, -40.72714], [-71.37826, -38.91474], [-70.89532, -38.6923], [-71.24279, -37.20264], [-70.95047, -36.4321], [-70.38008, -36.02375], [-70.49416, -35.24145], [-69.87386, -34.13344], [-69.88099, -33.34489], [-70.55832, -31.51559], [-70.14479, -30.36595], [-69.8596, -30.26131], [-69.99507, -29.28351], [-69.80969, -29.07185], [-69.66709, -28.44055], [-69.22504, -27.95042], [-68.77586, -27.16029], [-68.43363, -27.08414], [-68.27677, -26.90626], [-68.59048, -26.49861], [-68.56909, -26.28146], [-68.38372, -26.15353], [-68.57622, -25.32505], [-68.38372, -25.08636], [-68.56909, -24.69831], [-68.24825, -24.42596], [-67.33563, -24.04237], [-66.99632, -22.99839], [-67.18382, -22.81525], [-67.54284, -22.89771], [-67.85114, -22.87076], [-68.18816, -21.28614], [-68.40403, -20.94562], [-68.53957, -20.91542], [-68.55383, -20.7355], [-68.44023, -20.62701], [-68.7276, -20.46178], [-68.74273, -20.08817], [-68.57132, -20.03134], [-68.54611, -19.84651], [-68.66761, -19.72118], [-68.41218, -19.40499], [-68.61989, -19.27584], [-68.80602, -19.08355], [-68.87082, -19.06003], [-68.94987, -18.93302], [-69.07432, -18.28259], [-69.14807, -18.16893], [-69.07496, -18.03715], [-69.28671, -17.94844], [-69.34126, -17.72753], [-69.46623, -17.60518], [-69.46897, -17.4988], [-69.66483, -17.65083], [-69.79087, -17.65563], [-69.82868, -17.72048], [-69.75305, -17.94605], [-69.81607, -18.12582], [-69.96732, -18.25992], [-70.16394, -18.31737], [-70.31267, -18.31258], [-70.378, -18.3495], [-70.59118, -18.35072], [-113.52687, -26.52828], [-68.11646, -58.14883], [-66.07313, -55.19618], [-67.11046, -54.94199], [-67.46182, -54.92205], [-68.01394, -54.8753], [-68.60733, -54.9125], [-68.60702, -52.65781]]]] } },
34127 { type: "Feature", properties: { iso1A2: "CM", iso1A3: "CMR", iso1N3: "120", wikidata: "Q1009", nameEn: "Cameroon", groups: ["017", "202", "002", "UN"], callingCodes: ["237"] }, geometry: { type: "MultiPolygon", coordinates: [[[[14.83314, 12.62963], [14.55058, 12.78256], [14.56101, 12.91036], [14.46881, 13.08259], [14.08251, 13.0797], [14.20204, 12.53405], [14.17523, 12.41916], [14.22215, 12.36533], [14.4843, 12.35223], [14.6474, 12.17466], [14.61612, 11.7798], [14.55207, 11.72001], [14.64591, 11.66166], [14.6124, 11.51283], [14.17821, 11.23831], [13.97489, 11.30258], [13.78945, 11.00154], [13.7403, 11.00593], [13.70753, 10.94451], [13.73434, 10.9255], [13.54964, 10.61236], [13.5705, 10.53183], [13.43644, 10.13326], [13.34111, 10.12299], [13.25025, 10.03647], [13.25323, 10.00127], [13.286, 9.9822], [13.27409, 9.93232], [13.24132, 9.91031], [13.25025, 9.86042], [13.29941, 9.8296], [13.25472, 9.76795], [13.22642, 9.57266], [13.02385, 9.49334], [12.85628, 9.36698], [12.91958, 9.33905], [12.90022, 9.11411], [12.81085, 8.91992], [12.79, 8.75361], [12.71701, 8.7595], [12.68722, 8.65938], [12.44146, 8.6152], [12.4489, 8.52536], [12.26123, 8.43696], [12.24782, 8.17904], [12.19271, 8.10826], [12.20909, 7.97553], [11.99908, 7.67302], [12.01844, 7.52981], [11.93205, 7.47812], [11.84864, 7.26098], [11.87396, 7.09398], [11.63117, 6.9905], [11.55818, 6.86186], [11.57755, 6.74059], [11.51499, 6.60892], [11.42264, 6.5882], [11.42041, 6.53789], [11.09495, 6.51717], [11.09644, 6.68437], [10.94302, 6.69325], [10.8179, 6.83377], [10.83727, 6.9358], [10.60789, 7.06885], [10.59746, 7.14719], [10.57214, 7.16345], [10.53639, 6.93432], [10.21466, 6.88996], [10.15135, 7.03781], [9.86314, 6.77756], [9.77824, 6.79088], [9.70674, 6.51717], [9.51757, 6.43874], [8.84209, 5.82562], [8.88156, 5.78857], [8.83687, 5.68483], [8.92029, 5.58403], [8.78027, 5.1243], [8.60302, 4.87353], [8.34397, 4.30689], [9.22018, 3.72052], [9.81162, 2.33797], [9.82123, 2.35097], [9.83754, 2.32428], [9.83238, 2.29079], [9.84716, 2.24676], [9.89012, 2.20457], [9.90749, 2.20049], [9.991, 2.16561], [11.3561, 2.17217], [11.37116, 2.29975], [13.28534, 2.25716], [13.29457, 2.16106], [14.61145, 2.17866], [15.00996, 1.98887], [15.22634, 2.03243], [15.34776, 1.91264], [15.48942, 1.98265], [16.02959, 1.76483], [16.02647, 1.65591], [16.14634, 1.70259], [16.05294, 1.9811], [16.08563, 2.19733], [16.15568, 2.18955], [16.19357, 2.21537], [16.08252, 2.45708], [16.05449, 3.02306], [15.77725, 3.26835], [15.73522, 3.24348], [15.07686, 4.01805], [15.17482, 4.05131], [15.10644, 4.1362], [15.08609, 4.30282], [15.00825, 4.41458], [14.73383, 4.6135], [14.65489, 5.21343], [14.57083, 5.23979], [14.52724, 5.28319], [14.62531, 5.51411], [14.58951, 5.59777], [14.62375, 5.70466], [14.60974, 5.91838], [14.49455, 5.91683], [14.42917, 6.00508], [14.43073, 6.08867], [14.56149, 6.18928], [14.74206, 6.26356], [14.80122, 6.34866], [14.79966, 6.39043], [14.96311, 6.75693], [15.04717, 6.77085], [15.23397, 7.25135], [15.49743, 7.52179], [15.56964, 7.58936], [15.59272, 7.7696], [15.50743, 7.79302], [15.20426, 8.50892], [15.09484, 8.65982], [14.83566, 8.80557], [14.35707, 9.19611], [14.37094, 9.2954], [13.97544, 9.6365], [14.01793, 9.73169], [14.1317, 9.82413], [14.20411, 10.00055], [14.4673, 10.00264], [14.80082, 9.93818], [14.95722, 9.97926], [15.05999, 9.94845], [15.14043, 9.99246], [15.24618, 9.99246], [15.41408, 9.92876], [15.68761, 9.99344], [15.50535, 10.1098], [15.30874, 10.31063], [15.23724, 10.47764], [15.14936, 10.53915], [15.15532, 10.62846], [15.06737, 10.80921], [15.09127, 10.87431], [15.04957, 11.02347], [15.10021, 11.04101], [15.0585, 11.40481], [15.13149, 11.5537], [15.06595, 11.71126], [15.11579, 11.79313], [15.04808, 11.8731], [15.05786, 12.0608], [15.0349, 12.10698], [15.00146, 12.1223], [14.96952, 12.0925], [14.89019, 12.16593], [14.90827, 12.3269], [14.83314, 12.62963]]]] } },
34128 { type: "Feature", properties: { iso1A2: "CN", iso1A3: "CHN", iso1N3: "156", wikidata: "Q148", nameEn: "People's Republic of China" }, geometry: null },
34129 { type: "Feature", properties: { iso1A2: "CO", iso1A3: "COL", iso1N3: "170", wikidata: "Q739", nameEn: "Colombia", groups: ["005", "419", "019", "UN"], callingCodes: ["57"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-71.19849, 12.65801], [-81.58685, 18.0025], [-82.06974, 14.49418], [-82.56142, 11.91792], [-78.79327, 9.93766], [-77.58292, 9.22278], [-77.32389, 8.81247], [-77.45064, 8.49991], [-77.17257, 7.97422], [-77.57185, 7.51147], [-77.72514, 7.72348], [-77.72157, 7.47612], [-77.81426, 7.48319], [-77.89178, 7.22681], [-78.06168, 7.07793], [-82.12561, 4.00341], [-78.87137, 1.47457], [-78.42749, 1.15389], [-77.85677, 0.80197], [-77.7148, 0.85003], [-77.68613, 0.83029], [-77.66416, 0.81604], [-77.67815, 0.73863], [-77.49984, 0.64476], [-77.52001, 0.40782], [-76.89177, 0.24736], [-76.4094, 0.24015], [-76.41215, 0.38228], [-76.23441, 0.42294], [-75.82927, 0.09578], [-75.25764, -0.11943], [-75.18513, -0.0308], [-74.42701, -0.50218], [-74.26675, -0.97229], [-73.65312, -1.26222], [-72.92587, -2.44514], [-71.75223, -2.15058], [-70.94377, -2.23142], [-70.04609, -2.73906], [-70.71396, -3.7921], [-70.52393, -3.87553], [-70.3374, -3.79505], [-70.28573, -3.82549], [-69.96843, -4.19678], [-69.94924, -4.23116], [-69.93571, -4.2195], [-69.93323, -4.21971], [-69.43395, -1.42219], [-69.4215, -1.01853], [-69.59796, -0.75136], [-69.603, -0.51947], [-70.04294, -0.19043], [-70.04708, 0.56194], [-69.82577, 0.59225], [-69.47696, 0.71065], [-69.20976, 0.57958], [-69.14422, 0.84172], [-69.26017, 1.06856], [-69.84259, 1.07881], [-69.84289, 1.69122], [-69.55722, 1.77158], [-69.39079, 1.72934], [-68.18183, 1.72948], [-68.26699, 1.83463], [-68.18632, 2.00091], [-67.9292, 1.82455], [-67.40488, 2.22258], [-67.299, 1.87494], [-67.15784, 1.80439], [-67.08222, 1.17441], [-66.85795, 1.22998], [-67.21967, 2.35778], [-67.65696, 2.81691], [-67.85862, 2.79173], [-67.85862, 2.86727], [-67.30945, 3.38393], [-67.50067, 3.75812], [-67.62671, 3.74303], [-67.85358, 4.53249], [-67.83341, 5.31104], [-67.59141, 5.5369], [-67.63914, 5.64963], [-67.58558, 5.84537], [-67.43513, 5.98835], [-67.4625, 6.20625], [-67.60654, 6.2891], [-69.41843, 6.1072], [-70.10716, 6.96516], [-70.7596, 7.09799], [-71.03941, 6.98163], [-71.37234, 7.01588], [-71.42212, 7.03854], [-71.44118, 7.02116], [-71.82441, 7.04314], [-72.04895, 7.03837], [-72.19437, 7.37034], [-72.43132, 7.40034], [-72.47415, 7.48928], [-72.45321, 7.57232], [-72.47827, 7.65604], [-72.46763, 7.79518], [-72.44454, 7.86031], [-72.46183, 7.90682], [-72.45806, 7.91141], [-72.47042, 7.92306], [-72.48183, 7.92909], [-72.48801, 7.94329], [-72.47213, 7.96106], [-72.39137, 8.03534], [-72.35163, 8.01163], [-72.36987, 8.19976], [-72.4042, 8.36513], [-72.65474, 8.61428], [-72.77415, 9.10165], [-72.94052, 9.10663], [-73.02119, 9.27584], [-73.36905, 9.16636], [-72.98085, 9.85253], [-72.88002, 10.44309], [-72.4767, 11.1117], [-72.24983, 11.14138], [-71.9675, 11.65536], [-71.3275, 11.85], [-70.92579, 11.96275], [-71.19849, 12.65801]]]] } },
34130 { type: "Feature", properties: { iso1A2: "CP", iso1A3: "CPT", wikidata: "Q161258", nameEn: "Clipperton Island", country: "FR", groups: ["EU", "013", "003", "019", "UN"], isoStatus: "excRes" }, geometry: { type: "MultiPolygon", coordinates: [[[[-110.36279, 9.79626], [-108.755, 9.84085], [-109.04145, 11.13245], [-110.36279, 9.79626]]]] } },
34131 { type: "Feature", properties: { iso1A2: "CQ", iso1A3: "CRQ", iso1N3: "680", m49: "680", wikidata: "Q3405693", ccTLD: null, nameEn: "Sark", country: "GB", groups: ["GG", "830", "Q185086", "154", "150", "UN"], level: "subterritory", isoStatus: "excRes", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44 01481"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.36485, 49.48223], [-2.65349, 49.15373], [-2.09454, 49.46288], [-2.36485, 49.48223]]]] } },
34132 { type: "Feature", properties: { iso1A2: "CR", iso1A3: "CRI", iso1N3: "188", wikidata: "Q800", nameEn: "Costa Rica", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["506"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-83.68276, 11.01562], [-83.66597, 10.79916], [-83.90838, 10.71161], [-84.68197, 11.07568], [-84.92439, 10.9497], [-85.60529, 11.22607], [-85.71223, 11.06868], [-86.14524, 11.09059], [-87.41779, 5.02401], [-82.94503, 7.93865], [-82.89978, 8.04083], [-82.89137, 8.05755], [-82.88641, 8.10219], [-82.9388, 8.26634], [-83.05209, 8.33394], [-82.93056, 8.43465], [-82.8679, 8.44042], [-82.8382, 8.48117], [-82.83322, 8.52464], [-82.83975, 8.54755], [-82.82739, 8.60153], [-82.8794, 8.6981], [-82.92068, 8.74832], [-82.91377, 8.774], [-82.88253, 8.83331], [-82.72126, 8.97125], [-82.93516, 9.07687], [-82.93516, 9.46741], [-82.84871, 9.4973], [-82.87919, 9.62645], [-82.77206, 9.59573], [-82.66667, 9.49746], [-82.61345, 9.49881], [-82.56507, 9.57279], [-82.51044, 9.65379], [-83.54024, 10.96805], [-83.68276, 11.01562]]]] } },
34133 { type: "Feature", properties: { iso1A2: "CU", iso1A3: "CUB", iso1N3: "192", wikidata: "Q241", nameEn: "Cuba", groups: ["029", "003", "419", "019", "UN"], callingCodes: ["53"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-73.62304, 20.6935], [-82.02215, 24.23074], [-85.77883, 21.92705], [-74.81171, 18.82201], [-73.62304, 20.6935]]]] } },
34134 { type: "Feature", properties: { iso1A2: "CV", iso1A3: "CPV", iso1N3: "132", wikidata: "Q1011", nameEn: "Cape Verde", groups: ["Q105472", "011", "202", "002", "UN"], callingCodes: ["238"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-28.81604, 14.57305], [-20.39702, 14.12816], [-23.37101, 19.134], [-28.81604, 14.57305]]]] } },
34135 { type: "Feature", properties: { iso1A2: "CW", iso1A3: "CUW", iso1N3: "531", wikidata: "Q25279", nameEn: "Cura\xE7ao", aliases: ["NL-CW"], country: "NL", groups: ["Q1451600", "029", "003", "419", "019", "UN"], callingCodes: ["599"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-68.90012, 12.62309], [-69.59009, 12.46019], [-68.99639, 11.79035], [-68.33524, 11.78151], [-68.90012, 12.62309]]]] } },
34136 { type: "Feature", properties: { iso1A2: "CX", iso1A3: "CXR", iso1N3: "162", wikidata: "Q31063", nameEn: "Christmas Island", country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[105.66835, -9.31927], [104.67494, -11.2566], [106.66176, -11.14349], [105.66835, -9.31927]]]] } },
34137 { type: "Feature", properties: { iso1A2: "CY", iso1A3: "CYP", iso1N3: "196", wikidata: "Q229", nameEn: "Republic of Cyprus", groups: ["Q644636", "EU", "145", "142", "UN"], driveSide: "left", callingCodes: ["357"] }, geometry: { type: "MultiPolygon", coordinates: [[[[32.60361, 35.16647], [32.46489, 35.48584], [30.15137, 34.08517], [32.74412, 34.43926], [32.75515, 34.64985], [32.76136, 34.68318], [32.79433, 34.67883], [32.82717, 34.70622], [32.86014, 34.70585], [32.86167, 34.68734], [32.9068, 34.66102], [32.91398, 34.67343], [32.93043, 34.67091], [32.92824, 34.66821], [32.93535, 34.66317], [32.93756, 34.67072], [32.93989, 34.67034], [32.94127, 34.67426], [32.95567, 34.6839], [32.98967, 34.67981], [32.98668, 34.67268], [32.99014, 34.65518], [32.98046, 34.65336], [32.969, 34.6549], [32.9639, 34.65866], [32.96154, 34.65587], [32.95277, 34.65104], [32.95471, 34.64528], [32.95323, 34.64075], [32.95516, 34.63541], [32.96312, 34.63236], [32.96718, 34.63446], [32.96968, 34.64046], [33.0138, 34.64424], [33.26744, 34.49942], [33.83531, 34.73974], [33.70575, 34.97947], [33.70639, 34.99303], [33.71514, 35.00294], [33.69731, 35.01754], [33.69938, 35.03123], [33.67678, 35.03866], [33.63765, 35.03869], [33.61215, 35.0527], [33.59658, 35.03635], [33.567, 35.04803], [33.57478, 35.06049], [33.53975, 35.08151], [33.48915, 35.06594], [33.47666, 35.00701], [33.45256, 35.00288], [33.45178, 35.02078], [33.47825, 35.04103], [33.48136, 35.0636], [33.46813, 35.10564], [33.41675, 35.16325], [33.4076, 35.20062], [33.38575, 35.2018], [33.37248, 35.18698], [33.3717, 35.1788], [33.36569, 35.17479], [33.35612, 35.17402], [33.35596, 35.17942], [33.34964, 35.17803], [33.35056, 35.18328], [33.31955, 35.18096], [33.3072, 35.16816], [33.27068, 35.16815], [33.15138, 35.19504], [33.11105, 35.15639], [33.08249, 35.17319], [33.01192, 35.15639], [32.94471, 35.09422], [32.86406, 35.1043], [32.85733, 35.07742], [32.70779, 35.14127], [32.70947, 35.18328], [32.64864, 35.19967], [32.60361, 35.16647]]], [[[33.7343, 35.01178], [33.74144, 35.01053], [33.7492, 35.01319], [33.74983, 35.02274], [33.74265, 35.02329], [33.73781, 35.02181], [33.7343, 35.01178]]], [[[33.77553, 34.99518], [33.77312, 34.9976], [33.75994, 35.00113], [33.75682, 34.99916], [33.76605, 34.99543], [33.76738, 34.99188], [33.7778, 34.98981], [33.77843, 34.988], [33.78149, 34.98854], [33.78318, 34.98699], [33.78571, 34.98951], [33.78917, 34.98854], [33.79191, 34.98914], [33.78516, 34.99582], [33.77553, 34.99518]]], [[[33.82051, 35.0667], [33.8012, 35.04786], [33.81524, 35.04192], [33.83055, 35.02865], [33.82875, 35.01685], [33.84045, 35.00616], [33.85216, 35.00579], [33.85891, 35.001], [33.85488, 34.98462], [33.84616, 34.98511], [33.83459, 34.97448], [33.84028, 34.97179], [33.84741, 34.97167], [33.86018, 34.97381], [33.90146, 34.96458], [33.98684, 34.76642], [35.48515, 34.70851], [35.51152, 36.10954], [34.23164, 35.1777], [33.99999, 35.07016], [33.94869, 35.07277], [33.92495, 35.06789], [33.90247, 35.07686], [33.89322, 35.06789], [33.87438, 35.08118], [33.85261, 35.0574], [33.8355, 35.05777], [33.82051, 35.0667]]]] } },
34138 { type: "Feature", properties: { iso1A2: "CZ", iso1A3: "CZE", iso1N3: "203", wikidata: "Q213", nameEn: "Czechia", groups: ["EU", "151", "150", "UN"], callingCodes: ["420"] }, geometry: { type: "MultiPolygon", coordinates: [[[[14.82803, 50.86966], [14.79139, 50.81438], [14.70661, 50.84096], [14.61993, 50.86049], [14.63434, 50.8883], [14.65259, 50.90513], [14.64802, 50.93241], [14.58024, 50.91443], [14.56374, 50.922], [14.59702, 50.96148], [14.59908, 50.98685], [14.58215, 50.99306], [14.56432, 51.01008], [14.53438, 51.00374], [14.53321, 51.01679], [14.49873, 51.02242], [14.50809, 51.0427], [14.49991, 51.04692], [14.49154, 51.04382], [14.49202, 51.02286], [14.45827, 51.03712], [14.41335, 51.02086], [14.30098, 51.05515], [14.25665, 50.98935], [14.28776, 50.97718], [14.32353, 50.98556], [14.32793, 50.97379], [14.30251, 50.96606], [14.31422, 50.95243], [14.39848, 50.93866], [14.38691, 50.89907], [14.30098, 50.88448], [14.27123, 50.89386], [14.24314, 50.88761], [14.22331, 50.86049], [14.02982, 50.80662], [13.98864, 50.8177], [13.89113, 50.78533], [13.89444, 50.74142], [13.82942, 50.7251], [13.76316, 50.73487], [13.70204, 50.71771], [13.65977, 50.73096], [13.52474, 50.70394], [13.53748, 50.67654], [13.5226, 50.64721], [13.49742, 50.63133], [13.46413, 50.60102], [13.42189, 50.61243], [13.37485, 50.64931], [13.37805, 50.627], [13.32264, 50.60317], [13.32594, 50.58009], [13.29454, 50.57904], [13.25158, 50.59268], [13.19043, 50.50237], [13.13424, 50.51709], [13.08301, 50.50132], [13.0312, 50.50944], [13.02038, 50.4734], [13.02147, 50.44763], [12.98433, 50.42016], [12.94058, 50.40944], [12.82465, 50.45738], [12.73476, 50.43237], [12.73044, 50.42268], [12.70731, 50.39948], [12.67261, 50.41949], [12.51356, 50.39694], [12.48747, 50.37278], [12.49214, 50.35228], [12.48256, 50.34784], [12.46643, 50.35527], [12.43722, 50.33774], [12.43371, 50.32506], [12.39924, 50.32302], [12.40158, 50.29521], [12.36594, 50.28289], [12.35425, 50.23993], [12.33263, 50.24367], [12.32445, 50.20442], [12.33847, 50.19432], [12.32596, 50.17146], [12.29232, 50.17524], [12.28063, 50.19544], [12.28755, 50.22429], [12.23943, 50.24594], [12.24791, 50.25525], [12.26953, 50.25189], [12.25119, 50.27079], [12.20823, 50.2729], [12.18013, 50.32146], [12.10907, 50.32041], [12.13716, 50.27396], [12.09287, 50.25032], [12.19335, 50.19997], [12.21484, 50.16399], [12.1917, 50.13434], [12.2073, 50.10315], [12.23709, 50.10213], [12.27433, 50.0771], [12.26111, 50.06331], [12.30798, 50.05719], [12.49908, 49.97305], [12.47264, 49.94222], [12.55197, 49.92094], [12.48256, 49.83575], [12.46603, 49.78882], [12.40489, 49.76321], [12.4462, 49.70233], [12.52553, 49.68415], [12.53544, 49.61888], [12.56188, 49.6146], [12.60155, 49.52887], [12.64782, 49.52565], [12.64121, 49.47628], [12.669, 49.42935], [12.71227, 49.42363], [12.75854, 49.3989], [12.78168, 49.34618], [12.88414, 49.33541], [12.88249, 49.35479], [12.94859, 49.34079], [13.03618, 49.30417], [13.02957, 49.27399], [13.05883, 49.26259], [13.17665, 49.16713], [13.17019, 49.14339], [13.20405, 49.12303], [13.23689, 49.11412], [13.28242, 49.1228], [13.39479, 49.04812], [13.40802, 48.98851], [13.50221, 48.93752], [13.50552, 48.97441], [13.58319, 48.96899], [13.61624, 48.9462], [13.67739, 48.87886], [13.73854, 48.88538], [13.76994, 48.83537], [13.78977, 48.83319], [13.8096, 48.77877], [13.84023, 48.76988], [14.06151, 48.66873], [14.01482, 48.63788], [14.09104, 48.5943], [14.20691, 48.5898], [14.33909, 48.55852], [14.43076, 48.58855], [14.4587, 48.64695], [14.56139, 48.60429], [14.60808, 48.62881], [14.66762, 48.58215], [14.71794, 48.59794], [14.72756, 48.69502], [14.80584, 48.73489], [14.80821, 48.77711], [14.81545, 48.7874], [14.94773, 48.76268], [14.95641, 48.75915], [14.9758, 48.76857], [14.98112, 48.77524], [14.9782, 48.7766], [14.98032, 48.77959], [14.95072, 48.79101], [14.98917, 48.90082], [14.97612, 48.96983], [14.99878, 49.01444], [15.15534, 48.99056], [15.16358, 48.94278], [15.26177, 48.95766], [15.28305, 48.98831], [15.34823, 48.98444], [15.48027, 48.94481], [15.51357, 48.91549], [15.61622, 48.89541], [15.6921, 48.85973], [15.75341, 48.8516], [15.78087, 48.87644], [15.84404, 48.86921], [16.06034, 48.75436], [16.37345, 48.729], [16.40915, 48.74576], [16.46134, 48.80865], [16.67008, 48.77699], [16.68518, 48.7281], [16.71883, 48.73806], [16.79779, 48.70998], [16.90354, 48.71541], [16.93955, 48.60371], [17.00215, 48.70887], [17.11202, 48.82925], [17.19355, 48.87602], [17.29054, 48.85546], [17.3853, 48.80936], [17.45671, 48.85004], [17.5295, 48.81117], [17.7094, 48.86721], [17.73126, 48.87885], [17.77944, 48.92318], [17.87831, 48.92679], [17.91814, 49.01784], [18.06885, 49.03157], [18.1104, 49.08624], [18.15022, 49.24518], [18.18456, 49.28909], [18.36446, 49.3267], [18.4139, 49.36517], [18.4084, 49.40003], [18.44686, 49.39467], [18.54848, 49.47059], [18.53063, 49.49022], [18.57183, 49.51162], [18.6144, 49.49824], [18.67757, 49.50895], [18.74761, 49.492], [18.84521, 49.51672], [18.84786, 49.5446], [18.80479, 49.6815], [18.72838, 49.68163], [18.69817, 49.70473], [18.62676, 49.71983], [18.62943, 49.74603], [18.62645, 49.75002], [18.61368, 49.75426], [18.61278, 49.7618], [18.57183, 49.83334], [18.60341, 49.86256], [18.57045, 49.87849], [18.57697, 49.91565], [18.54299, 49.92537], [18.54495, 49.9079], [18.53423, 49.89906], [18.41604, 49.93498], [18.33562, 49.94747], [18.33278, 49.92415], [18.31914, 49.91565], [18.27794, 49.93863], [18.27107, 49.96779], [18.21752, 49.97309], [18.20241, 49.99958], [18.10628, 50.00223], [18.07898, 50.04535], [18.03212, 50.06574], [18.00396, 50.04954], [18.04585, 50.03311], [18.04585, 50.01194], [18.00191, 50.01723], [17.86886, 49.97452], [17.77669, 50.02253], [17.7506, 50.07896], [17.6888, 50.12037], [17.66683, 50.10275], [17.59404, 50.16437], [17.70528, 50.18812], [17.76296, 50.23382], [17.72176, 50.25665], [17.74648, 50.29966], [17.69292, 50.32859], [17.67764, 50.28977], [17.58889, 50.27837], [17.3702, 50.28123], [17.34548, 50.2628], [17.34273, 50.32947], [17.27681, 50.32246], [17.19991, 50.3654], [17.19579, 50.38817], [17.14498, 50.38117], [17.1224, 50.39494], [16.89229, 50.45117], [16.85933, 50.41093], [16.90877, 50.38642], [16.94448, 50.31281], [16.99803, 50.30316], [17.02138, 50.27772], [16.99803, 50.25753], [17.02825, 50.23118], [17.00353, 50.21449], [16.98018, 50.24172], [16.8456, 50.20834], [16.7014, 50.09659], [16.63137, 50.1142], [16.55446, 50.16613], [16.56407, 50.21009], [16.42674, 50.32509], [16.39379, 50.3207], [16.3622, 50.34875], [16.36495, 50.37679], [16.30289, 50.38292], [16.28118, 50.36891], [16.22821, 50.41054], [16.21585, 50.40627], [16.19526, 50.43291], [16.31413, 50.50274], [16.34572, 50.49575], [16.44597, 50.58041], [16.33611, 50.66579], [16.23174, 50.67101], [16.20839, 50.63096], [16.10265, 50.66405], [16.02437, 50.60046], [15.98317, 50.61528], [16.0175, 50.63009], [15.97219, 50.69799], [15.87331, 50.67188], [15.81683, 50.75666], [15.73186, 50.73885], [15.43798, 50.80833], [15.3803, 50.77187], [15.36656, 50.83956], [15.2773, 50.8907], [15.27043, 50.97724], [15.2361, 50.99886], [15.1743, 50.9833], [15.16744, 51.01959], [15.11937, 50.99021], [15.10152, 51.01095], [15.06218, 51.02269], [15.03895, 51.0123], [15.02433, 51.0242], [14.96419, 50.99108], [15.01088, 50.97984], [14.99852, 50.86817], [14.82803, 50.86966]]]] } },
34139 { type: "Feature", properties: { iso1A2: "DE", iso1A3: "DEU", iso1N3: "276", wikidata: "Q183", nameEn: "Germany", groups: ["EU", "155", "150", "UN"], callingCodes: ["49"] }, geometry: { type: "MultiPolygon", coordinates: [[[[8.70847, 47.68904], [8.71773, 47.69088], [8.70237, 47.71453], [8.68571, 47.70954], [8.66416, 47.71367], [8.67508, 47.6979], [8.65769, 47.68928], [8.66837, 47.68437], [8.67538, 47.68629], [8.68985, 47.69552], [8.70847, 47.68904]]], [[[8.72617, 47.69651], [8.72809, 47.69282], [8.75856, 47.68969], [8.79511, 47.67462], [8.79966, 47.70222], [8.76965, 47.7075], [8.77309, 47.72059], [8.80663, 47.73821], [8.82002, 47.71458], [8.86881, 47.70524], [8.87474, 47.69425], [8.85148, 47.69769], [8.87383, 47.67045], [8.87625, 47.65441], [8.89946, 47.64769], [8.94093, 47.65596], [9.02093, 47.6868], [9.09891, 47.67801], [9.13845, 47.66389], [9.15181, 47.66904], [9.1705, 47.65513], [9.1755, 47.65584], [9.17593, 47.65399], [9.18203, 47.65598], [9.25619, 47.65939], [9.55125, 47.53629], [9.72564, 47.53282], [9.73683, 47.53564], [9.73528, 47.54527], [9.75798, 47.57982], [9.77612, 47.59359], [9.80254, 47.59419], [9.82591, 47.58158], [9.8189, 47.54688], [9.87499, 47.52953], [9.87733, 47.54688], [9.92407, 47.53111], [9.96229, 47.53612], [9.97173, 47.51551], [9.97837, 47.51314], [10.00003, 47.48216], [10.03859, 47.48927], [10.07131, 47.45531], [10.09001, 47.46005], [10.1052, 47.4316], [10.06897, 47.40709], [10.09819, 47.35724], [10.11805, 47.37228], [10.16362, 47.36674], [10.17648, 47.38889], [10.2127, 47.38019], [10.22774, 47.38904], [10.23757, 47.37609], [10.19998, 47.32832], [10.2147, 47.31014], [10.17648, 47.29149], [10.17531, 47.27167], [10.23257, 47.27088], [10.33424, 47.30813], [10.39851, 47.37623], [10.4324, 47.38494], [10.4359, 47.41183], [10.47446, 47.43318], [10.46278, 47.47901], [10.44291, 47.48453], [10.4324, 47.50111], [10.45145, 47.55472], [10.42973, 47.57752], [10.43892, 47.58408], [10.48202, 47.58434], [10.45444, 47.5558], [10.48849, 47.54057], [10.56912, 47.53584], [10.60337, 47.56755], [10.63456, 47.5591], [10.68832, 47.55752], [10.6965, 47.54253], [10.7596, 47.53228], [10.77596, 47.51729], [10.88814, 47.53701], [10.91268, 47.51334], [10.86945, 47.5015], [10.87061, 47.4786], [10.90918, 47.48571], [10.93839, 47.48018], [10.92437, 47.46991], [10.98513, 47.42882], [10.97111, 47.41617], [10.97111, 47.39561], [11.11835, 47.39719], [11.12536, 47.41222], [11.20482, 47.43198], [11.25157, 47.43277], [11.22002, 47.3964], [11.27844, 47.39956], [11.29597, 47.42566], [11.33804, 47.44937], [11.4175, 47.44621], [11.38128, 47.47465], [11.4362, 47.51413], [11.52618, 47.50939], [11.58578, 47.52281], [11.58811, 47.55515], [11.60681, 47.57881], [11.63934, 47.59202], [11.84052, 47.58354], [11.85572, 47.60166], [12.0088, 47.62451], [12.02282, 47.61033], [12.05788, 47.61742], [12.13734, 47.60639], [12.17824, 47.61506], [12.18145, 47.61019], [12.17737, 47.60121], [12.18568, 47.6049], [12.20398, 47.60667], [12.20801, 47.61082], [12.19895, 47.64085], [12.18507, 47.65984], [12.18347, 47.66663], [12.16769, 47.68167], [12.16217, 47.70105], [12.18303, 47.70065], [12.22571, 47.71776], [12.2542, 47.7433], [12.26238, 47.73544], [12.24017, 47.69534], [12.26004, 47.67725], [12.27991, 47.68827], [12.336, 47.69534], [12.37222, 47.68433], [12.40137, 47.69215], [12.44018, 47.6952], [12.44117, 47.6741], [12.50076, 47.62293], [12.53816, 47.63553], [12.57438, 47.63238], [12.6071, 47.6741], [12.7357, 47.6787], [12.77435, 47.66102], [12.76492, 47.64485], [12.82101, 47.61493], [12.77427, 47.58025], [12.80699, 47.54477], [12.84672, 47.54556], [12.85256, 47.52741], [12.9624, 47.47452], [12.98344, 47.48716], [12.9998, 47.46267], [13.04537, 47.49426], [13.03252, 47.53373], [13.05355, 47.56291], [13.04537, 47.58183], [13.06641, 47.58577], [13.06407, 47.60075], [13.09562, 47.63304], [13.07692, 47.68814], [13.01382, 47.72116], [12.98578, 47.7078], [12.92969, 47.71094], [12.91333, 47.7178], [12.90274, 47.72513], [12.91711, 47.74026], [12.9353, 47.74788], [12.94371, 47.76281], [12.93202, 47.77302], [12.96311, 47.79957], [12.98543, 47.82896], [13.00588, 47.84374], [12.94163, 47.92927], [12.93886, 47.94046], [12.93642, 47.94436], [12.93419, 47.94063], [12.92668, 47.93879], [12.91985, 47.94069], [12.9211, 47.95135], [12.91683, 47.95647], [12.87476, 47.96195], [12.8549, 48.01122], [12.76141, 48.07373], [12.74973, 48.10885], [12.7617, 48.12796], [12.78595, 48.12445], [12.80676, 48.14979], [12.82673, 48.15245], [12.8362, 48.15876], [12.836, 48.1647], [12.84475, 48.16556], [12.87126, 48.20318], [12.95306, 48.20629], [13.02083, 48.25689], [13.0851, 48.27711], [13.126, 48.27867], [13.18093, 48.29577], [13.26039, 48.29422], [13.31419, 48.31643], [13.40656, 48.3719], [13.43929, 48.43386], [13.42527, 48.45711], [13.45727, 48.51092], [13.43695, 48.55776], [13.45214, 48.56472], [13.46967, 48.55157], [13.50663, 48.57506], [13.50131, 48.58091], [13.51291, 48.59023], [13.57535, 48.55912], [13.59705, 48.57013], [13.62508, 48.55501], [13.65186, 48.55092], [13.66113, 48.53558], [13.72802, 48.51208], [13.74816, 48.53058], [13.7513, 48.5624], [13.76921, 48.55324], [13.80519, 48.58026], [13.80038, 48.59487], [13.82208, 48.6151], [13.82609, 48.62345], [13.81901, 48.6761], [13.81283, 48.68426], [13.81791, 48.69832], [13.79337, 48.71375], [13.81863, 48.73257], [13.82266, 48.75544], [13.84023, 48.76988], [13.8096, 48.77877], [13.78977, 48.83319], [13.76994, 48.83537], [13.73854, 48.88538], [13.67739, 48.87886], [13.61624, 48.9462], [13.58319, 48.96899], [13.50552, 48.97441], [13.50221, 48.93752], [13.40802, 48.98851], [13.39479, 49.04812], [13.28242, 49.1228], [13.23689, 49.11412], [13.20405, 49.12303], [13.17019, 49.14339], [13.17665, 49.16713], [13.05883, 49.26259], [13.02957, 49.27399], [13.03618, 49.30417], [12.94859, 49.34079], [12.88249, 49.35479], [12.88414, 49.33541], [12.78168, 49.34618], [12.75854, 49.3989], [12.71227, 49.42363], [12.669, 49.42935], [12.64121, 49.47628], [12.64782, 49.52565], [12.60155, 49.52887], [12.56188, 49.6146], [12.53544, 49.61888], [12.52553, 49.68415], [12.4462, 49.70233], [12.40489, 49.76321], [12.46603, 49.78882], [12.48256, 49.83575], [12.55197, 49.92094], [12.47264, 49.94222], [12.49908, 49.97305], [12.30798, 50.05719], [12.26111, 50.06331], [12.27433, 50.0771], [12.23709, 50.10213], [12.2073, 50.10315], [12.1917, 50.13434], [12.21484, 50.16399], [12.19335, 50.19997], [12.09287, 50.25032], [12.13716, 50.27396], [12.10907, 50.32041], [12.18013, 50.32146], [12.20823, 50.2729], [12.25119, 50.27079], [12.26953, 50.25189], [12.24791, 50.25525], [12.23943, 50.24594], [12.28755, 50.22429], [12.28063, 50.19544], [12.29232, 50.17524], [12.32596, 50.17146], [12.33847, 50.19432], [12.32445, 50.20442], [12.33263, 50.24367], [12.35425, 50.23993], [12.36594, 50.28289], [12.40158, 50.29521], [12.39924, 50.32302], [12.43371, 50.32506], [12.43722, 50.33774], [12.46643, 50.35527], [12.48256, 50.34784], [12.49214, 50.35228], [12.48747, 50.37278], [12.51356, 50.39694], [12.67261, 50.41949], [12.70731, 50.39948], [12.73044, 50.42268], [12.73476, 50.43237], [12.82465, 50.45738], [12.94058, 50.40944], [12.98433, 50.42016], [13.02147, 50.44763], [13.02038, 50.4734], [13.0312, 50.50944], [13.08301, 50.50132], [13.13424, 50.51709], [13.19043, 50.50237], [13.25158, 50.59268], [13.29454, 50.57904], [13.32594, 50.58009], [13.32264, 50.60317], [13.37805, 50.627], [13.37485, 50.64931], [13.42189, 50.61243], [13.46413, 50.60102], [13.49742, 50.63133], [13.5226, 50.64721], [13.53748, 50.67654], [13.52474, 50.70394], [13.65977, 50.73096], [13.70204, 50.71771], [13.76316, 50.73487], [13.82942, 50.7251], [13.89444, 50.74142], [13.89113, 50.78533], [13.98864, 50.8177], [14.02982, 50.80662], [14.22331, 50.86049], [14.24314, 50.88761], [14.27123, 50.89386], [14.30098, 50.88448], [14.38691, 50.89907], [14.39848, 50.93866], [14.31422, 50.95243], [14.30251, 50.96606], [14.32793, 50.97379], [14.32353, 50.98556], [14.28776, 50.97718], [14.25665, 50.98935], [14.30098, 51.05515], [14.41335, 51.02086], [14.45827, 51.03712], [14.49202, 51.02286], [14.49154, 51.04382], [14.49991, 51.04692], [14.50809, 51.0427], [14.49873, 51.02242], [14.53321, 51.01679], [14.53438, 51.00374], [14.56432, 51.01008], [14.58215, 50.99306], [14.59908, 50.98685], [14.59702, 50.96148], [14.56374, 50.922], [14.58024, 50.91443], [14.64802, 50.93241], [14.65259, 50.90513], [14.63434, 50.8883], [14.61993, 50.86049], [14.70661, 50.84096], [14.79139, 50.81438], [14.82803, 50.86966], [14.81664, 50.88148], [14.89681, 50.9422], [14.89252, 50.94999], [14.92942, 50.99744], [14.95529, 51.04552], [14.97938, 51.07742], [14.98229, 51.11354], [14.99689, 51.12205], [14.99079, 51.14284], [14.99646, 51.14365], [15.00083, 51.14974], [14.99414, 51.15813], [14.99311, 51.16249], [15.0047, 51.16874], [15.01242, 51.21285], [15.04288, 51.28387], [14.98008, 51.33449], [14.96899, 51.38367], [14.9652, 51.44793], [14.94749, 51.47155], [14.73219, 51.52922], [14.72652, 51.53902], [14.73047, 51.54606], [14.71125, 51.56209], [14.7727, 51.61263], [14.75759, 51.62318], [14.75392, 51.67445], [14.69065, 51.70842], [14.66386, 51.73282], [14.64625, 51.79472], [14.60493, 51.80473], [14.59089, 51.83302], [14.6588, 51.88359], [14.6933, 51.9044], [14.70601, 51.92944], [14.7177, 51.94048], [14.72163, 51.95188], [14.71836, 51.95606], [14.7139, 51.95643], [14.70488, 51.97679], [14.71339, 52.00337], [14.76026, 52.06624], [14.72971, 52.09167], [14.6917, 52.10283], [14.67683, 52.13936], [14.70616, 52.16927], [14.68344, 52.19612], [14.71319, 52.22144], [14.70139, 52.25038], [14.58149, 52.28007], [14.56378, 52.33838], [14.55228, 52.35264], [14.54423, 52.42568], [14.63056, 52.48993], [14.60081, 52.53116], [14.6289, 52.57136], [14.61073, 52.59847], [14.22071, 52.81175], [14.13806, 52.82392], [14.12256, 52.84311], [14.15873, 52.87715], [14.14056, 52.95786], [14.25954, 53.00264], [14.35044, 53.05829], [14.38679, 53.13669], [14.36696, 53.16444], [14.37853, 53.20405], [14.40662, 53.21098], [14.45125, 53.26241], [14.44133, 53.27427], [14.4215, 53.27724], [14.35209, 53.49506], [14.3273, 53.50587], [14.30416, 53.55499], [14.31904, 53.61581], [14.2853, 53.63392], [14.28477, 53.65955], [14.27133, 53.66613], [14.2836, 53.67721], [14.26782, 53.69866], [14.27249, 53.74464], [14.21323, 53.8664], [14.20823, 53.90776], [14.18544, 53.91258], [14.20647, 53.91671], [14.22634, 53.9291], [14.20811, 54.12784], [13.93395, 54.84044], [12.85844, 54.82438], [11.90309, 54.38543], [11.00303, 54.63689], [10.31111, 54.65968], [10.16755, 54.73883], [9.89314, 54.84171], [9.73563, 54.8247], [9.61187, 54.85548], [9.62734, 54.88057], [9.58937, 54.88785], [9.4659, 54.83131], [9.43155, 54.82586], [9.41213, 54.84254], [9.38532, 54.83968], [9.36496, 54.81749], [9.33849, 54.80233], [9.32771, 54.80602], [9.2474, 54.8112], [9.23445, 54.83432], [9.24631, 54.84726], [9.20571, 54.85841], [9.14275, 54.87421], [9.04629, 54.87249], [8.92795, 54.90452], [8.81178, 54.90518], [8.76387, 54.8948], [8.63979, 54.91069], [8.55769, 54.91837], [8.45719, 55.06747], [8.02459, 55.09613], [5.45168, 54.20039], [6.91025, 53.44221], [7.00198, 53.32672], [7.19052, 53.31866], [7.21679, 53.20058], [7.22681, 53.18165], [7.17898, 53.13817], [7.21694, 53.00742], [7.07253, 52.81083], [7.04557, 52.63318], [6.77307, 52.65375], [6.71641, 52.62905], [6.69507, 52.488], [6.94293, 52.43597], [6.99041, 52.47235], [7.03417, 52.40237], [7.07044, 52.37805], [7.02703, 52.27941], [7.06365, 52.23789], [7.03729, 52.22695], [6.9897, 52.2271], [6.97189, 52.20329], [6.83984, 52.11728], [6.76117, 52.11895], [6.68128, 52.05052], [6.83035, 51.9905], [6.82357, 51.96711], [6.72319, 51.89518], [6.68386, 51.91861], [6.58556, 51.89386], [6.50231, 51.86313], [6.47179, 51.85395], [6.38815, 51.87257], [6.40704, 51.82771], [6.30593, 51.84998], [6.29872, 51.86801], [6.21443, 51.86801], [6.15349, 51.90439], [6.11551, 51.89769], [6.16902, 51.84094], [6.10337, 51.84829], [6.06705, 51.86136], [5.99848, 51.83195], [5.94568, 51.82786], [5.98665, 51.76944], [5.95003, 51.7493], [6.04091, 51.71821], [6.02767, 51.6742], [6.11759, 51.65609], [6.09055, 51.60564], [6.18017, 51.54096], [6.21724, 51.48568], [6.20654, 51.40049], [6.22641, 51.39948], [6.22674, 51.36135], [6.16977, 51.33169], [6.07889, 51.24432], [6.07889, 51.17038], [6.17384, 51.19589], [6.16706, 51.15677], [5.98292, 51.07469], [5.9541, 51.03496], [5.9134, 51.06736], [5.86735, 51.05182], [5.87849, 51.01969], [5.90493, 51.00198], [5.90296, 50.97356], [5.95282, 50.98728], [6.02697, 50.98303], [6.01615, 50.93367], [6.09297, 50.92066], [6.07486, 50.89307], [6.08805, 50.87223], [6.07693, 50.86025], [6.07431, 50.84674], [6.05702, 50.85179], [6.05623, 50.8572], [6.01921, 50.84435], [6.02328, 50.81694], [6.00462, 50.80065], [5.98404, 50.80988], [5.97497, 50.79992], [6.02624, 50.77453], [6.01976, 50.75398], [6.03889, 50.74618], [6.0326, 50.72647], [6.0406, 50.71848], [6.04428, 50.72861], [6.11707, 50.72231], [6.17852, 50.6245], [6.26957, 50.62444], [6.2476, 50.60392], [6.24888, 50.59869], [6.24005, 50.58732], [6.22581, 50.5907], [6.20281, 50.56952], [6.17739, 50.55875], [6.17802, 50.54179], [6.19735, 50.53576], [6.19579, 50.5313], [6.18716, 50.52653], [6.19193, 50.5212], [6.20599, 50.52089], [6.22335, 50.49578], [6.26637, 50.50272], [6.30809, 50.50058], [6.3465, 50.48833], [6.34005, 50.46083], [6.37219, 50.45397], [6.36852, 50.40776], [6.34406, 50.37994], [6.3688, 50.35898], [6.40785, 50.33557], [6.40641, 50.32425], [6.35701, 50.31139], [6.32488, 50.32333], [6.29949, 50.30887], [6.28797, 50.27458], [6.208, 50.25179], [6.16853, 50.2234], [6.18364, 50.20815], [6.18739, 50.1822], [6.14588, 50.17106], [6.14132, 50.14971], [6.15298, 50.14126], [6.1379, 50.12964], [6.12055, 50.09171], [6.11274, 50.05916], [6.13458, 50.04141], [6.13044, 50.02929], [6.14666, 50.02207], [6.13794, 50.01466], [6.13273, 50.02019], [6.1295, 50.01849], [6.13806, 50.01056], [6.14948, 50.00908], [6.14147, 49.99563], [6.1701, 49.98518], [6.16466, 49.97086], [6.17872, 49.9537], [6.18554, 49.95622], [6.18045, 49.96611], [6.19089, 49.96991], [6.19856, 49.95053], [6.22094, 49.94955], [6.22608, 49.929], [6.21882, 49.92403], [6.22926, 49.92096], [6.23496, 49.89972], [6.26146, 49.88203], [6.28874, 49.87592], [6.29692, 49.86685], [6.30963, 49.87021], [6.32303, 49.85133], [6.32098, 49.83728], [6.33585, 49.83785], [6.34267, 49.84974], [6.36576, 49.85032], [6.40022, 49.82029], [6.42521, 49.81591], [6.42905, 49.81091], [6.44131, 49.81443], [6.45425, 49.81164], [6.47111, 49.82263], [6.48718, 49.81267], [6.50647, 49.80916], [6.51215, 49.80124], [6.52121, 49.81338], [6.53122, 49.80666], [6.52169, 49.79787], [6.50534, 49.78952], [6.51669, 49.78336], [6.51056, 49.77515], [6.51828, 49.76855], [6.51646, 49.75961], [6.50174, 49.75292], [6.50193, 49.73291], [6.51805, 49.72425], [6.51397, 49.72058], [6.50261, 49.72718], [6.49535, 49.72645], [6.49694, 49.72205], [6.5042, 49.71808], [6.50647, 49.71353], [6.49785, 49.71118], [6.48014, 49.69767], [6.46048, 49.69092], [6.44654, 49.67799], [6.42937, 49.66857], [6.42726, 49.66078], [6.43768, 49.66021], [6.4413, 49.65722], [6.41861, 49.61723], [6.39822, 49.60081], [6.385, 49.59946], [6.37464, 49.58886], [6.38342, 49.5799], [6.38024, 49.57593], [6.36676, 49.57813], [6.35825, 49.57053], [6.38228, 49.55855], [6.38072, 49.55171], [6.35666, 49.52931], [6.36788, 49.50377], [6.36907, 49.48931], [6.36778, 49.46937], [6.38352, 49.46463], [6.39168, 49.4667], [6.40274, 49.46546], [6.42432, 49.47683], [6.55404, 49.42464], [6.533, 49.40748], [6.60091, 49.36864], [6.58807, 49.35358], [6.572, 49.35027], [6.60186, 49.31055], [6.66583, 49.28065], [6.69274, 49.21661], [6.71843, 49.2208], [6.73256, 49.20486], [6.71137, 49.18808], [6.73765, 49.16375], [6.78265, 49.16793], [6.83385, 49.15162], [6.84703, 49.15734], [6.86225, 49.18185], [6.85016, 49.19354], [6.85119, 49.20038], [6.83555, 49.21249], [6.85939, 49.22376], [6.89298, 49.20863], [6.91875, 49.22261], [6.93831, 49.2223], [6.94028, 49.21641], [6.95963, 49.203], [6.97273, 49.2099], [7.01318, 49.19018], [7.03459, 49.19096], [7.0274, 49.17042], [7.03178, 49.15734], [7.04662, 49.13724], [7.04409, 49.12123], [7.04843, 49.11422], [7.05548, 49.11185], [7.06642, 49.11415], [7.07162, 49.1255], [7.09007, 49.13094], [7.07859, 49.15031], [7.10715, 49.15631], [7.10384, 49.13787], [7.12504, 49.14253], [7.1358, 49.1282], [7.1593, 49.1204], [7.23473, 49.12971], [7.29514, 49.11426], [7.3195, 49.14231], [7.35995, 49.14399], [7.3662, 49.17308], [7.44052, 49.18354], [7.44455, 49.16765], [7.49473, 49.17], [7.49172, 49.13915], [7.53012, 49.09818], [7.56416, 49.08136], [7.62575, 49.07654], [7.63618, 49.05428], [7.75948, 49.04562], [7.79557, 49.06583], [7.86386, 49.03499], [7.93641, 49.05544], [7.97783, 49.03161], [8.14189, 48.97833], [8.22604, 48.97352], [8.19989, 48.95825], [8.12813, 48.87985], [8.10253, 48.81829], [8.06802, 48.78957], [8.0326, 48.79017], [8.01534, 48.76085], [7.96994, 48.75606], [7.96812, 48.72491], [7.89002, 48.66317], [7.84098, 48.64217], [7.80057, 48.5857], [7.80167, 48.54758], [7.80647, 48.51239], [7.76833, 48.48945], [7.73109, 48.39192], [7.74562, 48.32736], [7.69022, 48.30018], [7.6648, 48.22219], [7.57137, 48.12292], [7.56966, 48.03265], [7.62302, 47.97898], [7.55673, 47.87371], [7.55975, 47.83953], [7.52764, 47.78161], [7.54761, 47.72912], [7.53722, 47.71635], [7.51266, 47.70197], [7.51915, 47.68335], [7.52067, 47.66437], [7.53384, 47.65115], [7.5591, 47.63849], [7.57423, 47.61628], [7.58851, 47.60794], [7.59301, 47.60058], [7.58945, 47.59017], [7.60523, 47.58519], [7.60459, 47.57869], [7.61929, 47.57683], [7.64309, 47.59151], [7.64213, 47.5944], [7.64599, 47.59695], [7.67395, 47.59212], [7.68229, 47.59905], [7.69385, 47.60099], [7.68486, 47.59601], [7.67115, 47.5871], [7.672, 47.58527], [7.68904, 47.57133], [7.68229, 47.56754], [7.64859, 47.55996], [7.63604, 47.56387], [7.63432, 47.56171], [7.65083, 47.54662], [7.66174, 47.54554], [7.6656, 47.53752], [7.68101, 47.53232], [7.69642, 47.53297], [7.71961, 47.54219], [7.75261, 47.54599], [7.79716, 47.5575], [7.82174, 47.58757], [7.84412, 47.5841], [7.88664, 47.58854], [7.91159, 47.57185], [7.90773, 47.55738], [7.91554, 47.54765], [7.94828, 47.54408], [7.95494, 47.55764], [7.97581, 47.55493], [8.00113, 47.55616], [8.02136, 47.55096], [8.04692, 47.55561], [8.06017, 47.56351], [8.06689, 47.56398], [8.08557, 47.55768], [8.10002, 47.56504], [8.10395, 47.57918], [8.11543, 47.5841], [8.13662, 47.58432], [8.13823, 47.59147], [8.14947, 47.59558], [8.1652, 47.5945], [8.19378, 47.61636], [8.20617, 47.62141], [8.22011, 47.6181], [8.22577, 47.60385], [8.23809, 47.61204], [8.25863, 47.61571], [8.26313, 47.6103], [8.2824, 47.61225], [8.2973, 47.60647], [8.29524, 47.5919], [8.30277, 47.58607], [8.32735, 47.57133], [8.35512, 47.57014], [8.38273, 47.56608], [8.39477, 47.57826], [8.43235, 47.56617], [8.49431, 47.58107], [8.48949, 47.588], [8.46637, 47.58389], [8.45578, 47.60121], [8.50747, 47.61897], [8.51686, 47.63476], [8.55756, 47.62394], [8.57449, 47.61148], [8.57586, 47.59537], [8.60348, 47.61204], [8.59545, 47.64298], [8.60701, 47.65271], [8.61471, 47.64514], [8.60412, 47.63735], [8.62049, 47.63757], [8.62884, 47.65098], [8.60695, 47.66622], [8.60469, 47.67239], [8.57683, 47.66158], [8.56141, 47.67088], [8.52801, 47.66059], [8.5322, 47.64687], [8.49656, 47.64709], [8.46605, 47.64103], [8.4667, 47.65747], [8.44711, 47.65379], [8.42264, 47.66667], [8.41346, 47.66676], [8.40473, 47.67499], [8.4211, 47.68407], [8.40569, 47.69855], [8.44807, 47.72426], [8.45771, 47.7493], [8.48868, 47.77215], [8.56814, 47.78001], [8.56415, 47.80633], [8.61657, 47.79998], [8.62408, 47.7626], [8.64425, 47.76398], [8.65292, 47.80066], [8.68022, 47.78599], [8.68985, 47.75686], [8.71778, 47.76571], [8.74251, 47.75168], [8.70543, 47.73121], [8.73671, 47.7169], [8.72617, 47.69651]]]] } },
34140 { type: "Feature", properties: { iso1A2: "DG", iso1A3: "DGA", wikidata: "Q184851", nameEn: "Diego Garcia", country: "GB", groups: ["IO", "BOTS", "014", "202", "002", "UN"], isoStatus: "excRes", callingCodes: ["246"] }, geometry: { type: "MultiPolygon", coordinates: [[[[73.14823, -7.76302], [73.09982, -6.07324], [71.43792, -7.73904], [73.14823, -7.76302]]]] } },
34141 { type: "Feature", properties: { iso1A2: "DJ", iso1A3: "DJI", iso1N3: "262", wikidata: "Q977", nameEn: "Djibouti", groups: ["014", "202", "002", "UN"], callingCodes: ["253"] }, geometry: { type: "MultiPolygon", coordinates: [[[[43.90659, 12.3823], [43.90659, 12.3823], [43.32909, 12.59711], [43.29075, 12.79154], [42.86195, 12.58747], [42.7996, 12.42629], [42.6957, 12.36201], [42.46941, 12.52661], [42.4037, 12.46478], [41.95461, 11.81157], [41.82878, 11.72361], [41.77727, 11.49902], [41.8096, 11.33606], [41.80056, 10.97127], [42.06302, 10.92599], [42.13691, 10.97586], [42.42669, 10.98493], [42.62989, 11.09711], [42.75111, 11.06992], [42.79037, 10.98493], [42.95776, 10.98533], [43.90659, 12.3823]]]] } },
34142 { type: "Feature", properties: { iso1A2: "DK", iso1A3: "DNK", iso1N3: "208", wikidata: "Q756617", nameEn: "Kingdom of Denmark" }, geometry: null },
34143 { type: "Feature", properties: { iso1A2: "DM", iso1A3: "DMA", iso1N3: "212", wikidata: "Q784", nameEn: "Dominica", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 767"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-61.32485, 14.91445], [-60.86656, 15.82603], [-61.95646, 15.5094], [-61.32485, 14.91445]]]] } },
34144 { type: "Feature", properties: { iso1A2: "DO", iso1A3: "DOM", iso1N3: "214", wikidata: "Q786", nameEn: "Dominican Republic", groups: ["029", "003", "419", "019", "UN"], callingCodes: ["1 809", "1 829", "1 849"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-67.87844, 21.7938], [-72.38946, 20.27111], [-71.77419, 19.73128], [-71.75865, 19.70231], [-71.7429, 19.58445], [-71.71449, 19.55364], [-71.71268, 19.53374], [-71.6802, 19.45008], [-71.69448, 19.37866], [-71.77766, 19.33823], [-71.73229, 19.26686], [-71.62642, 19.21212], [-71.65337, 19.11759], [-71.69938, 19.10916], [-71.71088, 19.08353], [-71.74088, 19.0437], [-71.88102, 18.95007], [-71.77766, 18.95007], [-71.72624, 18.87802], [-71.71885, 18.78423], [-71.82556, 18.62551], [-71.95412, 18.64939], [-72.00201, 18.62312], [-71.88102, 18.50125], [-71.90875, 18.45821], [-71.69952, 18.34101], [-71.78271, 18.18302], [-71.75465, 18.14405], [-71.74994, 18.11115], [-71.73783, 18.07177], [-71.75671, 18.03456], [-72.29523, 17.48026], [-68.39466, 16.14167], [-67.87844, 21.7938]]]] } },
34145 { type: "Feature", properties: { iso1A2: "DZ", iso1A3: "DZA", iso1N3: "012", wikidata: "Q262", nameEn: "Algeria", groups: ["015", "002", "UN"], callingCodes: ["213"] }, geometry: { type: "MultiPolygon", coordinates: [[[[8.59123, 37.14286], [5.10072, 39.89531], [-2.27707, 35.35051], [-2.21248, 35.08532], [-2.21445, 35.04378], [-2.04734, 34.93218], [-1.97833, 34.93218], [-1.97469, 34.886], [-1.73707, 34.74226], [-1.84569, 34.61907], [-1.69788, 34.48056], [-1.78042, 34.39018], [-1.64666, 34.10405], [-1.73494, 33.71721], [-1.59508, 33.59929], [-1.67067, 33.27084], [-1.46249, 33.0499], [-1.54244, 32.95499], [-1.37794, 32.73628], [-0.9912, 32.52467], [-1.24998, 32.32993], [-1.24453, 32.1917], [-1.15735, 32.12096], [-1.22829, 32.07832], [-2.46166, 32.16603], [-2.93873, 32.06557], [-2.82784, 31.79459], [-3.66314, 31.6339], [-3.66386, 31.39202], [-3.77647, 31.31912], [-3.77103, 31.14984], [-3.54944, 31.0503], [-3.65418, 30.85566], [-3.64735, 30.67539], [-4.31774, 30.53229], [-4.6058, 30.28343], [-5.21671, 29.95253], [-5.58831, 29.48103], [-5.72121, 29.52322], [-5.75616, 29.61407], [-6.69965, 29.51623], [-6.78351, 29.44634], [-6.95824, 29.50924], [-7.61585, 29.36252], [-8.6715, 28.71194], [-8.66879, 27.6666], [-8.66674, 27.31569], [-4.83423, 24.99935], [1.15698, 21.12843], [1.20992, 20.73533], [3.24648, 19.81703], [3.12501, 19.1366], [3.36082, 18.9745], [4.26651, 19.14224], [5.8153, 19.45101], [7.38361, 20.79165], [7.48273, 20.87258], [11.96886, 23.51735], [11.62498, 24.26669], [11.41061, 24.21456], [10.85323, 24.5595], [10.33159, 24.5465], [10.02432, 24.98124], [10.03146, 25.35635], [9.38834, 26.19288], [9.51696, 26.39148], [9.89569, 26.57696], [9.78136, 29.40961], [9.3876, 30.16738], [9.55544, 30.23971], [9.07483, 32.07865], [8.35999, 32.50101], [8.31895, 32.83483], [8.1179, 33.05086], [8.11433, 33.10175], [7.83028, 33.18851], [7.73687, 33.42114], [7.54088, 33.7726], [7.52851, 34.06493], [7.66174, 34.20167], [7.74207, 34.16492], [7.81242, 34.21841], [7.86264, 34.3987], [8.20482, 34.57575], [8.29655, 34.72798], [8.25189, 34.92009], [8.30727, 34.95378], [8.3555, 35.10007], [8.47318, 35.23376], [8.30329, 35.29884], [8.36086, 35.47774], [8.35371, 35.66373], [8.26472, 35.73669], [8.2626, 35.91733], [8.40731, 36.42208], [8.18936, 36.44939], [8.16167, 36.48817], [8.47609, 36.66607], [8.46537, 36.7706], [8.57613, 36.78062], [8.67706, 36.8364], [8.62972, 36.86499], [8.64044, 36.9401], [8.59123, 37.14286]]]] } },
34146 { type: "Feature", properties: { iso1A2: "EA", wikidata: "Q28868874", nameEn: "Ceuta, Melilla", country: "ES", level: "territory", isoStatus: "excRes" }, geometry: null },
34147 { type: "Feature", properties: { iso1A2: "EC", iso1A3: "ECU", iso1N3: "218", wikidata: "Q736", nameEn: "Ecuador" }, geometry: null },
34148 { type: "Feature", properties: { iso1A2: "EE", iso1A3: "EST", iso1N3: "233", wikidata: "Q191", nameEn: "Estonia", aliases: ["EW"], groups: ["EU", "154", "150", "UN"], callingCodes: ["372"] }, geometry: { type: "MultiPolygon", coordinates: [[[[26.32936, 60.00121], [20.5104, 59.15546], [19.84909, 57.57876], [22.80496, 57.87798], [23.20055, 57.56697], [24.26221, 57.91787], [24.3579, 57.87471], [25.19484, 58.0831], [25.28237, 57.98539], [25.29581, 58.08288], [25.73499, 57.90193], [26.05949, 57.84744], [26.0324, 57.79037], [26.02456, 57.78342], [26.027, 57.78158], [26.0266, 57.77441], [26.02069, 57.77169], [26.02415, 57.76865], [26.03332, 57.7718], [26.0543, 57.76105], [26.08098, 57.76619], [26.2029, 57.7206], [26.1866, 57.6849], [26.29253, 57.59244], [26.46527, 57.56885], [26.54675, 57.51813], [26.90364, 57.62823], [27.34698, 57.52242], [27.31919, 57.57672], [27.40393, 57.62125], [27.3746, 57.66834], [27.52615, 57.72843], [27.50171, 57.78842], [27.56689, 57.83356], [27.78526, 57.83963], [27.81841, 57.89244], [27.67282, 57.92627], [27.62393, 58.09462], [27.48541, 58.22615], [27.55489, 58.39525], [27.36366, 58.78381], [27.74429, 58.98351], [27.80482, 59.1116], [27.87978, 59.18097], [27.90911, 59.24353], [28.00689, 59.28351], [28.14215, 59.28934], [28.19284, 59.35791], [28.20537, 59.36491], [28.21137, 59.38058], [28.19061, 59.39962], [28.04187, 59.47017], [27.85643, 59.58538], [26.90044, 59.63819], [26.32936, 60.00121]]]] } },
34149 { type: "Feature", properties: { iso1A2: "EG", iso1A3: "EGY", iso1N3: "818", wikidata: "Q79", nameEn: "Egypt", groups: ["015", "002", "UN"], callingCodes: ["20"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.62659, 31.82938], [26.92891, 33.39516], [24.8458, 31.39877], [25.01077, 30.73861], [24.71117, 30.17441], [24.99968, 29.24574], [24.99885, 21.99535], [33.17563, 22.00405], [34.0765, 22.00501], [37.8565, 22.00903], [34.4454, 27.91479], [34.8812, 29.36878], [34.92298, 29.45305], [34.26742, 31.21998], [34.24012, 31.29591], [34.23572, 31.2966], [34.21853, 31.32363], [34.052, 31.46619], [33.62659, 31.82938]]]] } },
34150 { type: "Feature", properties: { iso1A2: "EH", iso1A3: "ESH", iso1N3: "732", wikidata: "Q6250", nameEn: "Western Sahara", groups: ["015", "002"], callingCodes: ["212"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-8.66879, 27.6666], [-8.77527, 27.66663], [-8.71787, 26.9898], [-9.08698, 26.98639], [-9.56957, 26.90042], [-9.81998, 26.71379], [-10.68417, 26.90984], [-11.35695, 26.8505], [-11.23622, 26.72023], [-11.38635, 26.611], [-11.62052, 26.05229], [-12.06001, 26.04442], [-12.12281, 25.13682], [-12.92147, 24.39502], [-13.00628, 24.01923], [-13.75627, 23.77231], [-14.10361, 22.75501], [-14.1291, 22.41636], [-14.48112, 22.00886], [-14.47329, 21.63839], [-14.78487, 21.36587], [-16.44269, 21.39745], [-16.9978, 21.36239], [-17.02707, 21.34022], [-17.21511, 21.34226], [-17.35589, 20.80492], [-17.0471, 20.76408], [-17.0695, 20.85742], [-17.06781, 20.92697], [-17.0396, 20.9961], [-17.0357, 21.05368], [-16.99806, 21.12142], [-16.95474, 21.33997], [-13.01525, 21.33343], [-13.08438, 22.53866], [-13.15313, 22.75649], [-13.10753, 22.89493], [-13.00412, 23.02297], [-12.5741, 23.28975], [-12.36213, 23.3187], [-12.14969, 23.41935], [-12.00251, 23.4538], [-12.0002, 25.9986], [-8.66721, 25.99918], [-8.66674, 27.31569], [-8.66879, 27.6666]]]] } },
34151 { type: "Feature", properties: { iso1A2: "ER", iso1A3: "ERI", iso1N3: "232", wikidata: "Q986", nameEn: "Eritrea", groups: ["014", "202", "002", "UN"], callingCodes: ["291"] }, geometry: { type: "MultiPolygon", coordinates: [[[[40.99158, 15.81743], [39.63762, 18.37348], [38.57727, 17.98125], [38.45916, 17.87167], [38.37133, 17.66269], [38.13362, 17.53906], [37.50967, 17.32199], [37.42694, 17.04041], [36.99777, 17.07172], [36.92193, 16.23451], [36.76371, 15.80831], [36.69761, 15.75323], [36.54276, 15.23478], [36.44337, 15.14963], [36.54376, 14.25597], [36.56536, 14.26177], [36.55659, 14.28237], [36.63364, 14.31172], [36.85787, 14.32201], [37.01622, 14.2561], [37.09486, 14.27155], [37.13206, 14.40746], [37.3106, 14.44657], [37.47319, 14.2149], [37.528, 14.18413], [37.91287, 14.89447], [38.0364, 14.72745], [38.25562, 14.67287], [38.3533, 14.51323], [38.45748, 14.41445], [38.78306, 14.4754], [38.98058, 14.54895], [39.02834, 14.63717], [39.16074, 14.65187], [39.14772, 14.61827], [39.19547, 14.56996], [39.23888, 14.56365], [39.26927, 14.48801], [39.2302, 14.44598], [39.2519, 14.40393], [39.37685, 14.54402], [39.52756, 14.49011], [39.50585, 14.55735], [39.58182, 14.60987], [39.76632, 14.54264], [39.9443, 14.41024], [40.07236, 14.54264], [40.14649, 14.53969], [40.21128, 14.39342], [40.25686, 14.41445], [40.9167, 14.11152], [41.25097, 13.60787], [41.62864, 13.38626], [42.05841, 12.80912], [42.21469, 12.75832], [42.2798, 12.6355], [42.4037, 12.46478], [42.46941, 12.52661], [42.6957, 12.36201], [42.7996, 12.42629], [42.86195, 12.58747], [43.29075, 12.79154], [40.99158, 15.81743]]]] } },
34152 { type: "Feature", properties: { iso1A2: "ES", iso1A3: "ESP", iso1N3: "724", wikidata: "Q29", nameEn: "Spain" }, geometry: null },
34153 { type: "Feature", properties: { iso1A2: "ET", iso1A3: "ETH", iso1N3: "231", wikidata: "Q115", nameEn: "Ethiopia", groups: ["014", "202", "002", "UN"], callingCodes: ["251"] }, geometry: { type: "MultiPolygon", coordinates: [[[[42.4037, 12.46478], [42.2798, 12.6355], [42.21469, 12.75832], [42.05841, 12.80912], [41.62864, 13.38626], [41.25097, 13.60787], [40.9167, 14.11152], [40.25686, 14.41445], [40.21128, 14.39342], [40.14649, 14.53969], [40.07236, 14.54264], [39.9443, 14.41024], [39.76632, 14.54264], [39.58182, 14.60987], [39.50585, 14.55735], [39.52756, 14.49011], [39.37685, 14.54402], [39.2519, 14.40393], [39.2302, 14.44598], [39.26927, 14.48801], [39.23888, 14.56365], [39.19547, 14.56996], [39.14772, 14.61827], [39.16074, 14.65187], [39.02834, 14.63717], [38.98058, 14.54895], [38.78306, 14.4754], [38.45748, 14.41445], [38.3533, 14.51323], [38.25562, 14.67287], [38.0364, 14.72745], [37.91287, 14.89447], [37.528, 14.18413], [37.47319, 14.2149], [37.3106, 14.44657], [37.13206, 14.40746], [37.09486, 14.27155], [37.01622, 14.2561], [36.85787, 14.32201], [36.63364, 14.31172], [36.55659, 14.28237], [36.56536, 14.26177], [36.54376, 14.25597], [36.44653, 13.95666], [36.48824, 13.83954], [36.38993, 13.56459], [36.24545, 13.36759], [36.13374, 12.92665], [36.16651, 12.88019], [36.14268, 12.70879], [36.01458, 12.72478], [35.70476, 12.67101], [35.24302, 11.91132], [35.11492, 11.85156], [35.05832, 11.71158], [35.09556, 11.56278], [34.95704, 11.24448], [35.01215, 11.19626], [34.93172, 10.95946], [34.97789, 10.91559], [34.97491, 10.86147], [34.86916, 10.78832], [34.86618, 10.74588], [34.77532, 10.69027], [34.77383, 10.74588], [34.59062, 10.89072], [34.4372, 10.781], [34.2823, 10.53508], [34.34783, 10.23914], [34.32102, 10.11599], [34.22718, 10.02506], [34.20484, 9.9033], [34.13186, 9.7492], [34.08717, 9.55243], [34.10229, 9.50238], [34.14304, 9.04654], [34.14453, 8.60204], [34.01346, 8.50041], [33.89579, 8.4842], [33.87195, 8.41938], [33.71407, 8.3678], [33.66938, 8.44442], [33.54575, 8.47094], [33.3119, 8.45474], [33.19721, 8.40317], [33.1853, 8.29264], [33.18083, 8.13047], [33.08401, 8.05822], [33.0006, 7.90333], [33.04944, 7.78989], [33.24637, 7.77939], [33.32531, 7.71297], [33.44745, 7.7543], [33.71407, 7.65983], [33.87642, 7.5491], [34.02984, 7.36449], [34.03878, 7.27437], [34.01495, 7.25664], [34.19369, 7.12807], [34.19369, 7.04382], [34.35753, 6.91963], [34.47669, 6.91076], [34.53925, 6.82794], [34.53776, 6.74808], [34.65096, 6.72589], [34.77459, 6.5957], [34.87736, 6.60161], [35.01738, 6.46991], [34.96227, 6.26415], [35.00546, 5.89387], [35.12611, 5.68937], [35.13058, 5.62118], [35.31188, 5.50106], [35.29938, 5.34042], [35.50792, 5.42431], [35.8576, 5.33413], [35.81968, 5.10757], [35.82118, 4.77382], [35.9419, 4.61933], [35.95449, 4.53244], [36.03924, 4.44406], [36.84474, 4.44518], [37.07724, 4.33503], [38.14168, 3.62487], [38.45812, 3.60445], [38.52336, 3.62551], [38.91938, 3.51198], [39.07736, 3.5267], [39.19954, 3.47834], [39.49444, 3.45521], [39.51551, 3.40895], [39.55132, 3.39634], [39.58339, 3.47434], [39.76808, 3.67058], [39.86043, 3.86974], [40.77498, 4.27683], [41.1754, 3.94079], [41.89488, 3.97375], [42.07619, 4.17667], [42.55853, 4.20518], [42.84526, 4.28357], [42.97746, 4.44032], [43.04177, 4.57923], [43.40263, 4.79289], [44.02436, 4.9451], [44.98104, 4.91821], [47.97917, 8.00124], [47.92477, 8.00111], [46.99339, 7.9989], [44.19222, 8.93028], [43.32613, 9.59205], [43.23518, 9.84605], [43.0937, 9.90579], [42.87643, 10.18441], [42.69452, 10.62672], [42.95776, 10.98533], [42.79037, 10.98493], [42.75111, 11.06992], [42.62989, 11.09711], [42.42669, 10.98493], [42.13691, 10.97586], [42.06302, 10.92599], [41.80056, 10.97127], [41.8096, 11.33606], [41.77727, 11.49902], [41.82878, 11.72361], [41.95461, 11.81157], [42.4037, 12.46478]]]] } },
34154 { type: "Feature", properties: { iso1A2: "EU", iso1A3: "EUE", wikidata: "Q458", nameEn: "European Union", level: "union", isoStatus: "excRes" }, geometry: null },
34155 { type: "Feature", properties: { iso1A2: "FI", iso1A3: "FIN", iso1N3: "246", wikidata: "Q33", nameEn: "Finland", aliases: ["SF"] }, geometry: null },
34156 { type: "Feature", properties: { iso1A2: "FJ", iso1A3: "FJI", iso1N3: "242", wikidata: "Q712", nameEn: "Fiji", groups: ["054", "009", "UN"], driveSide: "left", callingCodes: ["679"] }, geometry: { type: "MultiPolygon", coordinates: [[[[174.245, -23.1974], [179.99999, -22.5], [179.99999, -11.5], [174, -11.5], [174.245, -23.1974]]], [[[-176.76826, -14.95183], [-180, -14.96041], [-180, -22.90585], [-176.74538, -22.89767], [-176.76826, -14.95183]]]] } },
34157 { type: "Feature", properties: { iso1A2: "FK", iso1A3: "FLK", iso1N3: "238", wikidata: "Q9648", nameEn: "Falkland Islands", country: "GB", groups: ["BOTS", "005", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["500"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.67376, -55.11859], [-54.56126, -51.26248], [-61.26735, -50.63919], [-63.67376, -55.11859]]]] } },
34158 { type: "Feature", properties: { iso1A2: "FM", iso1A3: "FSM", iso1N3: "583", wikidata: "Q702", nameEn: "Federated States of Micronesia", groups: ["057", "009", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["691"] }, geometry: { type: "MultiPolygon", coordinates: [[[[138.20583, 13.3783], [136.27107, 6.73747], [156.88247, -1.39237], [165.19726, 6.22546], [138.20583, 13.3783]]]] } },
34159 { type: "Feature", properties: { iso1A2: "FO", iso1A3: "FRO", iso1N3: "234", wikidata: "Q4628", nameEn: "Faroe Islands", country: "DK", groups: ["154", "150", "UN"], callingCodes: ["298"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-8.51774, 62.35338], [-6.51083, 60.95272], [-5.70102, 62.77194], [-8.51774, 62.35338]]]] } },
34160 { type: "Feature", properties: { iso1A2: "FR", iso1A3: "FRA", iso1N3: "250", wikidata: "Q142", nameEn: "France" }, geometry: null },
34161 { type: "Feature", properties: { iso1A2: "FX", iso1A3: "FXX", iso1N3: "249", wikidata: "Q212429", nameEn: "Metropolitan France", country: "FR", groups: ["EU", "155", "150", "UN"], isoStatus: "excRes", callingCodes: ["33"] }, geometry: { type: "MultiPolygon", coordinates: [[[[2.55904, 51.07014], [2.18458, 51.52087], [1.17405, 50.74239], [-2.02963, 49.91866], [-2.09454, 49.46288], [-1.83944, 49.23037], [-2.00491, 48.86706], [-2.65349, 49.15373], [-6.28985, 48.93406], [-1.81005, 43.59738], [-1.77289, 43.38957], [-1.79319, 43.37497], [-1.78184, 43.36235], [-1.78829, 43.35192], [-1.77307, 43.342], [-1.75913, 43.34422], [-1.75334, 43.34107], [-1.75079, 43.3317], [-1.7397, 43.32979], [-1.73074, 43.29481], [-1.69407, 43.31378], [-1.62481, 43.30726], [-1.63052, 43.28591], [-1.61341, 43.25269], [-1.57674, 43.25269], [-1.55963, 43.28828], [-1.50992, 43.29481], [-1.45289, 43.27049], [-1.40942, 43.27272], [-1.3758, 43.24511], [-1.41562, 43.12815], [-1.47555, 43.08372], [-1.44067, 43.047], [-1.35272, 43.02658], [-1.34419, 43.09665], [-1.32209, 43.1127], [-1.28008, 43.11842], [-1.26996, 43.11832], [-1.27038, 43.11712], [-1.2879, 43.10494], [-1.29765, 43.09427], [-1.30823, 43.07102], [-1.25244, 43.04164], [-1.22881, 43.05534], [-1.10333, 43.0059], [-1.00963, 42.99279], [-0.97133, 42.96239], [-0.81652, 42.95166], [-0.75478, 42.96916], [-0.72037, 42.92541], [-0.73422, 42.91228], [-0.72608, 42.89318], [-0.69837, 42.87945], [-0.67637, 42.88303], [-0.55497, 42.77846], [-0.50863, 42.82713], [-0.44334, 42.79939], [-0.41319, 42.80776], [-0.38833, 42.80132], [-0.3122, 42.84788], [-0.17939, 42.78974], [-0.16141, 42.79535], [-0.10519, 42.72761], [-0.02468, 42.68513], [0.17569, 42.73424], [0.25336, 42.7174], [0.29407, 42.67431], [0.36251, 42.72282], [0.40214, 42.69779], [0.67873, 42.69458], [0.65421, 42.75872], [0.66121, 42.84021], [0.711, 42.86372], [0.93089, 42.79154], [0.96166, 42.80629], [0.98292, 42.78754], [1.0804, 42.78569], [1.15928, 42.71407], [1.35562, 42.71944], [1.44197, 42.60217], [1.47986, 42.61346], [1.46718, 42.63296], [1.48043, 42.65203], [1.50867, 42.64483], [1.55418, 42.65669], [1.60085, 42.62703], [1.63485, 42.62957], [1.6625, 42.61982], [1.68267, 42.62533], [1.73452, 42.61515], [1.72588, 42.59098], [1.7858, 42.57698], [1.73683, 42.55492], [1.72515, 42.50338], [1.76335, 42.48863], [1.83037, 42.48395], [1.88853, 42.4501], [1.93663, 42.45439], [1.94292, 42.44316], [1.94061, 42.43333], [1.94084, 42.43039], [1.9574, 42.42401], [1.96482, 42.37787], [2.00488, 42.35399], [2.06241, 42.35906], [2.11621, 42.38393], [2.12789, 42.41291], [2.16599, 42.42314], [2.20578, 42.41633], [2.25551, 42.43757], [2.38504, 42.39977], [2.43299, 42.39423], [2.43508, 42.37568], [2.48457, 42.33933], [2.54382, 42.33406], [2.55516, 42.35351], [2.57934, 42.35808], [2.6747, 42.33974], [2.65311, 42.38771], [2.72056, 42.42298], [2.75497, 42.42578], [2.77464, 42.41046], [2.84335, 42.45724], [2.85675, 42.45444], [2.86983, 42.46843], [2.88413, 42.45938], [2.92107, 42.4573], [2.94283, 42.48174], [2.96518, 42.46692], [3.03734, 42.47363], [3.08167, 42.42748], [3.10027, 42.42621], [3.11379, 42.43646], [3.17156, 42.43545], [3.75438, 42.33445], [7.60802, 41.05927], [10.09675, 41.44089], [9.56115, 43.20816], [7.50102, 43.51859], [7.42422, 43.72209], [7.40903, 43.7296], [7.41113, 43.73156], [7.41291, 43.73168], [7.41298, 43.73311], [7.41233, 43.73439], [7.42062, 43.73977], [7.42299, 43.74176], [7.42443, 43.74087], [7.42809, 43.74396], [7.43013, 43.74895], [7.43624, 43.75014], [7.43708, 43.75197], [7.4389, 43.75151], [7.4379, 43.74963], [7.47823, 43.73341], [7.53006, 43.78405], [7.50423, 43.84345], [7.49355, 43.86551], [7.51162, 43.88301], [7.56075, 43.89932], [7.56858, 43.94506], [7.60771, 43.95772], [7.65266, 43.9763], [7.66848, 43.99943], [7.6597, 44.03009], [7.72508, 44.07578], [7.66878, 44.12795], [7.68694, 44.17487], [7.63245, 44.17877], [7.62155, 44.14881], [7.36364, 44.11882], [7.34547, 44.14359], [7.27827, 44.1462], [7.16929, 44.20352], [7.00764, 44.23736], [6.98221, 44.28289], [6.89171, 44.36637], [6.88784, 44.42043], [6.94504, 44.43112], [6.86233, 44.49834], [6.85507, 44.53072], [6.96042, 44.62129], [6.95133, 44.66264], [7.00582, 44.69364], [7.07484, 44.68073], [7.00401, 44.78782], [7.02217, 44.82519], [6.93499, 44.8664], [6.90774, 44.84322], [6.75518, 44.89915], [6.74519, 44.93661], [6.74791, 45.01939], [6.66981, 45.02324], [6.62803, 45.11175], [6.7697, 45.16044], [6.85144, 45.13226], [6.96706, 45.20841], [7.07074, 45.21228], [7.13115, 45.25386], [7.10572, 45.32924], [7.18019, 45.40071], [7.00037, 45.509], [6.98948, 45.63869], [6.80785, 45.71864], [6.80785, 45.83265], [6.95315, 45.85163], [7.04151, 45.92435], [7.00946, 45.9944], [6.93862, 46.06502], [6.87868, 46.03855], [6.89321, 46.12548], [6.78968, 46.14058], [6.86052, 46.28512], [6.77152, 46.34784], [6.8024, 46.39171], [6.82312, 46.42661], [6.53358, 46.45431], [6.25432, 46.3632], [6.21981, 46.31304], [6.24826, 46.30175], [6.25137, 46.29014], [6.23775, 46.27822], [6.24952, 46.26255], [6.26749, 46.24745], [6.29474, 46.26221], [6.31041, 46.24417], [6.29663, 46.22688], [6.27694, 46.21566], [6.26007, 46.21165], [6.24821, 46.20531], [6.23913, 46.20511], [6.23544, 46.20714], [6.22175, 46.20045], [6.22222, 46.19888], [6.21844, 46.19837], [6.21603, 46.19507], [6.21273, 46.19409], [6.21114, 46.1927], [6.20539, 46.19163], [6.19807, 46.18369], [6.19552, 46.18401], [6.18707, 46.17999], [6.18871, 46.16644], [6.18116, 46.16187], [6.15305, 46.15194], [6.13397, 46.1406], [6.09926, 46.14373], [6.09199, 46.15191], [6.07491, 46.14879], [6.05203, 46.15191], [6.04564, 46.14031], [6.03614, 46.13712], [6.01791, 46.14228], [5.9871, 46.14499], [5.97893, 46.13303], [5.95781, 46.12925], [5.9641, 46.14412], [5.97508, 46.15863], [5.98188, 46.17392], [5.98846, 46.17046], [5.99573, 46.18587], [5.96515, 46.19638], [5.97542, 46.21525], [6.02461, 46.23313], [6.03342, 46.2383], [6.04602, 46.23127], [6.05029, 46.23518], [6.0633, 46.24583], [6.07072, 46.24085], [6.08563, 46.24651], [6.10071, 46.23772], [6.12446, 46.25059], [6.11926, 46.2634], [6.1013, 46.28512], [6.11697, 46.29547], [6.1198, 46.31157], [6.13876, 46.33844], [6.15738, 46.3491], [6.16987, 46.36759], [6.15985, 46.37721], [6.15016, 46.3778], [6.09926, 46.40768], [6.06407, 46.41676], [6.08427, 46.44305], [6.07269, 46.46244], [6.1567, 46.54402], [6.11084, 46.57649], [6.27135, 46.68251], [6.38351, 46.73171], [6.45209, 46.77502], [6.43216, 46.80336], [6.46456, 46.88865], [6.43341, 46.92703], [6.50315, 46.96736], [6.61239, 46.99083], [6.64008, 47.00251], [6.65915, 47.02734], [6.68456, 47.03714], [6.69579, 47.0371], [6.71531, 47.0494], [6.68823, 47.06616], [6.76788, 47.1208], [6.85069, 47.15744], [6.86359, 47.18015], [6.95087, 47.24121], [6.95108, 47.26428], [6.94316, 47.28747], [7.00827, 47.3014], [7.01, 47.32451], [7.05302, 47.33131], [7.05198, 47.35634], [7.03125, 47.36996], [6.87959, 47.35335], [6.88542, 47.37262], [6.93744, 47.40714], [6.93953, 47.43388], [7.0024, 47.45264], [6.98425, 47.49432], [7.0231, 47.50522], [7.07425, 47.48863], [7.12781, 47.50371], [7.16249, 47.49025], [7.19583, 47.49455], [7.17026, 47.44312], [7.24669, 47.4205], [7.33818, 47.44256], [7.34123, 47.43873], [7.3527, 47.43426], [7.37349, 47.43399], [7.38122, 47.43208], [7.38216, 47.433], [7.40308, 47.43638], [7.41906, 47.44626], [7.43088, 47.45846], [7.4462, 47.46264], [7.4583, 47.47216], [7.42923, 47.48628], [7.43356, 47.49712], [7.47534, 47.47932], [7.49025, 47.48355], [7.50898, 47.49819], [7.50813, 47.51601], [7.5229, 47.51644], [7.53199, 47.5284], [7.51904, 47.53515], [7.50588, 47.52856], [7.49691, 47.53821], [7.50873, 47.54546], [7.51723, 47.54578], [7.52831, 47.55347], [7.53634, 47.55553], [7.55652, 47.56779], [7.55689, 47.57232], [7.56548, 47.57617], [7.56684, 47.57785], [7.58386, 47.57536], [7.58945, 47.59017], [7.59301, 47.60058], [7.58851, 47.60794], [7.57423, 47.61628], [7.5591, 47.63849], [7.53384, 47.65115], [7.52067, 47.66437], [7.51915, 47.68335], [7.51266, 47.70197], [7.53722, 47.71635], [7.54761, 47.72912], [7.52764, 47.78161], [7.55975, 47.83953], [7.55673, 47.87371], [7.62302, 47.97898], [7.56966, 48.03265], [7.57137, 48.12292], [7.6648, 48.22219], [7.69022, 48.30018], [7.74562, 48.32736], [7.73109, 48.39192], [7.76833, 48.48945], [7.80647, 48.51239], [7.80167, 48.54758], [7.80057, 48.5857], [7.84098, 48.64217], [7.89002, 48.66317], [7.96812, 48.72491], [7.96994, 48.75606], [8.01534, 48.76085], [8.0326, 48.79017], [8.06802, 48.78957], [8.10253, 48.81829], [8.12813, 48.87985], [8.19989, 48.95825], [8.22604, 48.97352], [8.14189, 48.97833], [7.97783, 49.03161], [7.93641, 49.05544], [7.86386, 49.03499], [7.79557, 49.06583], [7.75948, 49.04562], [7.63618, 49.05428], [7.62575, 49.07654], [7.56416, 49.08136], [7.53012, 49.09818], [7.49172, 49.13915], [7.49473, 49.17], [7.44455, 49.16765], [7.44052, 49.18354], [7.3662, 49.17308], [7.35995, 49.14399], [7.3195, 49.14231], [7.29514, 49.11426], [7.23473, 49.12971], [7.1593, 49.1204], [7.1358, 49.1282], [7.12504, 49.14253], [7.10384, 49.13787], [7.10715, 49.15631], [7.07859, 49.15031], [7.09007, 49.13094], [7.07162, 49.1255], [7.06642, 49.11415], [7.05548, 49.11185], [7.04843, 49.11422], [7.04409, 49.12123], [7.04662, 49.13724], [7.03178, 49.15734], [7.0274, 49.17042], [7.03459, 49.19096], [7.01318, 49.19018], [6.97273, 49.2099], [6.95963, 49.203], [6.94028, 49.21641], [6.93831, 49.2223], [6.91875, 49.22261], [6.89298, 49.20863], [6.85939, 49.22376], [6.83555, 49.21249], [6.85119, 49.20038], [6.85016, 49.19354], [6.86225, 49.18185], [6.84703, 49.15734], [6.83385, 49.15162], [6.78265, 49.16793], [6.73765, 49.16375], [6.71137, 49.18808], [6.73256, 49.20486], [6.71843, 49.2208], [6.69274, 49.21661], [6.66583, 49.28065], [6.60186, 49.31055], [6.572, 49.35027], [6.58807, 49.35358], [6.60091, 49.36864], [6.533, 49.40748], [6.55404, 49.42464], [6.42432, 49.47683], [6.40274, 49.46546], [6.39168, 49.4667], [6.38352, 49.46463], [6.36778, 49.46937], [6.3687, 49.4593], [6.28818, 49.48465], [6.27875, 49.503], [6.25029, 49.50609], [6.2409, 49.51408], [6.19543, 49.50536], [6.17386, 49.50934], [6.15366, 49.50226], [6.16115, 49.49297], [6.14321, 49.48796], [6.12814, 49.49365], [6.12346, 49.4735], [6.10325, 49.4707], [6.09845, 49.46351], [6.10072, 49.45268], [6.08373, 49.45594], [6.07887, 49.46399], [6.05553, 49.46663], [6.04176, 49.44801], [6.02743, 49.44845], [6.02648, 49.45451], [5.97693, 49.45513], [5.96876, 49.49053], [5.94224, 49.49608], [5.94128, 49.50034], [5.86571, 49.50015], [5.83389, 49.52152], [5.83467, 49.52717], [5.84466, 49.53027], [5.83648, 49.5425], [5.81664, 49.53775], [5.80871, 49.5425], [5.81838, 49.54777], [5.79195, 49.55228], [5.77435, 49.56298], [5.7577, 49.55915], [5.75649, 49.54321], [5.64505, 49.55146], [5.60909, 49.51228], [5.55001, 49.52729], [5.46541, 49.49825], [5.46734, 49.52648], [5.43713, 49.5707], [5.3974, 49.61596], [5.34837, 49.62889], [5.33851, 49.61599], [5.3137, 49.61225], [5.30214, 49.63055], [5.33039, 49.6555], [5.31465, 49.66846], [5.26232, 49.69456], [5.14545, 49.70287], [5.09249, 49.76193], [4.96714, 49.79872], [4.85464, 49.78995], [4.86965, 49.82271], [4.85134, 49.86457], [4.88529, 49.9236], [4.78827, 49.95609], [4.8382, 50.06738], [4.88602, 50.15182], [4.83279, 50.15331], [4.82438, 50.16878], [4.75237, 50.11314], [4.70064, 50.09384], [4.68695, 49.99685], [4.5414, 49.96911], [4.51098, 49.94659], [4.43488, 49.94122], [4.35051, 49.95315], [4.31963, 49.97043], [4.20532, 49.95803], [4.14239, 49.98034], [4.13508, 50.01976], [4.16294, 50.04719], [4.23101, 50.06945], [4.20147, 50.13535], [4.13561, 50.13078], [4.16014, 50.19239], [4.15524, 50.21103], [4.21945, 50.25539], [4.20651, 50.27333], [4.17861, 50.27443], [4.17347, 50.28838], [4.15524, 50.2833], [4.16808, 50.25786], [4.13665, 50.25609], [4.11954, 50.30425], [4.10957, 50.30234], [4.10237, 50.31247], [4.0689, 50.3254], [4.0268, 50.35793], [3.96771, 50.34989], [3.90781, 50.32814], [3.84314, 50.35219], [3.73911, 50.34809], [3.70987, 50.3191], [3.71009, 50.30305], [3.66976, 50.34563], [3.65709, 50.36873], [3.67262, 50.38663], [3.67494, 50.40239], [3.66153, 50.45165], [3.64426, 50.46275], [3.61014, 50.49568], [3.58361, 50.49049], [3.5683, 50.50192], [3.49509, 50.48885], [3.51564, 50.5256], [3.47385, 50.53397], [3.44629, 50.51009], [3.37693, 50.49538], [3.28575, 50.52724], [3.2729, 50.60718], [3.23951, 50.6585], [3.264, 50.67668], [3.2536, 50.68977], [3.26141, 50.69151], [3.26063, 50.70086], [3.24593, 50.71389], [3.22042, 50.71019], [3.20845, 50.71662], [3.19017, 50.72569], [3.20064, 50.73547], [3.18811, 50.74025], [3.18339, 50.74981], [3.16476, 50.76843], [3.15017, 50.79031], [3.1257, 50.78603], [3.11987, 50.79188], [3.11206, 50.79416], [3.10614, 50.78303], [3.09163, 50.77717], [3.04314, 50.77674], [3.00537, 50.76588], [2.96778, 50.75242], [2.95019, 50.75138], [2.90873, 50.702], [2.91036, 50.6939], [2.90069, 50.69263], [2.88504, 50.70656], [2.87937, 50.70298], [2.86985, 50.7033], [2.8483, 50.72276], [2.81056, 50.71773], [2.71165, 50.81295], [2.63331, 50.81457], [2.59093, 50.91751], [2.63074, 50.94746], [2.57551, 51.00326], [2.55904, 51.07014]], [[1.99838, 42.44682], [1.98378, 42.44697], [1.96125, 42.45364], [1.95606, 42.45785], [1.96215, 42.47854], [1.97003, 42.48081], [1.97227, 42.48487], [1.97697, 42.48568], [1.98022, 42.49569], [1.98916, 42.49351], [1.99766, 42.4858], [1.98579, 42.47486], [1.99216, 42.46208], [2.01564, 42.45171], [1.99838, 42.44682]]]] } },
34162 { type: "Feature", properties: { iso1A2: "GA", iso1A3: "GAB", iso1N3: "266", wikidata: "Q1000", nameEn: "Gabon", groups: ["017", "202", "002", "UN"], callingCodes: ["241"] }, geometry: { type: "MultiPolygon", coordinates: [[[[13.29457, 2.16106], [13.28534, 2.25716], [11.37116, 2.29975], [11.3561, 2.17217], [11.35307, 1.00251], [9.79648, 1.0019], [9.75065, 1.06753], [9.66433, 1.06723], [7.24416, -0.64092], [10.75913, -4.39519], [11.12647, -3.94169], [11.22301, -3.69888], [11.48764, -3.51089], [11.57949, -3.52798], [11.68608, -3.68942], [11.87083, -3.71571], [11.92719, -3.62768], [11.8318, -3.5812], [11.96554, -3.30267], [11.70227, -3.17465], [11.70558, -3.0773], [11.80365, -3.00424], [11.64798, -2.81146], [11.5359, -2.85654], [11.64487, -2.61865], [11.57637, -2.33379], [11.74605, -2.39936], [11.96866, -2.33559], [12.04895, -2.41704], [12.47925, -2.32626], [12.44656, -1.92025], [12.61312, -1.8129], [12.82172, -1.91091], [13.02759, -2.33098], [13.47977, -2.43224], [13.75884, -2.09293], [13.92073, -2.35581], [13.85846, -2.46935], [14.10442, -2.49268], [14.23829, -2.33715], [14.16202, -2.23916], [14.23518, -2.15671], [14.25932, -1.97624], [14.41838, -1.89412], [14.52569, -0.57818], [14.41887, -0.44799], [14.2165, -0.38261], [14.06862, -0.20826], [13.90632, -0.2287], [13.88648, 0.26652], [14.10909, 0.58563], [14.26066, 0.57255], [14.48179, 0.9152], [14.25186, 1.39842], [13.89582, 1.4261], [13.15519, 1.23368], [13.25447, 1.32339], [13.13461, 1.57238], [13.29457, 2.16106]]]] } },
34163 { type: "Feature", properties: { iso1A2: "GB", iso1A3: "GBR", iso1N3: "826", wikidata: "Q145", ccTLD: ".uk", nameEn: "United Kingdom", aliases: ["UK"] }, geometry: null },
34164 { type: "Feature", properties: { iso1A2: "GD", iso1A3: "GRD", iso1N3: "308", wikidata: "Q769", nameEn: "Grenada", aliases: ["WG"], groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 473"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-62.64026, 12.69984], [-61.77886, 11.36496], [-59.94058, 12.34011], [-62.64026, 12.69984]]]] } },
34165 { type: "Feature", properties: { iso1A2: "GE", iso1A3: "GEO", iso1N3: "268", wikidata: "Q230", nameEn: "Georgia", groups: ["145", "142", "UN"], callingCodes: ["995"] }, geometry: { type: "MultiPolygon", coordinates: [[[[46.42738, 41.91323], [45.61676, 42.20768], [45.78692, 42.48358], [45.36501, 42.55268], [45.15318, 42.70598], [44.88754, 42.74934], [44.80941, 42.61277], [44.70002, 42.74679], [44.54202, 42.75699], [43.95517, 42.55396], [43.73119, 42.62043], [43.81453, 42.74297], [43.0419, 43.02413], [43.03322, 43.08883], [42.75889, 43.19651], [42.66667, 43.13917], [42.40563, 43.23226], [41.64935, 43.22331], [40.65957, 43.56212], [40.10657, 43.57344], [40.04445, 43.47776], [40.03312, 43.44262], [40.01007, 43.42411], [40.01552, 43.42025], [40.00853, 43.40578], [40.0078, 43.38551], [39.81147, 43.06294], [40.89217, 41.72528], [41.54366, 41.52185], [41.7148, 41.4932], [41.7124, 41.47417], [41.81939, 41.43621], [41.95134, 41.52466], [42.26387, 41.49346], [42.51772, 41.43606], [42.59202, 41.58183], [42.72794, 41.59714], [42.84471, 41.58912], [42.78995, 41.50126], [42.84899, 41.47265], [42.8785, 41.50516], [43.02956, 41.37891], [43.21707, 41.30331], [43.13373, 41.25503], [43.1945, 41.25242], [43.23096, 41.17536], [43.36118, 41.2028], [43.44973, 41.17666], [43.4717, 41.12611], [43.67712, 41.13398], [43.74717, 41.1117], [43.84835, 41.16329], [44.16591, 41.19141], [44.18148, 41.24644], [44.32139, 41.2079], [44.34337, 41.20312], [44.34417, 41.2382], [44.46791, 41.18204], [44.59322, 41.1933], [44.61462, 41.24018], [44.72814, 41.20338], [44.82084, 41.21513], [44.87887, 41.20195], [44.89911, 41.21366], [44.84358, 41.23088], [44.81749, 41.23488], [44.80053, 41.25949], [44.81437, 41.30371], [44.93493, 41.25685], [45.0133, 41.29747], [45.09867, 41.34065], [45.1797, 41.42231], [45.26285, 41.46433], [45.31352, 41.47168], [45.4006, 41.42402], [45.45973, 41.45898], [45.68389, 41.3539], [45.71035, 41.36208], [45.75705, 41.35157], [45.69946, 41.29545], [45.80842, 41.2229], [45.95786, 41.17956], [46.13221, 41.19479], [46.27698, 41.19011], [46.37661, 41.10805], [46.456, 41.09984], [46.48558, 41.0576], [46.55096, 41.1104], [46.63969, 41.09515], [46.66148, 41.20533], [46.72375, 41.28609], [46.63658, 41.37727], [46.4669, 41.43331], [46.40307, 41.48464], [46.33925, 41.4963], [46.29794, 41.5724], [46.34126, 41.57454], [46.34039, 41.5947], [46.3253, 41.60912], [46.28182, 41.60089], [46.26531, 41.63339], [46.24429, 41.59883], [46.19759, 41.62327], [46.17891, 41.72094], [46.20538, 41.77205], [46.23962, 41.75811], [46.30863, 41.79133], [46.3984, 41.84399], [46.42738, 41.91323]]]] } },
34166 { type: "Feature", properties: { iso1A2: "GF", iso1A3: "GUF", iso1N3: "254", wikidata: "Q3769", nameEn: "French Guiana", country: "FR", groups: ["Q3320166", "EU", "005", "419", "019", "UN"], callingCodes: ["594"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-51.35485, 4.8383], [-53.7094, 6.2264], [-54.01074, 5.68785], [-54.01877, 5.52789], [-54.26916, 5.26909], [-54.4717, 4.91964], [-54.38444, 4.13222], [-54.19367, 3.84387], [-54.05128, 3.63557], [-53.98914, 3.627], [-53.9849, 3.58697], [-54.28534, 2.67798], [-54.42864, 2.42442], [-54.6084, 2.32856], [-54.16286, 2.10779], [-53.78743, 2.34412], [-52.96539, 2.1881], [-52.6906, 2.37298], [-52.31787, 3.17896], [-51.85573, 3.83427], [-51.82312, 3.85825], [-51.79599, 3.89336], [-51.61983, 4.14596], [-51.63798, 4.51394], [-51.35485, 4.8383]]]] } },
34167 { type: "Feature", properties: { iso1A2: "GG", iso1A3: "GGY", iso1N3: "831", wikidata: "Q25230", nameEn: "Bailiwick of Guernsey", country: "GB" }, geometry: null },
34168 { type: "Feature", properties: { iso1A2: "GH", iso1A3: "GHA", iso1N3: "288", wikidata: "Q117", nameEn: "Ghana", groups: ["011", "202", "002", "UN"], callingCodes: ["233"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-0.13493, 11.14075], [-0.27374, 11.17157], [-0.28566, 11.12713], [-0.35955, 11.07801], [-0.38219, 11.12596], [-0.42391, 11.11661], [-0.44298, 11.04292], [-0.61937, 10.91305], [-0.67143, 10.99811], [-2.83373, 11.0067], [-2.94232, 10.64281], [-2.83108, 10.40252], [-2.74174, 9.83172], [-2.76534, 9.56589], [-2.68802, 9.49343], [-2.69814, 9.22717], [-2.77799, 9.04949], [-2.66357, 9.01771], [-2.58243, 8.7789], [-2.49037, 8.20872], [-2.62901, 8.11495], [-2.61232, 8.02645], [-2.67787, 8.02055], [-2.74819, 7.92613], [-2.78395, 7.94974], [-2.79467, 7.86002], [-2.92339, 7.60847], [-2.97822, 7.27165], [-2.95438, 7.23737], [-3.23327, 6.81744], [-3.21954, 6.74407], [-3.25999, 6.62521], [-3.01896, 5.71697], [-2.95323, 5.71865], [-2.96671, 5.6415], [-2.93132, 5.62137], [-2.85378, 5.65156], [-2.76614, 5.60963], [-2.72737, 5.34789], [-2.77625, 5.34621], [-2.73074, 5.1364], [-2.75502, 5.10657], [-2.95261, 5.12477], [-2.96554, 5.10397], [-3.063, 5.13665], [-3.11073, 5.12675], [-3.10675, 5.08515], [-3.34019, 4.17519], [1.07031, 5.15655], [1.27574, 5.93551], [1.19771, 6.11522], [1.19966, 6.17069], [1.09187, 6.17074], [1.05969, 6.22998], [1.03108, 6.24064], [0.99652, 6.33779], [0.89283, 6.33779], [0.71048, 6.53083], [0.74862, 6.56517], [0.63659, 6.63857], [0.6497, 6.73682], [0.58176, 6.76049], [0.57406, 6.80348], [0.52853, 6.82921], [0.56508, 6.92971], [0.52098, 6.94391], [0.52217, 6.9723], [0.59606, 7.01252], [0.65327, 7.31643], [0.62943, 7.41099], [0.57223, 7.39326], [0.52455, 7.45354], [0.51979, 7.58706], [0.58295, 7.62368], [0.62943, 7.85751], [0.58891, 8.12779], [0.6056, 8.13959], [0.61156, 8.18324], [0.5913, 8.19622], [0.63897, 8.25873], [0.73432, 8.29529], [0.64731, 8.48866], [0.47211, 8.59945], [0.37319, 8.75262], [0.52455, 8.87746], [0.45424, 9.04581], [0.56388, 9.40697], [0.49118, 9.48339], [0.36485, 9.49749], [0.33148, 9.44812], [0.25758, 9.42696], [0.2254, 9.47869], [0.31241, 9.50337], [0.30406, 9.521], [0.2409, 9.52335], [0.23851, 9.57389], [0.38153, 9.58682], [0.36008, 9.6256], [0.29334, 9.59387], [0.26712, 9.66437], [0.28261, 9.69022], [0.32313, 9.6491], [0.34816, 9.66907], [0.34816, 9.71607], [0.32075, 9.72781], [0.36366, 10.03309], [0.41252, 10.02018], [0.41371, 10.06361], [0.35293, 10.09412], [0.39584, 10.31112], [0.33028, 10.30408], [0.29453, 10.41546], [0.18846, 10.4096], [0.12886, 10.53149], [-0.05945, 10.63458], [-0.09141, 10.7147], [-0.07327, 10.71845], [-0.07183, 10.76794], [-0.0228, 10.81916], [-0.02685, 10.8783], [-908e-5, 10.91644], [-63e-4, 10.96417], [0.03355, 10.9807], [0.02395, 11.06229], [342e-5, 11.08317], [-514e-5, 11.10763], [-0.0275, 11.11202], [-0.05733, 11.08628], [-0.14462, 11.10811], [-0.13493, 11.14075]]]] } },
34169 { type: "Feature", properties: { iso1A2: "GI", iso1A3: "GIB", iso1N3: "292", wikidata: "Q1410", nameEn: "Gibraltar", country: "GB", groups: ["Q12837", "BOTS", "039", "150", "UN"], callingCodes: ["350"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-5.34064, 36.03744], [-5.27801, 36.14942], [-5.33822, 36.15272], [-5.34536, 36.15501], [-5.40526, 36.15488], [-5.34064, 36.03744]]]] } },
34170 { type: "Feature", properties: { iso1A2: "GL", iso1A3: "GRL", iso1N3: "304", wikidata: "Q223", nameEn: "Greenland", country: "DK", groups: ["Q1451600", "021", "003", "019", "UN"], callingCodes: ["299"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-49.33696, 84.57952], [-68.21821, 80.48551], [-77.52957, 77.23408], [-46.37635, 57.3249], [-9.68082, 72.73731], [-5.7106, 84.28058], [-49.33696, 84.57952]]]] } },
34171 { type: "Feature", properties: { iso1A2: "GM", iso1A3: "GMB", iso1N3: "270", wikidata: "Q1005", nameEn: "The Gambia", groups: ["011", "202", "002", "UN"], callingCodes: ["220"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-15.14917, 13.57989], [-14.36795, 13.23033], [-13.79409, 13.34472], [-13.8955, 13.59126], [-14.34721, 13.46578], [-14.93719, 13.80173], [-15.36504, 13.79313], [-15.47902, 13.58758], [-17.43598, 13.59273], [-17.43966, 13.04579], [-16.74676, 13.06025], [-16.69343, 13.16791], [-15.80355, 13.16729], [-15.80478, 13.34832], [-15.26908, 13.37768], [-15.14917, 13.57989]]]] } },
34172 { type: "Feature", properties: { iso1A2: "GN", iso1A3: "GIN", iso1N3: "324", wikidata: "Q1006", nameEn: "Guinea", groups: ["011", "202", "002", "UN"], callingCodes: ["224"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-11.37536, 12.40788], [-11.46267, 12.44559], [-11.91331, 12.42008], [-12.35415, 12.32758], [-12.87336, 12.51892], [-13.06603, 12.49342], [-13.05296, 12.64003], [-13.70523, 12.68013], [-13.7039, 12.60313], [-13.65089, 12.49515], [-13.64168, 12.42764], [-13.70851, 12.24978], [-13.92745, 12.24077], [-13.94589, 12.16869], [-13.7039, 12.00869], [-13.7039, 11.70195], [-14.09799, 11.63649], [-14.26623, 11.67486], [-14.31513, 11.60713], [-14.51173, 11.49708], [-14.66677, 11.51188], [-14.77786, 11.36323], [-14.95993, 10.99244], [-15.07174, 10.89557], [-15.96748, 10.162], [-14.36218, 8.64107], [-13.29911, 9.04245], [-13.18586, 9.0925], [-13.08953, 9.0409], [-12.94095, 9.26335], [-12.76788, 9.3133], [-12.47254, 9.86834], [-12.24262, 9.92386], [-12.12634, 9.87203], [-11.91023, 9.93927], [-11.89624, 9.99763], [-11.2118, 10.00098], [-10.6534, 9.29919], [-10.74484, 9.07998], [-10.5783, 9.06386], [-10.56197, 8.81225], [-10.47707, 8.67669], [-10.61422, 8.5314], [-10.70565, 8.29235], [-10.63934, 8.35326], [-10.54891, 8.31174], [-10.37257, 8.48941], [-10.27575, 8.48711], [-10.203, 8.47991], [-10.14579, 8.52665], [-10.05375, 8.50697], [-10.05873, 8.42578], [-9.77763, 8.54633], [-9.47415, 8.35195], [-9.50898, 8.18455], [-9.41445, 8.02448], [-9.44928, 7.9284], [-9.35724, 7.74111], [-9.37465, 7.62032], [-9.48161, 7.37122], [-9.41943, 7.41809], [-9.305, 7.42056], [-9.20798, 7.38109], [-9.18311, 7.30461], [-9.09107, 7.1985], [-8.93435, 7.2824], [-8.85724, 7.26019], [-8.8448, 7.35149], [-8.72789, 7.51429], [-8.67814, 7.69428], [-8.55874, 7.70167], [-8.55874, 7.62525], [-8.47114, 7.55676], [-8.4003, 7.6285], [-8.21374, 7.54466], [-8.09931, 7.78626], [-8.13414, 7.87991], [-8.06449, 8.04989], [-7.94695, 8.00925], [-7.99919, 8.11023], [-7.98675, 8.20134], [-8.062, 8.16071], [-8.2411, 8.24196], [-8.22991, 8.48438], [-7.92518, 8.50652], [-7.65653, 8.36873], [-7.69882, 8.66148], [-7.95503, 8.81146], [-7.92518, 8.99332], [-7.73862, 9.08422], [-7.90777, 9.20456], [-7.85056, 9.41812], [-8.03463, 9.39604], [-8.14657, 9.55062], [-8.09434, 9.86936], [-8.15652, 9.94288], [-8.11921, 10.04577], [-8.01225, 10.1021], [-7.97971, 10.17117], [-7.9578, 10.2703], [-8.10207, 10.44649], [-8.22711, 10.41722], [-8.32614, 10.69273], [-8.2667, 10.91762], [-8.35083, 11.06234], [-8.66923, 10.99397], [-8.40058, 11.37466], [-8.80854, 11.66715], [-8.94784, 12.34842], [-9.13689, 12.50875], [-9.38067, 12.48446], [-9.32097, 12.29009], [-9.63938, 12.18312], [-9.714, 12.0226], [-10.30604, 12.24634], [-10.71897, 11.91552], [-10.80355, 12.1053], [-10.99758, 12.24634], [-11.24136, 12.01286], [-11.50006, 12.17826], [-11.37536, 12.40788]]]] } },
34173 { type: "Feature", properties: { iso1A2: "GP", iso1A3: "GLP", iso1N3: "312", wikidata: "Q17012", nameEn: "Guadeloupe", country: "FR", groups: ["Q3320166", "EU", "029", "003", "419", "019", "UN"], callingCodes: ["590"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-60.03183, 16.1129], [-61.60296, 16.73066], [-63.00549, 15.26166], [-60.03183, 16.1129]]]] } },
34174 { type: "Feature", properties: { iso1A2: "GQ", iso1A3: "GNQ", iso1N3: "226", wikidata: "Q983", nameEn: "Equatorial Guinea", groups: ["017", "202", "002", "UN"], callingCodes: ["240"] }, geometry: { type: "MultiPolygon", coordinates: [[[[9.22018, 3.72052], [8.34397, 4.30689], [7.71762, 0.6674], [3.35016, -3.29031], [9.66433, 1.06723], [9.75065, 1.06753], [9.79648, 1.0019], [11.35307, 1.00251], [11.3561, 2.17217], [9.991, 2.16561], [9.90749, 2.20049], [9.89012, 2.20457], [9.84716, 2.24676], [9.83238, 2.29079], [9.83754, 2.32428], [9.82123, 2.35097], [9.81162, 2.33797], [9.22018, 3.72052]]]] } },
34175 { type: "Feature", properties: { iso1A2: "GR", iso1A3: "GRC", iso1N3: "300", wikidata: "Q41", nameEn: "Greece", aliases: ["EL"], groups: ["EU", "039", "150", "UN"], callingCodes: ["30"] }, geometry: { type: "MultiPolygon", coordinates: [[[[26.03489, 40.73051], [26.0754, 40.72772], [26.08638, 40.73214], [26.12495, 40.74283], [26.12854, 40.77339], [26.15685, 40.80709], [26.21351, 40.83298], [26.20856, 40.86048], [26.26169, 40.9168], [26.29441, 40.89119], [26.28623, 40.93005], [26.32259, 40.94042], [26.35894, 40.94292], [26.33297, 40.98388], [26.3606, 41.02027], [26.31928, 41.07386], [26.32259, 41.24929], [26.39861, 41.25053], [26.5209, 41.33993], [26.5837, 41.32131], [26.62997, 41.34613], [26.61767, 41.42281], [26.59742, 41.48058], [26.59196, 41.60491], [26.5209, 41.62592], [26.47958, 41.67037], [26.35957, 41.71149], [26.30255, 41.70925], [26.2654, 41.71544], [26.22888, 41.74139], [26.21325, 41.73223], [26.16841, 41.74858], [26.06148, 41.70345], [26.07083, 41.64584], [26.15146, 41.60828], [26.14328, 41.55496], [26.17951, 41.55409], [26.176, 41.50072], [26.14796, 41.47533], [26.20288, 41.43943], [26.16548, 41.42278], [26.12926, 41.35878], [25.87919, 41.30526], [25.8266, 41.34563], [25.70507, 41.29209], [25.66183, 41.31316], [25.61042, 41.30614], [25.55082, 41.31667], [25.52394, 41.2798], [25.48187, 41.28506], [25.28322, 41.23411], [25.11611, 41.34212], [24.942, 41.38685], [24.90928, 41.40876], [24.86136, 41.39298], [24.82514, 41.4035], [24.8041, 41.34913], [24.71529, 41.41928], [24.61129, 41.42278], [24.52599, 41.56808], [24.30513, 41.51297], [24.27124, 41.57682], [24.18126, 41.51735], [24.10063, 41.54796], [24.06323, 41.53222], [24.06908, 41.46132], [23.96975, 41.44118], [23.91483, 41.47971], [23.89613, 41.45257], [23.80148, 41.43943], [23.76525, 41.40175], [23.67644, 41.41139], [23.63203, 41.37632], [23.52453, 41.40262], [23.40416, 41.39999], [23.33639, 41.36317], [23.31301, 41.40525], [23.22771, 41.37106], [23.21953, 41.33773], [23.1833, 41.31755], [22.93334, 41.34104], [22.81199, 41.3398], [22.76408, 41.32225], [22.74538, 41.16321], [22.71266, 41.13945], [22.65306, 41.18168], [22.62852, 41.14385], [22.58295, 41.11568], [22.5549, 41.13065], [22.42285, 41.11921], [22.26744, 41.16409], [22.17629, 41.15969], [22.1424, 41.12449], [22.06527, 41.15617], [21.90869, 41.09191], [21.91102, 41.04786], [21.7556, 40.92525], [21.69601, 40.9429], [21.57448, 40.86076], [21.53007, 40.90759], [21.41555, 40.9173], [21.35595, 40.87578], [21.25779, 40.86165], [21.21105, 40.8855], [21.15262, 40.85546], [20.97887, 40.85475], [20.98396, 40.79109], [20.95752, 40.76982], [20.98134, 40.76046], [21.05833, 40.66586], [21.03932, 40.56299], [20.96908, 40.51526], [20.94925, 40.46625], [20.83688, 40.47882], [20.7906, 40.42726], [20.78234, 40.35803], [20.71789, 40.27739], [20.67162, 40.09433], [20.62566, 40.0897], [20.61081, 40.07866], [20.55593, 40.06524], [20.51297, 40.08168], [20.48487, 40.06271], [20.42373, 40.06777], [20.37911, 39.99058], [20.31135, 39.99438], [20.41546, 39.82832], [20.41475, 39.81437], [20.38572, 39.78516], [20.30804, 39.81563], [20.29152, 39.80421], [20.31961, 39.72799], [20.27412, 39.69884], [20.22707, 39.67459], [20.22376, 39.64532], [20.15988, 39.652], [20.12956, 39.65805], [20.05189, 39.69112], [20.00957, 39.69227], [19.98042, 39.6504], [19.92466, 39.69533], [19.97622, 39.78684], [19.95905, 39.82857], [19.0384, 40.35325], [19.20409, 39.7532], [22.5213, 33.45682], [29.73302, 35.92555], [29.69611, 36.10365], [29.61805, 36.14179], [29.61002, 36.1731], [29.48192, 36.18377], [29.30783, 36.01033], [28.23708, 36.56812], [27.95037, 36.46155], [27.89482, 36.69898], [27.46117, 36.53789], [27.24613, 36.71622], [27.45627, 36.9008], [27.20312, 36.94571], [27.14757, 37.32], [26.95583, 37.64989], [26.99377, 37.69034], [27.16428, 37.72343], [27.05537, 37.9131], [26.21136, 38.17558], [26.24183, 38.44695], [26.32173, 38.48731], [26.21136, 38.65436], [26.61814, 38.81372], [26.70773, 39.0312], [26.43357, 39.43096], [25.94257, 39.39358], [25.61285, 40.17161], [26.04292, 40.3958], [25.94795, 40.72797], [26.03489, 40.73051]]]] } },
34176 { type: "Feature", properties: { iso1A2: "GS", iso1A3: "SGS", iso1N3: "239", wikidata: "Q35086", nameEn: "South Georgia and South Sandwich Islands", country: "GB", groups: ["BOTS", "005", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["500"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-35.26394, -43.68272], [-53.39656, -59.87088], [-22.31757, -59.85974], [-35.26394, -43.68272]]]] } },
34177 { type: "Feature", properties: { iso1A2: "GT", iso1A3: "GTM", iso1N3: "320", wikidata: "Q774", nameEn: "Guatemala", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["502"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-89.14985, 17.81563], [-90.98678, 17.81655], [-90.99199, 17.25192], [-91.43809, 17.25373], [-91.04436, 16.92175], [-90.69064, 16.70697], [-90.61212, 16.49832], [-90.40499, 16.40524], [-90.44567, 16.07573], [-91.73182, 16.07371], [-92.20983, 15.26077], [-92.0621, 15.07406], [-92.1454, 14.98143], [-92.1423, 14.88647], [-92.18161, 14.84147], [-92.1454, 14.6804], [-92.2261, 14.53423], [-92.37213, 14.39277], [-90.55276, 12.8866], [-90.11344, 13.73679], [-90.10505, 13.85104], [-89.88937, 14.0396], [-89.81807, 14.07073], [-89.76103, 14.02923], [-89.73251, 14.04133], [-89.75569, 14.07073], [-89.70756, 14.1537], [-89.61844, 14.21937], [-89.52397, 14.22628], [-89.50614, 14.26084], [-89.58814, 14.33165], [-89.57441, 14.41637], [-89.39028, 14.44561], [-89.34776, 14.43013], [-89.35189, 14.47553], [-89.23719, 14.58046], [-89.15653, 14.57802], [-89.13132, 14.71582], [-89.23467, 14.85596], [-89.15149, 14.97775], [-89.18048, 14.99967], [-89.15149, 15.07392], [-88.97343, 15.14039], [-88.32467, 15.63665], [-88.31459, 15.66942], [-88.24022, 15.69247], [-88.22552, 15.72294], [-88.20359, 16.03858], [-88.40779, 16.09624], [-88.95358, 15.88698], [-89.02415, 15.9063], [-89.17418, 15.90898], [-89.22683, 15.88619], [-89.15025, 17.04813], [-89.14985, 17.81563]]]] } },
34178 { type: "Feature", properties: { iso1A2: "GU", iso1A3: "GUM", iso1N3: "316", wikidata: "Q16635", nameEn: "Guam", aliases: ["US-GU"], country: "US", groups: ["Q1352230", "Q153732", "057", "009", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 671"] }, geometry: { type: "MultiPolygon", coordinates: [[[[146.25931, 13.85876], [143.82485, 13.92273], [144.61642, 12.82462], [146.25931, 13.85876]]]] } },
34179 { type: "Feature", properties: { iso1A2: "GW", iso1A3: "GNB", iso1N3: "624", wikidata: "Q1007", nameEn: "Guinea-Bissau", groups: ["011", "202", "002", "UN"], callingCodes: ["245"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-14.31513, 11.60713], [-14.26623, 11.67486], [-14.09799, 11.63649], [-13.7039, 11.70195], [-13.7039, 12.00869], [-13.94589, 12.16869], [-13.92745, 12.24077], [-13.70851, 12.24978], [-13.64168, 12.42764], [-13.65089, 12.49515], [-13.7039, 12.60313], [-13.70523, 12.68013], [-15.17582, 12.6847], [-15.67302, 12.42974], [-16.20591, 12.46157], [-16.38191, 12.36449], [-16.70562, 12.34803], [-17.4623, 11.92379], [-15.96748, 10.162], [-15.07174, 10.89557], [-14.95993, 10.99244], [-14.77786, 11.36323], [-14.66677, 11.51188], [-14.51173, 11.49708], [-14.31513, 11.60713]]]] } },
34180 { type: "Feature", properties: { iso1A2: "GY", iso1A3: "GUY", iso1N3: "328", wikidata: "Q734", nameEn: "Guyana", groups: ["005", "419", "019", "UN"], driveSide: "left", callingCodes: ["592"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-56.84822, 6.73257], [-59.54058, 8.6862], [-59.98508, 8.53046], [-59.85562, 8.35213], [-59.80661, 8.28906], [-59.83156, 8.23261], [-59.97059, 8.20791], [-60.02407, 8.04557], [-60.38056, 7.8302], [-60.51959, 7.83373], [-60.64793, 7.56877], [-60.71923, 7.55817], [-60.59802, 7.33194], [-60.63367, 7.25061], [-60.54098, 7.14804], [-60.44116, 7.20817], [-60.28074, 7.1162], [-60.39419, 6.94847], [-60.54873, 6.8631], [-61.13632, 6.70922], [-61.20762, 6.58174], [-61.15058, 6.19558], [-61.4041, 5.95304], [-60.73204, 5.20931], [-60.32352, 5.21299], [-60.20944, 5.28754], [-59.98129, 5.07097], [-60.04189, 4.69801], [-60.15953, 4.53456], [-59.78878, 4.45637], [-59.69361, 4.34069], [-59.73353, 4.20399], [-59.51963, 3.91951], [-59.86899, 3.57089], [-59.81484, 3.41955], [-59.81107, 3.38023], [-59.8041, 3.37027], [-59.80525, 3.35466], [-59.99733, 2.92312], [-59.91177, 2.36759], [-59.7264, 2.27497], [-59.74066, 1.87596], [-59.25583, 1.40559], [-58.92072, 1.31293], [-58.84229, 1.17749], [-58.53571, 1.29154], [-58.4858, 1.48399], [-58.33887, 1.58014], [-58.01873, 1.51966], [-57.97336, 1.64566], [-57.77281, 1.73344], [-57.55743, 1.69605], [-57.35073, 1.98327], [-57.23981, 1.95808], [-57.09109, 2.01854], [-57.07092, 1.95304], [-56.7659, 1.89509], [-56.47045, 1.95135], [-56.55439, 2.02003], [-56.70519, 2.02964], [-57.35891, 3.32121], [-58.0307, 3.95513], [-57.8699, 4.89394], [-57.37442, 5.0208], [-57.22536, 5.15605], [-57.31629, 5.33714], [-56.84822, 6.73257]]]] } },
34181 { type: "Feature", properties: { iso1A2: "HK", iso1A3: "HKG", iso1N3: "344", wikidata: "Q8646", nameEn: "Hong Kong", country: "CN", groups: ["030", "142", "UN"], driveSide: "left", callingCodes: ["852"] }, geometry: { type: "MultiPolygon", coordinates: [[[[113.92195, 22.13873], [114.50148, 22.15017], [114.44998, 22.55977], [114.25154, 22.55977], [114.22888, 22.5436], [114.22185, 22.55343], [114.20655, 22.55706], [114.18338, 22.55444], [114.17247, 22.55944], [114.1597, 22.56041], [114.15123, 22.55163], [114.1482, 22.54091], [114.13823, 22.54319], [114.12665, 22.54003], [114.11656, 22.53415], [114.11181, 22.52878], [114.1034, 22.5352], [114.09692, 22.53435], [114.09048, 22.53716], [114.08606, 22.53276], [114.07817, 22.52997], [114.07267, 22.51855], [114.06272, 22.51617], [114.05729, 22.51104], [114.05438, 22.5026], [114.03113, 22.5065], [113.86771, 22.42972], [113.81621, 22.2163], [113.83338, 22.1826], [113.92195, 22.13873]]]] } },
34182 { type: "Feature", properties: { iso1A2: "HM", iso1A3: "HMD", iso1N3: "334", wikidata: "Q131198", nameEn: "Heard Island and McDonald Islands", country: "AU", groups: ["053", "009", "UN"], driveSide: "left" }, geometry: { type: "MultiPolygon", coordinates: [[[[71.08716, -53.87687], [75.44182, -53.99822], [72.87012, -51.48322], [71.08716, -53.87687]]]] } },
34183 { type: "Feature", properties: { iso1A2: "HN", iso1A3: "HND", iso1N3: "340", wikidata: "Q783", nameEn: "Honduras", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["504"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-83.86109, 17.73736], [-88.20359, 16.03858], [-88.22552, 15.72294], [-88.24022, 15.69247], [-88.31459, 15.66942], [-88.32467, 15.63665], [-88.97343, 15.14039], [-89.15149, 15.07392], [-89.18048, 14.99967], [-89.15149, 14.97775], [-89.23467, 14.85596], [-89.13132, 14.71582], [-89.15653, 14.57802], [-89.23719, 14.58046], [-89.35189, 14.47553], [-89.34776, 14.43013], [-89.04187, 14.33644], [-88.94608, 14.20207], [-88.85785, 14.17763], [-88.815, 14.11652], [-88.73182, 14.10919], [-88.70661, 14.04317], [-88.49738, 13.97224], [-88.48982, 13.86458], [-88.25791, 13.91108], [-88.23018, 13.99915], [-88.07641, 13.98447], [-88.00331, 13.86948], [-87.7966, 13.91353], [-87.68821, 13.80829], [-87.73106, 13.75443], [-87.78148, 13.52906], [-87.71657, 13.50577], [-87.72115, 13.46083], [-87.73841, 13.44169], [-87.77354, 13.45767], [-87.83467, 13.44655], [-87.84675, 13.41078], [-87.80177, 13.35689], [-87.73714, 13.32715], [-87.69751, 13.25228], [-87.55124, 13.12523], [-87.37107, 12.98646], [-87.06306, 13.00892], [-87.03785, 12.98682], [-86.93197, 13.05313], [-86.93383, 13.18677], [-86.87066, 13.30641], [-86.71267, 13.30348], [-86.76812, 13.79605], [-86.35219, 13.77157], [-86.14801, 14.04317], [-86.00685, 14.08474], [-86.03458, 13.99181], [-85.75477, 13.8499], [-85.73964, 13.9698], [-85.45762, 14.11304], [-85.32149, 14.2562], [-85.18602, 14.24929], [-85.1575, 14.53934], [-84.90082, 14.80489], [-84.82596, 14.82212], [-84.70119, 14.68078], [-84.48373, 14.63249], [-84.10584, 14.76353], [-83.89551, 14.76697], [-83.62101, 14.89448], [-83.49268, 15.01158], [-83.13724, 15.00002], [-83.04763, 15.03256], [-82.06974, 14.49418], [-81.58685, 18.0025], [-83.86109, 17.73736]]]] } },
34184 { type: "Feature", properties: { iso1A2: "HR", iso1A3: "HRV", iso1N3: "191", wikidata: "Q224", nameEn: "Croatia", groups: ["EU", "039", "150", "UN"], callingCodes: ["385"] }, geometry: { type: "MultiPolygon", coordinates: [[[[17.6444, 42.88641], [17.5392, 42.92787], [17.70879, 42.97223], [17.64268, 43.08595], [17.46986, 43.16559], [17.286, 43.33065], [17.25579, 43.40353], [17.29699, 43.44542], [17.24411, 43.49376], [17.15828, 43.49376], [17.00585, 43.58037], [16.80736, 43.76011], [16.75316, 43.77157], [16.70922, 43.84887], [16.55472, 43.95326], [16.50528, 44.0244], [16.43629, 44.02826], [16.43662, 44.07523], [16.36864, 44.08263], [16.18688, 44.27012], [16.21346, 44.35231], [16.12969, 44.38275], [16.16814, 44.40679], [16.10566, 44.52586], [16.03012, 44.55572], [16.00884, 44.58605], [16.05828, 44.61538], [15.89348, 44.74964], [15.8255, 44.71501], [15.72584, 44.82334], [15.79472, 44.8455], [15.76096, 44.87045], [15.74723, 44.96818], [15.78568, 44.97401], [15.74585, 45.0638], [15.78842, 45.11519], [15.76371, 45.16508], [15.83512, 45.22459], [15.98412, 45.23088], [16.12153, 45.09616], [16.29036, 44.99732], [16.35404, 45.00241], [16.35863, 45.03529], [16.3749, 45.05206], [16.38219, 45.05139], [16.38309, 45.05955], [16.40023, 45.1147], [16.4634, 45.14522], [16.49155, 45.21153], [16.52982, 45.22713], [16.5501, 45.2212], [16.56559, 45.22307], [16.60194, 45.23042], [16.64962, 45.20714], [16.74845, 45.20393], [16.78219, 45.19002], [16.81137, 45.18434], [16.83804, 45.18951], [16.92405, 45.27607], [16.9385, 45.22742], [17.0415, 45.20759], [17.18438, 45.14764], [17.24325, 45.146], [17.25131, 45.14957], [17.26815, 45.18444], [17.32092, 45.16246], [17.33573, 45.14521], [17.41229, 45.13335], [17.4498, 45.16119], [17.45615, 45.12523], [17.47589, 45.12656], [17.51469, 45.10791], [17.59104, 45.10816], [17.66571, 45.13408], [17.84826, 45.04489], [17.87148, 45.04645], [17.93706, 45.08016], [17.97336, 45.12245], [17.97834, 45.13831], [17.99479, 45.14958], [18.01594, 45.15163], [18.03121, 45.12632], [18.1624, 45.07654], [18.24387, 45.13699], [18.32077, 45.1021], [18.41896, 45.11083], [18.47939, 45.05871], [18.65723, 45.07544], [18.78357, 44.97741], [18.80661, 44.93561], [18.76369, 44.93707], [18.76347, 44.90669], [18.8704, 44.85097], [19.01994, 44.85493], [18.98957, 44.90645], [19.02871, 44.92541], [19.06853, 44.89915], [19.15573, 44.95409], [19.05205, 44.97692], [19.1011, 45.01191], [19.07952, 45.14668], [19.14063, 45.12972], [19.19144, 45.17863], [19.43589, 45.17137], [19.41941, 45.23475], [19.28208, 45.23813], [19.10774, 45.29547], [18.97446, 45.37528], [18.99918, 45.49333], [19.08364, 45.48804], [19.07471, 45.53086], [18.94562, 45.53712], [18.88776, 45.57253], [18.96691, 45.66731], [18.90305, 45.71863], [18.85783, 45.85493], [18.81394, 45.91329], [18.80211, 45.87995], [18.6792, 45.92057], [18.57483, 45.80772], [18.44368, 45.73972], [18.12439, 45.78905], [18.08869, 45.76511], [17.99805, 45.79671], [17.87377, 45.78522], [17.66545, 45.84207], [17.56821, 45.93728], [17.35672, 45.95209], [17.14592, 46.16697], [16.8903, 46.28122], [16.8541, 46.36255], [16.7154, 46.39523], [16.6639, 46.45203], [16.59527, 46.47524], [16.52604, 46.47831], [16.5007, 46.49644], [16.44036, 46.5171], [16.38771, 46.53608], [16.37193, 46.55008], [16.29793, 46.5121], [16.26733, 46.51505], [16.26759, 46.50566], [16.23961, 46.49653], [16.25124, 46.48067], [16.27398, 46.42875], [16.27329, 46.41467], [16.30162, 46.40437], [16.30233, 46.37837], [16.18824, 46.38282], [16.14859, 46.40547], [16.05281, 46.39141], [16.05065, 46.3833], [16.07314, 46.36458], [16.07616, 46.3463], [15.97965, 46.30652], [15.79284, 46.25811], [15.78817, 46.21719], [15.75479, 46.20336], [15.75436, 46.21969], [15.67395, 46.22478], [15.6434, 46.21396], [15.64904, 46.19229], [15.59909, 46.14761], [15.6083, 46.11992], [15.62317, 46.09103], [15.72977, 46.04682], [15.71246, 46.01196], [15.70327, 46.00015], [15.70636, 45.92116], [15.67967, 45.90455], [15.68383, 45.88867], [15.68232, 45.86819], [15.70411, 45.8465], [15.66662, 45.84085], [15.64185, 45.82915], [15.57952, 45.84953], [15.52234, 45.82195], [15.47325, 45.8253], [15.47531, 45.79802], [15.40836, 45.79491], [15.25423, 45.72275], [15.30872, 45.69014], [15.34919, 45.71623], [15.4057, 45.64727], [15.38952, 45.63682], [15.34214, 45.64702], [15.34695, 45.63382], [15.31027, 45.6303], [15.27747, 45.60504], [15.29837, 45.5841], [15.30249, 45.53224], [15.38188, 45.48752], [15.33051, 45.45258], [15.27758, 45.46678], [15.16862, 45.42309], [15.05187, 45.49079], [15.02385, 45.48533], [14.92266, 45.52788], [14.90554, 45.47769], [14.81992, 45.45913], [14.80124, 45.49515], [14.71718, 45.53442], [14.68605, 45.53006], [14.69694, 45.57366], [14.59576, 45.62812], [14.60977, 45.66403], [14.57397, 45.67165], [14.53816, 45.6205], [14.5008, 45.60852], [14.49769, 45.54424], [14.36693, 45.48642], [14.32487, 45.47142], [14.27681, 45.4902], [14.26611, 45.48239], [14.24239, 45.50607], [14.22371, 45.50388], [14.20348, 45.46896], [14.07116, 45.48752], [14.00578, 45.52352], [13.96063, 45.50825], [13.99488, 45.47551], [13.97309, 45.45258], [13.90771, 45.45149], [13.88124, 45.42637], [13.81742, 45.43729], [13.7785, 45.46787], [13.67398, 45.4436], [13.62902, 45.45898], [13.56979, 45.4895], [13.45644, 45.59464], [13.05142, 45.33128], [13.12821, 44.48877], [16.15283, 42.18525], [18.45131, 42.21682], [18.54128, 42.39171], [18.52152, 42.42302], [18.43588, 42.48556], [18.44307, 42.51077], [18.43735, 42.55921], [18.36197, 42.61423], [18.24318, 42.6112], [17.88201, 42.83668], [17.80854, 42.9182], [17.7948, 42.89556], [17.68151, 42.92725], [17.6444, 42.88641]]]] } },
34185 { type: "Feature", properties: { iso1A2: "HT", iso1A3: "HTI", iso1N3: "332", wikidata: "Q790", nameEn: "Haiti", aliases: ["RH"], groups: ["029", "003", "419", "019", "UN"], callingCodes: ["509"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-71.71885, 18.78423], [-71.72624, 18.87802], [-71.77766, 18.95007], [-71.88102, 18.95007], [-71.74088, 19.0437], [-71.71088, 19.08353], [-71.69938, 19.10916], [-71.65337, 19.11759], [-71.62642, 19.21212], [-71.73229, 19.26686], [-71.77766, 19.33823], [-71.69448, 19.37866], [-71.6802, 19.45008], [-71.71268, 19.53374], [-71.71449, 19.55364], [-71.7429, 19.58445], [-71.75865, 19.70231], [-71.77419, 19.73128], [-72.38946, 20.27111], [-73.37289, 20.43199], [-74.7289, 18.71009], [-74.76465, 18.06252], [-72.29523, 17.48026], [-71.75671, 18.03456], [-71.73783, 18.07177], [-71.74994, 18.11115], [-71.75465, 18.14405], [-71.78271, 18.18302], [-71.69952, 18.34101], [-71.90875, 18.45821], [-71.88102, 18.50125], [-72.00201, 18.62312], [-71.95412, 18.64939], [-71.82556, 18.62551], [-71.71885, 18.78423]]]] } },
34186 { type: "Feature", properties: { iso1A2: "HU", iso1A3: "HUN", iso1N3: "348", wikidata: "Q28", nameEn: "Hungary", groups: ["EU", "151", "150", "UN"], callingCodes: ["36"] }, geometry: { type: "MultiPolygon", coordinates: [[[[21.72525, 48.34628], [21.67134, 48.3989], [21.6068, 48.50365], [21.44063, 48.58456], [21.11516, 48.49546], [20.83248, 48.5824], [20.5215, 48.53336], [20.29943, 48.26104], [20.24312, 48.2784], [19.92452, 48.1283], [19.63338, 48.25006], [19.52489, 48.19791], [19.47957, 48.09437], [19.28182, 48.08336], [19.23924, 48.0595], [19.01952, 48.07052], [18.82176, 48.04206], [18.76134, 47.97499], [18.76821, 47.87469], [18.8506, 47.82308], [18.74074, 47.8157], [18.72154, 47.78683], [18.65644, 47.7568], [18.56496, 47.76588], [18.29305, 47.73541], [18.02938, 47.75665], [17.71215, 47.7548], [17.23699, 48.02094], [17.16001, 48.00636], [17.09786, 47.97336], [17.11269, 47.92736], [17.08275, 47.87719], [17.01645, 47.8678], [17.00995, 47.85836], [17.07039, 47.81129], [17.05048, 47.79377], [17.08893, 47.70928], [16.87538, 47.68895], [16.86509, 47.72268], [16.82938, 47.68432], [16.7511, 47.67878], [16.72089, 47.73469], [16.65679, 47.74197], [16.61183, 47.76171], [16.54779, 47.75074], [16.53514, 47.73837], [16.55129, 47.72268], [16.41442, 47.65936], [16.51643, 47.64538], [16.58699, 47.61772], [16.64193, 47.63114], [16.71059, 47.52692], [16.64821, 47.50155], [16.67049, 47.47426], [16.66203, 47.45571], [16.57152, 47.40868], [16.52414, 47.41007], [16.49908, 47.39416], [16.45104, 47.41181], [16.47782, 47.25918], [16.44142, 47.25079], [16.43663, 47.21127], [16.41739, 47.20649], [16.42801, 47.18422], [16.4523, 47.18812], [16.46442, 47.16845], [16.44932, 47.14418], [16.52863, 47.13974], [16.46134, 47.09395], [16.52176, 47.05747], [16.43936, 47.03548], [16.51369, 47.00084], [16.28202, 47.00159], [16.27594, 46.9643], [16.22403, 46.939], [16.19904, 46.94134], [16.10983, 46.867], [16.14365, 46.8547], [16.15711, 46.85434], [16.21892, 46.86961], [16.2365, 46.87775], [16.2941, 46.87137], [16.34547, 46.83836], [16.3408, 46.80641], [16.31303, 46.79838], [16.30966, 46.7787], [16.37816, 46.69975], [16.42641, 46.69228], [16.41863, 46.66238], [16.38594, 46.6549], [16.39217, 46.63673], [16.50139, 46.56684], [16.52885, 46.53303], [16.52604, 46.5051], [16.59527, 46.47524], [16.6639, 46.45203], [16.7154, 46.39523], [16.8541, 46.36255], [16.8903, 46.28122], [17.14592, 46.16697], [17.35672, 45.95209], [17.56821, 45.93728], [17.66545, 45.84207], [17.87377, 45.78522], [17.99805, 45.79671], [18.08869, 45.76511], [18.12439, 45.78905], [18.44368, 45.73972], [18.57483, 45.80772], [18.6792, 45.92057], [18.80211, 45.87995], [18.81394, 45.91329], [18.99712, 45.93537], [19.01284, 45.96529], [19.0791, 45.96458], [19.10388, 46.04015], [19.14543, 45.9998], [19.28826, 45.99694], [19.52473, 46.1171], [19.56113, 46.16824], [19.66007, 46.19005], [19.81491, 46.1313], [19.93508, 46.17553], [20.01816, 46.17696], [20.03533, 46.14509], [20.09713, 46.17315], [20.26068, 46.12332], [20.28324, 46.1438], [20.35573, 46.16629], [20.45377, 46.14405], [20.49718, 46.18721], [20.63863, 46.12728], [20.76085, 46.21002], [20.74574, 46.25467], [20.86797, 46.28884], [21.06572, 46.24897], [21.16872, 46.30118], [21.28061, 46.44941], [21.26929, 46.4993], [21.33214, 46.63035], [21.43926, 46.65109], [21.5151, 46.72147], [21.48935, 46.7577], [21.52028, 46.84118], [21.59307, 46.86935], [21.59581, 46.91628], [21.68645, 46.99595], [21.648, 47.03902], [21.78395, 47.11104], [21.94463, 47.38046], [22.01055, 47.37767], [22.03389, 47.42508], [22.00917, 47.50492], [22.31816, 47.76126], [22.41979, 47.7391], [22.46559, 47.76583], [22.67247, 47.7871], [22.76617, 47.8417], [22.77991, 47.87211], [22.89849, 47.95851], [22.84276, 47.98602], [22.87847, 48.04665], [22.81804, 48.11363], [22.73427, 48.12005], [22.66835, 48.09162], [22.58733, 48.10813], [22.59007, 48.15121], [22.49806, 48.25189], [22.38133, 48.23726], [22.2083, 48.42534], [22.14689, 48.4005], [21.83339, 48.36242], [21.8279, 48.33321], [21.72525, 48.34628]]]] } },
34187 { type: "Feature", properties: { iso1A2: "IC", wikidata: "Q5813", nameEn: "Canary Islands", country: "ES", groups: ["Q3320166", "Q105472", "EU", "039", "150", "UN"], isoStatus: "excRes", callingCodes: ["34"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-12.00985, 30.24121], [-25.3475, 27.87574], [-14.43883, 27.02969], [-12.00985, 30.24121]]]] } },
34188 { type: "Feature", properties: { iso1A2: "ID", iso1A3: "IDN", iso1N3: "360", wikidata: "Q252", nameEn: "Indonesia", aliases: ["RI"] }, geometry: null },
34189 { type: "Feature", properties: { iso1A2: "IE", iso1A3: "IRL", iso1N3: "372", wikidata: "Q27", nameEn: "Republic of Ireland", groups: ["EU", "Q22890", "154", "150", "UN"], driveSide: "left", callingCodes: ["353"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-6.26218, 54.09785], [-6.29003, 54.11278], [-6.32694, 54.09337], [-6.36279, 54.11248], [-6.36605, 54.07234], [-6.47849, 54.06947], [-6.62842, 54.03503], [-6.66264, 54.0666], [-6.6382, 54.17071], [-6.70175, 54.20218], [-6.74575, 54.18788], [-6.81583, 54.22791], [-6.85179, 54.29176], [-6.87775, 54.34682], [-7.02034, 54.4212], [-7.19145, 54.31296], [-7.14908, 54.22732], [-7.25012, 54.20063], [-7.26316, 54.13863], [-7.29493, 54.12013], [-7.29687, 54.1354], [-7.28017, 54.16714], [-7.29157, 54.17191], [-7.34005, 54.14698], [-7.30553, 54.11869], [-7.32834, 54.11475], [-7.44567, 54.1539], [-7.4799, 54.12239], [-7.55812, 54.12239], [-7.69501, 54.20731], [-7.81397, 54.20159], [-7.8596, 54.21779], [-7.87101, 54.29299], [-8.04555, 54.36292], [-8.179, 54.46763], [-8.04538, 54.48941], [-7.99812, 54.54427], [-7.8596, 54.53671], [-7.70315, 54.62077], [-7.93293, 54.66603], [-7.83352, 54.73854], [-7.75041, 54.7103], [-7.64449, 54.75265], [-7.54671, 54.74606], [-7.54508, 54.79401], [-7.47626, 54.83084], [-7.4473, 54.87003], [-7.44404, 54.9403], [-7.40004, 54.94498], [-7.4033, 55.00391], [-7.34464, 55.04688], [-7.2471, 55.06933], [-6.34755, 55.49206], [-7.75229, 55.93854], [-11.75, 54], [-11, 51], [-6.03913, 51.13217], [-5.37267, 53.63269], [-6.26218, 54.09785]]]] } },
34190 { type: "Feature", properties: { iso1A2: "IL", iso1A3: "ISR", iso1N3: "376", wikidata: "Q801", nameEn: "Israel", groups: ["145", "142", "UN"], callingCodes: ["972"] }, geometry: { type: "MultiPolygon", coordinates: [[[[34.052, 31.46619], [34.29262, 31.70393], [34.48681, 31.59711], [34.56797, 31.54197], [34.48892, 31.48365], [34.40077, 31.40926], [34.36505, 31.36404], [34.37381, 31.30598], [34.36523, 31.28963], [34.29417, 31.24194], [34.26742, 31.21998], [34.92298, 29.45305], [34.97718, 29.54294], [34.98207, 29.58147], [35.02147, 29.66343], [35.14108, 30.07374], [35.19183, 30.34636], [35.16218, 30.43535], [35.19595, 30.50297], [35.21379, 30.60401], [35.29311, 30.71365], [35.33456, 30.81224], [35.33984, 30.8802], [35.41371, 30.95565], [35.43658, 31.12444], [35.40316, 31.25535], [35.47672, 31.49578], [35.39675, 31.49572], [35.22921, 31.37445], [35.13033, 31.3551], [35.02459, 31.35979], [34.92571, 31.34337], [34.88932, 31.37093], [34.87833, 31.39321], [34.89756, 31.43891], [34.93258, 31.47816], [34.94356, 31.50743], [34.9415, 31.55601], [34.95249, 31.59813], [35.00879, 31.65426], [35.08226, 31.69107], [35.10782, 31.71594], [35.11895, 31.71454], [35.12933, 31.7325], [35.13931, 31.73012], [35.15119, 31.73634], [35.15474, 31.73352], [35.16478, 31.73242], [35.18023, 31.72067], [35.20538, 31.72388], [35.21937, 31.71578], [35.22392, 31.71899], [35.23972, 31.70896], [35.24315, 31.71244], [35.2438, 31.7201], [35.24981, 31.72543], [35.25182, 31.73945], [35.26319, 31.74846], [35.25225, 31.7678], [35.26058, 31.79064], [35.25573, 31.81362], [35.26404, 31.82567], [35.251, 31.83085], [35.25753, 31.8387], [35.24816, 31.8458], [35.2304, 31.84222], [35.2249, 31.85433], [35.22817, 31.8638], [35.22567, 31.86745], [35.22294, 31.87889], [35.22014, 31.88264], [35.2136, 31.88241], [35.21276, 31.88153], [35.21016, 31.88237], [35.20945, 31.8815], [35.20791, 31.8821], [35.20673, 31.88151], [35.20381, 31.86716], [35.21128, 31.863], [35.216, 31.83894], [35.21469, 31.81835], [35.19461, 31.82687], [35.18169, 31.82542], [35.18603, 31.80901], [35.14174, 31.81325], [35.07677, 31.85627], [35.05617, 31.85685], [35.01978, 31.82944], [34.9724, 31.83352], [34.99712, 31.85569], [35.03489, 31.85919], [35.03978, 31.89276], [35.03489, 31.92448], [35.00124, 31.93264], [34.98682, 31.96935], [35.00261, 32.027], [34.9863, 32.09551], [34.99437, 32.10962], [34.98507, 32.12606], [34.99039, 32.14626], [34.96009, 32.17503], [34.95703, 32.19522], [34.98885, 32.20758], [35.01841, 32.23981], [35.02939, 32.2671], [35.01119, 32.28684], [35.01772, 32.33863], [35.04243, 32.35008], [35.05142, 32.3667], [35.0421, 32.38242], [35.05311, 32.4024], [35.05423, 32.41754], [35.07059, 32.4585], [35.08564, 32.46948], [35.09236, 32.47614], [35.10024, 32.47856], [35.10882, 32.4757], [35.15937, 32.50466], [35.2244, 32.55289], [35.25049, 32.52453], [35.29306, 32.50947], [35.30685, 32.51024], [35.35212, 32.52047], [35.40224, 32.50136], [35.42034, 32.46009], [35.41598, 32.45593], [35.41048, 32.43706], [35.42078, 32.41562], [35.55807, 32.38674], [35.55494, 32.42687], [35.57485, 32.48669], [35.56614, 32.64393], [35.59813, 32.65159], [35.61669, 32.67999], [35.66527, 32.681], [35.68467, 32.70715], [35.75983, 32.74803], [35.78745, 32.77938], [35.83758, 32.82817], [35.84021, 32.8725], [35.87012, 32.91976], [35.89298, 32.9456], [35.87188, 32.98028], [35.84802, 33.1031], [35.81911, 33.11077], [35.81911, 33.1336], [35.84285, 33.16673], [35.83846, 33.19397], [35.81647, 33.2028], [35.81295, 33.24841], [35.77513, 33.27342], [35.813, 33.3172], [35.77477, 33.33609], [35.62019, 33.27278], [35.62283, 33.24226], [35.58502, 33.26653], [35.58326, 33.28381], [35.56523, 33.28969], [35.55555, 33.25844], [35.54544, 33.25513], [35.54808, 33.236], [35.5362, 33.23196], [35.54228, 33.19865], [35.52573, 33.11921], [35.50335, 33.114], [35.50272, 33.09056], [35.448, 33.09264], [35.43059, 33.06659], [35.35223, 33.05617], [35.31429, 33.10515], [35.1924, 33.08743], [35.10645, 33.09318], [34.78515, 33.20368], [33.62659, 31.82938], [34.052, 31.46619]]]] } },
34191 { type: "Feature", properties: { iso1A2: "IM", iso1A3: "IMN", iso1N3: "833", wikidata: "Q9676", nameEn: "Isle of Man", country: "GB", groups: ["Q185086", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44 01624", "44 07624", "44 07524", "44 07924"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-3.98763, 54.07351], [-4.1819, 54.57861], [-5.6384, 53.81157], [-3.98763, 54.07351]]]] } },
34192 { type: "Feature", properties: { iso1A2: "IN", iso1A3: "IND", iso1N3: "356", wikidata: "Q668", nameEn: "India" }, geometry: null },
34193 { type: "Feature", properties: { iso1A2: "IO", iso1A3: "IOT", iso1N3: "086", wikidata: "Q43448", nameEn: "British Indian Ocean Territory", country: "GB" }, geometry: null },
34194 { type: "Feature", properties: { iso1A2: "IQ", iso1A3: "IRQ", iso1N3: "368", wikidata: "Q796", nameEn: "Iraq", groups: ["145", "142", "UN"], callingCodes: ["964"] }, geometry: { type: "MultiPolygon", coordinates: [[[[42.78887, 37.38615], [42.56725, 37.14878], [42.35724, 37.10998], [42.36697, 37.0627], [41.81736, 36.58782], [41.40058, 36.52502], [41.28864, 36.35368], [41.2564, 36.06012], [41.37027, 35.84095], [41.38184, 35.62502], [41.26569, 35.42708], [41.21654, 35.1508], [41.2345, 34.80049], [41.12388, 34.65742], [40.97676, 34.39788], [40.64314, 34.31604], [38.79171, 33.37328], [39.08202, 32.50304], [38.98762, 32.47694], [39.04251, 32.30203], [39.26157, 32.35555], [39.29903, 32.23259], [40.01521, 32.05667], [42.97601, 30.72204], [42.97796, 30.48295], [44.72255, 29.19736], [46.42415, 29.05947], [46.5527, 29.10283], [46.89695, 29.50584], [47.15166, 30.01044], [47.37192, 30.10421], [47.7095, 30.10453], [48.01114, 29.98906], [48.06782, 30.02906], [48.17332, 30.02448], [48.40479, 29.85763], [48.59531, 29.66815], [48.83867, 29.78572], [48.61441, 29.93675], [48.51011, 29.96238], [48.44785, 30.00148], [48.4494, 30.04456], [48.43384, 30.08233], [48.38869, 30.11062], [48.38714, 30.13485], [48.41671, 30.17254], [48.41117, 30.19846], [48.26393, 30.3408], [48.24385, 30.33846], [48.21279, 30.31644], [48.19425, 30.32796], [48.18321, 30.39703], [48.14585, 30.44133], [48.02443, 30.4789], [48.03221, 30.9967], [47.68219, 31.00004], [47.6804, 31.39086], [47.86337, 31.78422], [47.64771, 32.07666], [47.52474, 32.15972], [47.57144, 32.20583], [47.37529, 32.47808], [47.17218, 32.45393], [46.46788, 32.91992], [46.32298, 32.9731], [46.17198, 32.95612], [46.09103, 32.98354], [46.15175, 33.07229], [46.03966, 33.09577], [46.05367, 33.13097], [46.11905, 33.11924], [46.20623, 33.20395], [45.99919, 33.5082], [45.86687, 33.49263], [45.96183, 33.55751], [45.89801, 33.63661], [45.77814, 33.60938], [45.50261, 33.94968], [45.42789, 33.9458], [45.41077, 33.97421], [45.47264, 34.03099], [45.56176, 34.15088], [45.58667, 34.30147], [45.53552, 34.35148], [45.49171, 34.3439], [45.46697, 34.38221], [45.43879, 34.45949], [45.51883, 34.47692], [45.53219, 34.60441], [45.59074, 34.55558], [45.60224, 34.55057], [45.73923, 34.54416], [45.70031, 34.69277], [45.65672, 34.7222], [45.68284, 34.76624], [45.70031, 34.82322], [45.73641, 34.83975], [45.79682, 34.85133], [45.78904, 34.91135], [45.86532, 34.89858], [45.89477, 34.95805], [45.87864, 35.03441], [45.92173, 35.0465], [45.92203, 35.09538], [45.93108, 35.08148], [45.94756, 35.09188], [46.06508, 35.03699], [46.07747, 35.0838], [46.11763, 35.07551], [46.19116, 35.11097], [46.15642, 35.1268], [46.16229, 35.16984], [46.19738, 35.18536], [46.18457, 35.22561], [46.11367, 35.23729], [46.15474, 35.2883], [46.13152, 35.32548], [46.05358, 35.38568], [45.98453, 35.49848], [46.01518, 35.52012], [45.97584, 35.58132], [46.03028, 35.57416], [46.01307, 35.59756], [46.0165, 35.61501], [45.99452, 35.63574], [46.0117, 35.65059], [46.01631, 35.69139], [46.23736, 35.71414], [46.34166, 35.78363], [46.32921, 35.82655], [46.17198, 35.8013], [46.08325, 35.8581], [45.94711, 35.82218], [45.89784, 35.83708], [45.81442, 35.82107], [45.76145, 35.79898], [45.6645, 35.92872], [45.60018, 35.96069], [45.55245, 35.99943], [45.46594, 36.00042], [45.38275, 35.97156], [45.33916, 35.99424], [45.37652, 36.06222], [45.37312, 36.09917], [45.32235, 36.17383], [45.30038, 36.27769], [45.26261, 36.3001], [45.27394, 36.35846], [45.23953, 36.43257], [45.11811, 36.40751], [45.00759, 36.5402], [45.06985, 36.62645], [45.06985, 36.6814], [45.01537, 36.75128], [44.84725, 36.77622], [44.83479, 36.81362], [44.90173, 36.86096], [44.91199, 36.91468], [44.89862, 37.01897], [44.81611, 37.04383], [44.75229, 37.11958], [44.78319, 37.1431], [44.76698, 37.16162], [44.63179, 37.19229], [44.42631, 37.05825], [44.38117, 37.05825], [44.35315, 37.04955], [44.35937, 37.02843], [44.30645, 36.97373], [44.25975, 36.98119], [44.18503, 37.09551], [44.22239, 37.15756], [44.27998, 37.16501], [44.2613, 37.25055], [44.13521, 37.32486], [44.02002, 37.33229], [43.90949, 37.22453], [43.84878, 37.22205], [43.82699, 37.19477], [43.8052, 37.22825], [43.7009, 37.23692], [43.63085, 37.21957], [43.56702, 37.25675], [43.50787, 37.24436], [43.33508, 37.33105], [43.30083, 37.30629], [43.11403, 37.37436], [42.93705, 37.32015], [42.78887, 37.38615]]]] } },
34195 { type: "Feature", properties: { iso1A2: "IR", iso1A3: "IRN", iso1N3: "364", wikidata: "Q794", nameEn: "Iran", groups: ["034", "142", "UN"], callingCodes: ["98"] }, geometry: { type: "MultiPolygon", coordinates: [[[[44.96746, 39.42998], [44.88916, 39.59653], [44.81043, 39.62677], [44.71806, 39.71124], [44.65422, 39.72163], [44.6137, 39.78393], [44.47298, 39.68788], [44.48111, 39.61579], [44.41849, 39.56659], [44.42832, 39.4131], [44.37921, 39.4131], [44.29818, 39.378], [44.22452, 39.4169], [44.03667, 39.39223], [44.1043, 39.19842], [44.20946, 39.13975], [44.18863, 38.93881], [44.30322, 38.81581], [44.26155, 38.71427], [44.28065, 38.6465], [44.32058, 38.62752], [44.3207, 38.49799], [44.3119, 38.37887], [44.38309, 38.36117], [44.44386, 38.38295], [44.50115, 38.33939], [44.42476, 38.25763], [44.22509, 37.88859], [44.3883, 37.85433], [44.45948, 37.77065], [44.55498, 37.783], [44.62096, 37.71985], [44.56887, 37.6429], [44.61401, 37.60165], [44.58449, 37.45018], [44.81021, 37.2915], [44.75986, 37.21549], [44.7868, 37.16644], [44.78319, 37.1431], [44.75229, 37.11958], [44.81611, 37.04383], [44.89862, 37.01897], [44.91199, 36.91468], [44.90173, 36.86096], [44.83479, 36.81362], [44.84725, 36.77622], [45.01537, 36.75128], [45.06985, 36.6814], [45.06985, 36.62645], [45.00759, 36.5402], [45.11811, 36.40751], [45.23953, 36.43257], [45.27394, 36.35846], [45.26261, 36.3001], [45.30038, 36.27769], [45.32235, 36.17383], [45.37312, 36.09917], [45.37652, 36.06222], [45.33916, 35.99424], [45.38275, 35.97156], [45.46594, 36.00042], [45.55245, 35.99943], [45.60018, 35.96069], [45.6645, 35.92872], [45.76145, 35.79898], [45.81442, 35.82107], [45.89784, 35.83708], [45.94711, 35.82218], [46.08325, 35.8581], [46.17198, 35.8013], [46.32921, 35.82655], [46.34166, 35.78363], [46.23736, 35.71414], [46.01631, 35.69139], [46.0117, 35.65059], [45.99452, 35.63574], [46.0165, 35.61501], [46.01307, 35.59756], [46.03028, 35.57416], [45.97584, 35.58132], [46.01518, 35.52012], [45.98453, 35.49848], [46.05358, 35.38568], [46.13152, 35.32548], [46.15474, 35.2883], [46.11367, 35.23729], [46.18457, 35.22561], [46.19738, 35.18536], [46.16229, 35.16984], [46.15642, 35.1268], [46.19116, 35.11097], [46.11763, 35.07551], [46.07747, 35.0838], [46.06508, 35.03699], [45.94756, 35.09188], [45.93108, 35.08148], [45.92203, 35.09538], [45.92173, 35.0465], [45.87864, 35.03441], [45.89477, 34.95805], [45.86532, 34.89858], [45.78904, 34.91135], [45.79682, 34.85133], [45.73641, 34.83975], [45.70031, 34.82322], [45.68284, 34.76624], [45.65672, 34.7222], [45.70031, 34.69277], [45.73923, 34.54416], [45.60224, 34.55057], [45.59074, 34.55558], [45.53219, 34.60441], [45.51883, 34.47692], [45.43879, 34.45949], [45.46697, 34.38221], [45.49171, 34.3439], [45.53552, 34.35148], [45.58667, 34.30147], [45.56176, 34.15088], [45.47264, 34.03099], [45.41077, 33.97421], [45.42789, 33.9458], [45.50261, 33.94968], [45.77814, 33.60938], [45.89801, 33.63661], [45.96183, 33.55751], [45.86687, 33.49263], [45.99919, 33.5082], [46.20623, 33.20395], [46.11905, 33.11924], [46.05367, 33.13097], [46.03966, 33.09577], [46.15175, 33.07229], [46.09103, 32.98354], [46.17198, 32.95612], [46.32298, 32.9731], [46.46788, 32.91992], [47.17218, 32.45393], [47.37529, 32.47808], [47.57144, 32.20583], [47.52474, 32.15972], [47.64771, 32.07666], [47.86337, 31.78422], [47.6804, 31.39086], [47.68219, 31.00004], [48.03221, 30.9967], [48.02443, 30.4789], [48.14585, 30.44133], [48.18321, 30.39703], [48.19425, 30.32796], [48.21279, 30.31644], [48.24385, 30.33846], [48.26393, 30.3408], [48.41117, 30.19846], [48.41671, 30.17254], [48.38714, 30.13485], [48.38869, 30.11062], [48.43384, 30.08233], [48.4494, 30.04456], [48.44785, 30.00148], [48.51011, 29.96238], [48.61441, 29.93675], [48.83867, 29.78572], [49.98877, 27.87827], [50.37726, 27.89227], [54.39838, 25.68383], [55.14145, 25.62624], [55.81777, 26.18798], [56.2644, 26.58649], [56.68954, 26.76645], [56.79239, 26.41236], [56.82555, 25.7713], [56.86325, 25.03856], [61.46682, 24.57869], [61.6433, 25.27541], [61.683, 25.66638], [61.83968, 25.7538], [61.83831, 26.07249], [61.89391, 26.26251], [62.05117, 26.31647], [62.21304, 26.26601], [62.31484, 26.528], [62.77352, 26.64099], [63.1889, 26.65072], [63.18688, 26.83844], [63.25005, 26.84212], [63.25005, 27.08692], [63.32283, 27.14437], [63.19649, 27.25674], [62.80604, 27.22412], [62.79684, 27.34381], [62.84905, 27.47627], [62.7638, 28.02992], [62.79412, 28.28108], [62.59499, 28.24842], [62.40259, 28.42703], [61.93581, 28.55284], [61.65978, 28.77937], [61.53765, 29.00507], [61.31508, 29.38903], [60.87231, 29.86514], [61.80829, 30.84224], [61.78268, 30.92724], [61.8335, 30.97669], [61.83257, 31.0452], [61.80957, 31.12576], [61.80569, 31.16167], [61.70929, 31.37391], [60.84541, 31.49561], [60.86191, 32.22565], [60.56485, 33.12944], [60.88908, 33.50219], [60.91133, 33.55596], [60.69573, 33.56054], [60.57762, 33.59772], [60.5485, 33.73422], [60.5838, 33.80793], [60.50209, 34.13992], [60.66502, 34.31539], [60.91321, 34.30411], [60.72316, 34.52857], [60.99922, 34.63064], [61.00197, 34.70631], [61.06926, 34.82139], [61.12831, 35.09938], [61.0991, 35.27845], [61.18187, 35.30249], [61.27371, 35.61482], [61.22719, 35.67038], [61.26152, 35.80749], [61.22444, 35.92879], [61.12007, 35.95992], [61.22719, 36.12759], [61.1393, 36.38782], [61.18187, 36.55348], [61.14516, 36.64644], [60.34767, 36.63214], [60.00768, 37.04102], [59.74678, 37.12499], [59.55178, 37.13594], [59.39385, 37.34257], [59.39797, 37.47892], [59.33507, 37.53146], [59.22905, 37.51161], [58.9338, 37.67374], [58.6921, 37.64548], [58.5479, 37.70526], [58.47786, 37.6433], [58.39959, 37.63134], [58.22999, 37.6856], [58.21399, 37.77281], [57.79534, 37.89299], [57.35042, 37.98546], [57.37236, 38.09321], [57.21169, 38.28965], [57.03453, 38.18717], [56.73928, 38.27887], [56.62255, 38.24005], [56.43303, 38.26054], [56.32454, 38.18502], [56.33278, 38.08132], [55.97847, 38.08024], [55.76561, 38.12238], [55.44152, 38.08564], [55.13412, 37.94705], [54.851, 37.75739], [54.77684, 37.62264], [54.81804, 37.61285], [54.77822, 37.51597], [54.67247, 37.43532], [54.58664, 37.45809], [54.36211, 37.34912], [54.24565, 37.32047], [53.89734, 37.3464], [48.88288, 38.43975], [48.84969, 38.45015], [48.81072, 38.44853], [48.78979, 38.45026], [48.70001, 38.40564], [48.62217, 38.40198], [48.58793, 38.45076], [48.45084, 38.61013], [48.3146, 38.59958], [48.24773, 38.71883], [48.02581, 38.82705], [48.01409, 38.90333], [48.07734, 38.91616], [48.08627, 38.94434], [48.28437, 38.97186], [48.33884, 39.03022], [48.31239, 39.09278], [48.15361, 39.19419], [48.12404, 39.25208], [48.15984, 39.30028], [48.37385, 39.37584], [48.34264, 39.42935], [47.98977, 39.70999], [47.84774, 39.66285], [47.50099, 39.49615], [47.38978, 39.45999], [47.31301, 39.37492], [47.05927, 39.24846], [47.05771, 39.20143], [46.95341, 39.13505], [46.92539, 39.16644], [46.83822, 39.13143], [46.75752, 39.03231], [46.53497, 38.86548], [46.34059, 38.92076], [46.20601, 38.85262], [46.14785, 38.84206], [46.06766, 38.87861], [46.00228, 38.87376], [45.94624, 38.89072], [45.90266, 38.87739], [45.83883, 38.90768], [45.65172, 38.95199], [45.6155, 38.94304], [45.6131, 38.964], [45.44966, 38.99243], [45.44811, 39.04927], [45.40452, 39.07224], [45.40148, 39.09007], [45.30489, 39.18333], [45.16168, 39.21952], [45.08751, 39.35052], [45.05932, 39.36435], [44.96746, 39.42998]]]] } },
34196 { type: "Feature", properties: { iso1A2: "IS", iso1A3: "ISL", iso1N3: "352", wikidata: "Q189", nameEn: "Iceland", groups: ["154", "150", "UN"], callingCodes: ["354"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-33.15676, 62.62995], [-8.25539, 63.0423], [-15.70914, 69.67442], [-33.15676, 62.62995]]]] } },
34197 { type: "Feature", properties: { iso1A2: "IT", iso1A3: "ITA", iso1N3: "380", wikidata: "Q38", nameEn: "Italy", groups: ["EU", "039", "150", "UN"], callingCodes: ["39"] }, geometry: { type: "MultiPolygon", coordinates: [[[[8.95861, 45.96485], [8.97604, 45.96151], [8.97741, 45.98317], [8.96668, 45.98436], [8.95861, 45.96485]]], [[[7.63035, 43.57419], [9.56115, 43.20816], [10.09675, 41.44089], [7.60802, 41.05927], [7.89009, 38.19924], [11.2718, 37.6713], [12.13667, 34.20326], [14.02721, 36.53141], [17.67657, 35.68918], [18.83516, 40.36999], [16.15283, 42.18525], [13.12821, 44.48877], [13.05142, 45.33128], [13.45644, 45.59464], [13.6076, 45.64761], [13.7198, 45.59352], [13.74587, 45.59811], [13.78445, 45.5825], [13.84106, 45.58185], [13.86771, 45.59898], [13.8695, 45.60835], [13.9191, 45.6322], [13.87933, 45.65207], [13.83422, 45.68703], [13.83332, 45.70855], [13.8235, 45.7176], [13.66986, 45.79955], [13.59784, 45.8072], [13.58858, 45.83503], [13.57563, 45.8425], [13.58644, 45.88173], [13.59565, 45.89446], [13.60857, 45.89907], [13.61931, 45.91782], [13.63815, 45.93607], [13.6329, 45.94894], [13.64307, 45.98326], [13.63458, 45.98947], [13.62074, 45.98388], [13.58903, 45.99009], [13.56759, 45.96991], [13.52963, 45.96588], [13.50104, 45.98078], [13.47474, 46.00546], [13.49702, 46.01832], [13.50998, 46.04498], [13.49568, 46.04839], [13.50104, 46.05986], [13.57072, 46.09022], [13.64053, 46.13587], [13.66472, 46.17392], [13.64451, 46.18966], [13.56682, 46.18703], [13.56114, 46.2054], [13.47587, 46.22725], [13.42218, 46.20758], [13.40899, 46.21509], [13.41193, 46.22767], [13.37671, 46.29668], [13.44808, 46.33507], [13.43418, 46.35992], [13.47019, 46.3621], [13.5763, 46.40915], [13.5763, 46.42613], [13.59777, 46.44137], [13.68684, 46.43881], [13.7148, 46.5222], [13.64088, 46.53438], [13.27627, 46.56059], [12.94445, 46.60401], [12.59992, 46.6595], [12.38708, 46.71529], [12.27591, 46.88651], [12.2006, 46.88854], [12.11675, 47.01241], [12.21781, 47.03996], [12.19254, 47.09331], [11.74789, 46.98484], [11.50739, 47.00644], [11.33355, 46.99862], [11.10618, 46.92966], [11.00764, 46.76896], [10.72974, 46.78972], [10.75753, 46.82258], [10.66405, 46.87614], [10.54783, 46.84505], [10.47197, 46.85698], [10.38659, 46.67847], [10.40475, 46.63671], [10.44686, 46.64162], [10.49375, 46.62049], [10.46136, 46.53164], [10.25309, 46.57432], [10.23674, 46.63484], [10.10307, 46.61003], [10.03715, 46.44479], [10.165, 46.41051], [10.10506, 46.3372], [10.17862, 46.25626], [10.14439, 46.22992], [10.07055, 46.21668], [9.95249, 46.38045], [9.73086, 46.35071], [9.71273, 46.29266], [9.57015, 46.2958], [9.46117, 46.37481], [9.45936, 46.50873], [9.40487, 46.46621], [9.36128, 46.5081], [9.28136, 46.49685], [9.25502, 46.43743], [9.29226, 46.32717], [9.24503, 46.23616], [9.01618, 46.04928], [8.99257, 45.9698], [9.09065, 45.89906], [9.06642, 45.8761], [9.04546, 45.84968], [9.04059, 45.8464], [9.03505, 45.83976], [9.03793, 45.83548], [9.03279, 45.82865], [9.0298, 45.82127], [9.00324, 45.82055], [8.99663, 45.83466], [8.9621, 45.83707], [8.94737, 45.84285], [8.91129, 45.8388], [8.93504, 45.86245], [8.94372, 45.86587], [8.93649, 45.86775], [8.88904, 45.95465], [8.86688, 45.96135], [8.85121, 45.97239], [8.8319, 45.9879], [8.79362, 45.99207], [8.78585, 45.98973], [8.79414, 46.00913], [8.85617, 46.0748], [8.80778, 46.10085], [8.75697, 46.10395], [8.62242, 46.12112], [8.45032, 46.26869], [8.46317, 46.43712], [8.42464, 46.46367], [8.30648, 46.41587], [8.31162, 46.38044], [8.08814, 46.26692], [8.16866, 46.17817], [8.11383, 46.11577], [8.02906, 46.10331], [7.98881, 45.99867], [7.9049, 45.99945], [7.85949, 45.91485], [7.56343, 45.97421], [7.10685, 45.85653], [7.04151, 45.92435], [6.95315, 45.85163], [6.80785, 45.83265], [6.80785, 45.71864], [6.98948, 45.63869], [7.00037, 45.509], [7.18019, 45.40071], [7.10572, 45.32924], [7.13115, 45.25386], [7.07074, 45.21228], [6.96706, 45.20841], [6.85144, 45.13226], [6.7697, 45.16044], [6.62803, 45.11175], [6.66981, 45.02324], [6.74791, 45.01939], [6.74519, 44.93661], [6.75518, 44.89915], [6.90774, 44.84322], [6.93499, 44.8664], [7.02217, 44.82519], [7.00401, 44.78782], [7.07484, 44.68073], [7.00582, 44.69364], [6.95133, 44.66264], [6.96042, 44.62129], [6.85507, 44.53072], [6.86233, 44.49834], [6.94504, 44.43112], [6.88784, 44.42043], [6.89171, 44.36637], [6.98221, 44.28289], [7.00764, 44.23736], [7.16929, 44.20352], [7.27827, 44.1462], [7.34547, 44.14359], [7.36364, 44.11882], [7.62155, 44.14881], [7.63245, 44.17877], [7.68694, 44.17487], [7.66878, 44.12795], [7.72508, 44.07578], [7.6597, 44.03009], [7.66848, 43.99943], [7.65266, 43.9763], [7.60771, 43.95772], [7.56858, 43.94506], [7.56075, 43.89932], [7.51162, 43.88301], [7.49355, 43.86551], [7.50423, 43.84345], [7.53006, 43.78405], [7.63035, 43.57419]], [[12.45181, 41.90056], [12.44834, 41.90095], [12.44582, 41.90194], [12.44815, 41.90326], [12.44984, 41.90545], [12.45091, 41.90625], [12.45543, 41.90738], [12.45561, 41.90629], [12.45762, 41.9058], [12.45755, 41.9033], [12.45826, 41.90281], [12.45834, 41.90174], [12.4577, 41.90115], [12.45691, 41.90125], [12.45626, 41.90172], [12.45435, 41.90143], [12.45446, 41.90028], [12.45181, 41.90056]], [[12.45648, 43.89369], [12.44184, 43.90498], [12.41641, 43.89991], [12.40935, 43.9024], [12.41233, 43.90956], [12.40733, 43.92379], [12.41551, 43.92984], [12.41165, 43.93769], [12.40506, 43.94325], [12.40415, 43.95485], [12.41414, 43.95273], [12.42005, 43.9578], [12.43662, 43.95698], [12.44684, 43.96597], [12.46205, 43.97463], [12.47853, 43.98052], [12.49406, 43.98492], [12.50678, 43.99113], [12.51463, 43.99122], [12.5154, 43.98508], [12.51064, 43.98165], [12.51109, 43.97201], [12.50622, 43.97131], [12.50875, 43.96198], [12.50655, 43.95796], [12.51427, 43.94897], [12.51553, 43.94096], [12.50496, 43.93017], [12.50269, 43.92363], [12.49724, 43.92248], [12.49247, 43.91774], [12.49429, 43.90973], [12.48771, 43.89706], [12.45648, 43.89369]]]] } },
34198 { type: "Feature", properties: { iso1A2: "JE", iso1A3: "JEY", iso1N3: "832", wikidata: "Q785", nameEn: "Bailiwick of Jersey", country: "GB", groups: ["830", "Q185086", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44 01534"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.00491, 48.86706], [-1.83944, 49.23037], [-2.09454, 49.46288], [-2.65349, 49.15373], [-2.00491, 48.86706]]]] } },
34199 { type: "Feature", properties: { iso1A2: "JM", iso1A3: "JAM", iso1N3: "388", wikidata: "Q766", nameEn: "Jamaica", aliases: ["JA"], groups: ["029", "003", "419", "019", "UN"], driveSide: "left", callingCodes: ["1 876", "1 658"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-74.09729, 17.36817], [-78.9741, 19.59515], [-78.34606, 16.57862], [-74.09729, 17.36817]]]] } },
34200 { type: "Feature", properties: { iso1A2: "JO", iso1A3: "JOR", iso1N3: "400", wikidata: "Q810", nameEn: "Jordan", groups: ["145", "142", "UN"], callingCodes: ["962"] }, geometry: { type: "MultiPolygon", coordinates: [[[[39.04251, 32.30203], [38.98762, 32.47694], [39.08202, 32.50304], [38.79171, 33.37328], [36.83946, 32.31293], [36.40959, 32.37908], [36.23948, 32.50108], [36.20875, 32.49529], [36.20379, 32.52751], [36.08074, 32.51463], [36.02239, 32.65911], [35.96633, 32.66237], [35.93307, 32.71966], [35.88405, 32.71321], [35.75983, 32.74803], [35.68467, 32.70715], [35.66527, 32.681], [35.61669, 32.67999], [35.59813, 32.65159], [35.56614, 32.64393], [35.57485, 32.48669], [35.55494, 32.42687], [35.55807, 32.38674], [35.57111, 32.21877], [35.52012, 32.04076], [35.54375, 31.96587], [35.52758, 31.9131], [35.55941, 31.76535], [35.47672, 31.49578], [35.40316, 31.25535], [35.43658, 31.12444], [35.41371, 30.95565], [35.33984, 30.8802], [35.33456, 30.81224], [35.29311, 30.71365], [35.21379, 30.60401], [35.19595, 30.50297], [35.16218, 30.43535], [35.19183, 30.34636], [35.14108, 30.07374], [35.02147, 29.66343], [34.98207, 29.58147], [34.97718, 29.54294], [34.92298, 29.45305], [34.8812, 29.36878], [36.07081, 29.18469], [36.50005, 29.49696], [36.75083, 29.86903], [37.4971, 29.99949], [37.66395, 30.33245], [37.99354, 30.49998], [36.99791, 31.50081], [38.99233, 31.99721], [39.29903, 32.23259], [39.26157, 32.35555], [39.04251, 32.30203]]]] } },
34201 { type: "Feature", properties: { iso1A2: "JP", iso1A3: "JPN", iso1N3: "392", wikidata: "Q17", nameEn: "Japan", groups: ["030", "142", "UN"], driveSide: "left", callingCodes: ["81"] }, geometry: { type: "MultiPolygon", coordinates: [[[[145.82361, 43.38904], [145.23667, 43.76813], [145.82343, 44.571], [140.9182, 45.92937], [133.61399, 37.41], [129.2669, 34.87122], [122.26612, 25.98197], [123.92912, 17.8782], [155.16731, 23.60141], [145.82361, 43.38904]]]] } },
34202 { type: "Feature", properties: { iso1A2: "KE", iso1A3: "KEN", iso1N3: "404", wikidata: "Q114", nameEn: "Kenya", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["254"] }, geometry: { type: "MultiPolygon", coordinates: [[[[35.9419, 4.61933], [35.51424, 4.61643], [35.42366, 4.76969], [35.47843, 4.91872], [35.30992, 4.90402], [35.34151, 5.02364], [34.47601, 4.72162], [33.9873, 4.23316], [34.06046, 4.15235], [34.15429, 3.80464], [34.45815, 3.67385], [34.44922, 3.51627], [34.39112, 3.48802], [34.41794, 3.44342], [34.40006, 3.37949], [34.45815, 3.18319], [34.56242, 3.11478], [34.60114, 2.93034], [34.65774, 2.8753], [34.73967, 2.85447], [34.78137, 2.76223], [34.77244, 2.70272], [34.95267, 2.47209], [34.90947, 2.42447], [34.98692, 1.97348], [34.9899, 1.6668], [34.92734, 1.56109], [34.87819, 1.5596], [34.7918, 1.36752], [34.82606, 1.30944], [34.82606, 1.26626], [34.80223, 1.22754], [34.67562, 1.21265], [34.58029, 1.14712], [34.57427, 1.09868], [34.52369, 1.10692], [34.43349, 0.85254], [34.40041, 0.80266], [34.31516, 0.75693], [34.27345, 0.63182], [34.20196, 0.62289], [34.13493, 0.58118], [34.11408, 0.48884], [34.08727, 0.44713], [34.10067, 0.36372], [33.90936, 0.10581], [33.98449, -0.13079], [33.9264, -0.54188], [33.93107, -0.99298], [34.02286, -1.00779], [34.03084, -1.05101], [34.0824, -1.02264], [37.67199, -3.06222], [37.71745, -3.304], [37.5903, -3.42735], [37.63099, -3.50723], [37.75036, -3.54243], [37.81321, -3.69179], [39.21631, -4.67835], [39.44306, -4.93877], [39.62121, -4.68136], [41.75542, -1.85308], [41.56362, -1.66375], [41.56, -1.59812], [41.00099, -0.83068], [40.98767, 2.82959], [41.31368, 3.14314], [41.89488, 3.97375], [41.1754, 3.94079], [40.77498, 4.27683], [39.86043, 3.86974], [39.76808, 3.67058], [39.58339, 3.47434], [39.55132, 3.39634], [39.51551, 3.40895], [39.49444, 3.45521], [39.19954, 3.47834], [39.07736, 3.5267], [38.91938, 3.51198], [38.52336, 3.62551], [38.45812, 3.60445], [38.14168, 3.62487], [37.07724, 4.33503], [36.84474, 4.44518], [36.03924, 4.44406], [35.95449, 4.53244], [35.9419, 4.61933]]]] } },
34203 { type: "Feature", properties: { iso1A2: "KG", iso1A3: "KGZ", iso1N3: "417", wikidata: "Q813", nameEn: "Kyrgyzstan", groups: ["143", "142", "UN"], callingCodes: ["996"] }, geometry: { type: "MultiPolygon", coordinates: [[[[74.88756, 42.98612], [74.75, 42.99029], [74.70331, 43.02519], [74.64615, 43.05881], [74.57491, 43.13702], [74.22489, 43.24657], [73.55634, 43.03071], [73.50992, 42.82356], [73.44393, 42.43098], [71.88792, 42.83578], [71.62405, 42.76613], [71.53272, 42.8014], [71.2724, 42.77853], [71.22785, 42.69248], [71.17807, 42.67381], [71.15232, 42.60486], [70.97717, 42.50147], [70.85973, 42.30188], [70.94483, 42.26238], [71.13263, 42.28356], [71.28719, 42.18033], [70.69777, 41.92554], [70.17682, 41.5455], [70.48909, 41.40335], [70.67586, 41.47953], [70.78572, 41.36419], [70.77885, 41.24813], [70.86263, 41.23833], [70.9615, 41.16393], [71.02193, 41.19494], [71.11806, 41.15359], [71.25813, 41.18796], [71.27187, 41.11015], [71.34877, 41.16807], [71.40198, 41.09436], [71.46148, 41.13958], [71.43814, 41.19644], [71.46688, 41.31883], [71.57227, 41.29175], [71.6787, 41.42111], [71.65914, 41.49599], [71.73054, 41.54713], [71.71132, 41.43012], [71.76625, 41.4466], [71.83914, 41.3546], [71.91457, 41.2982], [71.85964, 41.19081], [72.07249, 41.11739], [72.10745, 41.15483], [72.16433, 41.16483], [72.17594, 41.15522], [72.14864, 41.13363], [72.1792, 41.10621], [72.21061, 41.05607], [72.17594, 41.02377], [72.18339, 40.99571], [72.324, 41.03381], [72.34026, 41.04539], [72.34757, 41.06104], [72.36138, 41.04384], [72.38511, 41.02785], [72.45206, 41.03018], [72.48742, 40.97136], [72.55109, 40.96046], [72.59136, 40.86947], [72.68157, 40.84942], [72.84291, 40.85512], [72.94454, 40.8094], [73.01869, 40.84681], [73.13267, 40.83512], [73.13412, 40.79122], [73.0612, 40.76678], [72.99133, 40.76457], [72.93296, 40.73089], [72.8722, 40.71111], [72.85372, 40.7116], [72.84754, 40.67229], [72.80137, 40.67856], [72.74866, 40.60873], [72.74894, 40.59592], [72.75982, 40.57273], [72.74862, 40.57131], [72.74768, 40.58051], [72.73995, 40.58409], [72.69579, 40.59778], [72.66713, 40.59076], [72.66713, 40.5219], [72.47795, 40.5532], [72.40517, 40.61917], [72.34406, 40.60144], [72.41714, 40.55736], [72.38384, 40.51535], [72.41513, 40.50856], [72.44191, 40.48222], [72.40346, 40.4007], [72.24368, 40.46091], [72.18648, 40.49893], [71.96401, 40.31907], [72.05464, 40.27586], [71.85002, 40.25647], [71.82646, 40.21872], [71.73054, 40.14818], [71.71719, 40.17886], [71.69621, 40.18492], [71.70569, 40.20391], [71.68386, 40.26984], [71.61931, 40.26775], [71.61725, 40.20615], [71.51549, 40.22986], [71.51215, 40.26943], [71.4246, 40.28619], [71.36663, 40.31593], [71.13042, 40.34106], [71.05901, 40.28765], [70.95789, 40.28761], [70.9818, 40.22392], [70.80495, 40.16813], [70.7928, 40.12797], [70.65827, 40.0981], [70.65946, 39.9878], [70.58912, 39.95211], [70.55033, 39.96619], [70.47557, 39.93216], [70.57384, 39.99394], [70.58297, 40.00891], [70.01283, 40.23288], [69.67001, 40.10639], [69.64704, 40.12165], [69.57615, 40.10524], [69.55555, 40.12296], [69.53794, 40.11833], [69.53855, 40.0887], [69.5057, 40.03277], [69.53615, 39.93991], [69.43557, 39.92877], [69.43134, 39.98431], [69.35649, 40.01994], [69.26938, 39.8127], [69.3594, 39.52516], [69.68677, 39.59281], [69.87491, 39.53882], [70.11111, 39.58223], [70.2869, 39.53141], [70.44757, 39.60128], [70.64087, 39.58792], [70.7854, 39.38933], [71.06418, 39.41586], [71.08752, 39.50704], [71.49814, 39.61397], [71.55856, 39.57588], [71.5517, 39.45722], [71.62688, 39.44056], [71.76816, 39.45456], [71.80164, 39.40631], [71.7522, 39.32031], [71.79202, 39.27355], [71.90601, 39.27674], [72.04059, 39.36704], [72.09689, 39.26823], [72.17242, 39.2661], [72.23834, 39.17248], [72.33173, 39.33093], [72.62027, 39.39696], [72.85934, 39.35116], [73.18454, 39.35536], [73.31912, 39.38615], [73.45096, 39.46677], [73.59831, 39.46425], [73.87018, 39.47879], [73.94683, 39.60733], [73.92354, 39.69565], [73.9051, 39.75073], [73.83006, 39.76136], [73.97049, 40.04378], [74.25533, 40.13191], [74.35063, 40.09742], [74.69875, 40.34668], [74.85996, 40.32857], [74.78168, 40.44886], [74.82013, 40.52197], [75.08243, 40.43945], [75.22834, 40.45382], [75.5854, 40.66874], [75.69663, 40.28642], [75.91361, 40.2948], [75.96168, 40.38064], [76.33659, 40.3482], [76.5261, 40.46114], [76.75681, 40.95354], [76.99302, 41.0696], [77.28004, 41.0033], [77.3693, 41.0375], [77.52723, 41.00227], [77.76206, 41.01574], [77.81287, 41.14307], [78.12873, 41.23091], [78.15757, 41.38565], [78.3732, 41.39603], [79.92977, 42.04113], [80.17842, 42.03211], [80.17807, 42.21166], [79.97364, 42.42816], [79.52921, 42.44778], [79.19763, 42.804], [78.91502, 42.76839], [78.48469, 42.89649], [75.82823, 42.94848], [75.72174, 42.79672], [75.29966, 42.86183], [75.22619, 42.85528], [74.88756, 42.98612]], [[70.74189, 39.86319], [70.63105, 39.77923], [70.59667, 39.83542], [70.54998, 39.85137], [70.52631, 39.86989], [70.53651, 39.89155], [70.74189, 39.86319]], [[71.86463, 39.98598], [71.84316, 39.95582], [71.7504, 39.93701], [71.71511, 39.96348], [71.78838, 40.01404], [71.86463, 39.98598]], [[71.21139, 40.03369], [71.1427, 39.95026], [71.23067, 39.93581], [71.16101, 39.88423], [71.10531, 39.91354], [71.04979, 39.89808], [71.10501, 39.95568], [71.09063, 39.99], [71.11668, 39.99291], [71.11037, 40.01984], [71.01035, 40.05481], [71.00236, 40.18154], [71.06305, 40.1771], [71.12218, 40.03052], [71.21139, 40.03369]]]] } },
34204 { type: "Feature", properties: { iso1A2: "KH", iso1A3: "KHM", iso1N3: "116", wikidata: "Q424", nameEn: "Cambodia", groups: ["035", "142", "UN"], callingCodes: ["855"] }, geometry: { type: "MultiPolygon", coordinates: [[[[105.87328, 11.55953], [105.81645, 11.56876], [105.80867, 11.60536], [105.8507, 11.66635], [105.88962, 11.67854], [105.95188, 11.63738], [106.00792, 11.7197], [106.02038, 11.77457], [106.06708, 11.77761], [106.13158, 11.73283], [106.18539, 11.75171], [106.26478, 11.72122], [106.30525, 11.67549], [106.37219, 11.69836], [106.44691, 11.66787], [106.45158, 11.68616], [106.41577, 11.76999], [106.44535, 11.8279], [106.44068, 11.86294], [106.4687, 11.86751], [106.4111, 11.97413], [106.70687, 11.96956], [106.79405, 12.0807], [106.92325, 12.06548], [106.99953, 12.08983], [107.15831, 12.27547], [107.34511, 12.33327], [107.42917, 12.24657], [107.4463, 12.29373], [107.55059, 12.36824], [107.5755, 12.52177], [107.55993, 12.7982], [107.49611, 12.88926], [107.49144, 13.01215], [107.62843, 13.3668], [107.61909, 13.52577], [107.53503, 13.73908], [107.45252, 13.78897], [107.46498, 13.91593], [107.44318, 13.99751], [107.38247, 13.99147], [107.35757, 14.02319], [107.37158, 14.07906], [107.33577, 14.11832], [107.40427, 14.24509], [107.39493, 14.32655], [107.44941, 14.41552], [107.48521, 14.40346], [107.52569, 14.54665], [107.52102, 14.59034], [107.55371, 14.628], [107.54361, 14.69092], [107.47238, 14.61523], [107.44435, 14.52785], [107.37897, 14.54443], [107.3276, 14.58812], [107.29803, 14.58963], [107.26534, 14.54292], [107.256, 14.48716], [107.21241, 14.48716], [107.17038, 14.41782], [107.09722, 14.3937], [107.03962, 14.45099], [107.04585, 14.41782], [106.98825, 14.36806], [106.9649, 14.3198], [106.90574, 14.33639], [106.8497, 14.29416], [106.80767, 14.31226], [106.73762, 14.42687], [106.63333, 14.44194], [106.59908, 14.50977], [106.57106, 14.50525], [106.54148, 14.59565], [106.50723, 14.58963], [106.45898, 14.55045], [106.47766, 14.50977], [106.43874, 14.52032], [106.40916, 14.45249], [106.32355, 14.44043], [106.25194, 14.48415], [106.21302, 14.36203], [106.00131, 14.36957], [105.99509, 14.32734], [106.02311, 14.30623], [106.04801, 14.20363], [106.10872, 14.18401], [106.11962, 14.11307], [106.18656, 14.06324], [106.16632, 14.01794], [106.10094, 13.98471], [106.10405, 13.9137], [105.90791, 13.92881], [105.78182, 14.02247], [105.78338, 14.08438], [105.5561, 14.15684], [105.44869, 14.10703], [105.36775, 14.09948], [105.2759, 14.17496], [105.20894, 14.34967], [105.17748, 14.34432], [105.14012, 14.23873], [105.08408, 14.20402], [105.02804, 14.23722], [104.97667, 14.38806], [104.69335, 14.42726], [104.55014, 14.36091], [104.27616, 14.39861], [103.93836, 14.3398], [103.70175, 14.38052], [103.71109, 14.4348], [103.53518, 14.42575], [103.39353, 14.35639], [103.16469, 14.33075], [102.93275, 14.19044], [102.91251, 14.01531], [102.77864, 13.93374], [102.72727, 13.77806], [102.56848, 13.69366], [102.5481, 13.6589], [102.58635, 13.6286], [102.62483, 13.60883], [102.57573, 13.60461], [102.5358, 13.56933], [102.44601, 13.5637], [102.36859, 13.57488], [102.33828, 13.55613], [102.361, 13.50551], [102.35563, 13.47307], [102.35692, 13.38274], [102.34611, 13.35618], [102.36001, 13.31142], [102.36146, 13.26006], [102.43422, 13.09061], [102.46011, 13.08057], [102.52275, 12.99813], [102.48694, 12.97537], [102.49335, 12.92711], [102.53053, 12.77506], [102.4994, 12.71736], [102.51963, 12.66117], [102.57567, 12.65358], [102.7796, 12.43781], [102.78116, 12.40284], [102.73134, 12.37091], [102.70176, 12.1686], [102.77026, 12.06815], [102.78427, 11.98746], [102.83957, 11.8519], [102.90973, 11.75613], [102.91449, 11.65512], [102.52395, 11.25257], [102.47649, 9.66162], [103.99198, 10.48391], [104.43778, 10.42386], [104.47963, 10.43046], [104.49869, 10.4057], [104.59018, 10.53073], [104.87933, 10.52833], [104.95094, 10.64003], [105.09571, 10.72722], [105.02722, 10.89236], [105.08326, 10.95656], [105.11449, 10.96332], [105.34011, 10.86179], [105.42884, 10.96878], [105.50045, 10.94586], [105.77751, 11.03671], [105.86376, 10.89839], [105.84603, 10.85873], [105.93403, 10.83853], [105.94535, 10.9168], [106.06708, 10.8098], [106.18539, 10.79451], [106.14301, 10.98176], [106.20095, 10.97795], [106.1757, 11.07301], [106.1527, 11.10476], [106.10444, 11.07879], [105.86782, 11.28343], [105.88962, 11.43605], [105.87328, 11.55953]]]] } },
34205 { type: "Feature", properties: { iso1A2: "KI", iso1A3: "KIR", iso1N3: "296", wikidata: "Q710", nameEn: "Kiribati", groups: ["057", "009", "UN"], driveSide: "left", callingCodes: ["686"] }, geometry: { type: "MultiPolygon", coordinates: [[[[169, 3.9], [169, -3.5], [178, -3.5], [178, 3.9], [169, 3.9]]], [[[-161.06795, 5.2462], [-158.12991, -1.86122], [-175.33482, -1.40631], [-175.31804, -7.54825], [-156.50903, -7.4975], [-156.48634, -15.52824], [-135.59706, -4.70473], [-161.06795, 5.2462]]]] } },
34206 { type: "Feature", properties: { iso1A2: "KM", iso1A3: "COM", iso1N3: "174", wikidata: "Q970", nameEn: "Comoros", groups: ["014", "202", "002", "UN"], callingCodes: ["269"] }, geometry: { type: "MultiPolygon", coordinates: [[[[42.63904, -10.02522], [43.28731, -13.97126], [45.4971, -11.75965], [42.63904, -10.02522]]]] } },
34207 { type: "Feature", properties: { iso1A2: "KN", iso1A3: "KNA", iso1N3: "659", wikidata: "Q763", nameEn: "St. Kitts and Nevis", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 869"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-62.29333, 17.43155], [-62.76692, 17.64353], [-63.09677, 17.21372], [-62.63813, 16.65446], [-62.29333, 17.43155]]]] } },
34208 { type: "Feature", properties: { iso1A2: "KP", iso1A3: "PRK", iso1N3: "408", wikidata: "Q423", nameEn: "North Korea", groups: ["030", "142", "UN"], callingCodes: ["850"] }, geometry: { type: "MultiPolygon", coordinates: [[[[130.26095, 42.9027], [130.09764, 42.91425], [130.12957, 42.98361], [129.96409, 42.97306], [129.95082, 43.01051], [129.8865, 43.00395], [129.85261, 42.96494], [129.83277, 42.86746], [129.80719, 42.79218], [129.7835, 42.76521], [129.77183, 42.69435], [129.75294, 42.59409], [129.72541, 42.43739], [129.60482, 42.44461], [129.54701, 42.37254], [129.42882, 42.44702], [129.28541, 42.41574], [129.22423, 42.3553], [129.22285, 42.26491], [129.15178, 42.17224], [128.96068, 42.06657], [128.94007, 42.03537], [128.04487, 42.01769], [128.15119, 41.74568], [128.30716, 41.60322], [128.20061, 41.40895], [128.18546, 41.41279], [128.12967, 41.37931], [128.03311, 41.39232], [128.02633, 41.42103], [127.92943, 41.44291], [127.29712, 41.49473], [127.17841, 41.59714], [126.90729, 41.79955], [126.60631, 41.65565], [126.53189, 41.35206], [126.242, 41.15454], [126.00335, 40.92835], [125.76869, 40.87908], [125.71172, 40.85223], [124.86913, 40.45387], [124.40719, 40.13655], [124.38556, 40.11047], [124.3322, 40.05573], [124.37089, 40.03004], [124.35029, 39.95639], [124.23201, 39.9248], [124.17532, 39.8232], [123.90497, 38.79949], [123.85601, 37.49093], [124.67666, 38.05679], [124.84224, 37.977], [124.87921, 37.80827], [125.06408, 37.66334], [125.37112, 37.62643], [125.81159, 37.72949], [126.13074, 37.70512], [126.18776, 37.74728], [126.19097, 37.81462], [126.24402, 37.83113], [126.43239, 37.84095], [126.46818, 37.80873], [126.56709, 37.76857], [126.59918, 37.76364], [126.66067, 37.7897], [126.68793, 37.83728], [126.68793, 37.9175], [126.67023, 37.95852], [126.84961, 38.0344], [126.88106, 38.10246], [126.95887, 38.1347], [126.95338, 38.17735], [127.04479, 38.25518], [127.15749, 38.30722], [127.38727, 38.33227], [127.49672, 38.30647], [127.55013, 38.32257], [128.02917, 38.31861], [128.27652, 38.41657], [128.31105, 38.58462], [128.37487, 38.62345], [128.65655, 38.61914], [131.95041, 41.5445], [130.65022, 42.32281], [130.66367, 42.38024], [130.64181, 42.41422], [130.60805, 42.4317], [130.56835, 42.43281], [130.55143, 42.52158], [130.50123, 42.61636], [130.44361, 42.54849], [130.41826, 42.6011], [130.2385, 42.71127], [130.23068, 42.80125], [130.26095, 42.9027]]]] } },
34209 { type: "Feature", properties: { iso1A2: "KR", iso1A3: "KOR", iso1N3: "410", wikidata: "Q884", nameEn: "South Korea", groups: ["030", "142", "UN"], callingCodes: ["82"] }, geometry: { type: "MultiPolygon", coordinates: [[[[133.11729, 37.53115], [128.65655, 38.61914], [128.37487, 38.62345], [128.31105, 38.58462], [128.27652, 38.41657], [128.02917, 38.31861], [127.55013, 38.32257], [127.49672, 38.30647], [127.38727, 38.33227], [127.15749, 38.30722], [127.04479, 38.25518], [126.95338, 38.17735], [126.95887, 38.1347], [126.88106, 38.10246], [126.84961, 38.0344], [126.67023, 37.95852], [126.68793, 37.9175], [126.68793, 37.83728], [126.66067, 37.7897], [126.59918, 37.76364], [126.56709, 37.76857], [126.46818, 37.80873], [126.43239, 37.84095], [126.24402, 37.83113], [126.19097, 37.81462], [126.18776, 37.74728], [126.13074, 37.70512], [125.81159, 37.72949], [125.37112, 37.62643], [125.06408, 37.66334], [124.87921, 37.80827], [124.84224, 37.977], [124.67666, 38.05679], [123.85601, 37.49093], [122.80525, 33.30571], [125.99728, 32.63328], [129.2669, 34.87122], [133.11729, 37.53115]]]] } },
34210 { type: "Feature", properties: { iso1A2: "KW", iso1A3: "KWT", iso1N3: "414", wikidata: "Q817", nameEn: "Kuwait", groups: ["145", "142", "UN"], callingCodes: ["965"] }, geometry: { type: "MultiPolygon", coordinates: [[[[49.00421, 28.81495], [48.59531, 29.66815], [48.40479, 29.85763], [48.17332, 30.02448], [48.06782, 30.02906], [48.01114, 29.98906], [47.7095, 30.10453], [47.37192, 30.10421], [47.15166, 30.01044], [46.89695, 29.50584], [46.5527, 29.10283], [47.46202, 29.0014], [47.58376, 28.83382], [47.59863, 28.66798], [47.70561, 28.5221], [48.42991, 28.53628], [49.00421, 28.81495]]]] } },
34211 { type: "Feature", properties: { iso1A2: "KY", iso1A3: "CYM", iso1N3: "136", wikidata: "Q5785", nameEn: "Cayman Islands", country: "GB", groups: ["BOTS", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 345"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-82.11509, 19.60401], [-80.36068, 18.11751], [-79.32727, 20.06742], [-82.11509, 19.60401]]]] } },
34212 { type: "Feature", properties: { iso1A2: "KZ", iso1A3: "KAZ", iso1N3: "398", wikidata: "Q232", nameEn: "Kazakhstan", groups: ["143", "142", "UN"], callingCodes: ["7"] }, geometry: { type: "MultiPolygon", coordinates: [[[[68.90865, 55.38148], [68.19206, 55.18823], [68.26661, 55.09226], [68.21308, 54.98645], [65.20174, 54.55216], [65.24663, 54.35721], [65.11033, 54.33028], [64.97216, 54.4212], [63.97686, 54.29763], [64.02715, 54.22679], [63.91224, 54.20013], [63.80604, 54.27079], [62.58651, 54.05871], [62.56876, 53.94047], [62.45931, 53.90737], [62.38535, 54.03961], [62.00966, 54.04134], [62.03913, 53.94768], [61.65318, 54.02445], [61.56941, 53.95703], [61.47603, 54.08048], [61.3706, 54.08464], [61.26863, 53.92797], [60.99796, 53.93699], [61.14283, 53.90063], [61.22574, 53.80268], [60.90626, 53.62937], [61.55706, 53.57144], [61.57185, 53.50112], [61.37957, 53.45887], [61.29082, 53.50992], [61.14291, 53.41481], [61.19024, 53.30536], [62.14574, 53.09626], [62.12799, 52.99133], [62.0422, 52.96105], [61.23462, 53.03227], [61.05842, 52.92217], [60.71989, 52.75923], [60.71693, 52.66245], [60.84118, 52.63912], [60.84709, 52.52228], [60.98021, 52.50068], [61.05417, 52.35096], [60.78201, 52.22067], [60.72581, 52.15538], [60.48915, 52.15175], [60.19925, 51.99173], [59.99809, 51.98263], [60.09867, 51.87135], [60.50986, 51.7964], [60.36787, 51.66815], [60.5424, 51.61675], [60.92401, 51.61124], [60.95655, 51.48615], [61.50677, 51.40687], [61.55114, 51.32746], [61.6813, 51.25716], [61.56889, 51.23679], [61.4431, 50.80679], [60.81833, 50.6629], [60.31914, 50.67705], [60.17262, 50.83312], [60.01288, 50.8163], [59.81172, 50.54451], [59.51886, 50.49937], [59.48928, 50.64216], [58.87974, 50.70852], [58.3208, 51.15151], [57.75578, 51.13852], [57.74986, 50.93017], [57.44221, 50.88354], [57.17302, 51.11253], [56.17906, 50.93204], [56.11398, 50.7471], [55.67774, 50.54508], [54.72067, 51.03261], [54.56685, 51.01958], [54.71476, 50.61214], [54.55797, 50.52006], [54.41894, 50.61214], [54.46331, 50.85554], [54.12248, 51.11542], [53.69299, 51.23466], [53.46165, 51.49445], [52.54329, 51.48444], [52.36119, 51.74161], [51.8246, 51.67916], [51.77431, 51.49536], [51.301, 51.48799], [51.26254, 51.68466], [50.59695, 51.61859], [50.26859, 51.28677], [49.97277, 51.2405], [49.76866, 51.11067], [49.39001, 51.09396], [49.41959, 50.85927], [49.12673, 50.78639], [48.86936, 50.61589], [48.57946, 50.63278], [48.90782, 50.02281], [48.68352, 49.89546], [48.42564, 49.82283], [48.24519, 49.86099], [48.10044, 50.09242], [47.58551, 50.47867], [47.30448, 50.30894], [47.34589, 50.09308], [47.18319, 49.93721], [46.9078, 49.86707], [46.78398, 49.34026], [47.04658, 49.19834], [47.00857, 49.04921], [46.78392, 48.95352], [46.49011, 48.43019], [47.11516, 48.27188], [47.12107, 47.83687], [47.38731, 47.68176], [47.41689, 47.83687], [47.64973, 47.76559], [48.15348, 47.74545], [48.45173, 47.40818], [48.52326, 47.4102], [49.01136, 46.72716], [48.51142, 46.69268], [48.54988, 46.56267], [49.16518, 46.38542], [49.32259, 46.26944], [49.88945, 46.04554], [49.2134, 44.84989], [52.26048, 41.69249], [52.47884, 41.78034], [52.97575, 42.1308], [54.20635, 42.38477], [54.95182, 41.92424], [55.45471, 41.25609], [56.00314, 41.32584], [55.97584, 44.99322], [55.97584, 44.99328], [55.97584, 44.99338], [55.97584, 44.99343], [55.97584, 44.99348], [55.97584, 44.99353], [55.97584, 44.99359], [55.97584, 44.99369], [55.97584, 44.99374], [55.97584, 44.99384], [55.97584, 44.9939], [55.97584, 44.994], [55.97584, 44.99405], [55.97584, 44.99415], [55.97584, 44.99421], [55.97584, 44.99426], [55.97584, 44.99431], [55.97584, 44.99436], [55.97584, 44.99441], [55.97594, 44.99446], [55.97605, 44.99452], [55.97605, 44.99457], [55.97605, 44.99462], [55.97605, 44.99467], [55.97605, 44.99477], [55.97615, 44.99477], [55.97615, 44.99483], [55.97615, 44.99493], [55.97615, 44.99498], [55.97615, 44.99503], [55.97615, 44.99508], [55.97625, 44.99514], [55.97636, 44.99519], [55.97636, 44.99524], [55.97646, 44.99529], [55.97646, 44.99534], [55.97656, 44.99539], [55.97667, 44.99545], [55.97677, 44.9955], [55.97677, 44.99555], [55.97677, 44.9956], [55.97687, 44.9956], [55.97698, 44.99565], [55.97698, 44.9957], [55.97708, 44.99576], [55.97718, 44.99581], [55.97729, 44.99586], [55.97739, 44.99586], [55.97739, 44.99591], [55.97749, 44.99591], [55.9776, 44.99591], [55.9777, 44.99596], [55.9777, 44.99601], [55.9778, 44.99607], [55.97791, 44.99607], [55.97801, 44.99607], [55.97801, 44.99612], [55.97811, 44.99617], [55.97822, 44.99617], [55.97832, 44.99622], [55.97842, 44.99622], [58.59711, 45.58671], [61.01475, 44.41383], [62.01711, 43.51008], [63.34656, 43.64003], [64.53885, 43.56941], [64.96464, 43.74748], [65.18666, 43.48835], [65.53277, 43.31856], [65.85194, 42.85481], [66.09482, 42.93426], [66.00546, 41.94455], [66.53302, 41.87388], [66.69129, 41.1311], [67.9644, 41.14611], [67.98511, 41.02794], [68.08273, 41.08148], [68.1271, 41.0324], [67.96736, 40.83798], [68.49983, 40.56437], [68.63, 40.59358], [68.58444, 40.91447], [68.49983, 40.99669], [68.62221, 41.03019], [68.65662, 40.93861], [68.73945, 40.96989], [68.7217, 41.05025], [69.01308, 41.22804], [69.05006, 41.36183], [69.15137, 41.43078], [69.17701, 41.43769], [69.18528, 41.45175], [69.20439, 41.45391], [69.22671, 41.46298], [69.23332, 41.45847], [69.25059, 41.46693], [69.29778, 41.43673], [69.35554, 41.47211], [69.37468, 41.46555], [69.45081, 41.46246], [69.39485, 41.51518], [69.45751, 41.56863], [69.49545, 41.545], [70.94483, 42.26238], [70.85973, 42.30188], [70.97717, 42.50147], [71.15232, 42.60486], [71.17807, 42.67381], [71.22785, 42.69248], [71.2724, 42.77853], [71.53272, 42.8014], [71.62405, 42.76613], [71.88792, 42.83578], [73.44393, 42.43098], [73.50992, 42.82356], [73.55634, 43.03071], [74.22489, 43.24657], [74.57491, 43.13702], [74.64615, 43.05881], [74.70331, 43.02519], [74.75, 42.99029], [74.88756, 42.98612], [75.22619, 42.85528], [75.29966, 42.86183], [75.72174, 42.79672], [75.82823, 42.94848], [78.48469, 42.89649], [78.91502, 42.76839], [79.19763, 42.804], [79.52921, 42.44778], [79.97364, 42.42816], [80.17807, 42.21166], [80.26841, 42.23797], [80.16892, 42.61137], [80.26886, 42.8366], [80.38169, 42.83142], [80.58999, 42.9011], [80.3735, 43.01557], [80.62913, 43.141], [80.78817, 43.14235], [80.77771, 43.30065], [80.69718, 43.32589], [80.75156, 43.44948], [80.40031, 44.10986], [80.40229, 44.23319], [80.38384, 44.63073], [79.8987, 44.89957], [80.11169, 45.03352], [81.73278, 45.3504], [82.51374, 45.1755], [82.58474, 45.40027], [82.21792, 45.56619], [83.04622, 47.19053], [83.92184, 46.98912], [84.73077, 47.01394], [84.93995, 46.87399], [85.22443, 47.04816], [85.54294, 47.06171], [85.69696, 47.2898], [85.61067, 47.49753], [85.5169, 48.05493], [85.73581, 48.3939], [86.38069, 48.46064], [86.75343, 48.70331], [86.73568, 48.99918], [86.87238, 49.12432], [87.28386, 49.11626], [87.31465, 49.23603], [87.03071, 49.25142], [86.82606, 49.51796], [86.61307, 49.60239], [86.79056, 49.74787], [86.63674, 49.80136], [86.18709, 49.50259], [85.24047, 49.60239], [84.99198, 50.06793], [84.29385, 50.27257], [83.8442, 50.87375], [83.14607, 51.00796], [82.55443, 50.75412], [81.94999, 50.79307], [81.46581, 50.77658], [81.41248, 50.97524], [81.06091, 50.94833], [81.16999, 51.15662], [80.80318, 51.28262], [80.44819, 51.20855], [80.4127, 50.95581], [80.08138, 50.77658], [79.11255, 52.01171], [77.90383, 53.29807], [76.54243, 53.99329], [76.44076, 54.16017], [76.82266, 54.1798], [76.91052, 54.4677], [75.3668, 54.07439], [75.43398, 53.98652], [75.07405, 53.80831], [73.39218, 53.44623], [73.25412, 53.61532], [73.68921, 53.86522], [73.74778, 54.07194], [73.37963, 53.96132], [72.71026, 54.1161], [72.43415, 53.92685], [72.17477, 54.36303], [71.96141, 54.17736], [71.10379, 54.13326], [71.08706, 54.33376], [71.24185, 54.64965], [71.08288, 54.71253], [70.96009, 55.10558], [70.76493, 55.3027], [70.19179, 55.1476], [69.74917, 55.35545], [69.34224, 55.36344], [68.90865, 55.38148]]]] } },
34213 { type: "Feature", properties: { iso1A2: "LA", iso1A3: "LAO", iso1N3: "418", wikidata: "Q819", nameEn: "Laos", groups: ["035", "142", "UN"], callingCodes: ["856"] }, geometry: { type: "MultiPolygon", coordinates: [[[[102.1245, 22.43372], [102.03633, 22.46164], [101.98487, 22.42766], [101.91344, 22.44417], [101.90714, 22.38688], [101.86828, 22.38397], [101.7685, 22.50337], [101.68973, 22.46843], [101.61306, 22.27515], [101.56789, 22.28876], [101.53638, 22.24794], [101.60675, 22.13513], [101.57525, 22.13026], [101.62566, 21.96574], [101.7791, 21.83019], [101.74555, 21.72852], [101.83257, 21.61562], [101.80001, 21.57461], [101.7475, 21.5873], [101.7727, 21.51794], [101.74224, 21.48276], [101.74014, 21.30967], [101.84412, 21.25291], [101.83887, 21.20983], [101.76745, 21.21571], [101.79266, 21.19025], [101.7622, 21.14813], [101.70548, 21.14911], [101.66977, 21.20004], [101.60886, 21.17947], [101.59491, 21.18621], [101.6068, 21.23329], [101.54563, 21.25668], [101.29326, 21.17254], [101.2229, 21.23271], [101.26912, 21.36482], [101.19349, 21.41959], [101.2124, 21.56422], [101.15156, 21.56129], [101.16198, 21.52808], [101.00234, 21.39612], [100.80173, 21.2934], [100.72716, 21.31786], [100.63578, 21.05639], [100.55281, 21.02796], [100.50974, 20.88574], [100.64628, 20.88279], [100.60112, 20.8347], [100.51079, 20.82194], [100.36375, 20.82783], [100.1957, 20.68247], [100.08404, 20.36626], [100.09999, 20.31614], [100.09337, 20.26293], [100.11785, 20.24787], [100.1712, 20.24324], [100.16668, 20.2986], [100.22076, 20.31598], [100.25769, 20.3992], [100.33383, 20.4028], [100.37439, 20.35156], [100.41473, 20.25625], [100.44992, 20.23644], [100.4537, 20.19971], [100.47567, 20.19133], [100.51052, 20.14928], [100.55218, 20.17741], [100.58808, 20.15791], [100.5094, 19.87904], [100.398, 19.75047], [100.49604, 19.53504], [100.58219, 19.49164], [100.64606, 19.55884], [100.77231, 19.48324], [100.90302, 19.61901], [101.08928, 19.59748], [101.26545, 19.59242], [101.26991, 19.48324], [101.21347, 19.46223], [101.20604, 19.35296], [101.24911, 19.33334], [101.261, 19.12717], [101.35606, 19.04716], [101.25803, 18.89545], [101.22832, 18.73377], [101.27585, 18.68875], [101.06047, 18.43247], [101.18227, 18.34367], [101.15108, 18.25624], [101.19118, 18.2125], [101.1793, 18.0544], [101.02185, 17.87637], [100.96541, 17.57926], [101.15108, 17.47586], [101.44667, 17.7392], [101.72294, 17.92867], [101.78087, 18.07559], [101.88485, 18.02474], [102.11359, 18.21532], [102.45523, 17.97106], [102.59234, 17.96127], [102.60971, 17.95411], [102.61432, 17.92273], [102.5896, 17.84889], [102.59485, 17.83537], [102.68194, 17.80151], [102.69946, 17.81686], [102.67543, 17.84529], [102.68538, 17.86653], [102.75954, 17.89561], [102.79044, 17.93612], [102.81988, 17.94233], [102.86323, 17.97531], [102.95812, 18.0054], [102.9912, 17.9949], [103.01998, 17.97095], [103.0566, 18.00144], [103.07823, 18.03833], [103.07343, 18.12351], [103.1493, 18.17799], [103.14994, 18.23172], [103.17093, 18.2618], [103.29757, 18.30475], [103.23818, 18.34875], [103.24779, 18.37807], [103.30977, 18.4341], [103.41044, 18.4486], [103.47773, 18.42841], [103.60957, 18.40528], [103.699, 18.34125], [103.82449, 18.33979], [103.85642, 18.28666], [103.93916, 18.33914], [103.97725, 18.33631], [104.06533, 18.21656], [104.10927, 18.10826], [104.21776, 17.99335], [104.2757, 17.86139], [104.35432, 17.82871], [104.45404, 17.66788], [104.69867, 17.53038], [104.80061, 17.39367], [104.80716, 17.19025], [104.73712, 17.01404], [104.7373, 16.91125], [104.76442, 16.84752], [104.7397, 16.81005], [104.76099, 16.69302], [104.73349, 16.565], [104.88057, 16.37311], [105.00262, 16.25627], [105.06204, 16.09792], [105.42001, 16.00657], [105.38508, 15.987], [105.34115, 15.92737], [105.37959, 15.84074], [105.42285, 15.76971], [105.46573, 15.74742], [105.61756, 15.68792], [105.60446, 15.53301], [105.58191, 15.41031], [105.47635, 15.3796], [105.4692, 15.33709], [105.50662, 15.32054], [105.58043, 15.32724], [105.46661, 15.13132], [105.61162, 15.00037], [105.5121, 14.80802], [105.53864, 14.55731], [105.43783, 14.43865], [105.20894, 14.34967], [105.2759, 14.17496], [105.36775, 14.09948], [105.44869, 14.10703], [105.5561, 14.15684], [105.78338, 14.08438], [105.78182, 14.02247], [105.90791, 13.92881], [106.10405, 13.9137], [106.10094, 13.98471], [106.16632, 14.01794], [106.18656, 14.06324], [106.11962, 14.11307], [106.10872, 14.18401], [106.04801, 14.20363], [106.02311, 14.30623], [105.99509, 14.32734], [106.00131, 14.36957], [106.21302, 14.36203], [106.25194, 14.48415], [106.32355, 14.44043], [106.40916, 14.45249], [106.43874, 14.52032], [106.47766, 14.50977], [106.45898, 14.55045], [106.50723, 14.58963], [106.54148, 14.59565], [106.57106, 14.50525], [106.59908, 14.50977], [106.63333, 14.44194], [106.73762, 14.42687], [106.80767, 14.31226], [106.8497, 14.29416], [106.90574, 14.33639], [106.9649, 14.3198], [106.98825, 14.36806], [107.04585, 14.41782], [107.03962, 14.45099], [107.09722, 14.3937], [107.17038, 14.41782], [107.21241, 14.48716], [107.256, 14.48716], [107.26534, 14.54292], [107.29803, 14.58963], [107.3276, 14.58812], [107.37897, 14.54443], [107.44435, 14.52785], [107.47238, 14.61523], [107.54361, 14.69092], [107.51579, 14.79282], [107.59285, 14.87795], [107.48277, 14.93751], [107.46516, 15.00982], [107.61486, 15.0566], [107.61926, 15.13949], [107.58844, 15.20111], [107.62587, 15.2266], [107.60605, 15.37524], [107.62367, 15.42193], [107.53341, 15.40496], [107.50699, 15.48771], [107.3815, 15.49832], [107.34408, 15.62345], [107.27583, 15.62769], [107.27143, 15.71459], [107.21859, 15.74638], [107.21419, 15.83747], [107.34188, 15.89464], [107.39471, 15.88829], [107.46296, 16.01106], [107.44975, 16.08511], [107.33968, 16.05549], [107.25822, 16.13587], [107.14595, 16.17816], [107.15035, 16.26271], [107.09091, 16.3092], [107.02597, 16.31132], [106.97385, 16.30204], [106.96638, 16.34938], [106.88067, 16.43594], [106.88727, 16.52671], [106.84104, 16.55415], [106.74418, 16.41904], [106.65832, 16.47816], [106.66052, 16.56892], [106.61477, 16.60713], [106.58267, 16.6012], [106.59013, 16.62259], [106.55485, 16.68704], [106.55265, 16.86831], [106.52183, 16.87884], [106.51963, 16.92097], [106.54824, 16.92729], [106.55045, 17.0031], [106.50862, 16.9673], [106.43597, 17.01362], [106.31929, 17.20509], [106.29287, 17.3018], [106.24444, 17.24714], [106.18991, 17.28227], [106.09019, 17.36399], [105.85744, 17.63221], [105.76612, 17.67147], [105.60381, 17.89356], [105.64784, 17.96687], [105.46292, 18.22008], [105.38366, 18.15315], [105.15942, 18.38691], [105.10408, 18.43533], [105.1327, 18.58355], [105.19654, 18.64196], [105.12829, 18.70453], [104.64617, 18.85668], [104.5361, 18.97747], [103.87125, 19.31854], [104.06058, 19.43484], [104.10832, 19.51575], [104.05617, 19.61743], [104.06498, 19.66926], [104.23229, 19.70242], [104.41281, 19.70035], [104.53169, 19.61743], [104.64837, 19.62365], [104.68359, 19.72729], [104.8355, 19.80395], [104.8465, 19.91783], [104.9874, 20.09573], [104.91695, 20.15567], [104.86852, 20.14121], [104.61315, 20.24452], [104.62195, 20.36633], [104.72102, 20.40554], [104.66158, 20.47774], [104.47886, 20.37459], [104.40621, 20.3849], [104.38199, 20.47155], [104.63957, 20.6653], [104.27412, 20.91433], [104.11121, 20.96779], [103.98024, 20.91531], [103.82282, 20.8732], [103.73478, 20.6669], [103.68633, 20.66324], [103.45737, 20.82382], [103.38032, 20.79501], [103.21497, 20.89832], [103.12055, 20.89994], [103.03469, 21.05821], [102.97745, 21.05821], [102.89825, 21.24707], [102.80794, 21.25736], [102.88939, 21.3107], [102.94223, 21.46034], [102.86297, 21.4255], [102.98846, 21.58936], [102.97965, 21.74076], [102.86077, 21.71213], [102.85637, 21.84501], [102.81894, 21.83888], [102.82115, 21.73667], [102.74189, 21.66713], [102.67145, 21.65894], [102.62301, 21.91447], [102.49092, 21.99002], [102.51734, 22.02676], [102.18712, 22.30403], [102.14099, 22.40092], [102.1245, 22.43372]]]] } },
34214 { type: "Feature", properties: { iso1A2: "LB", iso1A3: "LBN", iso1N3: "422", wikidata: "Q822", nameEn: "Lebanon", aliases: ["RL"], groups: ["145", "142", "UN"], callingCodes: ["961"] }, geometry: { type: "MultiPolygon", coordinates: [[[[35.94816, 33.47886], [35.94465, 33.52774], [36.05723, 33.57904], [35.9341, 33.6596], [36.06778, 33.82927], [36.14517, 33.85118], [36.3967, 33.83365], [36.38263, 33.86579], [36.28589, 33.91981], [36.41078, 34.05253], [36.50576, 34.05982], [36.5128, 34.09916], [36.62537, 34.20251], [36.59195, 34.2316], [36.58667, 34.27667], [36.60778, 34.31009], [36.56556, 34.31881], [36.53039, 34.3798], [36.55853, 34.41609], [36.46179, 34.46541], [36.4442, 34.50165], [36.34745, 34.5002], [36.3369, 34.52629], [36.39846, 34.55672], [36.41429, 34.61175], [36.45299, 34.59438], [36.46003, 34.6378], [36.42941, 34.62505], [36.35384, 34.65447], [36.35135, 34.68516], [36.32399, 34.69334], [36.29165, 34.62991], [35.98718, 34.64977], [35.97386, 34.63322], [35.48515, 34.70851], [34.78515, 33.20368], [35.10645, 33.09318], [35.1924, 33.08743], [35.31429, 33.10515], [35.35223, 33.05617], [35.43059, 33.06659], [35.448, 33.09264], [35.50272, 33.09056], [35.50335, 33.114], [35.52573, 33.11921], [35.54228, 33.19865], [35.5362, 33.23196], [35.54808, 33.236], [35.54544, 33.25513], [35.55555, 33.25844], [35.56523, 33.28969], [35.58326, 33.28381], [35.58502, 33.26653], [35.62283, 33.24226], [35.62019, 33.27278], [35.77477, 33.33609], [35.81324, 33.36354], [35.82577, 33.40479], [35.88668, 33.43183], [35.94816, 33.47886]]]] } },
34215 { type: "Feature", properties: { iso1A2: "LC", iso1A3: "LCA", iso1N3: "662", wikidata: "Q760", nameEn: "St. Lucia", aliases: ["WL"], groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 758"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-59.95997, 14.20285], [-61.69315, 14.26451], [-59.94058, 12.34011], [-59.95997, 14.20285]]]] } },
34216 { type: "Feature", properties: { iso1A2: "LI", iso1A3: "LIE", iso1N3: "438", wikidata: "Q347", nameEn: "Liechtenstein", aliases: ["FL"], groups: ["155", "150", "UN"], callingCodes: ["423"] }, geometry: { type: "MultiPolygon", coordinates: [[[[9.60717, 47.06091], [9.61216, 47.07732], [9.63395, 47.08443], [9.62623, 47.14685], [9.56539, 47.17124], [9.58264, 47.20673], [9.56981, 47.21926], [9.55176, 47.22585], [9.56766, 47.24281], [9.53116, 47.27029], [9.52406, 47.24959], [9.50318, 47.22153], [9.4891, 47.19346], [9.48774, 47.17402], [9.51044, 47.13727], [9.52089, 47.10019], [9.51362, 47.08505], [9.47139, 47.06402], [9.47548, 47.05257], [9.54041, 47.06495], [9.55721, 47.04762], [9.60717, 47.06091]]]] } },
34217 { type: "Feature", properties: { iso1A2: "LK", iso1A3: "LKA", iso1N3: "144", wikidata: "Q854", nameEn: "Sri Lanka", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["94"] }, geometry: { type: "MultiPolygon", coordinates: [[[[76.59015, 5.591], [85.15017, 5.21497], [80.48418, 10.20786], [79.42124, 9.80115], [79.50447, 8.91876], [76.59015, 5.591]]]] } },
34218 { type: "Feature", properties: { iso1A2: "LR", iso1A3: "LBR", iso1N3: "430", wikidata: "Q1014", nameEn: "Liberia", groups: ["011", "202", "002", "UN"], callingCodes: ["231"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-8.47114, 7.55676], [-8.55874, 7.62525], [-8.55874, 7.70167], [-8.67814, 7.69428], [-8.72789, 7.51429], [-8.8448, 7.35149], [-8.85724, 7.26019], [-8.93435, 7.2824], [-9.09107, 7.1985], [-9.18311, 7.30461], [-9.20798, 7.38109], [-9.305, 7.42056], [-9.41943, 7.41809], [-9.48161, 7.37122], [-9.37465, 7.62032], [-9.35724, 7.74111], [-9.44928, 7.9284], [-9.41445, 8.02448], [-9.50898, 8.18455], [-9.47415, 8.35195], [-9.77763, 8.54633], [-10.05873, 8.42578], [-10.05375, 8.50697], [-10.14579, 8.52665], [-10.203, 8.47991], [-10.27575, 8.48711], [-10.30084, 8.30008], [-10.31635, 8.28554], [-10.29839, 8.21283], [-10.35227, 8.15223], [-10.45023, 8.15627], [-10.51554, 8.1393], [-10.57523, 8.04829], [-10.60492, 8.04072], [-10.60422, 7.7739], [-11.29417, 7.21576], [-11.4027, 6.97746], [-11.50429, 6.92704], [-12.15048, 6.15992], [-7.52774, 3.7105], [-7.53259, 4.35145], [-7.59349, 4.8909], [-7.53876, 4.94294], [-7.55369, 5.08667], [-7.48901, 5.14118], [-7.46165, 5.26256], [-7.36463, 5.32944], [-7.43428, 5.42355], [-7.37209, 5.61173], [-7.43926, 5.74787], [-7.43677, 5.84687], [-7.46165, 5.84934], [-7.48155, 5.80974], [-7.67309, 5.94337], [-7.70294, 5.90625], [-7.78254, 5.99037], [-7.79747, 6.07696], [-7.8497, 6.08932], [-7.83478, 6.20309], [-7.90692, 6.27728], [-8.00642, 6.31684], [-8.17557, 6.28222], [-8.3298, 6.36381], [-8.38453, 6.35887], [-8.45666, 6.49977], [-8.48652, 6.43797], [-8.59456, 6.50612], [-8.31736, 6.82837], [-8.29249, 7.1691], [-8.37458, 7.25794], [-8.41935, 7.51203], [-8.47114, 7.55676]]]] } },
34219 { type: "Feature", properties: { iso1A2: "LS", iso1A3: "LSO", iso1N3: "426", wikidata: "Q1013", nameEn: "Lesotho", groups: ["018", "202", "002", "UN"], driveSide: "left", callingCodes: ["266"] }, geometry: { type: "MultiPolygon", coordinates: [[[[29.33204, -29.45598], [29.44883, -29.3772], [29.40524, -29.21246], [28.68043, -28.58744], [28.65091, -28.57025], [28.40612, -28.6215], [28.30518, -28.69531], [28.2348, -28.69471], [28.1317, -28.7293], [28.02503, -28.85991], [27.98675, -28.8787], [27.9392, -28.84864], [27.88933, -28.88156], [27.8907, -28.91612], [27.75458, -28.89839], [27.55974, -29.18954], [27.5158, -29.2261], [27.54258, -29.25575], [27.48679, -29.29349], [27.45125, -29.29708], [27.47254, -29.31968], [27.4358, -29.33465], [27.33464, -29.48161], [27.01016, -29.65439], [27.09489, -29.72796], [27.22719, -30.00718], [27.29603, -30.05473], [27.32555, -30.14785], [27.40778, -30.14577], [27.37293, -30.19401], [27.36649, -30.27246], [27.38108, -30.33456], [27.45452, -30.32239], [27.56901, -30.42504], [27.56781, -30.44562], [27.62137, -30.50509], [27.6521, -30.51707], [27.67819, -30.53437], [27.69467, -30.55862], [27.74814, -30.60635], [28.12073, -30.68072], [28.2319, -30.28476], [28.399, -30.1592], [28.68627, -30.12885], [28.80222, -30.10579], [28.9338, -30.05072], [29.16548, -29.91706], [29.12553, -29.76266], [29.28545, -29.58456], [29.33204, -29.45598]]]] } },
34220 { type: "Feature", properties: { iso1A2: "LT", iso1A3: "LTU", iso1N3: "440", wikidata: "Q37", nameEn: "Lithuania", groups: ["EU", "154", "150", "UN"], callingCodes: ["370"] }, geometry: { type: "MultiPolygon", coordinates: [[[[24.89005, 56.46666], [24.83686, 56.41565], [24.70022, 56.40483], [24.57353, 56.31525], [24.58143, 56.29125], [24.42746, 56.26522], [24.32334, 56.30226], [24.13139, 56.24881], [24.02657, 56.3231], [23.75726, 56.37282], [23.49803, 56.34307], [23.40486, 56.37689], [23.31606, 56.3827], [23.17312, 56.36795], [23.09531, 56.30511], [22.96988, 56.41213], [22.83048, 56.367], [22.69354, 56.36284], [22.56441, 56.39305], [22.3361, 56.4016], [22.09728, 56.42851], [22.00548, 56.41508], [21.74558, 56.33181], [21.57888, 56.31406], [21.49736, 56.29106], [21.24644, 56.16917], [21.15016, 56.07818], [20.68447, 56.04073], [20.60454, 55.40986], [20.95181, 55.27994], [21.26425, 55.24456], [21.35465, 55.28427], [21.38446, 55.29348], [21.46766, 55.21115], [21.51095, 55.18507], [21.55605, 55.20311], [21.64954, 55.1791], [21.85521, 55.09493], [21.96505, 55.07353], [21.99543, 55.08691], [22.03984, 55.07888], [22.02582, 55.05078], [22.06087, 55.02935], [22.11697, 55.02131], [22.14267, 55.05345], [22.31562, 55.0655], [22.47688, 55.04408], [22.58907, 55.07085], [22.60075, 55.01863], [22.65451, 54.97037], [22.68723, 54.9811], [22.76422, 54.92521], [22.85083, 54.88711], [22.87317, 54.79492], [22.73631, 54.72952], [22.73397, 54.66604], [22.75467, 54.6483], [22.74225, 54.64339], [22.7522, 54.63525], [22.68021, 54.58486], [22.71293, 54.56454], [22.67788, 54.532], [22.70208, 54.45312], [22.7253, 54.41732], [22.79705, 54.36264], [22.83756, 54.40827], [23.00584, 54.38514], [22.99649, 54.35927], [23.05726, 54.34565], [23.04323, 54.31567], [23.104, 54.29794], [23.13905, 54.31567], [23.15526, 54.31076], [23.15938, 54.29894], [23.24656, 54.25701], [23.3494, 54.25155], [23.39525, 54.21672], [23.42418, 54.17911], [23.45223, 54.17775], [23.49196, 54.14764], [23.52702, 54.04622], [23.48261, 53.98855], [23.51284, 53.95052], [23.61677, 53.92691], [23.71726, 53.93379], [23.80543, 53.89558], [23.81309, 53.94205], [23.95098, 53.9613], [23.98837, 53.92554], [24.19638, 53.96405], [24.34128, 53.90076], [24.44411, 53.90076], [24.62275, 54.00217], [24.69652, 54.01901], [24.69185, 53.96543], [24.74279, 53.96663], [24.85311, 54.02862], [24.77131, 54.11091], [24.96894, 54.17589], [24.991, 54.14241], [25.0728, 54.13419], [25.19199, 54.219], [25.22705, 54.26271], [25.35559, 54.26544], [25.509, 54.30267], [25.56823, 54.25212], [25.51452, 54.17799], [25.54724, 54.14925], [25.64875, 54.1259], [25.71084, 54.16704], [25.78563, 54.15747], [25.78553, 54.23327], [25.68513, 54.31727], [25.55425, 54.31591], [25.5376, 54.33158], [25.63371, 54.42075], [25.62203, 54.4656], [25.64813, 54.48704], [25.68045, 54.5321], [25.75977, 54.57252], [25.74122, 54.80108], [25.89462, 54.93438], [25.99129, 54.95705], [26.05907, 54.94631], [26.13386, 54.98924], [26.20397, 54.99729], [26.26941, 55.08032], [26.23202, 55.10439], [26.30628, 55.12536], [26.35121, 55.1525], [26.46249, 55.12814], [26.51481, 55.16051], [26.54753, 55.14181], [26.69243, 55.16718], [26.68075, 55.19787], [26.72983, 55.21788], [26.73017, 55.24226], [26.835, 55.28182], [26.83266, 55.30444], [26.80929, 55.31642], [26.6714, 55.33902], [26.5709, 55.32572], [26.44937, 55.34832], [26.5522, 55.40277], [26.55094, 55.5093], [26.63167, 55.57887], [26.63231, 55.67968], [26.58248, 55.6754], [26.46661, 55.70375], [26.39561, 55.71156], [26.18509, 55.86813], [26.03815, 55.95884], [25.90047, 56.0013], [25.85893, 56.00188], [25.81773, 56.05444], [25.69246, 56.08892], [25.68588, 56.14725], [25.53621, 56.16663], [25.39751, 56.15707], [25.23099, 56.19147], [25.09325, 56.1878], [25.05762, 56.26742], [24.89005, 56.46666]]]] } },
34221 { type: "Feature", properties: { iso1A2: "LU", iso1A3: "LUX", iso1N3: "442", wikidata: "Q32", nameEn: "Luxembourg", groups: ["EU", "155", "150", "UN"], callingCodes: ["352"] }, geometry: { type: "MultiPolygon", coordinates: [[[[6.1379, 50.12964], [6.1137, 50.13668], [6.12028, 50.16374], [6.08577, 50.17246], [6.06406, 50.15344], [6.03093, 50.16362], [6.02488, 50.18283], [5.96453, 50.17259], [5.95929, 50.13295], [5.89488, 50.11476], [5.8857, 50.07824], [5.85474, 50.06342], [5.86904, 50.04614], [5.8551, 50.02683], [5.81866, 50.01286], [5.82331, 49.99662], [5.83968, 49.9892], [5.83467, 49.97823], [5.81163, 49.97142], [5.80833, 49.96451], [5.77291, 49.96056], [5.77314, 49.93646], [5.73621, 49.89796], [5.78415, 49.87922], [5.75269, 49.8711], [5.75861, 49.85631], [5.74567, 49.85368], [5.75884, 49.84811], [5.74953, 49.84709], [5.74975, 49.83933], [5.74076, 49.83823], [5.7404, 49.83452], [5.74844, 49.82435], [5.74364, 49.82058], [5.74953, 49.81428], [5.75409, 49.79239], [5.78871, 49.7962], [5.82245, 49.75048], [5.83149, 49.74729], [5.82562, 49.72395], [5.84193, 49.72161], [5.86503, 49.72739], [5.88677, 49.70951], [5.86527, 49.69291], [5.86175, 49.67862], [5.9069, 49.66377], [5.90164, 49.6511], [5.90599, 49.63853], [5.88552, 49.63507], [5.88393, 49.62802], [5.87609, 49.62047], [5.8762, 49.60898], [5.84826, 49.5969], [5.84971, 49.58674], [5.86986, 49.58756], [5.87256, 49.57539], [5.8424, 49.56082], [5.84692, 49.55663], [5.84143, 49.5533], [5.81838, 49.54777], [5.80871, 49.5425], [5.81664, 49.53775], [5.83648, 49.5425], [5.84466, 49.53027], [5.83467, 49.52717], [5.83389, 49.52152], [5.86571, 49.50015], [5.94128, 49.50034], [5.94224, 49.49608], [5.96876, 49.49053], [5.97693, 49.45513], [6.02648, 49.45451], [6.02743, 49.44845], [6.04176, 49.44801], [6.05553, 49.46663], [6.07887, 49.46399], [6.08373, 49.45594], [6.10072, 49.45268], [6.09845, 49.46351], [6.10325, 49.4707], [6.12346, 49.4735], [6.12814, 49.49365], [6.14321, 49.48796], [6.16115, 49.49297], [6.15366, 49.50226], [6.17386, 49.50934], [6.19543, 49.50536], [6.2409, 49.51408], [6.25029, 49.50609], [6.27875, 49.503], [6.28818, 49.48465], [6.3687, 49.4593], [6.36778, 49.46937], [6.36907, 49.48931], [6.36788, 49.50377], [6.35666, 49.52931], [6.38072, 49.55171], [6.38228, 49.55855], [6.35825, 49.57053], [6.36676, 49.57813], [6.38024, 49.57593], [6.38342, 49.5799], [6.37464, 49.58886], [6.385, 49.59946], [6.39822, 49.60081], [6.41861, 49.61723], [6.4413, 49.65722], [6.43768, 49.66021], [6.42726, 49.66078], [6.42937, 49.66857], [6.44654, 49.67799], [6.46048, 49.69092], [6.48014, 49.69767], [6.49785, 49.71118], [6.50647, 49.71353], [6.5042, 49.71808], [6.49694, 49.72205], [6.49535, 49.72645], [6.50261, 49.72718], [6.51397, 49.72058], [6.51805, 49.72425], [6.50193, 49.73291], [6.50174, 49.75292], [6.51646, 49.75961], [6.51828, 49.76855], [6.51056, 49.77515], [6.51669, 49.78336], [6.50534, 49.78952], [6.52169, 49.79787], [6.53122, 49.80666], [6.52121, 49.81338], [6.51215, 49.80124], [6.50647, 49.80916], [6.48718, 49.81267], [6.47111, 49.82263], [6.45425, 49.81164], [6.44131, 49.81443], [6.42905, 49.81091], [6.42521, 49.81591], [6.40022, 49.82029], [6.36576, 49.85032], [6.34267, 49.84974], [6.33585, 49.83785], [6.32098, 49.83728], [6.32303, 49.85133], [6.30963, 49.87021], [6.29692, 49.86685], [6.28874, 49.87592], [6.26146, 49.88203], [6.23496, 49.89972], [6.22926, 49.92096], [6.21882, 49.92403], [6.22608, 49.929], [6.22094, 49.94955], [6.19856, 49.95053], [6.19089, 49.96991], [6.18045, 49.96611], [6.18554, 49.95622], [6.17872, 49.9537], [6.16466, 49.97086], [6.1701, 49.98518], [6.14147, 49.99563], [6.14948, 50.00908], [6.13806, 50.01056], [6.1295, 50.01849], [6.13273, 50.02019], [6.13794, 50.01466], [6.14666, 50.02207], [6.13044, 50.02929], [6.13458, 50.04141], [6.11274, 50.05916], [6.12055, 50.09171], [6.1379, 50.12964]]]] } },
34222 { type: "Feature", properties: { iso1A2: "LV", iso1A3: "LVA", iso1N3: "428", wikidata: "Q211", nameEn: "Latvia", groups: ["EU", "154", "150", "UN"], callingCodes: ["371"] }, geometry: { type: "MultiPolygon", coordinates: [[[[27.34698, 57.52242], [26.90364, 57.62823], [26.54675, 57.51813], [26.46527, 57.56885], [26.29253, 57.59244], [26.1866, 57.6849], [26.2029, 57.7206], [26.08098, 57.76619], [26.0543, 57.76105], [26.03332, 57.7718], [26.02415, 57.76865], [26.02069, 57.77169], [26.0266, 57.77441], [26.027, 57.78158], [26.02456, 57.78342], [26.0324, 57.79037], [26.05949, 57.84744], [25.73499, 57.90193], [25.29581, 58.08288], [25.28237, 57.98539], [25.19484, 58.0831], [24.3579, 57.87471], [24.26221, 57.91787], [23.20055, 57.56697], [22.80496, 57.87798], [19.84909, 57.57876], [19.64795, 57.06466], [20.68447, 56.04073], [21.15016, 56.07818], [21.24644, 56.16917], [21.49736, 56.29106], [21.57888, 56.31406], [21.74558, 56.33181], [22.00548, 56.41508], [22.09728, 56.42851], [22.3361, 56.4016], [22.56441, 56.39305], [22.69354, 56.36284], [22.83048, 56.367], [22.96988, 56.41213], [23.09531, 56.30511], [23.17312, 56.36795], [23.31606, 56.3827], [23.40486, 56.37689], [23.49803, 56.34307], [23.75726, 56.37282], [24.02657, 56.3231], [24.13139, 56.24881], [24.32334, 56.30226], [24.42746, 56.26522], [24.58143, 56.29125], [24.57353, 56.31525], [24.70022, 56.40483], [24.83686, 56.41565], [24.89005, 56.46666], [25.05762, 56.26742], [25.09325, 56.1878], [25.23099, 56.19147], [25.39751, 56.15707], [25.53621, 56.16663], [25.68588, 56.14725], [25.69246, 56.08892], [25.81773, 56.05444], [25.85893, 56.00188], [25.90047, 56.0013], [26.03815, 55.95884], [26.18509, 55.86813], [26.39561, 55.71156], [26.46661, 55.70375], [26.58248, 55.6754], [26.63231, 55.67968], [26.64888, 55.70515], [26.71802, 55.70645], [26.76872, 55.67658], [26.87448, 55.7172], [26.97153, 55.8102], [27.1559, 55.85032], [27.27804, 55.78299], [27.3541, 55.8089], [27.61683, 55.78558], [27.63065, 55.89687], [27.97865, 56.11849], [28.15217, 56.16964], [28.23716, 56.27588], [28.16599, 56.37806], [28.19057, 56.44637], [28.10069, 56.524], [28.13526, 56.57989], [28.04768, 56.59004], [27.86101, 56.88204], [27.66511, 56.83921], [27.86101, 57.29402], [27.52453, 57.42826], [27.56832, 57.53728], [27.34698, 57.52242]]]] } },
34223 { type: "Feature", properties: { iso1A2: "LY", iso1A3: "LBY", iso1N3: "434", wikidata: "Q1016", nameEn: "Libya", groups: ["015", "002", "UN"], callingCodes: ["218"] }, geometry: { type: "MultiPolygon", coordinates: [[[[26.92891, 33.39516], [11.58941, 33.36891], [11.55852, 33.1409], [11.51549, 33.09826], [11.46037, 32.6307], [11.57828, 32.48013], [11.53898, 32.4138], [11.04234, 32.2145], [10.7315, 31.97235], [10.62788, 31.96629], [10.48497, 31.72956], [10.31364, 31.72648], [10.12239, 31.42098], [10.29516, 30.90337], [9.88152, 30.34074], [9.76848, 30.34366], [9.55544, 30.23971], [9.3876, 30.16738], [9.78136, 29.40961], [9.89569, 26.57696], [9.51696, 26.39148], [9.38834, 26.19288], [10.03146, 25.35635], [10.02432, 24.98124], [10.33159, 24.5465], [10.85323, 24.5595], [11.41061, 24.21456], [11.62498, 24.26669], [11.96886, 23.51735], [13.5631, 23.16574], [14.22918, 22.61719], [14.99751, 23.00539], [15.99566, 23.49639], [23.99539, 19.49944], [23.99715, 20.00038], [24.99794, 19.99661], [24.99885, 21.99535], [24.99968, 29.24574], [24.71117, 30.17441], [25.01077, 30.73861], [24.8458, 31.39877], [26.92891, 33.39516]]]] } },
34224 { type: "Feature", properties: { iso1A2: "MA", iso1A3: "MAR", iso1N3: "504", wikidata: "Q1028", nameEn: "Morocco", groups: ["015", "002", "UN"], callingCodes: ["212"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.27707, 35.35051], [-5.10878, 36.05227], [-7.2725, 35.73269], [-14.43883, 27.02969], [-17.27295, 21.93519], [-17.21511, 21.34226], [-17.02707, 21.34022], [-16.9978, 21.36239], [-16.44269, 21.39745], [-14.78487, 21.36587], [-14.47329, 21.63839], [-14.48112, 22.00886], [-14.1291, 22.41636], [-14.10361, 22.75501], [-13.75627, 23.77231], [-13.00628, 24.01923], [-12.92147, 24.39502], [-12.12281, 25.13682], [-12.06001, 26.04442], [-11.62052, 26.05229], [-11.38635, 26.611], [-11.23622, 26.72023], [-11.35695, 26.8505], [-10.68417, 26.90984], [-9.81998, 26.71379], [-9.56957, 26.90042], [-9.08698, 26.98639], [-8.71787, 26.9898], [-8.77527, 27.66663], [-8.66879, 27.6666], [-8.6715, 28.71194], [-7.61585, 29.36252], [-6.95824, 29.50924], [-6.78351, 29.44634], [-6.69965, 29.51623], [-5.75616, 29.61407], [-5.72121, 29.52322], [-5.58831, 29.48103], [-5.21671, 29.95253], [-4.6058, 30.28343], [-4.31774, 30.53229], [-3.64735, 30.67539], [-3.65418, 30.85566], [-3.54944, 31.0503], [-3.77103, 31.14984], [-3.77647, 31.31912], [-3.66386, 31.39202], [-3.66314, 31.6339], [-2.82784, 31.79459], [-2.93873, 32.06557], [-2.46166, 32.16603], [-1.22829, 32.07832], [-1.15735, 32.12096], [-1.24453, 32.1917], [-1.24998, 32.32993], [-0.9912, 32.52467], [-1.37794, 32.73628], [-1.54244, 32.95499], [-1.46249, 33.0499], [-1.67067, 33.27084], [-1.59508, 33.59929], [-1.73494, 33.71721], [-1.64666, 34.10405], [-1.78042, 34.39018], [-1.69788, 34.48056], [-1.84569, 34.61907], [-1.73707, 34.74226], [-1.97469, 34.886], [-1.97833, 34.93218], [-2.04734, 34.93218], [-2.21445, 35.04378], [-2.21248, 35.08532], [-2.27707, 35.35051]], [[-2.91909, 35.33927], [-2.92272, 35.27509], [-2.93893, 35.26737], [-2.95065, 35.26576], [-2.95431, 35.2728], [-2.96516, 35.27967], [-2.96826, 35.28296], [-2.96507, 35.28801], [-2.97035, 35.28852], [-2.96978, 35.29459], [-2.96648, 35.30475], [-2.96038, 35.31609], [-2.91909, 35.33927]], [[-3.90602, 35.21494], [-3.89343, 35.22728], [-3.88372, 35.20767], [-3.90602, 35.21494]], [[-4.30191, 35.17419], [-4.29436, 35.17149], [-4.30112, 35.17058], [-4.30191, 35.17419]], [[-2.40316, 35.16893], [-2.45965, 35.16527], [-2.43262, 35.20652], [-2.40316, 35.16893]], [[-5.38491, 35.92591], [-5.21179, 35.90091], [-5.34379, 35.8711], [-5.35844, 35.87375], [-5.37338, 35.88417], [-5.38491, 35.92591]]]] } },
34225 { type: "Feature", properties: { iso1A2: "MC", iso1A3: "MCO", iso1N3: "492", wikidata: "Q235", nameEn: "Monaco", groups: ["155", "150", "UN"], callingCodes: ["377"] }, geometry: { type: "MultiPolygon", coordinates: [[[[7.47823, 43.73341], [7.4379, 43.74963], [7.4389, 43.75151], [7.43708, 43.75197], [7.43624, 43.75014], [7.43013, 43.74895], [7.42809, 43.74396], [7.42443, 43.74087], [7.42299, 43.74176], [7.42062, 43.73977], [7.41233, 43.73439], [7.41298, 43.73311], [7.41291, 43.73168], [7.41113, 43.73156], [7.40903, 43.7296], [7.42422, 43.72209], [7.47823, 43.73341]]]] } },
34226 { type: "Feature", properties: { iso1A2: "MD", iso1A3: "MDA", iso1N3: "498", wikidata: "Q217", nameEn: "Moldova", groups: ["151", "150", "UN"], callingCodes: ["373"] }, geometry: { type: "MultiPolygon", coordinates: [[[[27.74422, 48.45926], [27.6658, 48.44034], [27.59027, 48.46311], [27.5889, 48.49224], [27.46942, 48.454], [27.44333, 48.41209], [27.37741, 48.41026], [27.37604, 48.44398], [27.32159, 48.4434], [27.27855, 48.37534], [27.13434, 48.37288], [27.08078, 48.43214], [27.0231, 48.42485], [27.03821, 48.37653], [26.93384, 48.36558], [26.85556, 48.41095], [26.71274, 48.40388], [26.82809, 48.31629], [26.79239, 48.29071], [26.6839, 48.35828], [26.62823, 48.25804], [26.81161, 48.25049], [26.87708, 48.19919], [26.94265, 48.1969], [26.98042, 48.15752], [26.96119, 48.13003], [27.04118, 48.12522], [27.02985, 48.09083], [27.15622, 47.98538], [27.1618, 47.92391], [27.29069, 47.73722], [27.25519, 47.71366], [27.32202, 47.64009], [27.3979, 47.59473], [27.47942, 47.48113], [27.55731, 47.46637], [27.60263, 47.32507], [27.68706, 47.28962], [27.73172, 47.29248], [27.81892, 47.1381], [28.09095, 46.97621], [28.12173, 46.82283], [28.24808, 46.64305], [28.22281, 46.50481], [28.25769, 46.43334], [28.18902, 46.35283], [28.19864, 46.31869], [28.10937, 46.22852], [28.13684, 46.18099], [28.08612, 46.01105], [28.13111, 45.92819], [28.16568, 45.6421], [28.08927, 45.6051], [28.18741, 45.47358], [28.21139, 45.46895], [28.30201, 45.54744], [28.41836, 45.51715], [28.43072, 45.48538], [28.51449, 45.49982], [28.49252, 45.56716], [28.54196, 45.58062], [28.51587, 45.6613], [28.47879, 45.66994], [28.52823, 45.73803], [28.70401, 45.78019], [28.69852, 45.81753], [28.78503, 45.83475], [28.74383, 45.96664], [28.98004, 46.00385], [29.00613, 46.04962], [28.94643, 46.09176], [29.06656, 46.19716], [28.94953, 46.25852], [28.98478, 46.31803], [29.004, 46.31495], [28.9306, 46.45699], [29.01241, 46.46177], [29.02409, 46.49582], [29.23547, 46.55435], [29.24886, 46.37912], [29.35357, 46.49505], [29.49914, 46.45889], [29.5939, 46.35472], [29.6763, 46.36041], [29.66359, 46.4215], [29.74496, 46.45605], [29.88329, 46.35851], [29.94114, 46.40114], [30.09103, 46.38694], [30.16794, 46.40967], [30.02511, 46.45132], [29.88916, 46.54302], [29.94409, 46.56002], [29.9743, 46.75325], [29.94522, 46.80055], [29.98814, 46.82358], [29.87405, 46.88199], [29.75458, 46.8604], [29.72986, 46.92234], [29.57056, 46.94766], [29.62137, 47.05069], [29.61038, 47.09932], [29.53044, 47.07851], [29.49732, 47.12878], [29.57696, 47.13581], [29.54996, 47.24962], [29.59665, 47.25521], [29.5733, 47.36508], [29.48678, 47.36043], [29.47854, 47.30366], [29.39889, 47.30179], [29.3261, 47.44664], [29.18603, 47.43387], [29.11743, 47.55001], [29.22414, 47.60012], [29.22242, 47.73607], [29.27255, 47.79953], [29.20663, 47.80367], [29.27804, 47.88893], [29.19839, 47.89261], [29.1723, 47.99013], [28.9306, 47.96255], [28.8414, 48.03392], [28.85232, 48.12506], [28.69896, 48.13106], [28.53921, 48.17453], [28.48428, 48.0737], [28.42454, 48.12047], [28.43701, 48.15832], [28.38712, 48.17567], [28.34009, 48.13147], [28.30609, 48.14018], [28.30586, 48.1597], [28.34912, 48.1787], [28.36996, 48.20543], [28.35519, 48.24957], [28.32508, 48.23384], [28.2856, 48.23202], [28.19314, 48.20749], [28.17666, 48.25963], [28.07504, 48.23494], [28.09873, 48.3124], [28.04527, 48.32661], [27.95883, 48.32368], [27.88391, 48.36699], [27.87533, 48.4037], [27.81902, 48.41874], [27.79225, 48.44244], [27.74422, 48.45926]]]] } },
34227 { type: "Feature", properties: { iso1A2: "ME", iso1A3: "MNE", iso1N3: "499", wikidata: "Q236", nameEn: "Montenegro", groups: ["039", "150", "UN"], callingCodes: ["382"] }, geometry: { type: "MultiPolygon", coordinates: [[[[19.22807, 43.5264], [19.15685, 43.53943], [19.13933, 43.5282], [19.04934, 43.50384], [19.01078, 43.55806], [18.91379, 43.50299], [18.95469, 43.49367], [18.96053, 43.45042], [19.01078, 43.43854], [19.04071, 43.397], [19.08673, 43.31453], [19.08206, 43.29668], [19.04233, 43.30008], [19.00844, 43.24988], [18.95001, 43.29327], [18.95819, 43.32899], [18.90911, 43.36383], [18.83912, 43.34795], [18.84794, 43.33735], [18.85342, 43.32426], [18.76538, 43.29838], [18.6976, 43.25243], [18.71747, 43.2286], [18.66605, 43.2056], [18.64735, 43.14766], [18.66254, 43.03928], [18.52232, 43.01451], [18.49076, 42.95553], [18.49661, 42.89306], [18.4935, 42.86433], [18.47633, 42.85829], [18.45921, 42.81682], [18.47324, 42.74992], [18.56789, 42.72074], [18.55221, 42.69045], [18.54603, 42.69171], [18.54841, 42.68328], [18.57373, 42.64429], [18.52232, 42.62279], [18.55504, 42.58409], [18.53751, 42.57376], [18.49778, 42.58409], [18.43735, 42.55921], [18.44307, 42.51077], [18.43588, 42.48556], [18.52152, 42.42302], [18.54128, 42.39171], [18.45131, 42.21682], [19.26406, 41.74971], [19.37597, 41.84849], [19.37451, 41.8842], [19.33812, 41.90669], [19.34601, 41.95675], [19.37691, 41.96977], [19.36867, 42.02564], [19.37548, 42.06835], [19.40687, 42.10024], [19.28623, 42.17745], [19.42, 42.33019], [19.42352, 42.36546], [19.4836, 42.40831], [19.65972, 42.62774], [19.73244, 42.66299], [19.77375, 42.58517], [19.74731, 42.57422], [19.76549, 42.50237], [19.82333, 42.46581], [19.9324, 42.51699], [20.00842, 42.5109], [20.01834, 42.54622], [20.07761, 42.55582], [20.0969, 42.65559], [20.02915, 42.71147], [20.02088, 42.74789], [20.04898, 42.77701], [20.2539, 42.76245], [20.27869, 42.81945], [20.35692, 42.8335], [20.34528, 42.90676], [20.16415, 42.97177], [20.14896, 42.99058], [20.12325, 42.96237], [20.05431, 42.99571], [20.04729, 43.02732], [19.98887, 43.0538], [19.96549, 43.11098], [19.92576, 43.08539], [19.79255, 43.11951], [19.76918, 43.16044], [19.64063, 43.19027], [19.62661, 43.2286], [19.54598, 43.25158], [19.52962, 43.31623], [19.48171, 43.32644], [19.44315, 43.38846], [19.22229, 43.47926], [19.22807, 43.5264]]]] } },
34228 { type: "Feature", properties: { iso1A2: "MF", iso1A3: "MAF", iso1N3: "663", wikidata: "Q126125", nameEn: "Saint-Martin", country: "FR", groups: ["Q3320166", "EU", "029", "003", "419", "019", "UN"], callingCodes: ["590"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-62.93924, 18.02904], [-62.62718, 18.26185], [-63.35989, 18.06012], [-63.33064, 17.9615], [-63.13502, 18.05445], [-63.11042, 18.05339], [-63.09686, 18.04608], [-63.07759, 18.04943], [-63.0579, 18.06614], [-63.04039, 18.05619], [-63.02323, 18.05757], [-62.93924, 18.02904]]]] } },
34229 { type: "Feature", properties: { iso1A2: "MG", iso1A3: "MDG", iso1N3: "450", wikidata: "Q1019", nameEn: "Madagascar", aliases: ["RM"], groups: ["014", "202", "002", "UN"], callingCodes: ["261"] }, geometry: { type: "MultiPolygon", coordinates: [[[[51.93891, -10.85085], [45.84651, -12.77177], [42.14681, -19.63341], [45.80092, -33.00974], [51.93891, -10.85085]]]] } },
34230 { type: "Feature", properties: { iso1A2: "MH", iso1A3: "MHL", iso1N3: "584", wikidata: "Q709", nameEn: "Marshall Islands", groups: ["057", "009", "UN"], roadSpeedUnit: "mph", callingCodes: ["692"] }, geometry: { type: "MultiPolygon", coordinates: [[[[169, 3.9], [173.53711, 5.70687], [169.29099, 15.77133], [159.04653, 10.59067], [169, 3.9]]]] } },
34231 { type: "Feature", properties: { iso1A2: "MK", iso1A3: "MKD", iso1N3: "807", wikidata: "Q221", nameEn: "North Macedonia", groups: ["039", "150", "UN"], callingCodes: ["389"] }, geometry: { type: "MultiPolygon", coordinates: [[[[22.34773, 42.31725], [22.29275, 42.34913], [22.29605, 42.37477], [22.16384, 42.32103], [22.02908, 42.29848], [21.94405, 42.34669], [21.91595, 42.30392], [21.84654, 42.3247], [21.77176, 42.2648], [21.70111, 42.23789], [21.58992, 42.25915], [21.52145, 42.24465], [21.50823, 42.27156], [21.43882, 42.2789], [21.43882, 42.23609], [21.38428, 42.24465], [21.30496, 42.1418], [21.29913, 42.13954], [21.31983, 42.10993], [21.22728, 42.08909], [21.16614, 42.19815], [21.11491, 42.20794], [20.75464, 42.05229], [20.76786, 41.91839], [20.68523, 41.85318], [20.59524, 41.8818], [20.55976, 41.87068], [20.57144, 41.7897], [20.53405, 41.78099], [20.51301, 41.72433], [20.52937, 41.69292], [20.51769, 41.65975], [20.55508, 41.58113], [20.52103, 41.56473], [20.45809, 41.5549], [20.45331, 41.51436], [20.49039, 41.49277], [20.51301, 41.442], [20.55976, 41.4087], [20.52119, 41.34381], [20.49432, 41.33679], [20.51068, 41.2323], [20.59715, 41.13644], [20.58546, 41.11179], [20.59832, 41.09066], [20.63454, 41.0889], [20.65558, 41.08009], [20.71634, 40.91781], [20.73504, 40.9081], [20.81567, 40.89662], [20.83671, 40.92752], [20.94305, 40.92399], [20.97693, 40.90103], [20.97887, 40.85475], [21.15262, 40.85546], [21.21105, 40.8855], [21.25779, 40.86165], [21.35595, 40.87578], [21.41555, 40.9173], [21.53007, 40.90759], [21.57448, 40.86076], [21.69601, 40.9429], [21.7556, 40.92525], [21.91102, 41.04786], [21.90869, 41.09191], [22.06527, 41.15617], [22.1424, 41.12449], [22.17629, 41.15969], [22.26744, 41.16409], [22.42285, 41.11921], [22.5549, 41.13065], [22.58295, 41.11568], [22.62852, 41.14385], [22.65306, 41.18168], [22.71266, 41.13945], [22.74538, 41.16321], [22.76408, 41.32225], [22.81199, 41.3398], [22.93334, 41.34104], [22.96331, 41.35782], [22.95513, 41.63265], [23.03342, 41.71034], [23.01239, 41.76527], [22.96682, 41.77137], [22.90254, 41.87587], [22.86749, 42.02275], [22.67701, 42.06614], [22.51224, 42.15457], [22.50289, 42.19527], [22.47251, 42.20393], [22.38136, 42.30339], [22.34773, 42.31725]]]] } },
34232 { type: "Feature", properties: { iso1A2: "ML", iso1A3: "MLI", iso1N3: "466", wikidata: "Q912", nameEn: "Mali", groups: ["011", "202", "002", "UN"], callingCodes: ["223"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-4.83423, 24.99935], [-6.57191, 25.0002], [-5.60725, 16.49919], [-5.33435, 16.33354], [-5.50165, 15.50061], [-9.32979, 15.50032], [-9.31106, 15.69412], [-9.33314, 15.7044], [-9.44673, 15.60553], [-9.40447, 15.4396], [-10.71721, 15.4223], [-10.90932, 15.11001], [-11.43483, 15.62339], [-11.70705, 15.51558], [-11.94903, 14.76143], [-12.23936, 14.76324], [-11.93043, 13.84505], [-12.06897, 13.71049], [-11.83345, 13.33333], [-11.63025, 13.39174], [-11.39935, 12.97808], [-11.37536, 12.40788], [-11.50006, 12.17826], [-11.24136, 12.01286], [-10.99758, 12.24634], [-10.80355, 12.1053], [-10.71897, 11.91552], [-10.30604, 12.24634], [-9.714, 12.0226], [-9.63938, 12.18312], [-9.32097, 12.29009], [-9.38067, 12.48446], [-9.13689, 12.50875], [-8.94784, 12.34842], [-8.80854, 11.66715], [-8.40058, 11.37466], [-8.66923, 10.99397], [-8.35083, 11.06234], [-8.2667, 10.91762], [-8.32614, 10.69273], [-8.22711, 10.41722], [-8.10207, 10.44649], [-7.9578, 10.2703], [-7.97971, 10.17117], [-7.92107, 10.15577], [-7.63048, 10.46334], [-7.54462, 10.40921], [-7.52261, 10.4655], [-7.44555, 10.44602], [-7.3707, 10.24677], [-7.13331, 10.24877], [-7.0603, 10.14711], [-7.00966, 10.15794], [-6.97444, 10.21644], [-7.01186, 10.25111], [-6.93921, 10.35291], [-6.68164, 10.35074], [-6.63541, 10.66893], [-6.52974, 10.59104], [-6.42847, 10.5694], [-6.40646, 10.69922], [-6.325, 10.68624], [-6.24795, 10.74248], [-6.1731, 10.46983], [-6.18851, 10.24244], [-5.99478, 10.19694], [-5.78124, 10.43952], [-5.65135, 10.46767], [-5.51058, 10.43177], [-5.46643, 10.56074], [-5.47083, 10.75329], [-5.41579, 10.84628], [-5.49284, 11.07538], [-5.32994, 11.13371], [-5.32553, 11.21578], [-5.25949, 11.24816], [-5.25509, 11.36905], [-5.20665, 11.43811], [-5.22867, 11.60421], [-5.29251, 11.61715], [-5.26389, 11.75728], [-5.40258, 11.8327], [-5.26389, 11.84778], [-5.07897, 11.97918], [-4.72893, 12.01579], [-4.70692, 12.06746], [-4.62987, 12.06531], [-4.62546, 12.13204], [-4.54841, 12.1385], [-4.57703, 12.19875], [-4.41412, 12.31922], [-4.47356, 12.71252], [-4.238, 12.71467], [-4.21819, 12.95722], [-4.34477, 13.12927], [-3.96501, 13.49778], [-3.90558, 13.44375], [-3.96282, 13.38164], [-3.7911, 13.36665], [-3.54454, 13.1781], [-3.4313, 13.1588], [-3.43507, 13.27272], [-3.23599, 13.29035], [-3.28396, 13.5422], [-3.26407, 13.70699], [-2.88189, 13.64921], [-2.90831, 13.81174], [-2.84667, 14.05532], [-2.66175, 14.14713], [-2.47587, 14.29671], [-2.10223, 14.14878], [-1.9992, 14.19011], [-1.97945, 14.47709], [-1.68083, 14.50023], [-1.32166, 14.72774], [-1.05875, 14.7921], [-0.72004, 15.08655], [-0.24673, 15.07805], [0.06588, 14.96961], [0.23859, 15.00135], [0.72632, 14.95898], [0.96711, 14.98275], [1.31275, 15.27978], [3.01806, 15.34571], [3.03134, 15.42221], [3.50368, 15.35934], [4.19893, 16.39923], [4.21787, 17.00118], [4.26762, 17.00432], [4.26651, 19.14224], [3.36082, 18.9745], [3.12501, 19.1366], [3.24648, 19.81703], [1.20992, 20.73533], [1.15698, 21.12843], [-4.83423, 24.99935]]]] } },
34233 { type: "Feature", properties: { iso1A2: "MM", iso1A3: "MMR", iso1N3: "104", wikidata: "Q836", nameEn: "Myanmar", aliases: ["Burma", "BU"], groups: ["035", "142", "UN"], callingCodes: ["95"] }, geometry: { type: "MultiPolygon", coordinates: [[[[92.62187, 21.87037], [92.59775, 21.6092], [92.68152, 21.28454], [92.60187, 21.24615], [92.55105, 21.3856], [92.43158, 21.37025], [92.37939, 21.47764], [92.20087, 21.337], [92.17752, 21.17445], [92.26071, 21.05697], [92.47409, 20.38654], [92.61042, 13.76986], [94.6371, 13.81803], [97.63455, 9.60854], [98.12555, 9.44056], [98.33094, 9.91973], [98.47298, 9.95782], [98.52291, 9.92389], [98.55174, 9.92804], [98.7391, 10.31488], [98.81944, 10.52761], [98.77275, 10.62548], [98.78511, 10.68351], [98.86819, 10.78336], [99.0069, 10.85485], [98.99701, 10.92962], [99.02337, 10.97217], [99.06938, 10.94857], [99.32756, 11.28545], [99.31573, 11.32081], [99.39485, 11.3925], [99.47598, 11.62434], [99.5672, 11.62732], [99.64108, 11.78948], [99.64891, 11.82699], [99.53424, 12.02317], [99.56445, 12.14805], [99.47519, 12.1353], [99.409, 12.60603], [99.29254, 12.68921], [99.18905, 12.84799], [99.18748, 12.9898], [99.10646, 13.05804], [99.12225, 13.19847], [99.20617, 13.20575], [99.16695, 13.72621], [98.97356, 14.04868], [98.56762, 14.37701], [98.24874, 14.83013], [98.18821, 15.13125], [98.22, 15.21327], [98.30446, 15.30667], [98.40522, 15.25268], [98.41906, 15.27103], [98.39351, 15.34177], [98.4866, 15.39154], [98.56027, 15.33471], [98.58598, 15.46821], [98.541, 15.65406], [98.59853, 15.87197], [98.57019, 16.04578], [98.69585, 16.13353], [98.8376, 16.11706], [98.92656, 16.36425], [98.84485, 16.42354], [98.68074, 16.27068], [98.63817, 16.47424], [98.57912, 16.55983], [98.5695, 16.62826], [98.51113, 16.64503], [98.51833, 16.676], [98.51472, 16.68521], [98.51579, 16.69433], [98.51043, 16.70107], [98.49713, 16.69022], [98.50253, 16.7139], [98.46994, 16.73613], [98.53833, 16.81934], [98.49603, 16.8446], [98.52624, 16.89979], [98.39441, 17.06266], [98.34566, 17.04822], [98.10439, 17.33847], [98.11185, 17.36829], [97.91829, 17.54504], [97.76407, 17.71595], [97.66794, 17.88005], [97.73723, 17.97912], [97.60841, 18.23846], [97.64116, 18.29778], [97.56219, 18.33885], [97.50383, 18.26844], [97.34522, 18.54596], [97.36444, 18.57138], [97.5258, 18.4939], [97.76752, 18.58097], [97.73836, 18.88478], [97.66487, 18.9371], [97.73654, 18.9812], [97.73797, 19.04261], [97.83479, 19.09972], [97.84024, 19.22217], [97.78606, 19.26769], [97.84186, 19.29526], [97.78769, 19.39429], [97.88423, 19.5041], [97.84715, 19.55782], [98.04364, 19.65755], [98.03314, 19.80941], [98.13829, 19.78541], [98.24884, 19.67876], [98.51182, 19.71303], [98.56065, 19.67807], [98.83661, 19.80931], [98.98679, 19.7419], [99.0735, 20.10298], [99.20328, 20.12877], [99.416, 20.08614], [99.52943, 20.14811], [99.5569, 20.20676], [99.46077, 20.36198], [99.46008, 20.39673], [99.68255, 20.32077], [99.81096, 20.33687], [99.86383, 20.44371], [99.88211, 20.44488], [99.88451, 20.44596], [99.89168, 20.44548], [99.89301, 20.44311], [99.89692, 20.44789], [99.90499, 20.4487], [99.91616, 20.44986], [99.95721, 20.46301], [100.08404, 20.36626], [100.1957, 20.68247], [100.36375, 20.82783], [100.51079, 20.82194], [100.60112, 20.8347], [100.64628, 20.88279], [100.50974, 20.88574], [100.55281, 21.02796], [100.63578, 21.05639], [100.72716, 21.31786], [100.80173, 21.2934], [101.00234, 21.39612], [101.16198, 21.52808], [101.15156, 21.56129], [101.11744, 21.77659], [100.87265, 21.67396], [100.72143, 21.51898], [100.57861, 21.45637], [100.4811, 21.46148], [100.42892, 21.54325], [100.35201, 21.53176], [100.25863, 21.47043], [100.18447, 21.51898], [100.1625, 21.48704], [100.12542, 21.50365], [100.10757, 21.59945], [100.17486, 21.65306], [100.12679, 21.70539], [100.04956, 21.66843], [99.98654, 21.71064], [99.94003, 21.82782], [99.99084, 21.97053], [99.96612, 22.05965], [99.85351, 22.04183], [99.47585, 22.13345], [99.33166, 22.09656], [99.1552, 22.15874], [99.19176, 22.16983], [99.17318, 22.18025], [99.28771, 22.4105], [99.37972, 22.50188], [99.38247, 22.57544], [99.31243, 22.73893], [99.45654, 22.85726], [99.43537, 22.94086], [99.54218, 22.90014], [99.52214, 23.08218], [99.34127, 23.13099], [99.25741, 23.09025], [99.04601, 23.12215], [99.05975, 23.16382], [98.88597, 23.18656], [98.92515, 23.29535], [98.93958, 23.31414], [98.87573, 23.33038], [98.92104, 23.36946], [98.87683, 23.48995], [98.82877, 23.47908], [98.80294, 23.5345], [98.88396, 23.59555], [98.81775, 23.694], [98.82933, 23.72921], [98.79607, 23.77947], [98.68209, 23.80492], [98.67797, 23.9644], [98.89632, 24.10612], [98.87998, 24.15624], [98.85319, 24.13042], [98.59256, 24.08371], [98.54476, 24.13119], [98.20666, 24.11406], [98.07806, 24.07988], [98.06703, 24.08028], [98.0607, 24.07812], [98.05671, 24.07961], [98.05302, 24.07408], [98.04709, 24.07616], [97.99583, 24.04932], [97.98691, 24.03897], [97.93951, 24.01953], [97.90998, 24.02094], [97.88616, 24.00463], [97.88414, 23.99405], [97.88814, 23.98605], [97.89683, 23.98389], [97.89676, 23.97931], [97.8955, 23.97758], [97.88811, 23.97446], [97.86545, 23.97723], [97.84328, 23.97603], [97.79416, 23.95663], [97.79456, 23.94836], [97.72302, 23.89288], [97.64667, 23.84574], [97.5247, 23.94032], [97.62363, 24.00506], [97.72903, 24.12606], [97.75305, 24.16902], [97.72799, 24.18883], [97.72998, 24.2302], [97.76799, 24.26365], [97.71941, 24.29652], [97.66723, 24.30027], [97.65624, 24.33781], [97.7098, 24.35658], [97.66998, 24.45288], [97.60029, 24.4401], [97.52757, 24.43748], [97.56286, 24.54535], [97.56525, 24.72838], [97.54675, 24.74202], [97.5542, 24.74943], [97.56383, 24.75535], [97.56648, 24.76475], [97.64354, 24.79171], [97.70181, 24.84557], [97.73127, 24.83015], [97.76481, 24.8289], [97.79949, 24.85655], [97.72903, 24.91332], [97.72216, 25.08508], [97.77023, 25.11492], [97.83614, 25.2715], [97.92541, 25.20815], [98.14925, 25.41547], [98.12591, 25.50722], [98.18084, 25.56298], [98.16848, 25.62739], [98.25774, 25.6051], [98.31268, 25.55307], [98.40606, 25.61129], [98.54064, 25.85129], [98.63128, 25.79937], [98.70818, 25.86241], [98.60763, 26.01512], [98.57085, 26.11547], [98.63128, 26.15492], [98.66884, 26.09165], [98.7329, 26.17218], [98.67797, 26.24487], [98.72741, 26.36183], [98.77547, 26.61994], [98.7333, 26.85615], [98.69582, 27.56499], [98.43353, 27.67086], [98.42529, 27.55404], [98.32641, 27.51385], [98.13964, 27.9478], [98.15337, 28.12114], [97.90069, 28.3776], [97.79632, 28.33168], [97.70705, 28.5056], [97.56835, 28.55628], [97.50518, 28.49716], [97.47085, 28.2688], [97.41729, 28.29783], [97.34547, 28.21385], [97.31292, 28.06784], [97.35412, 28.06663], [97.38845, 28.01329], [97.35824, 27.87256], [97.29919, 27.92233], [96.90112, 27.62149], [96.91431, 27.45752], [97.17422, 27.14052], [97.14675, 27.09041], [96.89132, 27.17474], [96.85287, 27.2065], [96.88445, 27.25046], [96.73888, 27.36638], [96.55761, 27.29928], [96.40779, 27.29818], [96.15591, 27.24572], [96.04949, 27.19428], [95.93002, 27.04149], [95.81603, 27.01335], [95.437, 26.7083], [95.30339, 26.65372], [95.23513, 26.68499], [95.05798, 26.45408], [95.12801, 26.38397], [95.11428, 26.1019], [95.18556, 26.07338], [94.80117, 25.49359], [94.68032, 25.47003], [94.57458, 25.20318], [94.74212, 25.13606], [94.73937, 25.00545], [94.60204, 24.70889], [94.5526, 24.70764], [94.50729, 24.59281], [94.45279, 24.56656], [94.32362, 24.27692], [94.30215, 24.23752], [94.14081, 23.83333], [93.92089, 23.95812], [93.80279, 23.92549], [93.75952, 24.0003], [93.62871, 24.00922], [93.50616, 23.94432], [93.46633, 23.97067], [93.41415, 24.07854], [93.34735, 24.10151], [93.32351, 24.04468], [93.36059, 23.93176], [93.3908, 23.92925], [93.3908, 23.7622], [93.43475, 23.68299], [93.38805, 23.4728], [93.39981, 23.38828], [93.38781, 23.36139], [93.36862, 23.35426], [93.38478, 23.13698], [93.2878, 23.00464], [93.12988, 23.05772], [93.134, 22.92498], [93.09417, 22.69459], [93.134, 22.59573], [93.11477, 22.54374], [93.13537, 22.45873], [93.18206, 22.43716], [93.19991, 22.25425], [93.14224, 22.24535], [93.15734, 22.18687], [93.04885, 22.20595], [92.99255, 22.05965], [92.99804, 21.98964], [92.93899, 22.02656], [92.89504, 21.95143], [92.86208, 22.05456], [92.70416, 22.16017], [92.67532, 22.03547], [92.60949, 21.97638], [92.62187, 21.87037]]]] } },
34234 { type: "Feature", properties: { iso1A2: "MN", iso1A3: "MNG", iso1N3: "496", wikidata: "Q711", nameEn: "Mongolia", groups: ["030", "142", "UN"], callingCodes: ["976"] }, geometry: { type: "MultiPolygon", coordinates: [[[[102.14032, 51.35566], [101.5044, 51.50467], [101.39085, 51.45753], [100.61116, 51.73028], [99.89203, 51.74903], [99.75578, 51.90108], [99.27888, 51.96876], [98.87768, 52.14563], [98.74142, 51.8637], [98.33222, 51.71832], [98.22053, 51.46579], [98.05257, 51.46696], [97.83305, 51.00248], [98.01472, 50.86652], [97.9693, 50.78044], [98.06393, 50.61262], [98.31373, 50.4996], [98.29481, 50.33561], [97.85197, 49.91339], [97.76871, 49.99861], [97.56432, 49.92801], [97.56811, 49.84265], [97.24639, 49.74737], [96.97388, 49.88413], [95.80056, 50.04239], [95.74757, 49.97915], [95.02465, 49.96941], [94.97166, 50.04725], [94.6121, 50.04239], [94.49477, 50.17832], [94.39258, 50.22193], [94.30823, 50.57498], [92.99595, 50.63183], [93.01109, 50.79001], [92.44714, 50.78762], [92.07173, 50.69585], [91.86048, 50.73734], [89.59711, 49.90851], [89.70687, 49.72535], [88.82499, 49.44808], [88.42449, 49.48821], [88.17223, 49.46934], [88.15543, 49.30314], [87.98977, 49.18147], [87.81333, 49.17354], [87.88171, 48.95853], [87.73822, 48.89582], [88.0788, 48.71436], [87.96361, 48.58478], [88.58939, 48.34531], [88.58316, 48.21893], [88.8011, 48.11302], [88.93186, 48.10263], [89.0711, 47.98528], [89.55453, 48.0423], [89.76624, 47.82745], [90.06512, 47.88177], [90.10871, 47.7375], [90.33598, 47.68303], [90.48854, 47.41826], [90.48542, 47.30438], [90.76108, 46.99399], [90.84035, 46.99525], [91.03649, 46.72916], [91.0147, 46.58171], [91.07696, 46.57315], [90.89639, 46.30711], [90.99672, 46.14207], [91.03026, 46.04194], [90.70907, 45.73437], [90.65114, 45.49314], [90.89169, 45.19667], [91.64048, 45.07408], [93.51161, 44.95964], [94.10003, 44.71016], [94.71959, 44.35284], [95.01191, 44.25274], [95.39772, 44.2805], [95.32891, 44.02407], [95.52594, 43.99353], [95.89543, 43.2528], [96.35658, 42.90363], [96.37926, 42.72055], [97.1777, 42.7964], [99.50671, 42.56535], [100.33297, 42.68231], [100.84979, 42.67087], [101.80515, 42.50074], [102.07645, 42.22519], [102.72403, 42.14675], [103.92804, 41.78246], [104.52258, 41.8706], [104.51667, 41.66113], [105.0123, 41.63188], [106.76517, 42.28741], [107.24774, 42.36107], [107.29755, 42.41395], [107.49681, 42.46221], [107.57258, 42.40898], [108.84489, 42.40246], [109.00679, 42.45302], [109.452, 42.44842], [109.89402, 42.63111], [110.08401, 42.6411], [110.4327, 42.78293], [111.0149, 43.3289], [111.59087, 43.51207], [111.79758, 43.6637], [111.93776, 43.68709], [111.96289, 43.81596], [111.40498, 44.3461], [111.76275, 44.98032], [111.98695, 45.09074], [112.4164, 45.06858], [112.74662, 44.86297], [113.70918, 44.72891], [114.5166, 45.27189], [114.54801, 45.38337], [114.74612, 45.43585], [114.94546, 45.37377], [115.60329, 45.44717], [116.16989, 45.68603], [116.27366, 45.78637], [116.24012, 45.8778], [116.26678, 45.96479], [116.58612, 46.30211], [116.75551, 46.33083], [116.83166, 46.38637], [117.36609, 46.36335], [117.41782, 46.57862], [117.60748, 46.59771], [117.69554, 46.50991], [118.30534, 46.73519], [118.78747, 46.68689], [118.8337, 46.77742], [118.89974, 46.77139], [118.92616, 46.72765], [119.00541, 46.74273], [119.10448, 46.65516], [119.24978, 46.64761], [119.32827, 46.61433], [119.42827, 46.63783], [119.65265, 46.62342], [119.68127, 46.59015], [119.77373, 46.62947], [119.80455, 46.67631], [119.89261, 46.66423], [119.91242, 46.90091], [119.85518, 46.92196], [119.71209, 47.19192], [119.62403, 47.24575], [119.56019, 47.24874], [119.54918, 47.29505], [119.31964, 47.42617], [119.35892, 47.48104], [119.13995, 47.53997], [119.12343, 47.66458], [118.7564, 47.76947], [118.55766, 47.99277], [118.29654, 48.00246], [118.22677, 48.03853], [118.11009, 48.04], [118.03676, 48.00982], [117.80196, 48.01661], [117.50181, 47.77216], [117.37875, 47.63627], [116.9723, 47.87285], [116.67405, 47.89039], [116.4465, 47.83662], [116.21879, 47.88505], [115.94296, 47.67741], [115.57128, 47.91988], [115.52082, 48.15367], [115.811, 48.25699], [115.78876, 48.51781], [116.06565, 48.81716], [116.03781, 48.87014], [116.71193, 49.83813], [116.62502, 49.92919], [116.22402, 50.04477], [115.73602, 49.87688], [115.26068, 49.97367], [114.9703, 50.19254], [114.325, 50.28098], [113.20216, 49.83356], [113.02647, 49.60772], [110.64493, 49.1816], [110.39891, 49.25083], [110.24373, 49.16676], [109.51325, 49.22859], [109.18017, 49.34709], [108.53969, 49.32325], [108.27937, 49.53167], [107.95387, 49.66659], [107.96116, 49.93191], [107.36407, 49.97612], [107.1174, 50.04239], [107.00007, 50.1977], [106.80326, 50.30177], [106.58373, 50.34044], [106.51122, 50.34408], [106.49628, 50.32436], [106.47156, 50.31909], [106.07865, 50.33474], [106.05562, 50.40582], [105.32528, 50.4648], [103.70343, 50.13952], [102.71178, 50.38873], [102.32194, 50.67982], [102.14032, 51.35566]]]] } },
34235 { type: "Feature", properties: { iso1A2: "MO", iso1A3: "MAC", iso1N3: "446", wikidata: "Q14773", nameEn: "Macau", aliases: ["Macao"], country: "CN", groups: ["030", "142", "UN"], driveSide: "left", callingCodes: ["853"] }, geometry: { type: "MultiPolygon", coordinates: [[[[113.54942, 22.14519], [113.54839, 22.10909], [113.57191, 22.07696], [113.63011, 22.10782], [113.60504, 22.20464], [113.57123, 22.20416], [113.56865, 22.20973], [113.5508, 22.21672], [113.54333, 22.21688], [113.54093, 22.21314], [113.53593, 22.2137], [113.53301, 22.21235], [113.53552, 22.20607], [113.52659, 22.18271], [113.54093, 22.15497], [113.54942, 22.14519]]]] } },
34236 { type: "Feature", properties: { iso1A2: "MP", iso1A3: "MNP", iso1N3: "580", wikidata: "Q16644", nameEn: "Northern Mariana Islands", aliases: ["US-MP"], country: "US", groups: ["Q1352230", "Q153732", "057", "009", "UN"], roadSpeedUnit: "mph", callingCodes: ["1 670"] }, geometry: { type: "MultiPolygon", coordinates: [[[[135.52896, 14.32623], [152.19114, 13.63487], [145.05972, 21.28731], [135.52896, 14.32623]]]] } },
34237 { type: "Feature", properties: { iso1A2: "MQ", iso1A3: "MTQ", iso1N3: "474", wikidata: "Q17054", nameEn: "Martinique", country: "FR", groups: ["Q3320166", "EU", "029", "003", "419", "019", "UN"], callingCodes: ["596"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-59.95997, 14.20285], [-61.07821, 15.25109], [-61.69315, 14.26451], [-59.95997, 14.20285]]]] } },
34238 { type: "Feature", properties: { iso1A2: "MR", iso1A3: "MRT", iso1N3: "478", wikidata: "Q1025", nameEn: "Mauritania", groups: ["011", "202", "002", "UN"], callingCodes: ["222"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-5.60725, 16.49919], [-6.57191, 25.0002], [-4.83423, 24.99935], [-8.66674, 27.31569], [-8.66721, 25.99918], [-12.0002, 25.9986], [-12.00251, 23.4538], [-12.14969, 23.41935], [-12.36213, 23.3187], [-12.5741, 23.28975], [-13.00412, 23.02297], [-13.10753, 22.89493], [-13.15313, 22.75649], [-13.08438, 22.53866], [-13.01525, 21.33343], [-16.95474, 21.33997], [-16.99806, 21.12142], [-17.0357, 21.05368], [-17.0396, 20.9961], [-17.06781, 20.92697], [-17.0695, 20.85742], [-17.0471, 20.76408], [-17.15288, 16.07139], [-16.50854, 16.09032], [-16.48967, 16.0496], [-16.44814, 16.09753], [-16.4429, 16.20605], [-16.27016, 16.51565], [-15.6509, 16.50315], [-15.00557, 16.64997], [-14.32144, 16.61495], [-13.80075, 16.13961], [-13.43135, 16.09022], [-13.11029, 15.52116], [-12.23936, 14.76324], [-11.94903, 14.76143], [-11.70705, 15.51558], [-11.43483, 15.62339], [-10.90932, 15.11001], [-10.71721, 15.4223], [-9.40447, 15.4396], [-9.44673, 15.60553], [-9.33314, 15.7044], [-9.31106, 15.69412], [-9.32979, 15.50032], [-5.50165, 15.50061], [-5.33435, 16.33354], [-5.60725, 16.49919]]]] } },
34239 { type: "Feature", properties: { iso1A2: "MS", iso1A3: "MSR", iso1N3: "500", wikidata: "Q13353", nameEn: "Montserrat", country: "GB", groups: ["BOTS", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 664"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-61.91508, 16.51165], [-62.1023, 16.97277], [-62.58307, 16.68909], [-61.91508, 16.51165]]]] } },
34240 { type: "Feature", properties: { iso1A2: "MT", iso1A3: "MLT", iso1N3: "470", wikidata: "Q233", nameEn: "Malta", groups: ["EU", "039", "150", "UN"], driveSide: "left", callingCodes: ["356"] }, geometry: { type: "MultiPolygon", coordinates: [[[[15.70991, 35.79901], [14.07544, 36.41525], [13.27636, 35.20764], [15.70991, 35.79901]]]] } },
34241 { type: "Feature", properties: { iso1A2: "MU", iso1A3: "MUS", iso1N3: "480", wikidata: "Q1027", nameEn: "Mauritius", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["230"] }, geometry: { type: "MultiPolygon", coordinates: [[[[56.09755, -9.55401], [57.50644, -31.92637], [68.4673, -19.15185], [56.09755, -9.55401]]]] } },
34242 { type: "Feature", properties: { iso1A2: "MV", iso1A3: "MDV", iso1N3: "462", wikidata: "Q826", nameEn: "Maldives", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["960"] }, geometry: { type: "MultiPolygon", coordinates: [[[[71.9161, 8.55531], [72.57428, -3.7623], [76.59015, 5.591], [71.9161, 8.55531]]]] } },
34243 { type: "Feature", properties: { iso1A2: "MW", iso1A3: "MWI", iso1N3: "454", wikidata: "Q1020", nameEn: "Malawi", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["265"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.48052, -9.62442], [33.31581, -9.48554], [33.14925, -9.49322], [32.99397, -9.36712], [32.95389, -9.40138], [33.00476, -9.5133], [33.00256, -9.63053], [33.05485, -9.61316], [33.10163, -9.66525], [33.12144, -9.58929], [33.2095, -9.61099], [33.31517, -9.82364], [33.36581, -9.81063], [33.37902, -9.9104], [33.31297, -10.05133], [33.53863, -10.20148], [33.54797, -10.36077], [33.70675, -10.56896], [33.47636, -10.78465], [33.28022, -10.84428], [33.25998, -10.88862], [33.39697, -11.15296], [33.29267, -11.3789], [33.29267, -11.43536], [33.23663, -11.40637], [33.24252, -11.59302], [33.32692, -11.59248], [33.33937, -11.91252], [33.25998, -12.14242], [33.3705, -12.34931], [33.47636, -12.32498], [33.54485, -12.35996], [33.37517, -12.54085], [33.28177, -12.54692], [33.18837, -12.61377], [33.05917, -12.59554], [32.94397, -12.76868], [32.96733, -12.88251], [33.02181, -12.88707], [32.98289, -13.12671], [33.0078, -13.19492], [32.86113, -13.47292], [32.84176, -13.52794], [32.73683, -13.57682], [32.68436, -13.55769], [32.66468, -13.60019], [32.68654, -13.64268], [32.7828, -13.64805], [32.84528, -13.71576], [32.76962, -13.77224], [32.79015, -13.80755], [32.88985, -13.82956], [32.99042, -13.95689], [33.02977, -14.05022], [33.07568, -13.98447], [33.16749, -13.93992], [33.24249, -14.00019], [33.66677, -14.61306], [33.7247, -14.4989], [33.88503, -14.51652], [33.92898, -14.47929], [34.08588, -14.48893], [34.18733, -14.43823], [34.22355, -14.43607], [34.34453, -14.3985], [34.35843, -14.38652], [34.39277, -14.39467], [34.4192, -14.43191], [34.44641, -14.47746], [34.45053, -14.49873], [34.47628, -14.53363], [34.48932, -14.53646], [34.49636, -14.55091], [34.52366, -14.5667], [34.53962, -14.59776], [34.55112, -14.64494], [34.53516, -14.67782], [34.52057, -14.68263], [34.54503, -14.74672], [34.567, -14.77345], [34.61522, -14.99583], [34.57503, -15.30619], [34.43126, -15.44778], [34.44981, -15.60864], [34.25195, -15.90321], [34.43126, -16.04737], [34.40344, -16.20923], [35.04805, -16.83167], [35.13771, -16.81687], [35.17017, -16.93521], [35.04805, -17.00027], [35.0923, -17.13235], [35.3062, -17.1244], [35.27065, -16.93817], [35.30929, -16.82871], [35.27219, -16.69402], [35.14235, -16.56812], [35.25828, -16.4792], [35.30157, -16.2211], [35.43355, -16.11371], [35.52365, -16.15414], [35.70107, -16.10147], [35.80487, -16.03907], [35.85303, -15.41913], [35.78799, -15.17428], [35.91812, -14.89514], [35.87212, -14.89478], [35.86945, -14.67481], [35.5299, -14.27714], [35.47989, -14.15594], [34.86229, -13.48958], [34.60253, -13.48487], [34.37831, -12.17408], [34.46088, -12.0174], [34.70739, -12.15652], [34.82903, -12.04837], [34.57917, -11.87849], [34.64241, -11.57499], [34.96296, -11.57354], [34.91153, -11.39799], [34.79375, -11.32245], [34.63305, -11.11731], [34.61161, -11.01611], [34.67047, -10.93796], [34.65946, -10.6828], [34.57581, -10.56271], [34.51911, -10.12279], [34.54499, -10.0678], [34.03865, -9.49398], [33.95829, -9.54066], [33.9638, -9.62206], [33.93298, -9.71647], [33.76677, -9.58516], [33.48052, -9.62442]]]] } },
34244 { type: "Feature", properties: { iso1A2: "MX", iso1A3: "MEX", iso1N3: "484", wikidata: "Q96", nameEn: "Mexico", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["52"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-117.1243, 32.53427], [-118.48109, 32.5991], [-120.12904, 18.41089], [-92.37213, 14.39277], [-92.2261, 14.53423], [-92.1454, 14.6804], [-92.18161, 14.84147], [-92.1423, 14.88647], [-92.1454, 14.98143], [-92.0621, 15.07406], [-92.20983, 15.26077], [-91.73182, 16.07371], [-90.44567, 16.07573], [-90.40499, 16.40524], [-90.61212, 16.49832], [-90.69064, 16.70697], [-91.04436, 16.92175], [-91.43809, 17.25373], [-90.99199, 17.25192], [-90.98678, 17.81655], [-89.14985, 17.81563], [-89.15105, 17.95104], [-89.03839, 18.0067], [-88.8716, 17.89535], [-88.71505, 18.0707], [-88.48242, 18.49164], [-88.3268, 18.49048], [-88.29909, 18.47591], [-88.26593, 18.47617], [-88.03238, 18.41778], [-88.03165, 18.16657], [-87.90671, 18.15213], [-87.87604, 18.18313], [-87.86657, 18.19971], [-87.85693, 18.18266], [-87.84815, 18.18511], [-86.92368, 17.61462], [-85.9092, 21.8218], [-96.92418, 25.97377], [-97.13927, 25.96583], [-97.35946, 25.92189], [-97.37332, 25.83854], [-97.42511, 25.83969], [-97.45669, 25.86874], [-97.49828, 25.89877], [-97.52025, 25.88518], [-97.66511, 26.01708], [-97.95155, 26.0625], [-97.97017, 26.05232], [-98.24603, 26.07191], [-98.27075, 26.09457], [-98.30491, 26.10475], [-98.35126, 26.15129], [-99.00546, 26.3925], [-99.03053, 26.41249], [-99.08477, 26.39849], [-99.53573, 27.30926], [-99.49744, 27.43746], [-99.482, 27.47128], [-99.48045, 27.49016], [-99.50208, 27.50021], [-99.52955, 27.49747], [-99.51478, 27.55836], [-99.55409, 27.61314], [-100.50029, 28.66117], [-100.51222, 28.70679], [-100.5075, 28.74066], [-100.52313, 28.75598], [-100.59809, 28.88197], [-100.63689, 28.90812], [-100.67294, 29.09744], [-100.79696, 29.24688], [-100.87982, 29.296], [-100.94056, 29.33371], [-100.94579, 29.34523], [-100.96725, 29.3477], [-101.01128, 29.36947], [-101.05686, 29.44738], [-101.47277, 29.7744], [-102.60596, 29.8192], [-103.15787, 28.93865], [-104.37752, 29.54255], [-104.39363, 29.55396], [-104.3969, 29.57105], [-104.5171, 29.64671], [-104.77674, 30.4236], [-106.00363, 31.39181], [-106.09025, 31.40569], [-106.20346, 31.46305], [-106.23711, 31.51262], [-106.24612, 31.54193], [-106.28084, 31.56173], [-106.30305, 31.62154], [-106.33419, 31.66303], [-106.34864, 31.69663], [-106.3718, 31.71165], [-106.38003, 31.73151], [-106.41773, 31.75196], [-106.43419, 31.75478], [-106.45244, 31.76523], [-106.46726, 31.75998], [-106.47298, 31.75054], [-106.48815, 31.74769], [-106.50111, 31.75714], [-106.50962, 31.76155], [-106.51251, 31.76922], [-106.52266, 31.77509], [-106.529, 31.784], [-108.20899, 31.78534], [-108.20979, 31.33316], [-111.07523, 31.33232], [-114.82011, 32.49609], [-114.79524, 32.55731], [-114.81141, 32.55543], [-114.80584, 32.62028], [-114.76736, 32.64094], [-114.71871, 32.71894], [-115.88053, 32.63624], [-117.1243, 32.53427]]]] } },
34245 { type: "Feature", properties: { iso1A2: "MY", iso1A3: "MYS", iso1N3: "458", wikidata: "Q833", nameEn: "Malaysia" }, geometry: null },
34246 { type: "Feature", properties: { iso1A2: "MZ", iso1A3: "MOZ", iso1N3: "508", wikidata: "Q1029", nameEn: "Mozambique", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["258"] }, geometry: { type: "MultiPolygon", coordinates: [[[[40.74206, -10.25691], [40.44265, -10.4618], [40.00295, -10.80255], [39.58249, -10.96043], [39.24395, -11.17433], [38.88996, -11.16978], [38.47258, -11.4199], [38.21598, -11.27289], [37.93618, -11.26228], [37.8388, -11.3123], [37.76614, -11.53352], [37.3936, -11.68949], [36.80309, -11.56836], [36.62068, -11.72884], [36.19094, -11.70008], [36.19094, -11.57593], [35.82767, -11.41081], [35.63599, -11.55927], [34.96296, -11.57354], [34.64241, -11.57499], [34.57917, -11.87849], [34.82903, -12.04837], [34.70739, -12.15652], [34.46088, -12.0174], [34.37831, -12.17408], [34.60253, -13.48487], [34.86229, -13.48958], [35.47989, -14.15594], [35.5299, -14.27714], [35.86945, -14.67481], [35.87212, -14.89478], [35.91812, -14.89514], [35.78799, -15.17428], [35.85303, -15.41913], [35.80487, -16.03907], [35.70107, -16.10147], [35.52365, -16.15414], [35.43355, -16.11371], [35.30157, -16.2211], [35.25828, -16.4792], [35.14235, -16.56812], [35.27219, -16.69402], [35.30929, -16.82871], [35.27065, -16.93817], [35.3062, -17.1244], [35.0923, -17.13235], [35.04805, -17.00027], [35.17017, -16.93521], [35.13771, -16.81687], [35.04805, -16.83167], [34.40344, -16.20923], [34.43126, -16.04737], [34.25195, -15.90321], [34.44981, -15.60864], [34.43126, -15.44778], [34.57503, -15.30619], [34.61522, -14.99583], [34.567, -14.77345], [34.54503, -14.74672], [34.52057, -14.68263], [34.53516, -14.67782], [34.55112, -14.64494], [34.53962, -14.59776], [34.52366, -14.5667], [34.49636, -14.55091], [34.48932, -14.53646], [34.47628, -14.53363], [34.45053, -14.49873], [34.44641, -14.47746], [34.4192, -14.43191], [34.39277, -14.39467], [34.35843, -14.38652], [34.34453, -14.3985], [34.22355, -14.43607], [34.18733, -14.43823], [34.08588, -14.48893], [33.92898, -14.47929], [33.88503, -14.51652], [33.7247, -14.4989], [33.66677, -14.61306], [33.24249, -14.00019], [30.22098, -14.99447], [30.41902, -15.62269], [30.42568, -15.9962], [30.91597, -15.99924], [30.97761, -16.05848], [31.13171, -15.98019], [31.30563, -16.01193], [31.42451, -16.15154], [31.67988, -16.19595], [31.90223, -16.34388], [31.91324, -16.41569], [32.02772, -16.43892], [32.28529, -16.43892], [32.42838, -16.4727], [32.71017, -16.59932], [32.69917, -16.66893], [32.78943, -16.70267], [32.97655, -16.70689], [32.91051, -16.89446], [32.84113, -16.92259], [32.96554, -17.11971], [33.00517, -17.30477], [33.0426, -17.3468], [32.96554, -17.48964], [32.98536, -17.55891], [33.0492, -17.60298], [32.94133, -17.99705], [33.03159, -18.35054], [33.02278, -18.4696], [32.88629, -18.51344], [32.88629, -18.58023], [32.95013, -18.69079], [32.9017, -18.7992], [32.82465, -18.77419], [32.70137, -18.84712], [32.73439, -18.92628], [32.69917, -18.94293], [32.72118, -19.02204], [32.84006, -19.0262], [32.87088, -19.09279], [32.85107, -19.29238], [32.77966, -19.36098], [32.78282, -19.47513], [32.84446, -19.48343], [32.84666, -19.68462], [32.95013, -19.67219], [33.06461, -19.77787], [33.01178, -20.02007], [32.93032, -20.03868], [32.85987, -20.16686], [32.85987, -20.27841], [32.66174, -20.56106], [32.55167, -20.56312], [32.48122, -20.63319], [32.51644, -20.91929], [32.37115, -21.133], [32.48236, -21.32873], [32.41234, -21.31246], [31.38336, -22.36919], [31.30611, -22.422], [31.55779, -23.176], [31.56539, -23.47268], [31.67942, -23.60858], [31.70223, -23.72695], [31.77445, -23.90082], [31.87707, -23.95293], [31.90368, -24.18892], [31.9835, -24.29983], [32.03196, -25.10785], [32.01676, -25.38117], [31.97875, -25.46356], [32.00631, -25.65044], [31.92649, -25.84216], [31.974, -25.95387], [32.00916, -25.999], [32.08599, -26.00978], [32.10435, -26.15656], [32.07352, -26.40185], [32.13409, -26.5317], [32.13315, -26.84345], [32.19409, -26.84032], [32.22302, -26.84136], [32.29584, -26.852], [32.35222, -26.86027], [34.51034, -26.91792], [42.99868, -12.65261], [40.74206, -10.25691]]]] } },
34247 { type: "Feature", properties: { iso1A2: "NA", iso1A3: "NAM", iso1N3: "516", wikidata: "Q1030", nameEn: "Namibia", groups: ["018", "202", "002", "UN"], driveSide: "left", callingCodes: ["264"] }, geometry: { type: "MultiPolygon", coordinates: [[[[14.28743, -17.38814], [13.95896, -17.43141], [13.36212, -16.98048], [12.97145, -16.98567], [12.52111, -17.24495], [12.07076, -17.15165], [11.75063, -17.25013], [10.5065, -17.25284], [12.51595, -32.27486], [16.45332, -28.63117], [16.46592, -28.57126], [16.59922, -28.53246], [16.90446, -28.057], [17.15405, -28.08573], [17.4579, -28.68718], [18.99885, -28.89165], [19.99882, -28.42622], [19.99817, -24.76768], [19.99912, -21.99991], [20.99751, -22.00026], [20.99904, -18.31743], [21.45556, -18.31795], [23.0996, -18.00075], [23.29618, -17.99855], [23.61088, -18.4881], [24.19416, -18.01919], [24.40577, -17.95726], [24.57485, -18.07151], [24.6303, -17.9863], [24.71887, -17.9218], [24.73364, -17.89338], [24.95586, -17.79674], [25.05895, -17.84452], [25.16882, -17.78253], [25.26433, -17.79571], [25.00198, -17.58221], [24.70864, -17.49501], [24.5621, -17.52963], [24.38712, -17.46818], [24.32811, -17.49082], [24.23619, -17.47489], [23.47474, -17.62877], [21.42741, -18.02787], [21.14283, -17.94318], [18.84226, -17.80375], [18.39229, -17.38927], [14.28743, -17.38814]]]] } },
34248 { type: "Feature", properties: { iso1A2: "NC", iso1A3: "NCL", iso1N3: "540", wikidata: "Q33788", nameEn: "New Caledonia", country: "FR", groups: ["EU", "Q1451600", "054", "009", "UN"], callingCodes: ["687"] }, geometry: { type: "MultiPolygon", coordinates: [[[[159.77159, -28.41151], [174.245, -23.1974], [156.73836, -14.50464], [159.77159, -28.41151]]]] } },
34249 { type: "Feature", properties: { iso1A2: "NE", iso1A3: "NER", iso1N3: "562", wikidata: "Q1032", nameEn: "Niger", aliases: ["RN"], groups: ["011", "202", "002", "UN"], callingCodes: ["227"] }, geometry: { type: "MultiPolygon", coordinates: [[[[14.22918, 22.61719], [13.5631, 23.16574], [11.96886, 23.51735], [7.48273, 20.87258], [7.38361, 20.79165], [5.8153, 19.45101], [4.26651, 19.14224], [4.26762, 17.00432], [4.21787, 17.00118], [4.19893, 16.39923], [3.50368, 15.35934], [3.03134, 15.42221], [3.01806, 15.34571], [1.31275, 15.27978], [0.96711, 14.98275], [0.72632, 14.95898], [0.23859, 15.00135], [0.16936, 14.51654], [0.38051, 14.05575], [0.61924, 13.68491], [0.77377, 13.6866], [0.77637, 13.64442], [0.99514, 13.5668], [1.02813, 13.46635], [1.20088, 13.38951], [1.24429, 13.39373], [1.28509, 13.35488], [1.24516, 13.33968], [1.21217, 13.37853], [1.18873, 13.31771], [0.99253, 13.37515], [0.99167, 13.10727], [2.26349, 12.41915], [2.05785, 12.35539], [2.39723, 11.89473], [2.45824, 11.98672], [2.39657, 12.10952], [2.37783, 12.24804], [2.6593, 12.30631], [2.83978, 12.40585], [3.25352, 12.01467], [3.31613, 11.88495], [3.48187, 11.86092], [3.59375, 11.70269], [3.61075, 11.69181], [3.67988, 11.75429], [3.67122, 11.80865], [3.63063, 11.83042], [3.61955, 11.91847], [3.67775, 11.97599], [3.63136, 12.11826], [3.66364, 12.25884], [3.65111, 12.52223], [3.94339, 12.74979], [4.10006, 12.98862], [4.14367, 13.17189], [4.14186, 13.47586], [4.23456, 13.47725], [4.4668, 13.68286], [4.87425, 13.78], [4.9368, 13.7345], [5.07396, 13.75052], [5.21026, 13.73627], [5.27797, 13.75474], [5.35437, 13.83567], [5.52957, 13.8845], [6.15771, 13.64564], [6.27411, 13.67835], [6.43053, 13.6006], [6.69617, 13.34057], [6.94445, 12.99825], [7.0521, 13.00076], [7.12676, 13.02445], [7.22399, 13.1293], [7.39241, 13.09717], [7.81085, 13.34902], [8.07997, 13.30847], [8.25185, 13.20369], [8.41853, 13.06166], [8.49493, 13.07519], [8.60431, 13.01768], [8.64251, 12.93985], [8.97413, 12.83661], [9.65995, 12.80614], [10.00373, 13.18171], [10.19993, 13.27129], [10.46731, 13.28819], [10.66004, 13.36422], [11.4535, 13.37773], [11.88236, 13.2527], [12.04209, 13.14452], [12.16189, 13.10056], [12.19315, 13.12423], [12.47095, 13.06673], [12.58033, 13.27805], [12.6793, 13.29157], [12.87376, 13.48919], [13.05085, 13.53984], [13.19844, 13.52802], [13.33213, 13.71195], [13.6302, 13.71094], [13.47559, 14.40881], [13.48259, 14.46704], [13.68573, 14.55276], [13.67878, 14.64013], [13.809, 14.72915], [13.78991, 14.87519], [13.86301, 15.04043], [14.37425, 15.72591], [15.50373, 16.89649], [15.6032, 18.77402], [15.75098, 19.93002], [15.99632, 20.35364], [15.6721, 20.70069], [15.59841, 20.74039], [15.56004, 20.79488], [15.55382, 20.86507], [15.57248, 20.92138], [15.62515, 20.95395], [15.28332, 21.44557], [15.20213, 21.49365], [15.19692, 21.99339], [14.99751, 23.00539], [14.22918, 22.61719]]]] } },
34250 { type: "Feature", properties: { iso1A2: "NF", iso1A3: "NFK", iso1N3: "574", wikidata: "Q31057", nameEn: "Norfolk Island", country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["672 3"] }, geometry: { type: "MultiPolygon", coordinates: [[[[169.82316, -28.16667], [166.29505, -28.29175], [167.94076, -30.60745], [169.82316, -28.16667]]]] } },
34251 { type: "Feature", properties: { iso1A2: "NG", iso1A3: "NGA", iso1N3: "566", wikidata: "Q1033", nameEn: "Nigeria", groups: ["011", "202", "002", "UN"], callingCodes: ["234"] }, geometry: { type: "MultiPolygon", coordinates: [[[[6.15771, 13.64564], [5.52957, 13.8845], [5.35437, 13.83567], [5.27797, 13.75474], [5.21026, 13.73627], [5.07396, 13.75052], [4.9368, 13.7345], [4.87425, 13.78], [4.4668, 13.68286], [4.23456, 13.47725], [4.14186, 13.47586], [4.14367, 13.17189], [4.10006, 12.98862], [3.94339, 12.74979], [3.65111, 12.52223], [3.66364, 12.25884], [3.63136, 12.11826], [3.67775, 11.97599], [3.61955, 11.91847], [3.63063, 11.83042], [3.67122, 11.80865], [3.67988, 11.75429], [3.61075, 11.69181], [3.59375, 11.70269], [3.49175, 11.29765], [3.71505, 11.13015], [3.84243, 10.59316], [3.78292, 10.40538], [3.6844, 10.46351], [3.57275, 10.27185], [3.66908, 10.18136], [3.54429, 9.87739], [3.35383, 9.83641], [3.32099, 9.78032], [3.34726, 9.70696], [3.25093, 9.61632], [3.13928, 9.47167], [3.14147, 9.28375], [3.08017, 9.10006], [2.77907, 9.06924], [2.67523, 7.87825], [2.73095, 7.7755], [2.73405, 7.5423], [2.78668, 7.5116], [2.79442, 7.43486], [2.74489, 7.42565], [2.76965, 7.13543], [2.71702, 6.95722], [2.74024, 6.92802], [2.73405, 6.78508], [2.78823, 6.76356], [2.78204, 6.70514], [2.7325, 6.64057], [2.74334, 6.57291], [2.70464, 6.50831], [2.70566, 6.38038], [2.74181, 6.13349], [5.87055, 3.78489], [8.34397, 4.30689], [8.60302, 4.87353], [8.78027, 5.1243], [8.92029, 5.58403], [8.83687, 5.68483], [8.88156, 5.78857], [8.84209, 5.82562], [9.51757, 6.43874], [9.70674, 6.51717], [9.77824, 6.79088], [9.86314, 6.77756], [10.15135, 7.03781], [10.21466, 6.88996], [10.53639, 6.93432], [10.57214, 7.16345], [10.59746, 7.14719], [10.60789, 7.06885], [10.83727, 6.9358], [10.8179, 6.83377], [10.94302, 6.69325], [11.09644, 6.68437], [11.09495, 6.51717], [11.42041, 6.53789], [11.42264, 6.5882], [11.51499, 6.60892], [11.57755, 6.74059], [11.55818, 6.86186], [11.63117, 6.9905], [11.87396, 7.09398], [11.84864, 7.26098], [11.93205, 7.47812], [12.01844, 7.52981], [11.99908, 7.67302], [12.20909, 7.97553], [12.19271, 8.10826], [12.24782, 8.17904], [12.26123, 8.43696], [12.4489, 8.52536], [12.44146, 8.6152], [12.68722, 8.65938], [12.71701, 8.7595], [12.79, 8.75361], [12.81085, 8.91992], [12.90022, 9.11411], [12.91958, 9.33905], [12.85628, 9.36698], [13.02385, 9.49334], [13.22642, 9.57266], [13.25472, 9.76795], [13.29941, 9.8296], [13.25025, 9.86042], [13.24132, 9.91031], [13.27409, 9.93232], [13.286, 9.9822], [13.25323, 10.00127], [13.25025, 10.03647], [13.34111, 10.12299], [13.43644, 10.13326], [13.5705, 10.53183], [13.54964, 10.61236], [13.73434, 10.9255], [13.70753, 10.94451], [13.7403, 11.00593], [13.78945, 11.00154], [13.97489, 11.30258], [14.17821, 11.23831], [14.6124, 11.51283], [14.64591, 11.66166], [14.55207, 11.72001], [14.61612, 11.7798], [14.6474, 12.17466], [14.4843, 12.35223], [14.22215, 12.36533], [14.17523, 12.41916], [14.20204, 12.53405], [14.08251, 13.0797], [13.6302, 13.71094], [13.33213, 13.71195], [13.19844, 13.52802], [13.05085, 13.53984], [12.87376, 13.48919], [12.6793, 13.29157], [12.58033, 13.27805], [12.47095, 13.06673], [12.19315, 13.12423], [12.16189, 13.10056], [12.04209, 13.14452], [11.88236, 13.2527], [11.4535, 13.37773], [10.66004, 13.36422], [10.46731, 13.28819], [10.19993, 13.27129], [10.00373, 13.18171], [9.65995, 12.80614], [8.97413, 12.83661], [8.64251, 12.93985], [8.60431, 13.01768], [8.49493, 13.07519], [8.41853, 13.06166], [8.25185, 13.20369], [8.07997, 13.30847], [7.81085, 13.34902], [7.39241, 13.09717], [7.22399, 13.1293], [7.12676, 13.02445], [7.0521, 13.00076], [6.94445, 12.99825], [6.69617, 13.34057], [6.43053, 13.6006], [6.27411, 13.67835], [6.15771, 13.64564]]]] } },
34252 { type: "Feature", properties: { iso1A2: "NI", iso1A3: "NIC", iso1N3: "558", wikidata: "Q811", nameEn: "Nicaragua", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["505"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-83.13724, 15.00002], [-83.49268, 15.01158], [-83.62101, 14.89448], [-83.89551, 14.76697], [-84.10584, 14.76353], [-84.48373, 14.63249], [-84.70119, 14.68078], [-84.82596, 14.82212], [-84.90082, 14.80489], [-85.1575, 14.53934], [-85.18602, 14.24929], [-85.32149, 14.2562], [-85.45762, 14.11304], [-85.73964, 13.9698], [-85.75477, 13.8499], [-86.03458, 13.99181], [-86.00685, 14.08474], [-86.14801, 14.04317], [-86.35219, 13.77157], [-86.76812, 13.79605], [-86.71267, 13.30348], [-86.87066, 13.30641], [-86.93383, 13.18677], [-86.93197, 13.05313], [-87.03785, 12.98682], [-87.06306, 13.00892], [-87.37107, 12.98646], [-87.55124, 13.12523], [-87.7346, 13.13228], [-88.11443, 12.63306], [-86.14524, 11.09059], [-85.71223, 11.06868], [-85.60529, 11.22607], [-84.92439, 10.9497], [-84.68197, 11.07568], [-83.90838, 10.71161], [-83.66597, 10.79916], [-83.68276, 11.01562], [-82.56142, 11.91792], [-82.06974, 14.49418], [-83.04763, 15.03256], [-83.13724, 15.00002]]]] } },
34253 { type: "Feature", properties: { iso1A2: "NL", iso1A3: "NLD", iso1N3: "528", wikidata: "Q29999", nameEn: "Kingdom of the Netherlands" }, geometry: null },
34254 { type: "Feature", properties: { iso1A2: "NO", iso1A3: "NOR", iso1N3: "578", wikidata: "Q20", nameEn: "Norway" }, geometry: null },
34255 { type: "Feature", properties: { iso1A2: "NP", iso1A3: "NPL", iso1N3: "524", wikidata: "Q837", nameEn: "Nepal", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["977"] }, geometry: { type: "MultiPolygon", coordinates: [[[[88.13378, 27.88015], [87.82681, 27.95248], [87.72718, 27.80938], [87.56996, 27.84517], [87.11696, 27.84104], [87.03757, 27.94835], [86.75582, 28.04182], [86.74181, 28.10638], [86.56265, 28.09569], [86.51609, 27.96623], [86.42736, 27.91122], [86.22966, 27.9786], [86.18607, 28.17364], [86.088, 28.09264], [86.08333, 28.02121], [86.12069, 27.93047], [86.06309, 27.90021], [85.94946, 27.9401], [85.97813, 27.99023], [85.90743, 28.05144], [85.84672, 28.18187], [85.74864, 28.23126], [85.71907, 28.38064], [85.69105, 28.38475], [85.60854, 28.25045], [85.59765, 28.30529], [85.4233, 28.32996], [85.38127, 28.28336], [85.10729, 28.34092], [85.18668, 28.54076], [85.19135, 28.62825], [85.06059, 28.68562], [84.85511, 28.58041], [84.62317, 28.73887], [84.47528, 28.74023], [84.2231, 28.89571], [84.24801, 29.02783], [84.18107, 29.23451], [83.97559, 29.33091], [83.82303, 29.30513], [83.63156, 29.16249], [83.44787, 29.30513], [83.28131, 29.56813], [83.07116, 29.61957], [82.73024, 29.81695], [82.5341, 29.9735], [82.38622, 30.02608], [82.16984, 30.0692], [82.19475, 30.16884], [82.10757, 30.23745], [82.10135, 30.35439], [81.99082, 30.33423], [81.62033, 30.44703], [81.5459, 30.37688], [81.41018, 30.42153], [81.39928, 30.21862], [81.33355, 30.15303], [81.2623, 30.14596], [81.29032, 30.08806], [81.24362, 30.0126], [81.12842, 30.01395], [81.03953, 30.20059], [80.92547, 30.17193], [80.91143, 30.22173], [80.86673, 30.17321], [80.8778, 30.13384], [80.67076, 29.95732], [80.60226, 29.95732], [80.57179, 29.91422], [80.56247, 29.86661], [80.48997, 29.79566], [80.43458, 29.80466], [80.41554, 29.79451], [80.36803, 29.73865], [80.38428, 29.68513], [80.41858, 29.63581], [80.37939, 29.57098], [80.24322, 29.44299], [80.31428, 29.30784], [80.28626, 29.20327], [80.24112, 29.21414], [80.26602, 29.13938], [80.23178, 29.11626], [80.18085, 29.13649], [80.05743, 28.91479], [80.06957, 28.82763], [80.12125, 28.82346], [80.37188, 28.63371], [80.44504, 28.63098], [80.52443, 28.54897], [80.50575, 28.6706], [80.55142, 28.69182], [81.03471, 28.40054], [81.19847, 28.36284], [81.32923, 28.13521], [81.38683, 28.17638], [81.48179, 28.12148], [81.47867, 28.08303], [81.91223, 27.84995], [81.97214, 27.93322], [82.06554, 27.92222], [82.46405, 27.6716], [82.70378, 27.72122], [82.74119, 27.49838], [82.93261, 27.50328], [82.94938, 27.46036], [83.19413, 27.45632], [83.27197, 27.38309], [83.2673, 27.36235], [83.29999, 27.32778], [83.35136, 27.33885], [83.38872, 27.39276], [83.39495, 27.4798], [83.61288, 27.47013], [83.85595, 27.35797], [83.86182, 27.4241], [83.93306, 27.44939], [84.02229, 27.43836], [84.10791, 27.52399], [84.21376, 27.45218], [84.25735, 27.44941], [84.29315, 27.39], [84.62161, 27.33885], [84.69166, 27.21294], [84.64496, 27.04669], [84.793, 26.9968], [84.82913, 27.01989], [84.85754, 26.98984], [84.96687, 26.95599], [84.97186, 26.9149], [85.00536, 26.89523], [85.05592, 26.88991], [85.02635, 26.85381], [85.15883, 26.86966], [85.19291, 26.86909], [85.18046, 26.80519], [85.21159, 26.75933], [85.34302, 26.74954], [85.47752, 26.79292], [85.56471, 26.84133], [85.5757, 26.85955], [85.59461, 26.85161], [85.61621, 26.86721], [85.66239, 26.84822], [85.73483, 26.79613], [85.72315, 26.67471], [85.76907, 26.63076], [85.83126, 26.61134], [85.85126, 26.60866], [85.8492, 26.56667], [86.02729, 26.66756], [86.13596, 26.60651], [86.22513, 26.58863], [86.26235, 26.61886], [86.31564, 26.61925], [86.49726, 26.54218], [86.54258, 26.53819], [86.57073, 26.49825], [86.61313, 26.48658], [86.62686, 26.46891], [86.69124, 26.45169], [86.74025, 26.42386], [86.76797, 26.45892], [86.82898, 26.43919], [86.94543, 26.52076], [86.95912, 26.52076], [87.01559, 26.53228], [87.04691, 26.58685], [87.0707, 26.58571], [87.09147, 26.45039], [87.14751, 26.40542], [87.18863, 26.40558], [87.24682, 26.4143], [87.26587, 26.40592], [87.26568, 26.37294], [87.34568, 26.34787], [87.37314, 26.40815], [87.46566, 26.44058], [87.51571, 26.43106], [87.55274, 26.40596], [87.59175, 26.38342], [87.66803, 26.40294], [87.67893, 26.43501], [87.76004, 26.40711], [87.7918, 26.46737], [87.84193, 26.43663], [87.89085, 26.48565], [87.90115, 26.44923], [88.00895, 26.36029], [88.09414, 26.43732], [88.09963, 26.54195], [88.16452, 26.64111], [88.1659, 26.68177], [88.19107, 26.75516], [88.12302, 26.95324], [88.13422, 26.98705], [88.11719, 26.98758], [87.9887, 27.11045], [88.01587, 27.21388], [88.01646, 27.21612], [88.07277, 27.43007], [88.04008, 27.49223], [88.19107, 27.79285], [88.1973, 27.85067], [88.13378, 27.88015]]]] } },
34256 { type: "Feature", properties: { iso1A2: "NR", iso1A3: "NRU", iso1N3: "520", wikidata: "Q697", nameEn: "Nauru", groups: ["057", "009", "UN"], driveSide: "left", callingCodes: ["674"] }, geometry: { type: "MultiPolygon", coordinates: [[[[166.95155, 0.14829], [166.21778, -0.7977], [167.60042, -0.88259], [166.95155, 0.14829]]]] } },
34257 { type: "Feature", properties: { iso1A2: "NU", iso1A3: "NIU", iso1N3: "570", wikidata: "Q34020", nameEn: "Niue", country: "NZ", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["683"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-170.83899, -18.53439], [-170.82274, -20.44429], [-168.63096, -18.60489], [-170.83899, -18.53439]]]] } },
34258 { type: "Feature", properties: { iso1A2: "NZ", iso1A3: "NZL", iso1N3: "554", wikidata: "Q664", nameEn: "New Zealand" }, geometry: null },
34259 { type: "Feature", properties: { iso1A2: "OM", iso1A3: "OMN", iso1N3: "512", wikidata: "Q842", nameEn: "Oman", groups: ["145", "142", "UN"], callingCodes: ["968"] }, geometry: { type: "MultiPolygon", coordinates: [[[[56.82555, 25.7713], [56.79239, 26.41236], [56.68954, 26.76645], [56.2644, 26.58649], [55.81777, 26.18798], [56.08666, 26.05038], [56.15498, 26.06828], [56.19334, 25.9795], [56.13963, 25.82765], [56.17416, 25.77239], [56.13579, 25.73524], [56.14826, 25.66351], [56.18363, 25.65508], [56.20473, 25.61119], [56.25365, 25.60211], [56.26636, 25.60643], [56.25341, 25.61443], [56.26534, 25.62825], [56.82555, 25.7713]]], [[[56.26062, 25.33108], [56.23362, 25.31253], [56.25008, 25.28843], [56.24465, 25.27505], [56.20838, 25.25668], [56.20872, 25.24104], [56.24341, 25.22867], [56.27628, 25.23404], [56.34438, 25.26653], [56.35172, 25.30681], [56.3111, 25.30107], [56.3005, 25.31815], [56.26062, 25.33108]], [[56.28423, 25.26344], [56.27086, 25.26128], [56.2716, 25.27916], [56.28102, 25.28486], [56.29379, 25.2754], [56.28423, 25.26344]]], [[[61.45114, 22.55394], [56.86325, 25.03856], [56.3227, 24.97284], [56.34873, 24.93205], [56.30269, 24.88334], [56.20568, 24.85063], [56.20062, 24.78565], [56.13684, 24.73699], [56.06128, 24.74457], [56.03535, 24.81161], [55.97836, 24.87673], [55.97467, 24.89639], [56.05106, 24.87461], [56.05715, 24.95727], [55.96316, 25.00857], [55.90849, 24.96771], [55.85094, 24.96858], [55.81116, 24.9116], [55.81348, 24.80102], [55.83408, 24.77858], [55.83271, 24.68567], [55.76461, 24.5287], [55.83271, 24.41521], [55.83395, 24.32776], [55.80747, 24.31069], [55.79145, 24.27914], [55.76781, 24.26209], [55.75939, 24.26114], [55.75382, 24.2466], [55.75257, 24.23466], [55.76558, 24.23227], [55.77658, 24.23476], [55.83367, 24.20193], [55.95472, 24.2172], [56.01799, 24.07426], [55.8308, 24.01633], [55.73301, 24.05994], [55.48677, 23.94946], [55.57358, 23.669], [55.22634, 23.10378], [55.2137, 22.71065], [55.66469, 21.99658], [54.99756, 20.00083], [52.00311, 19.00083], [52.78009, 17.35124], [52.74267, 17.29519], [52.81185, 17.28568], [57.49095, 8.14549], [61.45114, 22.55394]]]] } },
34260 { type: "Feature", properties: { iso1A2: "PA", iso1A3: "PAN", iso1N3: "591", wikidata: "Q804", nameEn: "Panama", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["507"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-77.32389, 8.81247], [-77.58292, 9.22278], [-78.79327, 9.93766], [-82.51044, 9.65379], [-82.56507, 9.57279], [-82.61345, 9.49881], [-82.66667, 9.49746], [-82.77206, 9.59573], [-82.87919, 9.62645], [-82.84871, 9.4973], [-82.93516, 9.46741], [-82.93516, 9.07687], [-82.72126, 8.97125], [-82.88253, 8.83331], [-82.91377, 8.774], [-82.92068, 8.74832], [-82.8794, 8.6981], [-82.82739, 8.60153], [-82.83975, 8.54755], [-82.83322, 8.52464], [-82.8382, 8.48117], [-82.8679, 8.44042], [-82.93056, 8.43465], [-83.05209, 8.33394], [-82.9388, 8.26634], [-82.88641, 8.10219], [-82.89137, 8.05755], [-82.89978, 8.04083], [-82.94503, 7.93865], [-82.13751, 6.97312], [-78.06168, 7.07793], [-77.89178, 7.22681], [-77.81426, 7.48319], [-77.72157, 7.47612], [-77.72514, 7.72348], [-77.57185, 7.51147], [-77.17257, 7.97422], [-77.45064, 8.49991], [-77.32389, 8.81247]]]] } },
34261 { type: "Feature", properties: { iso1A2: "PE", iso1A3: "PER", iso1N3: "604", wikidata: "Q419", nameEn: "Peru", groups: ["005", "419", "019", "UN"], callingCodes: ["51"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-74.26675, -0.97229], [-74.42701, -0.50218], [-75.18513, -0.0308], [-75.25764, -0.11943], [-75.40192, -0.17196], [-75.61997, -0.10012], [-75.60169, -0.18708], [-75.53615, -0.19213], [-75.22862, -0.60048], [-75.22862, -0.95588], [-75.3872, -0.9374], [-75.57429, -1.55961], [-76.05203, -2.12179], [-76.6324, -2.58397], [-77.94147, -3.05454], [-78.19369, -3.36431], [-78.14324, -3.47653], [-78.22642, -3.51113], [-78.24589, -3.39907], [-78.34362, -3.38633], [-78.68394, -4.60754], [-78.85149, -4.66795], [-79.01659, -5.01481], [-79.1162, -4.97774], [-79.26248, -4.95167], [-79.59402, -4.46848], [-79.79722, -4.47558], [-80.13945, -4.29786], [-80.39256, -4.48269], [-80.46386, -4.41516], [-80.32114, -4.21323], [-80.45023, -4.20938], [-80.4822, -4.05477], [-80.46386, -4.01342], [-80.13232, -3.90317], [-80.19926, -3.68894], [-80.18741, -3.63994], [-80.19848, -3.59249], [-80.21642, -3.5888], [-80.20535, -3.51667], [-80.22629, -3.501], [-80.23651, -3.48652], [-80.24586, -3.48677], [-80.24123, -3.46124], [-80.20647, -3.431], [-80.30602, -3.39149], [-84.52388, -3.36941], [-85.71054, -21.15413], [-70.59118, -18.35072], [-70.378, -18.3495], [-70.31267, -18.31258], [-70.16394, -18.31737], [-69.96732, -18.25992], [-69.81607, -18.12582], [-69.75305, -17.94605], [-69.82868, -17.72048], [-69.79087, -17.65563], [-69.66483, -17.65083], [-69.46897, -17.4988], [-69.46863, -17.37466], [-69.62883, -17.28142], [-69.16896, -16.72233], [-69.00853, -16.66769], [-69.04027, -16.57214], [-68.98358, -16.42165], [-68.79464, -16.33272], [-68.96238, -16.194], [-69.09986, -16.22693], [-69.20291, -16.16668], [-69.40336, -15.61358], [-69.14856, -15.23478], [-69.36254, -14.94634], [-68.88135, -14.18639], [-69.05265, -13.68546], [-68.8864, -13.40792], [-68.85615, -12.87769], [-68.65044, -12.50689], [-68.98115, -11.8979], [-69.57156, -10.94555], [-69.57835, -10.94051], [-69.90896, -10.92744], [-70.38791, -11.07096], [-70.51395, -10.92249], [-70.64134, -11.0108], [-70.62487, -9.80666], [-70.55429, -9.76692], [-70.59272, -9.62142], [-70.49706, -9.425], [-71.23394, -9.9668], [-72.14742, -9.98049], [-72.31883, -9.5184], [-72.72216, -9.41397], [-73.21498, -9.40904], [-72.92886, -9.04074], [-73.76576, -7.89884], [-73.65485, -7.77897], [-73.96938, -7.58465], [-73.77011, -7.28944], [-73.73986, -6.87919], [-73.12983, -6.43852], [-73.24116, -6.07187], [-72.87086, -5.26346], [-72.83973, -5.14765], [-72.64391, -5.0391], [-71.87003, -4.51661], [-70.96814, -4.36915], [-70.78125, -4.16295], [-70.74728, -4.16112], [-70.73715, -4.17416], [-70.33236, -4.15214], [-70.27991, -4.23226], [-70.30567, -4.24361], [-70.19582, -4.3607], [-70.14422, -4.2714], [-70.0533, -4.2907], [-70.04593, -4.37554], [-70.02689, -4.37095], [-70.03272, -4.35441], [-69.99218, -4.32041], [-69.95836, -4.32881], [-69.94924, -4.23116], [-69.96843, -4.19678], [-70.28573, -3.82549], [-70.3374, -3.79505], [-70.52393, -3.87553], [-70.71396, -3.7921], [-70.04609, -2.73906], [-70.94377, -2.23142], [-71.75223, -2.15058], [-72.92587, -2.44514], [-73.65312, -1.26222], [-74.26675, -0.97229]]]] } },
34262 { type: "Feature", properties: { iso1A2: "PF", iso1A3: "PYF", iso1N3: "258", wikidata: "Q30971", nameEn: "French Polynesia", country: "FR", groups: ["EU", "Q1451600", "061", "009", "UN"], callingCodes: ["689"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-135.59706, -4.70473], [-156.48634, -15.52824], [-156.45576, -31.75456], [-133.59543, -28.4709], [-135.59706, -4.70473]]]] } },
34263 { type: "Feature", properties: { iso1A2: "PG", iso1A3: "PNG", iso1N3: "598", wikidata: "Q691", nameEn: "Papua New Guinea", groups: ["054", "009", "UN"], driveSide: "left", callingCodes: ["675"] }, geometry: { type: "MultiPolygon", coordinates: [[[[141.03157, 2.12829], [140.99813, -6.3233], [140.85295, -6.72996], [140.90448, -6.85033], [141.01763, -6.90181], [141.01842, -9.35091], [141.88934, -9.36111], [142.19246, -9.15378], [142.48658, -9.36754], [143.29772, -9.33993], [143.87386, -9.02382], [145.2855, -9.62524], [156.73836, -14.50464], [154.74815, -7.33315], [155.60735, -6.92266], [155.69784, -6.92661], [155.92557, -6.84664], [156.03993, -6.65703], [156.03296, -6.55528], [160.43769, -4.17974], [141.03157, 2.12829]]]] } },
34264 { type: "Feature", properties: { iso1A2: "PH", iso1A3: "PHL", iso1N3: "608", wikidata: "Q928", nameEn: "Philippines", aliases: ["PI", "RP"], groups: ["035", "142", "UN"], callingCodes: ["63"] }, geometry: { type: "MultiPolygon", coordinates: [[[[129.19694, 7.84182], [121.8109, 21.77688], [120.69238, 21.52331], [118.82252, 14.67191], [115.39742, 10.92666], [116.79524, 7.43869], [117.17735, 7.52841], [117.93857, 6.89845], [117.96674, 6.28383], [118.33378, 5.99991], [119.52945, 5.35672], [118.99941, 4.76678], [118.93936, 4.09009], [118.06469, 4.16638], [121.14448, 2.12444], [129.19694, 7.84182]]]] } },
34265 { type: "Feature", properties: { iso1A2: "PK", iso1A3: "PAK", iso1N3: "586", wikidata: "Q843", nameEn: "Pakistan", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["92"] }, geometry: { type: "MultiPolygon", coordinates: [[[[75.72737, 36.7529], [75.45562, 36.71971], [75.40481, 36.95382], [75.13839, 37.02622], [74.56453, 37.03023], [74.53739, 36.96224], [74.43389, 37.00977], [74.04856, 36.82648], [73.82685, 36.91421], [72.6323, 36.84601], [72.18135, 36.71838], [71.80267, 36.49924], [71.60491, 36.39429], [71.19505, 36.04134], [71.37969, 35.95865], [71.55273, 35.71483], [71.49917, 35.6267], [71.65435, 35.4479], [71.54294, 35.31037], [71.5541, 35.28776], [71.67495, 35.21262], [71.52938, 35.09023], [71.55273, 35.02615], [71.49917, 35.00478], [71.50329, 34.97328], [71.29472, 34.87728], [71.28356, 34.80882], [71.08718, 34.69034], [71.11602, 34.63047], [71.0089, 34.54568], [71.02401, 34.44835], [71.17662, 34.36769], [71.12815, 34.26619], [71.13078, 34.16503], [71.09453, 34.13524], [71.09307, 34.11961], [71.06933, 34.10564], [71.07345, 34.06242], [70.88119, 33.97933], [70.54336, 33.9463], [69.90203, 34.04194], [69.87307, 33.9689], [69.85671, 33.93719], [70.00503, 33.73528], [70.14236, 33.71701], [70.14785, 33.6553], [70.20141, 33.64387], [70.17062, 33.53535], [70.32775, 33.34496], [70.13686, 33.21064], [70.07369, 33.22557], [70.02563, 33.14282], [69.85259, 33.09451], [69.79766, 33.13247], [69.71526, 33.09911], [69.57656, 33.09911], [69.49004, 33.01509], [69.49854, 32.88843], [69.5436, 32.8768], [69.47082, 32.85834], [69.38018, 32.76601], [69.43649, 32.7302], [69.44747, 32.6678], [69.38155, 32.56601], [69.2868, 32.53938], [69.23599, 32.45946], [69.27932, 32.29119], [69.27032, 32.14141], [69.3225, 31.93186], [69.20577, 31.85957], [69.11514, 31.70782], [69.00939, 31.62249], [68.95995, 31.64822], [68.91078, 31.59687], [68.79997, 31.61665], [68.6956, 31.75687], [68.57475, 31.83158], [68.44222, 31.76446], [68.27605, 31.75863], [68.25614, 31.80357], [68.1655, 31.82691], [68.00071, 31.6564], [67.86887, 31.63536], [67.72056, 31.52304], [67.58323, 31.52772], [67.62374, 31.40473], [67.7748, 31.4188], [67.78854, 31.33203], [67.29964, 31.19586], [67.03323, 31.24519], [67.04147, 31.31561], [66.83273, 31.26867], [66.72561, 31.20526], [66.68166, 31.07597], [66.58175, 30.97532], [66.42645, 30.95309], [66.39194, 30.9408], [66.28413, 30.57001], [66.34869, 30.404], [66.23609, 30.06321], [66.36042, 29.9583], [66.24175, 29.85181], [65.04005, 29.53957], [64.62116, 29.58903], [64.19796, 29.50407], [64.12966, 29.39157], [63.5876, 29.50456], [62.47751, 29.40782], [60.87231, 29.86514], [61.31508, 29.38903], [61.53765, 29.00507], [61.65978, 28.77937], [61.93581, 28.55284], [62.40259, 28.42703], [62.59499, 28.24842], [62.79412, 28.28108], [62.7638, 28.02992], [62.84905, 27.47627], [62.79684, 27.34381], [62.80604, 27.22412], [63.19649, 27.25674], [63.32283, 27.14437], [63.25005, 27.08692], [63.25005, 26.84212], [63.18688, 26.83844], [63.1889, 26.65072], [62.77352, 26.64099], [62.31484, 26.528], [62.21304, 26.26601], [62.05117, 26.31647], [61.89391, 26.26251], [61.83831, 26.07249], [61.83968, 25.7538], [61.683, 25.66638], [61.6433, 25.27541], [61.46682, 24.57869], [68.11329, 23.53945], [68.20763, 23.85849], [68.39339, 23.96838], [68.74643, 23.97027], [68.7416, 24.31904], [68.90914, 24.33156], [68.97781, 24.26021], [69.07806, 24.29777], [69.19341, 24.25646], [69.29778, 24.28712], [69.59579, 24.29777], [69.73335, 24.17007], [70.03428, 24.172], [70.11712, 24.30915], [70.5667, 24.43787], [70.57906, 24.27774], [70.71502, 24.23517], [70.88393, 24.27398], [70.85784, 24.30903], [70.94985, 24.3791], [71.04461, 24.34657], [71.12838, 24.42662], [71.00341, 24.46038], [70.97594, 24.60904], [71.09405, 24.69017], [70.94002, 24.92843], [70.89148, 25.15064], [70.66695, 25.39314], [70.67382, 25.68186], [70.60378, 25.71898], [70.53649, 25.68928], [70.37444, 25.67443], [70.2687, 25.71156], [70.0985, 25.93238], [70.08193, 26.08094], [70.17532, 26.24118], [70.17532, 26.55362], [70.05584, 26.60398], [69.88555, 26.56836], [69.50904, 26.74892], [69.58519, 27.18109], [70.03136, 27.56627], [70.12502, 27.8057], [70.37307, 28.01208], [70.60927, 28.02178], [70.79054, 27.68423], [71.89921, 27.96035], [71.9244, 28.11555], [72.20329, 28.3869], [72.29495, 28.66367], [72.40402, 28.78283], [72.94272, 29.02487], [73.01337, 29.16422], [73.05886, 29.1878], [73.28094, 29.56646], [73.3962, 29.94707], [73.58665, 30.01848], [73.80299, 30.06969], [73.97225, 30.19829], [73.95736, 30.28466], [73.88993, 30.36305], [74.5616, 31.04153], [74.67971, 31.05479], [74.6852, 31.12771], [74.60006, 31.13711], [74.60281, 31.10419], [74.56023, 31.08303], [74.51629, 31.13829], [74.53223, 31.30321], [74.59773, 31.4136], [74.64713, 31.45605], [74.59319, 31.50197], [74.61517, 31.55698], [74.57498, 31.60382], [74.47771, 31.72227], [74.58907, 31.87824], [74.79919, 31.95983], [74.86236, 32.04485], [74.9269, 32.0658], [75.00793, 32.03786], [75.25649, 32.10187], [75.38046, 32.26836], [75.28259, 32.36556], [75.03265, 32.49538], [74.97634, 32.45367], [74.84725, 32.49075], [74.68362, 32.49298], [74.67431, 32.56676], [74.65251, 32.56416], [74.64424, 32.60985], [74.69542, 32.66792], [74.65345, 32.71225], [74.7113, 32.84219], [74.64675, 32.82604], [74.6289, 32.75561], [74.45312, 32.77755], [74.41467, 32.90563], [74.31227, 32.92795], [74.34875, 32.97823], [74.31854, 33.02891], [74.17571, 33.07495], [74.15374, 33.13477], [74.02144, 33.18908], [74.01366, 33.25199], [74.08782, 33.26232], [74.17983, 33.3679], [74.18121, 33.4745], [74.10115, 33.56392], [74.03576, 33.56718], [73.97367, 33.64061], [73.98968, 33.66155], [73.96423, 33.73071], [74.00891, 33.75437], [74.05898, 33.82089], [74.14001, 33.83002], [74.26086, 33.92237], [74.25262, 34.01577], [74.21554, 34.03853], [73.91341, 34.01235], [73.88732, 34.05105], [73.90677, 34.10504], [73.98208, 34.2522], [73.90517, 34.35317], [73.8475, 34.32935], [73.74862, 34.34183], [73.74999, 34.3781], [73.88732, 34.48911], [73.89419, 34.54568], [73.93951, 34.57169], [73.93401, 34.63386], [73.96423, 34.68244], [74.12897, 34.70073], [74.31239, 34.79626], [74.58083, 34.77386], [74.6663, 34.703], [75.01479, 34.64629], [75.38009, 34.55021], [75.75438, 34.51827], [76.04614, 34.67566], [76.15463, 34.6429], [76.47186, 34.78965], [76.67648, 34.76371], [76.74377, 34.84039], [76.74514, 34.92488], [76.87193, 34.96906], [76.99251, 34.93349], [77.11796, 35.05419], [76.93465, 35.39866], [76.85088, 35.39754], [76.75475, 35.52617], [76.77323, 35.66062], [76.50961, 35.8908], [76.33453, 35.84296], [76.14913, 35.82848], [76.15325, 35.9264], [75.93028, 36.13136], [76.00906, 36.17511], [76.0324, 36.41198], [75.92391, 36.56986], [75.72737, 36.7529]]]] } },
34266 { type: "Feature", properties: { iso1A2: "PL", iso1A3: "POL", iso1N3: "616", wikidata: "Q36", nameEn: "Poland", groups: ["EU", "151", "150", "UN"], callingCodes: ["48"] }, geometry: { type: "MultiPolygon", coordinates: [[[[18.57853, 55.25302], [14.20811, 54.12784], [14.22634, 53.9291], [14.20647, 53.91671], [14.18544, 53.91258], [14.20823, 53.90776], [14.21323, 53.8664], [14.27249, 53.74464], [14.26782, 53.69866], [14.2836, 53.67721], [14.27133, 53.66613], [14.28477, 53.65955], [14.2853, 53.63392], [14.31904, 53.61581], [14.30416, 53.55499], [14.3273, 53.50587], [14.35209, 53.49506], [14.4215, 53.27724], [14.44133, 53.27427], [14.45125, 53.26241], [14.40662, 53.21098], [14.37853, 53.20405], [14.36696, 53.16444], [14.38679, 53.13669], [14.35044, 53.05829], [14.25954, 53.00264], [14.14056, 52.95786], [14.15873, 52.87715], [14.12256, 52.84311], [14.13806, 52.82392], [14.22071, 52.81175], [14.61073, 52.59847], [14.6289, 52.57136], [14.60081, 52.53116], [14.63056, 52.48993], [14.54423, 52.42568], [14.55228, 52.35264], [14.56378, 52.33838], [14.58149, 52.28007], [14.70139, 52.25038], [14.71319, 52.22144], [14.68344, 52.19612], [14.70616, 52.16927], [14.67683, 52.13936], [14.6917, 52.10283], [14.72971, 52.09167], [14.76026, 52.06624], [14.71339, 52.00337], [14.70488, 51.97679], [14.7139, 51.95643], [14.71836, 51.95606], [14.72163, 51.95188], [14.7177, 51.94048], [14.70601, 51.92944], [14.6933, 51.9044], [14.6588, 51.88359], [14.59089, 51.83302], [14.60493, 51.80473], [14.64625, 51.79472], [14.66386, 51.73282], [14.69065, 51.70842], [14.75392, 51.67445], [14.75759, 51.62318], [14.7727, 51.61263], [14.71125, 51.56209], [14.73047, 51.54606], [14.72652, 51.53902], [14.73219, 51.52922], [14.94749, 51.47155], [14.9652, 51.44793], [14.96899, 51.38367], [14.98008, 51.33449], [15.04288, 51.28387], [15.01242, 51.21285], [15.0047, 51.16874], [14.99311, 51.16249], [14.99414, 51.15813], [15.00083, 51.14974], [14.99646, 51.14365], [14.99079, 51.14284], [14.99689, 51.12205], [14.98229, 51.11354], [14.97938, 51.07742], [14.95529, 51.04552], [14.92942, 50.99744], [14.89252, 50.94999], [14.89681, 50.9422], [14.81664, 50.88148], [14.82803, 50.86966], [14.99852, 50.86817], [15.01088, 50.97984], [14.96419, 50.99108], [15.02433, 51.0242], [15.03895, 51.0123], [15.06218, 51.02269], [15.10152, 51.01095], [15.11937, 50.99021], [15.16744, 51.01959], [15.1743, 50.9833], [15.2361, 50.99886], [15.27043, 50.97724], [15.2773, 50.8907], [15.36656, 50.83956], [15.3803, 50.77187], [15.43798, 50.80833], [15.73186, 50.73885], [15.81683, 50.75666], [15.87331, 50.67188], [15.97219, 50.69799], [16.0175, 50.63009], [15.98317, 50.61528], [16.02437, 50.60046], [16.10265, 50.66405], [16.20839, 50.63096], [16.23174, 50.67101], [16.33611, 50.66579], [16.44597, 50.58041], [16.34572, 50.49575], [16.31413, 50.50274], [16.19526, 50.43291], [16.21585, 50.40627], [16.22821, 50.41054], [16.28118, 50.36891], [16.30289, 50.38292], [16.36495, 50.37679], [16.3622, 50.34875], [16.39379, 50.3207], [16.42674, 50.32509], [16.56407, 50.21009], [16.55446, 50.16613], [16.63137, 50.1142], [16.7014, 50.09659], [16.8456, 50.20834], [16.98018, 50.24172], [17.00353, 50.21449], [17.02825, 50.23118], [16.99803, 50.25753], [17.02138, 50.27772], [16.99803, 50.30316], [16.94448, 50.31281], [16.90877, 50.38642], [16.85933, 50.41093], [16.89229, 50.45117], [17.1224, 50.39494], [17.14498, 50.38117], [17.19579, 50.38817], [17.19991, 50.3654], [17.27681, 50.32246], [17.34273, 50.32947], [17.34548, 50.2628], [17.3702, 50.28123], [17.58889, 50.27837], [17.67764, 50.28977], [17.69292, 50.32859], [17.74648, 50.29966], [17.72176, 50.25665], [17.76296, 50.23382], [17.70528, 50.18812], [17.59404, 50.16437], [17.66683, 50.10275], [17.6888, 50.12037], [17.7506, 50.07896], [17.77669, 50.02253], [17.86886, 49.97452], [18.00191, 50.01723], [18.04585, 50.01194], [18.04585, 50.03311], [18.00396, 50.04954], [18.03212, 50.06574], [18.07898, 50.04535], [18.10628, 50.00223], [18.20241, 49.99958], [18.21752, 49.97309], [18.27107, 49.96779], [18.27794, 49.93863], [18.31914, 49.91565], [18.33278, 49.92415], [18.33562, 49.94747], [18.41604, 49.93498], [18.53423, 49.89906], [18.54495, 49.9079], [18.54299, 49.92537], [18.57697, 49.91565], [18.57045, 49.87849], [18.60341, 49.86256], [18.57183, 49.83334], [18.61278, 49.7618], [18.61368, 49.75426], [18.62645, 49.75002], [18.62943, 49.74603], [18.62676, 49.71983], [18.69817, 49.70473], [18.72838, 49.68163], [18.80479, 49.6815], [18.84786, 49.5446], [18.84521, 49.51672], [18.94536, 49.52143], [18.97283, 49.49914], [18.9742, 49.39557], [19.18019, 49.41165], [19.25435, 49.53391], [19.36009, 49.53747], [19.37795, 49.574], [19.45348, 49.61583], [19.52626, 49.57311], [19.53313, 49.52856], [19.57845, 49.46077], [19.64162, 49.45184], [19.6375, 49.40897], [19.72127, 49.39288], [19.78581, 49.41701], [19.82237, 49.27806], [19.75286, 49.20751], [19.86409, 49.19316], [19.90529, 49.23532], [19.98494, 49.22904], [20.08238, 49.1813], [20.13738, 49.31685], [20.21977, 49.35265], [20.31453, 49.34817], [20.31728, 49.39914], [20.39939, 49.3896], [20.46422, 49.41612], [20.5631, 49.375], [20.61666, 49.41791], [20.72274, 49.41813], [20.77971, 49.35383], [20.9229, 49.29626], [20.98733, 49.30774], [21.09799, 49.37176], [21.041, 49.41791], [21.12477, 49.43666], [21.19756, 49.4054], [21.27858, 49.45988], [21.43376, 49.41433], [21.62328, 49.4447], [21.77983, 49.35443], [21.82927, 49.39467], [21.96385, 49.3437], [22.04427, 49.22136], [22.56155, 49.08865], [22.89122, 49.00725], [22.86336, 49.10513], [22.72009, 49.20288], [22.748, 49.32759], [22.69444, 49.49378], [22.64534, 49.53094], [22.78304, 49.65543], [22.80261, 49.69098], [22.83179, 49.69875], [22.99329, 49.84249], [23.28221, 50.0957], [23.67635, 50.33385], [23.71382, 50.38248], [23.79445, 50.40481], [23.99563, 50.41289], [24.03668, 50.44507], [24.07048, 50.5071], [24.0996, 50.60752], [24.0595, 50.71625], [23.95925, 50.79271], [23.99254, 50.83847], [24.0952, 50.83262], [24.14524, 50.86128], [24.04576, 50.90196], [23.92217, 51.00836], [23.90376, 51.07697], [23.80678, 51.18405], [23.63858, 51.32182], [23.69905, 51.40871], [23.62751, 51.50512], [23.56236, 51.53673], [23.57053, 51.55938], [23.53198, 51.74298], [23.62691, 51.78208], [23.61523, 51.92066], [23.68733, 51.9906], [23.64066, 52.07626], [23.61, 52.11264], [23.54314, 52.12148], [23.47859, 52.18215], [23.20071, 52.22848], [23.18196, 52.28812], [23.34141, 52.44845], [23.45112, 52.53774], [23.58296, 52.59868], [23.73615, 52.6149], [23.93763, 52.71332], [23.91805, 52.94016], [23.94689, 52.95919], [23.92184, 53.02079], [23.87548, 53.0831], [23.91393, 53.16469], [23.85657, 53.22923], [23.81995, 53.24131], [23.62004, 53.60942], [23.51284, 53.95052], [23.48261, 53.98855], [23.52702, 54.04622], [23.49196, 54.14764], [23.45223, 54.17775], [23.42418, 54.17911], [23.39525, 54.21672], [23.3494, 54.25155], [23.24656, 54.25701], [23.15938, 54.29894], [23.15526, 54.31076], [23.13905, 54.31567], [23.104, 54.29794], [23.04323, 54.31567], [23.05726, 54.34565], [22.99649, 54.35927], [23.00584, 54.38514], [22.83756, 54.40827], [22.79705, 54.36264], [21.41123, 54.32395], [20.63871, 54.3706], [19.8038, 54.44203], [19.64312, 54.45423], [18.57853, 55.25302]]]] } },
34267 { type: "Feature", properties: { iso1A2: "PM", iso1A3: "SPM", iso1N3: "666", wikidata: "Q34617", nameEn: "Saint Pierre and Miquelon", country: "FR", groups: ["EU", "Q1451600", "021", "003", "019", "UN"], callingCodes: ["508"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-56.72993, 46.65575], [-55.90758, 46.6223], [-56.27503, 47.39728], [-56.72993, 46.65575]]]] } },
34268 { type: "Feature", properties: { iso1A2: "PN", iso1A3: "PCN", iso1N3: "612", wikidata: "Q35672", nameEn: "Pitcairn Islands", country: "GB", groups: ["BOTS", "061", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-133.59543, -28.4709], [-122.0366, -24.55017], [-133.61511, -21.93325], [-133.59543, -28.4709]]]] } },
34269 { type: "Feature", properties: { iso1A2: "PR", iso1A3: "PRI", iso1N3: "630", wikidata: "Q1183", nameEn: "Puerto Rico", aliases: ["US-PR"], country: "US", groups: ["Q1352230", "029", "003", "419", "019", "UN"], roadSpeedUnit: "mph", callingCodes: ["1 787", "1 939"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-65.27974, 17.56928], [-65.02435, 18.73231], [-67.99519, 18.97186], [-68.23894, 17.84663], [-65.27974, 17.56928]]]] } },
34270 { type: "Feature", properties: { iso1A2: "PS", iso1A3: "PSE", iso1N3: "275", wikidata: "Q219060", nameEn: "Palestine" }, geometry: null },
34271 { type: "Feature", properties: { iso1A2: "PT", iso1A3: "PRT", iso1N3: "620", wikidata: "Q45", nameEn: "Portugal" }, geometry: null },
34272 { type: "Feature", properties: { iso1A2: "PW", iso1A3: "PLW", iso1N3: "585", wikidata: "Q695", nameEn: "Palau", groups: ["057", "009", "UN"], roadSpeedUnit: "mph", callingCodes: ["680"] }, geometry: { type: "MultiPolygon", coordinates: [[[[128.97621, 3.08804], [136.39296, 1.54187], [136.04605, 12.45908], [128.97621, 3.08804]]]] } },
34273 { type: "Feature", properties: { iso1A2: "PY", iso1A3: "PRY", iso1N3: "600", wikidata: "Q733", nameEn: "Paraguay", groups: ["005", "419", "019", "UN"], callingCodes: ["595"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-58.16225, -20.16193], [-58.23216, -19.80058], [-59.06965, -19.29148], [-60.00638, -19.2981], [-61.73723, -19.63958], [-61.93912, -20.10053], [-62.26883, -20.55311], [-62.2757, -21.06657], [-62.64455, -22.25091], [-62.51761, -22.37684], [-62.22768, -22.55807], [-61.9756, -23.0507], [-61.0782, -23.62932], [-60.99754, -23.80934], [-60.28163, -24.04436], [-60.03367, -24.00701], [-59.45482, -24.34787], [-59.33886, -24.49935], [-58.33055, -24.97099], [-58.25492, -24.92528], [-57.80821, -25.13863], [-57.57431, -25.47269], [-57.87176, -25.93604], [-58.1188, -26.16704], [-58.3198, -26.83443], [-58.65321, -27.14028], [-58.59549, -27.29973], [-58.04205, -27.2387], [-56.85337, -27.5165], [-56.18313, -27.29851], [-55.89195, -27.3467], [-55.74475, -27.44485], [-55.59094, -27.32444], [-55.62322, -27.1941], [-55.39611, -26.97679], [-55.25243, -26.93808], [-55.16948, -26.96068], [-55.06351, -26.80195], [-55.00584, -26.78754], [-54.80868, -26.55669], [-54.70732, -26.45099], [-54.69333, -26.37705], [-54.67359, -25.98607], [-54.60664, -25.9691], [-54.62063, -25.91213], [-54.59398, -25.59224], [-54.59509, -25.53696], [-54.60196, -25.48397], [-54.62033, -25.46026], [-54.4423, -25.13381], [-54.31115, -24.26625], [-54.34579, -24.13058], [-54.28207, -24.07305], [-54.32807, -24.01865], [-54.6238, -23.83078], [-55.02691, -23.97317], [-55.0518, -23.98666], [-55.12292, -23.99669], [-55.41784, -23.9657], [-55.44117, -23.9185], [-55.43585, -23.87157], [-55.4471, -23.7602], [-55.47567, -23.67566], [-55.55496, -23.28366], [-55.5222, -23.26048], [-55.53614, -23.24524], [-55.63849, -22.95122], [-55.62493, -22.62765], [-55.69103, -22.57959], [-55.69863, -22.56307], [-55.71193, -22.55809], [-55.72399, -22.55131], [-55.73792, -22.52632], [-55.74032, -22.51928], [-55.74069, -22.51564], [-55.74715, -22.50567], [-55.74718, -22.48376], [-55.75128, -22.48165], [-55.75257, -22.47633], [-55.74691, -22.46966], [-55.8331, -22.29008], [-56.23206, -22.25347], [-56.45893, -22.08072], [-56.5212, -22.11556], [-56.6508, -22.28387], [-57.98625, -22.09157], [-57.94642, -21.73799], [-57.88239, -21.6868], [-57.93492, -21.65505], [-57.84536, -20.93155], [-58.16225, -20.16193]]]] } },
34274 { type: "Feature", properties: { iso1A2: "QA", iso1A3: "QAT", iso1N3: "634", wikidata: "Q846", nameEn: "Qatar", groups: ["145", "142", "UN"], callingCodes: ["974"] }, geometry: { type: "MultiPolygon", coordinates: [[[[50.92992, 24.54396], [51.09638, 24.46907], [51.29972, 24.50747], [51.39468, 24.62785], [51.58834, 24.66608], [51.83108, 24.71675], [51.83682, 26.70231], [50.93865, 26.30758], [50.81266, 25.88946], [50.86149, 25.6965], [50.7801, 25.595], [50.80824, 25.54641], [50.57069, 25.57887], [50.8133, 24.74049], [50.92992, 24.54396]]]] } },
34275 { type: "Feature", properties: { iso1A2: "RE", iso1A3: "REU", iso1N3: "638", wikidata: "Q17070", nameEn: "R\xE9union", country: "FR", groups: ["Q3320166", "EU", "014", "202", "002", "UN"], callingCodes: ["262"] }, geometry: { type: "MultiPolygon", coordinates: [[[[53.37984, -21.23941], [56.73473, -21.9174], [56.62373, -20.2711], [53.37984, -21.23941]]]] } },
34276 { type: "Feature", properties: { iso1A2: "RO", iso1A3: "ROU", iso1N3: "642", wikidata: "Q218", nameEn: "Romania", groups: ["EU", "151", "150", "UN"], callingCodes: ["40"] }, geometry: { type: "MultiPolygon", coordinates: [[[[27.15622, 47.98538], [27.02985, 48.09083], [27.04118, 48.12522], [26.96119, 48.13003], [26.98042, 48.15752], [26.94265, 48.1969], [26.87708, 48.19919], [26.81161, 48.25049], [26.62823, 48.25804], [26.55202, 48.22445], [26.33504, 48.18418], [26.17711, 47.99246], [26.05901, 47.9897], [25.77723, 47.93919], [25.63878, 47.94924], [25.23778, 47.89403], [25.11144, 47.75203], [24.88896, 47.7234], [24.81893, 47.82031], [24.70632, 47.84428], [24.61994, 47.95062], [24.43578, 47.97131], [24.34926, 47.9244], [24.22566, 47.90231], [24.11281, 47.91487], [24.06466, 47.95317], [24.02999, 47.95087], [24.00801, 47.968], [23.98553, 47.96076], [23.96337, 47.96672], [23.94192, 47.94868], [23.89352, 47.94512], [23.8602, 47.9329], [23.80904, 47.98142], [23.75188, 47.99705], [23.66262, 47.98786], [23.63894, 48.00293], [23.5653, 48.00499], [23.52803, 48.01818], [23.4979, 47.96858], [23.33577, 48.0237], [23.27397, 48.08245], [23.15999, 48.12188], [23.1133, 48.08061], [23.08858, 48.00716], [23.0158, 47.99338], [22.92241, 48.02002], [22.94301, 47.96672], [22.89849, 47.95851], [22.77991, 47.87211], [22.76617, 47.8417], [22.67247, 47.7871], [22.46559, 47.76583], [22.41979, 47.7391], [22.31816, 47.76126], [22.00917, 47.50492], [22.03389, 47.42508], [22.01055, 47.37767], [21.94463, 47.38046], [21.78395, 47.11104], [21.648, 47.03902], [21.68645, 46.99595], [21.59581, 46.91628], [21.59307, 46.86935], [21.52028, 46.84118], [21.48935, 46.7577], [21.5151, 46.72147], [21.43926, 46.65109], [21.33214, 46.63035], [21.26929, 46.4993], [21.28061, 46.44941], [21.16872, 46.30118], [21.06572, 46.24897], [20.86797, 46.28884], [20.74574, 46.25467], [20.76085, 46.21002], [20.63863, 46.12728], [20.49718, 46.18721], [20.45377, 46.14405], [20.35573, 46.16629], [20.28324, 46.1438], [20.26068, 46.12332], [20.35862, 45.99356], [20.54818, 45.89939], [20.65645, 45.82801], [20.70069, 45.7493], [20.77416, 45.75601], [20.78446, 45.78522], [20.82364, 45.77738], [20.80361, 45.65875], [20.76798, 45.60969], [20.83321, 45.53567], [20.77217, 45.49788], [20.86026, 45.47295], [20.87948, 45.42743], [21.09894, 45.30144], [21.17612, 45.32566], [21.20392, 45.2677], [21.29398, 45.24148], [21.48278, 45.19557], [21.51299, 45.15345], [21.4505, 45.04294], [21.35855, 45.01941], [21.54938, 44.9327], [21.56328, 44.89502], [21.48202, 44.87199], [21.44013, 44.87613], [21.35643, 44.86364], [21.38802, 44.78133], [21.55007, 44.77304], [21.60019, 44.75208], [21.61942, 44.67059], [21.67504, 44.67107], [21.71692, 44.65349], [21.7795, 44.66165], [21.99364, 44.63395], [22.08016, 44.49844], [22.13234, 44.47444], [22.18315, 44.48179], [22.30844, 44.6619], [22.45301, 44.7194], [22.61917, 44.61489], [22.69196, 44.61587], [22.76749, 44.54446], [22.70981, 44.51852], [22.61368, 44.55719], [22.56493, 44.53419], [22.54021, 44.47836], [22.45436, 44.47258], [22.56012, 44.30712], [22.68166, 44.28206], [22.67173, 44.21564], [23.04988, 44.07694], [23.01674, 44.01946], [22.87873, 43.9844], [22.83753, 43.88055], [22.85314, 43.84452], [23.05288, 43.79494], [23.26772, 43.84843], [23.4507, 43.84936], [23.61687, 43.79289], [23.73978, 43.80627], [24.18149, 43.68218], [24.35364, 43.70211], [24.50264, 43.76314], [24.62281, 43.74082], [24.73542, 43.68523], [24.96682, 43.72693], [25.10718, 43.6831], [25.17144, 43.70261], [25.39528, 43.61866], [25.72792, 43.69263], [25.94911, 43.85745], [26.05584, 43.90925], [26.10115, 43.96908], [26.38764, 44.04356], [26.62712, 44.05698], [26.95141, 44.13555], [27.26845, 44.12602], [27.39757, 44.0141], [27.60834, 44.01206], [27.64542, 44.04958], [27.73468, 43.95326], [27.92008, 44.00761], [27.99558, 43.84193], [28.23293, 43.76], [29.24336, 43.70874], [30.04414, 45.08461], [29.69272, 45.19227], [29.65428, 45.25629], [29.68175, 45.26885], [29.59798, 45.38857], [29.42632, 45.44545], [29.24779, 45.43388], [28.96077, 45.33164], [28.94292, 45.28045], [28.81383, 45.3384], [28.78911, 45.24179], [28.71358, 45.22631], [28.5735, 45.24759], [28.34554, 45.32102], [28.28504, 45.43907], [28.21139, 45.46895], [28.18741, 45.47358], [28.08927, 45.6051], [28.16568, 45.6421], [28.13111, 45.92819], [28.08612, 46.01105], [28.13684, 46.18099], [28.10937, 46.22852], [28.19864, 46.31869], [28.18902, 46.35283], [28.25769, 46.43334], [28.22281, 46.50481], [28.24808, 46.64305], [28.12173, 46.82283], [28.09095, 46.97621], [27.81892, 47.1381], [27.73172, 47.29248], [27.68706, 47.28962], [27.60263, 47.32507], [27.55731, 47.46637], [27.47942, 47.48113], [27.3979, 47.59473], [27.32202, 47.64009], [27.25519, 47.71366], [27.29069, 47.73722], [27.1618, 47.92391], [27.15622, 47.98538]]]] } },
34277 { type: "Feature", properties: { iso1A2: "RS", iso1A3: "SRB", iso1N3: "688", wikidata: "Q403", nameEn: "Serbia", groups: ["039", "150", "UN"], callingCodes: ["381"] }, geometry: { type: "MultiPolygon", coordinates: [[[[19.66007, 46.19005], [19.56113, 46.16824], [19.52473, 46.1171], [19.28826, 45.99694], [19.14543, 45.9998], [19.10388, 46.04015], [19.0791, 45.96458], [19.01284, 45.96529], [18.99712, 45.93537], [18.81394, 45.91329], [18.85783, 45.85493], [18.90305, 45.71863], [18.96691, 45.66731], [18.88776, 45.57253], [18.94562, 45.53712], [19.07471, 45.53086], [19.08364, 45.48804], [18.99918, 45.49333], [18.97446, 45.37528], [19.10774, 45.29547], [19.28208, 45.23813], [19.41941, 45.23475], [19.43589, 45.17137], [19.19144, 45.17863], [19.14063, 45.12972], [19.07952, 45.14668], [19.1011, 45.01191], [19.05205, 44.97692], [19.15573, 44.95409], [19.06853, 44.89915], [19.02871, 44.92541], [18.98957, 44.90645], [19.01994, 44.85493], [19.18183, 44.92055], [19.36722, 44.88164], [19.32543, 44.74058], [19.26388, 44.65412], [19.16699, 44.52197], [19.13369, 44.52521], [19.12278, 44.50132], [19.14837, 44.45253], [19.14681, 44.41463], [19.11785, 44.40313], [19.10749, 44.39421], [19.10704, 44.38249], [19.10365, 44.37795], [19.10298, 44.36924], [19.11865, 44.36712], [19.1083, 44.3558], [19.11547, 44.34218], [19.13556, 44.338], [19.13332, 44.31492], [19.16741, 44.28648], [19.18328, 44.28383], [19.20508, 44.2917], [19.23306, 44.26097], [19.26945, 44.26957], [19.32464, 44.27185], [19.34773, 44.23244], [19.3588, 44.18353], [19.40927, 44.16722], [19.43905, 44.13088], [19.47338, 44.15034], [19.48386, 44.14332], [19.47321, 44.1193], [19.51167, 44.08158], [19.55999, 44.06894], [19.57467, 44.04716], [19.61991, 44.05254], [19.61836, 44.01464], [19.56498, 43.99922], [19.52515, 43.95573], [19.38439, 43.96611], [19.24363, 44.01502], [19.23465, 43.98764], [19.3986, 43.79668], [19.5176, 43.71403], [19.50455, 43.58385], [19.42696, 43.57987], [19.41941, 43.54056], [19.36653, 43.60921], [19.33426, 43.58833], [19.2553, 43.5938], [19.24774, 43.53061], [19.22807, 43.5264], [19.22229, 43.47926], [19.44315, 43.38846], [19.48171, 43.32644], [19.52962, 43.31623], [19.54598, 43.25158], [19.62661, 43.2286], [19.64063, 43.19027], [19.76918, 43.16044], [19.79255, 43.11951], [19.92576, 43.08539], [19.96549, 43.11098], [19.98887, 43.0538], [20.04729, 43.02732], [20.05431, 42.99571], [20.12325, 42.96237], [20.14896, 42.99058], [20.16415, 42.97177], [20.34528, 42.90676], [20.35692, 42.8335], [20.40594, 42.84853], [20.43734, 42.83157], [20.53484, 42.8885], [20.48692, 42.93208], [20.59929, 43.01067], [20.64557, 43.00826], [20.69515, 43.09641], [20.59929, 43.20492], [20.68688, 43.21335], [20.73811, 43.25068], [20.82145, 43.26769], [20.88685, 43.21697], [20.83727, 43.17842], [20.96287, 43.12416], [21.00749, 43.13984], [21.05378, 43.10707], [21.08952, 43.13471], [21.14465, 43.11089], [21.16734, 42.99694], [21.2041, 43.02277], [21.23877, 43.00848], [21.23534, 42.95523], [21.2719, 42.8994], [21.32974, 42.90424], [21.36941, 42.87397], [21.44047, 42.87276], [21.39045, 42.74888], [21.47498, 42.74695], [21.59154, 42.72643], [21.58755, 42.70418], [21.6626, 42.67813], [21.75025, 42.70125], [21.79413, 42.65923], [21.75672, 42.62695], [21.7327, 42.55041], [21.70522, 42.54176], [21.7035, 42.51899], [21.62556, 42.45106], [21.64209, 42.41081], [21.62887, 42.37664], [21.59029, 42.38042], [21.57021, 42.3647], [21.53467, 42.36809], [21.5264, 42.33634], [21.56772, 42.30946], [21.58992, 42.25915], [21.70111, 42.23789], [21.77176, 42.2648], [21.84654, 42.3247], [21.91595, 42.30392], [21.94405, 42.34669], [22.02908, 42.29848], [22.16384, 42.32103], [22.29605, 42.37477], [22.29275, 42.34913], [22.34773, 42.31725], [22.45919, 42.33822], [22.47498, 42.3915], [22.51961, 42.3991], [22.55669, 42.50144], [22.43983, 42.56851], [22.4997, 42.74144], [22.43309, 42.82057], [22.54302, 42.87774], [22.74826, 42.88701], [22.78397, 42.98253], [22.89521, 43.03625], [22.98104, 43.11199], [23.00806, 43.19279], [22.89727, 43.22417], [22.82036, 43.33665], [22.53397, 43.47225], [22.47582, 43.6558], [22.41043, 43.69566], [22.35558, 43.81281], [22.41449, 44.00514], [22.61688, 44.06534], [22.61711, 44.16938], [22.67173, 44.21564], [22.68166, 44.28206], [22.56012, 44.30712], [22.45436, 44.47258], [22.54021, 44.47836], [22.56493, 44.53419], [22.61368, 44.55719], [22.70981, 44.51852], [22.76749, 44.54446], [22.69196, 44.61587], [22.61917, 44.61489], [22.45301, 44.7194], [22.30844, 44.6619], [22.18315, 44.48179], [22.13234, 44.47444], [22.08016, 44.49844], [21.99364, 44.63395], [21.7795, 44.66165], [21.71692, 44.65349], [21.67504, 44.67107], [21.61942, 44.67059], [21.60019, 44.75208], [21.55007, 44.77304], [21.38802, 44.78133], [21.35643, 44.86364], [21.44013, 44.87613], [21.48202, 44.87199], [21.56328, 44.89502], [21.54938, 44.9327], [21.35855, 45.01941], [21.4505, 45.04294], [21.51299, 45.15345], [21.48278, 45.19557], [21.29398, 45.24148], [21.20392, 45.2677], [21.17612, 45.32566], [21.09894, 45.30144], [20.87948, 45.42743], [20.86026, 45.47295], [20.77217, 45.49788], [20.83321, 45.53567], [20.76798, 45.60969], [20.80361, 45.65875], [20.82364, 45.77738], [20.78446, 45.78522], [20.77416, 45.75601], [20.70069, 45.7493], [20.65645, 45.82801], [20.54818, 45.89939], [20.35862, 45.99356], [20.26068, 46.12332], [20.09713, 46.17315], [20.03533, 46.14509], [20.01816, 46.17696], [19.93508, 46.17553], [19.81491, 46.1313], [19.66007, 46.19005]]]] } },
34278 { type: "Feature", properties: { iso1A2: "RU", iso1A3: "RUS", iso1N3: "643", wikidata: "Q159", nameEn: "Russia" }, geometry: null },
34279 { type: "Feature", properties: { iso1A2: "RW", iso1A3: "RWA", iso1N3: "646", wikidata: "Q1037", nameEn: "Rwanda", groups: ["014", "202", "002", "UN"], callingCodes: ["250"] }, geometry: { type: "MultiPolygon", coordinates: [[[[30.47194, -1.0555], [30.35212, -1.06896], [30.16369, -1.34303], [29.912, -1.48269], [29.82657, -1.31187], [29.59061, -1.39016], [29.53062, -1.40499], [29.45038, -1.5054], [29.36322, -1.50887], [29.24323, -1.66826], [29.24458, -1.69663], [29.11847, -1.90576], [29.17562, -2.12278], [29.105, -2.27043], [29.00051, -2.29001], [28.95642, -2.37321], [28.89601, -2.37321], [28.86826, -2.41888], [28.86846, -2.44866], [28.89132, -2.47557], [28.89342, -2.49017], [28.88846, -2.50493], [28.87497, -2.50887], [28.86209, -2.5231], [28.86193, -2.53185], [28.87943, -2.55165], [28.89288, -2.55848], [28.90226, -2.62385], [28.89793, -2.66111], [28.94346, -2.69124], [29.00357, -2.70596], [29.04081, -2.7416], [29.0562, -2.58632], [29.32234, -2.6483], [29.36805, -2.82933], [29.88237, -2.75105], [29.95911, -2.33348], [30.14034, -2.43626], [30.42933, -2.31064], [30.54501, -2.41404], [30.83915, -2.35795], [30.89303, -2.08223], [30.80802, -1.91477], [30.84079, -1.64652], [30.71974, -1.43244], [30.57123, -1.33264], [30.50889, -1.16412], [30.45116, -1.10641], [30.47194, -1.0555]]]] } },
34280 { type: "Feature", properties: { iso1A2: "SA", iso1A3: "SAU", iso1N3: "682", wikidata: "Q851", nameEn: "Saudi Arabia", groups: ["145", "142", "UN"], callingCodes: ["966"] }, geometry: { type: "MultiPolygon", coordinates: [[[[40.01521, 32.05667], [39.29903, 32.23259], [38.99233, 31.99721], [36.99791, 31.50081], [37.99354, 30.49998], [37.66395, 30.33245], [37.4971, 29.99949], [36.75083, 29.86903], [36.50005, 29.49696], [36.07081, 29.18469], [34.8812, 29.36878], [34.4454, 27.91479], [37.8565, 22.00903], [39.63762, 18.37348], [40.99158, 15.81743], [42.15205, 16.40211], [42.76801, 16.40371], [42.94625, 16.39721], [42.94351, 16.49467], [42.97215, 16.51093], [43.11601, 16.53166], [43.15274, 16.67248], [43.22066, 16.65179], [43.21325, 16.74416], [43.25857, 16.75304], [43.26303, 16.79479], [43.24801, 16.80613], [43.22956, 16.80613], [43.22012, 16.83932], [43.18338, 16.84852], [43.1398, 16.90696], [43.19328, 16.94703], [43.1813, 16.98438], [43.18233, 17.02673], [43.23967, 17.03428], [43.17787, 17.14717], [43.20156, 17.25901], [43.32653, 17.31179], [43.22533, 17.38343], [43.29185, 17.53224], [43.43005, 17.56148], [43.70631, 17.35762], [44.50126, 17.47475], [46.31018, 17.20464], [46.76494, 17.29151], [47.00571, 16.94765], [47.48245, 17.10808], [47.58351, 17.50366], [48.19996, 18.20584], [49.04884, 18.59899], [52.00311, 19.00083], [54.99756, 20.00083], [55.66469, 21.99658], [55.2137, 22.71065], [55.13599, 22.63334], [52.56622, 22.94341], [51.59617, 24.12041], [51.58871, 24.27256], [51.41644, 24.39615], [51.58834, 24.66608], [51.39468, 24.62785], [51.29972, 24.50747], [51.09638, 24.46907], [50.92992, 24.54396], [50.8133, 24.74049], [50.57069, 25.57887], [50.302, 25.87592], [50.26923, 26.08243], [50.38162, 26.53976], [50.71771, 26.73086], [50.37726, 27.89227], [49.98877, 27.87827], [49.00421, 28.81495], [48.42991, 28.53628], [47.70561, 28.5221], [47.59863, 28.66798], [47.58376, 28.83382], [47.46202, 29.0014], [46.5527, 29.10283], [46.42415, 29.05947], [44.72255, 29.19736], [42.97796, 30.48295], [42.97601, 30.72204], [40.01521, 32.05667]]]] } },
34281 { type: "Feature", properties: { iso1A2: "SB", iso1A3: "SLB", iso1N3: "090", wikidata: "Q685", nameEn: "Solomon Islands", groups: ["054", "009", "UN"], driveSide: "left", callingCodes: ["677"] }, geometry: { type: "MultiPolygon", coordinates: [[[[172.71443, -12.01327], [160.43769, -4.17974], [156.03296, -6.55528], [156.03993, -6.65703], [155.92557, -6.84664], [155.69784, -6.92661], [155.60735, -6.92266], [154.74815, -7.33315], [156.73836, -14.50464], [172.71443, -12.01327]]]] } },
34282 { type: "Feature", properties: { iso1A2: "SC", iso1A3: "SYC", iso1N3: "690", wikidata: "Q1042", nameEn: "Seychelles", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["248"] }, geometry: { type: "MultiPolygon", coordinates: [[[[43.75112, -10.38913], [54.83239, -10.93575], [66.3222, 5.65313], [43.75112, -10.38913]]]] } },
34283 { type: "Feature", properties: { iso1A2: "SD", iso1A3: "SDN", iso1N3: "729", wikidata: "Q1049", nameEn: "Sudan", groups: ["015", "002", "UN"], callingCodes: ["249"] }, geometry: { type: "MultiPolygon", coordinates: [[[[37.8565, 22.00903], [34.0765, 22.00501], [33.99686, 21.76784], [33.57251, 21.72406], [33.17563, 22.00405], [24.99885, 21.99535], [24.99794, 19.99661], [23.99715, 20.00038], [23.99539, 19.49944], [23.99997, 15.69575], [23.62785, 15.7804], [23.38812, 15.69649], [23.10792, 15.71297], [22.93201, 15.55107], [22.92579, 15.47007], [22.99584, 15.40105], [22.99584, 15.22989], [22.66115, 14.86308], [22.70474, 14.69149], [22.38562, 14.58907], [22.44944, 14.24986], [22.55997, 14.23024], [22.5553, 14.11704], [22.22995, 13.96754], [22.08674, 13.77863], [22.29689, 13.3731], [22.1599, 13.19281], [22.02914, 13.13976], [21.94819, 13.05637], [21.81432, 12.81362], [21.89371, 12.68001], [21.98711, 12.63292], [22.15679, 12.66634], [22.22684, 12.74682], [22.46345, 12.61925], [22.38873, 12.45514], [22.50548, 12.16769], [22.48369, 12.02766], [22.64092, 12.07485], [22.54907, 11.64372], [22.7997, 11.40424], [22.93124, 11.41645], [22.97249, 11.21955], [22.87758, 10.91915], [23.02221, 10.69235], [23.3128, 10.45214], [23.67164, 9.86923], [23.69155, 9.67566], [24.09319, 9.66572], [24.12744, 9.73784], [24.49389, 9.79962], [24.84653, 9.80643], [24.97739, 9.9081], [25.05688, 10.06776], [25.0918, 10.33718], [25.78141, 10.42599], [25.93163, 10.38159], [25.93241, 10.17941], [26.21338, 9.91545], [26.35815, 9.57946], [26.70685, 9.48735], [27.14427, 9.62858], [27.90704, 9.61323], [28.99983, 9.67155], [29.06988, 9.74826], [29.53844, 9.75133], [29.54, 10.07949], [29.94629, 10.29245], [30.00389, 10.28633], [30.53005, 9.95992], [30.82893, 9.71451], [30.84605, 9.7498], [31.28504, 9.75287], [31.77539, 10.28939], [31.99177, 10.65065], [32.46967, 11.04662], [32.39358, 11.18207], [32.39578, 11.70208], [32.10079, 11.95203], [32.73921, 11.95203], [32.73921, 12.22757], [33.25876, 12.22111], [33.13988, 11.43248], [33.26977, 10.83632], [33.24645, 10.77913], [33.52294, 10.64382], [33.66604, 10.44254], [33.80913, 10.32994], [33.90159, 10.17179], [33.96984, 10.15446], [33.99185, 9.99623], [33.96323, 9.80972], [33.9082, 9.762], [33.87958, 9.49937], [34.10229, 9.50238], [34.08717, 9.55243], [34.13186, 9.7492], [34.20484, 9.9033], [34.22718, 10.02506], [34.32102, 10.11599], [34.34783, 10.23914], [34.2823, 10.53508], [34.4372, 10.781], [34.59062, 10.89072], [34.77383, 10.74588], [34.77532, 10.69027], [34.86618, 10.74588], [34.86916, 10.78832], [34.97491, 10.86147], [34.97789, 10.91559], [34.93172, 10.95946], [35.01215, 11.19626], [34.95704, 11.24448], [35.09556, 11.56278], [35.05832, 11.71158], [35.11492, 11.85156], [35.24302, 11.91132], [35.70476, 12.67101], [36.01458, 12.72478], [36.14268, 12.70879], [36.16651, 12.88019], [36.13374, 12.92665], [36.24545, 13.36759], [36.38993, 13.56459], [36.48824, 13.83954], [36.44653, 13.95666], [36.54376, 14.25597], [36.44337, 15.14963], [36.54276, 15.23478], [36.69761, 15.75323], [36.76371, 15.80831], [36.92193, 16.23451], [36.99777, 17.07172], [37.42694, 17.04041], [37.50967, 17.32199], [38.13362, 17.53906], [38.37133, 17.66269], [38.45916, 17.87167], [38.57727, 17.98125], [39.63762, 18.37348], [37.8565, 22.00903]]]] } },
34284 { type: "Feature", properties: { iso1A2: "SE", iso1A3: "SWE", iso1N3: "752", wikidata: "Q34", nameEn: "Sweden", groups: ["EU", "154", "150", "UN"], callingCodes: ["46"] }, geometry: { type: "MultiPolygon", coordinates: [[[[24.15791, 65.85385], [23.90497, 66.15802], [23.71339, 66.21299], [23.64982, 66.30603], [23.67591, 66.3862], [23.63776, 66.43568], [23.85959, 66.56434], [23.89488, 66.772], [23.98059, 66.79585], [23.98563, 66.84149], [23.56214, 67.17038], [23.58735, 67.20752], [23.54701, 67.25435], [23.75372, 67.29914], [23.75372, 67.43688], [23.39577, 67.46974], [23.54701, 67.59306], [23.45627, 67.85297], [23.65793, 67.9497], [23.40081, 68.05545], [23.26469, 68.15134], [23.15377, 68.14759], [23.10336, 68.26551], [22.73028, 68.40881], [22.00429, 68.50692], [21.03001, 68.88969], [20.90649, 68.89696], [20.85104, 68.93142], [20.91658, 68.96764], [20.78802, 69.03087], [20.55258, 69.06069], [20.0695, 69.04469], [20.28444, 68.93283], [20.33435, 68.80174], [20.22027, 68.67246], [19.95647, 68.55546], [20.22027, 68.48759], [19.93508, 68.35911], [18.97255, 68.52416], [18.63032, 68.50849], [18.39503, 68.58672], [18.1241, 68.53721], [18.13836, 68.20874], [17.90787, 67.96537], [17.30416, 68.11591], [16.7409, 67.91037], [16.38441, 67.52923], [16.12774, 67.52106], [16.09922, 67.4364], [16.39154, 67.21653], [16.35589, 67.06419], [15.37197, 66.48217], [15.49318, 66.28509], [15.05113, 66.15572], [14.53778, 66.12399], [14.50926, 65.31786], [13.64276, 64.58402], [14.11117, 64.46674], [14.16051, 64.18725], [13.98222, 64.00953], [13.23411, 64.09087], [12.74105, 64.02171], [12.14928, 63.59373], [12.19919, 63.47935], [11.98529, 63.27487], [12.19919, 63.00104], [12.07085, 62.6297], [12.29187, 62.25699], [12.14746, 61.7147], [12.40595, 61.57226], [12.57707, 61.56547], [12.86939, 61.35427], [12.69115, 61.06584], [12.2277, 61.02442], [12.59133, 60.50559], [12.52003, 60.13846], [12.36317, 59.99259], [12.15641, 59.8926], [11.87121, 59.86039], [11.92112, 59.69531], [11.69297, 59.59442], [11.8213, 59.24985], [11.65732, 58.90177], [11.45199, 58.89604], [11.4601, 58.99022], [11.34459, 59.11672], [11.15367, 59.07862], [11.08911, 58.98745], [10.64958, 58.89391], [10.40861, 58.38489], [12.16597, 56.60205], [12.07466, 56.29488], [12.65312, 56.04345], [12.6372, 55.91371], [12.88472, 55.63369], [12.60345, 55.42675], [12.84405, 55.13257], [14.28399, 55.1553], [14.89259, 55.5623], [15.79951, 55.54655], [19.64795, 57.06466], [19.84909, 57.57876], [20.5104, 59.15546], [19.08191, 60.19152], [19.23413, 60.61414], [20.15877, 63.06556], [24.14112, 65.39731], [24.15107, 65.81427], [24.14798, 65.83466], [24.15791, 65.85385]]]] } },
34285 { type: "Feature", properties: { iso1A2: "SG", iso1A3: "SGP", iso1N3: "702", wikidata: "Q334", nameEn: "Singapore", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["65"] }, geometry: { type: "MultiPolygon", coordinates: [[[[104.00131, 1.42405], [103.93384, 1.42926], [103.89565, 1.42841], [103.86383, 1.46288], [103.81181, 1.47953], [103.76395, 1.45183], [103.74161, 1.4502], [103.7219, 1.46108], [103.67468, 1.43166], [103.62738, 1.35255], [103.56591, 1.19719], [103.66049, 1.18825], [103.74084, 1.12902], [104.03085, 1.26954], [104.12282, 1.27714], [104.08072, 1.35998], [104.09162, 1.39694], [104.08871, 1.42015], [104.07348, 1.43322], [104.04622, 1.44691], [104.02277, 1.4438], [104.00131, 1.42405]]]] } },
34286 { type: "Feature", properties: { iso1A2: "SH", iso1A3: "SHN", iso1N3: "654", wikidata: "Q192184", nameEn: "Saint Helena, Ascension and Tristan da Cunha", country: "GB" }, geometry: null },
34287 { type: "Feature", properties: { iso1A2: "SI", iso1A3: "SVN", iso1N3: "705", wikidata: "Q215", nameEn: "Slovenia", groups: ["EU", "039", "150", "UN"], callingCodes: ["386"] }, geometry: { type: "MultiPolygon", coordinates: [[[[16.50139, 46.56684], [16.39217, 46.63673], [16.38594, 46.6549], [16.41863, 46.66238], [16.42641, 46.69228], [16.37816, 46.69975], [16.30966, 46.7787], [16.31303, 46.79838], [16.3408, 46.80641], [16.34547, 46.83836], [16.2941, 46.87137], [16.2365, 46.87775], [16.21892, 46.86961], [16.15711, 46.85434], [16.14365, 46.8547], [16.10983, 46.867], [16.05786, 46.83927], [15.99054, 46.82772], [15.99126, 46.78199], [15.98432, 46.74991], [15.99769, 46.7266], [16.02808, 46.71094], [16.04347, 46.68694], [16.04036, 46.6549], [15.99988, 46.67947], [15.98512, 46.68463], [15.94864, 46.68769], [15.87691, 46.7211], [15.8162, 46.71897], [15.78518, 46.70712], [15.76771, 46.69863], [15.73823, 46.70011], [15.72279, 46.69548], [15.69523, 46.69823], [15.67411, 46.70735], [15.6543, 46.70616], [15.6543, 46.69228], [15.6365, 46.6894], [15.63255, 46.68069], [15.62317, 46.67947], [15.59826, 46.68908], [15.54533, 46.66985], [15.55333, 46.64988], [15.54431, 46.6312], [15.46906, 46.61321], [15.45514, 46.63697], [15.41235, 46.65556], [15.23711, 46.63994], [15.14215, 46.66131], [15.01451, 46.641], [14.98024, 46.6009], [14.96002, 46.63459], [14.92283, 46.60848], [14.87129, 46.61], [14.86419, 46.59411], [14.83549, 46.56614], [14.81836, 46.51046], [14.72185, 46.49974], [14.66892, 46.44936], [14.5942, 46.43434], [14.56463, 46.37208], [14.52176, 46.42617], [14.45877, 46.41717], [14.42608, 46.44614], [14.314, 46.43327], [14.28326, 46.44315], [14.15989, 46.43327], [14.12097, 46.47724], [14.04002, 46.49117], [14.00422, 46.48474], [13.89837, 46.52331], [13.7148, 46.5222], [13.68684, 46.43881], [13.59777, 46.44137], [13.5763, 46.42613], [13.5763, 46.40915], [13.47019, 46.3621], [13.43418, 46.35992], [13.44808, 46.33507], [13.37671, 46.29668], [13.41193, 46.22767], [13.40899, 46.21509], [13.42218, 46.20758], [13.47587, 46.22725], [13.56114, 46.2054], [13.56682, 46.18703], [13.64451, 46.18966], [13.66472, 46.17392], [13.64053, 46.13587], [13.57072, 46.09022], [13.50104, 46.05986], [13.49568, 46.04839], [13.50998, 46.04498], [13.49702, 46.01832], [13.47474, 46.00546], [13.50104, 45.98078], [13.52963, 45.96588], [13.56759, 45.96991], [13.58903, 45.99009], [13.62074, 45.98388], [13.63458, 45.98947], [13.64307, 45.98326], [13.6329, 45.94894], [13.63815, 45.93607], [13.61931, 45.91782], [13.60857, 45.89907], [13.59565, 45.89446], [13.58644, 45.88173], [13.57563, 45.8425], [13.58858, 45.83503], [13.59784, 45.8072], [13.66986, 45.79955], [13.8235, 45.7176], [13.83332, 45.70855], [13.83422, 45.68703], [13.87933, 45.65207], [13.9191, 45.6322], [13.8695, 45.60835], [13.86771, 45.59898], [13.84106, 45.58185], [13.78445, 45.5825], [13.74587, 45.59811], [13.7198, 45.59352], [13.6076, 45.64761], [13.45644, 45.59464], [13.56979, 45.4895], [13.62902, 45.45898], [13.67398, 45.4436], [13.7785, 45.46787], [13.81742, 45.43729], [13.88124, 45.42637], [13.90771, 45.45149], [13.97309, 45.45258], [13.99488, 45.47551], [13.96063, 45.50825], [14.00578, 45.52352], [14.07116, 45.48752], [14.20348, 45.46896], [14.22371, 45.50388], [14.24239, 45.50607], [14.26611, 45.48239], [14.27681, 45.4902], [14.32487, 45.47142], [14.36693, 45.48642], [14.49769, 45.54424], [14.5008, 45.60852], [14.53816, 45.6205], [14.57397, 45.67165], [14.60977, 45.66403], [14.59576, 45.62812], [14.69694, 45.57366], [14.68605, 45.53006], [14.71718, 45.53442], [14.80124, 45.49515], [14.81992, 45.45913], [14.90554, 45.47769], [14.92266, 45.52788], [15.02385, 45.48533], [15.05187, 45.49079], [15.16862, 45.42309], [15.27758, 45.46678], [15.33051, 45.45258], [15.38188, 45.48752], [15.30249, 45.53224], [15.29837, 45.5841], [15.27747, 45.60504], [15.31027, 45.6303], [15.34695, 45.63382], [15.34214, 45.64702], [15.38952, 45.63682], [15.4057, 45.64727], [15.34919, 45.71623], [15.30872, 45.69014], [15.25423, 45.72275], [15.40836, 45.79491], [15.47531, 45.79802], [15.47325, 45.8253], [15.52234, 45.82195], [15.57952, 45.84953], [15.64185, 45.82915], [15.66662, 45.84085], [15.70411, 45.8465], [15.68232, 45.86819], [15.68383, 45.88867], [15.67967, 45.90455], [15.70636, 45.92116], [15.70327, 46.00015], [15.71246, 46.01196], [15.72977, 46.04682], [15.62317, 46.09103], [15.6083, 46.11992], [15.59909, 46.14761], [15.64904, 46.19229], [15.6434, 46.21396], [15.67395, 46.22478], [15.75436, 46.21969], [15.75479, 46.20336], [15.78817, 46.21719], [15.79284, 46.25811], [15.97965, 46.30652], [16.07616, 46.3463], [16.07314, 46.36458], [16.05065, 46.3833], [16.05281, 46.39141], [16.14859, 46.40547], [16.18824, 46.38282], [16.30233, 46.37837], [16.30162, 46.40437], [16.27329, 46.41467], [16.27398, 46.42875], [16.25124, 46.48067], [16.23961, 46.49653], [16.26759, 46.50566], [16.26733, 46.51505], [16.29793, 46.5121], [16.37193, 46.55008], [16.38771, 46.53608], [16.44036, 46.5171], [16.5007, 46.49644], [16.52604, 46.47831], [16.59527, 46.47524], [16.52604, 46.5051], [16.52885, 46.53303], [16.50139, 46.56684]]]] } },
34288 { type: "Feature", properties: { iso1A2: "SJ", iso1A3: "SJM", iso1N3: "744", wikidata: "Q842829", nameEn: "Svalbard and Jan Mayen", country: "NO" }, geometry: null },
34289 { type: "Feature", properties: { iso1A2: "SK", iso1A3: "SVK", iso1N3: "703", wikidata: "Q214", nameEn: "Slovakia", groups: ["EU", "151", "150", "UN"], callingCodes: ["421"] }, geometry: { type: "MultiPolygon", coordinates: [[[[19.82237, 49.27806], [19.78581, 49.41701], [19.72127, 49.39288], [19.6375, 49.40897], [19.64162, 49.45184], [19.57845, 49.46077], [19.53313, 49.52856], [19.52626, 49.57311], [19.45348, 49.61583], [19.37795, 49.574], [19.36009, 49.53747], [19.25435, 49.53391], [19.18019, 49.41165], [18.9742, 49.39557], [18.97283, 49.49914], [18.94536, 49.52143], [18.84521, 49.51672], [18.74761, 49.492], [18.67757, 49.50895], [18.6144, 49.49824], [18.57183, 49.51162], [18.53063, 49.49022], [18.54848, 49.47059], [18.44686, 49.39467], [18.4084, 49.40003], [18.4139, 49.36517], [18.36446, 49.3267], [18.18456, 49.28909], [18.15022, 49.24518], [18.1104, 49.08624], [18.06885, 49.03157], [17.91814, 49.01784], [17.87831, 48.92679], [17.77944, 48.92318], [17.73126, 48.87885], [17.7094, 48.86721], [17.5295, 48.81117], [17.45671, 48.85004], [17.3853, 48.80936], [17.29054, 48.85546], [17.19355, 48.87602], [17.11202, 48.82925], [17.00215, 48.70887], [16.93955, 48.60371], [16.94611, 48.53614], [16.85204, 48.44968], [16.8497, 48.38321], [16.83588, 48.3844], [16.83317, 48.38138], [16.84243, 48.35258], [16.90903, 48.32519], [16.89461, 48.31332], [16.97701, 48.17385], [17.02919, 48.13996], [17.05735, 48.14179], [17.09168, 48.09366], [17.07039, 48.0317], [17.16001, 48.00636], [17.23699, 48.02094], [17.71215, 47.7548], [18.02938, 47.75665], [18.29305, 47.73541], [18.56496, 47.76588], [18.65644, 47.7568], [18.72154, 47.78683], [18.74074, 47.8157], [18.8506, 47.82308], [18.76821, 47.87469], [18.76134, 47.97499], [18.82176, 48.04206], [19.01952, 48.07052], [19.23924, 48.0595], [19.28182, 48.08336], [19.47957, 48.09437], [19.52489, 48.19791], [19.63338, 48.25006], [19.92452, 48.1283], [20.24312, 48.2784], [20.29943, 48.26104], [20.5215, 48.53336], [20.83248, 48.5824], [21.11516, 48.49546], [21.44063, 48.58456], [21.6068, 48.50365], [21.67134, 48.3989], [21.72525, 48.34628], [21.8279, 48.33321], [21.83339, 48.36242], [22.14689, 48.4005], [22.16023, 48.56548], [22.21379, 48.6218], [22.34151, 48.68893], [22.42934, 48.92857], [22.48296, 48.99172], [22.54338, 49.01424], [22.56155, 49.08865], [22.04427, 49.22136], [21.96385, 49.3437], [21.82927, 49.39467], [21.77983, 49.35443], [21.62328, 49.4447], [21.43376, 49.41433], [21.27858, 49.45988], [21.19756, 49.4054], [21.12477, 49.43666], [21.041, 49.41791], [21.09799, 49.37176], [20.98733, 49.30774], [20.9229, 49.29626], [20.77971, 49.35383], [20.72274, 49.41813], [20.61666, 49.41791], [20.5631, 49.375], [20.46422, 49.41612], [20.39939, 49.3896], [20.31728, 49.39914], [20.31453, 49.34817], [20.21977, 49.35265], [20.13738, 49.31685], [20.08238, 49.1813], [19.98494, 49.22904], [19.90529, 49.23532], [19.86409, 49.19316], [19.75286, 49.20751], [19.82237, 49.27806]]]] } },
34290 { type: "Feature", properties: { iso1A2: "SL", iso1A3: "SLE", iso1N3: "694", wikidata: "Q1044", nameEn: "Sierra Leone", groups: ["011", "202", "002", "UN"], callingCodes: ["232"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-10.27575, 8.48711], [-10.37257, 8.48941], [-10.54891, 8.31174], [-10.63934, 8.35326], [-10.70565, 8.29235], [-10.61422, 8.5314], [-10.47707, 8.67669], [-10.56197, 8.81225], [-10.5783, 9.06386], [-10.74484, 9.07998], [-10.6534, 9.29919], [-11.2118, 10.00098], [-11.89624, 9.99763], [-11.91023, 9.93927], [-12.12634, 9.87203], [-12.24262, 9.92386], [-12.47254, 9.86834], [-12.76788, 9.3133], [-12.94095, 9.26335], [-13.08953, 9.0409], [-13.18586, 9.0925], [-13.29911, 9.04245], [-14.36218, 8.64107], [-12.15048, 6.15992], [-11.50429, 6.92704], [-11.4027, 6.97746], [-11.29417, 7.21576], [-10.60422, 7.7739], [-10.60492, 8.04072], [-10.57523, 8.04829], [-10.51554, 8.1393], [-10.45023, 8.15627], [-10.35227, 8.15223], [-10.29839, 8.21283], [-10.31635, 8.28554], [-10.30084, 8.30008], [-10.27575, 8.48711]]]] } },
34291 { type: "Feature", properties: { iso1A2: "SM", iso1A3: "SMR", iso1N3: "674", wikidata: "Q238", nameEn: "San Marino", groups: ["039", "150", "UN"], callingCodes: ["378"] }, geometry: { type: "MultiPolygon", coordinates: [[[[12.45648, 43.89369], [12.48771, 43.89706], [12.49429, 43.90973], [12.49247, 43.91774], [12.49724, 43.92248], [12.50269, 43.92363], [12.50496, 43.93017], [12.51553, 43.94096], [12.51427, 43.94897], [12.50655, 43.95796], [12.50875, 43.96198], [12.50622, 43.97131], [12.51109, 43.97201], [12.51064, 43.98165], [12.5154, 43.98508], [12.51463, 43.99122], [12.50678, 43.99113], [12.49406, 43.98492], [12.47853, 43.98052], [12.46205, 43.97463], [12.44684, 43.96597], [12.43662, 43.95698], [12.42005, 43.9578], [12.41414, 43.95273], [12.40415, 43.95485], [12.40506, 43.94325], [12.41165, 43.93769], [12.41551, 43.92984], [12.40733, 43.92379], [12.41233, 43.90956], [12.40935, 43.9024], [12.41641, 43.89991], [12.44184, 43.90498], [12.45648, 43.89369]]]] } },
34292 { type: "Feature", properties: { iso1A2: "SN", iso1A3: "SEN", iso1N3: "686", wikidata: "Q1041", nameEn: "Senegal", groups: ["011", "202", "002", "UN"], callingCodes: ["221"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-14.32144, 16.61495], [-15.00557, 16.64997], [-15.6509, 16.50315], [-16.27016, 16.51565], [-16.4429, 16.20605], [-16.44814, 16.09753], [-16.48967, 16.0496], [-16.50854, 16.09032], [-17.15288, 16.07139], [-18.35085, 14.63444], [-17.43598, 13.59273], [-15.47902, 13.58758], [-15.36504, 13.79313], [-14.93719, 13.80173], [-14.34721, 13.46578], [-13.8955, 13.59126], [-13.79409, 13.34472], [-14.36795, 13.23033], [-15.14917, 13.57989], [-15.26908, 13.37768], [-15.80478, 13.34832], [-15.80355, 13.16729], [-16.69343, 13.16791], [-16.74676, 13.06025], [-17.43966, 13.04579], [-17.4623, 11.92379], [-16.70562, 12.34803], [-16.38191, 12.36449], [-16.20591, 12.46157], [-15.67302, 12.42974], [-15.17582, 12.6847], [-13.70523, 12.68013], [-13.05296, 12.64003], [-13.06603, 12.49342], [-12.87336, 12.51892], [-12.35415, 12.32758], [-11.91331, 12.42008], [-11.46267, 12.44559], [-11.37536, 12.40788], [-11.39935, 12.97808], [-11.63025, 13.39174], [-11.83345, 13.33333], [-12.06897, 13.71049], [-11.93043, 13.84505], [-12.23936, 14.76324], [-13.11029, 15.52116], [-13.43135, 16.09022], [-13.80075, 16.13961], [-14.32144, 16.61495]]]] } },
34293 { type: "Feature", properties: { iso1A2: "SO", iso1A3: "SOM", iso1N3: "706", wikidata: "Q1045", nameEn: "Somalia", groups: ["014", "202", "002", "UN"], callingCodes: ["252"] }, geometry: { type: "MultiPolygon", coordinates: [[[[51.12877, 12.56479], [43.90659, 12.3823], [42.95776, 10.98533], [42.69452, 10.62672], [42.87643, 10.18441], [43.0937, 9.90579], [43.23518, 9.84605], [43.32613, 9.59205], [44.19222, 8.93028], [46.99339, 7.9989], [47.92477, 8.00111], [47.97917, 8.00124], [44.98104, 4.91821], [44.02436, 4.9451], [43.40263, 4.79289], [43.04177, 4.57923], [42.97746, 4.44032], [42.84526, 4.28357], [42.55853, 4.20518], [42.07619, 4.17667], [41.89488, 3.97375], [41.31368, 3.14314], [40.98767, 2.82959], [41.00099, -0.83068], [41.56, -1.59812], [41.56362, -1.66375], [41.75542, -1.85308], [57.49095, 8.14549], [51.12877, 12.56479]]]] } },
34294 { type: "Feature", properties: { iso1A2: "SR", iso1A3: "SUR", iso1N3: "740", wikidata: "Q730", nameEn: "Suriname", groups: ["005", "419", "019", "UN"], driveSide: "left", callingCodes: ["597"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-54.26916, 5.26909], [-54.01877, 5.52789], [-54.01074, 5.68785], [-53.7094, 6.2264], [-56.84822, 6.73257], [-57.31629, 5.33714], [-57.22536, 5.15605], [-57.37442, 5.0208], [-57.8699, 4.89394], [-58.0307, 3.95513], [-57.35891, 3.32121], [-56.70519, 2.02964], [-56.55439, 2.02003], [-56.47045, 1.95135], [-55.99278, 1.83137], [-55.89863, 1.89861], [-55.92159, 2.05236], [-56.13054, 2.27723], [-55.96292, 2.53188], [-55.71493, 2.40342], [-55.01919, 2.564], [-54.6084, 2.32856], [-54.42864, 2.42442], [-54.28534, 2.67798], [-53.9849, 3.58697], [-53.98914, 3.627], [-54.05128, 3.63557], [-54.19367, 3.84387], [-54.38444, 4.13222], [-54.4717, 4.91964], [-54.26916, 5.26909]]]] } },
34295 { type: "Feature", properties: { iso1A2: "SS", iso1A3: "SSD", iso1N3: "728", wikidata: "Q958", nameEn: "South Sudan", groups: ["014", "202", "002", "UN"], callingCodes: ["211"] }, geometry: { type: "MultiPolygon", coordinates: [[[[34.10229, 9.50238], [33.87958, 9.49937], [33.9082, 9.762], [33.96323, 9.80972], [33.99185, 9.99623], [33.96984, 10.15446], [33.90159, 10.17179], [33.80913, 10.32994], [33.66604, 10.44254], [33.52294, 10.64382], [33.24645, 10.77913], [33.26977, 10.83632], [33.13988, 11.43248], [33.25876, 12.22111], [32.73921, 12.22757], [32.73921, 11.95203], [32.10079, 11.95203], [32.39578, 11.70208], [32.39358, 11.18207], [32.46967, 11.04662], [31.99177, 10.65065], [31.77539, 10.28939], [31.28504, 9.75287], [30.84605, 9.7498], [30.82893, 9.71451], [30.53005, 9.95992], [30.00389, 10.28633], [29.94629, 10.29245], [29.54, 10.07949], [29.53844, 9.75133], [29.06988, 9.74826], [28.99983, 9.67155], [27.90704, 9.61323], [27.14427, 9.62858], [26.70685, 9.48735], [26.35815, 9.57946], [26.21338, 9.91545], [25.93241, 10.17941], [25.93163, 10.38159], [25.78141, 10.42599], [25.0918, 10.33718], [25.05688, 10.06776], [24.97739, 9.9081], [24.84653, 9.80643], [24.49389, 9.79962], [24.12744, 9.73784], [24.09319, 9.66572], [23.69155, 9.67566], [23.62179, 9.53823], [23.64981, 9.44303], [23.64358, 9.28637], [23.56263, 9.19418], [23.4848, 9.16959], [23.44744, 8.99128], [23.59065, 8.99743], [23.51905, 8.71749], [24.25691, 8.69288], [24.13238, 8.36959], [24.35965, 8.26177], [24.85156, 8.16933], [24.98855, 7.96588], [25.25319, 7.8487], [25.29214, 7.66675], [25.20649, 7.61115], [25.20337, 7.50312], [25.35281, 7.42595], [25.37461, 7.33024], [25.90076, 7.09549], [26.38022, 6.63493], [26.32729, 6.36272], [26.58259, 6.1987], [26.51721, 6.09655], [27.22705, 5.71254], [27.22705, 5.62889], [27.28621, 5.56382], [27.23017, 5.37167], [27.26886, 5.25876], [27.44012, 5.07349], [27.56656, 4.89375], [27.65462, 4.89375], [27.76469, 4.79284], [27.79551, 4.59976], [28.20719, 4.35614], [28.6651, 4.42638], [28.8126, 4.48784], [29.03054, 4.48784], [29.22207, 4.34297], [29.43341, 4.50101], [29.49726, 4.7007], [29.82087, 4.56246], [29.79666, 4.37809], [30.06964, 4.13221], [30.1621, 4.10586], [30.22374, 3.93896], [30.27658, 3.95653], [30.47691, 3.83353], [30.55396, 3.84451], [30.57378, 3.74567], [30.56277, 3.62703], [30.78512, 3.67097], [30.80713, 3.60506], [30.85997, 3.5743], [30.85153, 3.48867], [30.97601, 3.693], [31.16666, 3.79853], [31.29476, 3.8015], [31.50478, 3.67814], [31.50776, 3.63652], [31.72075, 3.74354], [31.81459, 3.82083], [31.86821, 3.78664], [31.96205, 3.6499], [31.95907, 3.57408], [32.05187, 3.589], [32.08491, 3.56287], [32.08866, 3.53543], [32.19888, 3.50867], [32.20782, 3.6053], [32.41337, 3.748], [32.72021, 3.77327], [32.89746, 3.81339], [33.02852, 3.89296], [33.18356, 3.77812], [33.51264, 3.75068], [33.9873, 4.23316], [34.47601, 4.72162], [35.34151, 5.02364], [35.30992, 4.90402], [35.47843, 4.91872], [35.42366, 4.76969], [35.51424, 4.61643], [35.9419, 4.61933], [35.82118, 4.77382], [35.81968, 5.10757], [35.8576, 5.33413], [35.50792, 5.42431], [35.29938, 5.34042], [35.31188, 5.50106], [35.13058, 5.62118], [35.12611, 5.68937], [35.00546, 5.89387], [34.96227, 6.26415], [35.01738, 6.46991], [34.87736, 6.60161], [34.77459, 6.5957], [34.65096, 6.72589], [34.53776, 6.74808], [34.53925, 6.82794], [34.47669, 6.91076], [34.35753, 6.91963], [34.19369, 7.04382], [34.19369, 7.12807], [34.01495, 7.25664], [34.03878, 7.27437], [34.02984, 7.36449], [33.87642, 7.5491], [33.71407, 7.65983], [33.44745, 7.7543], [33.32531, 7.71297], [33.24637, 7.77939], [33.04944, 7.78989], [33.0006, 7.90333], [33.08401, 8.05822], [33.18083, 8.13047], [33.1853, 8.29264], [33.19721, 8.40317], [33.3119, 8.45474], [33.54575, 8.47094], [33.66938, 8.44442], [33.71407, 8.3678], [33.87195, 8.41938], [33.89579, 8.4842], [34.01346, 8.50041], [34.14453, 8.60204], [34.14304, 9.04654], [34.10229, 9.50238]]]] } },
34296 { type: "Feature", properties: { iso1A2: "ST", iso1A3: "STP", iso1N3: "678", wikidata: "Q1039", nameEn: "S\xE3o Tom\xE9 and Principe", groups: ["017", "202", "002", "UN"], callingCodes: ["239"] }, geometry: { type: "MultiPolygon", coordinates: [[[[4.34149, 1.91417], [6.6507, -0.28606], [7.9035, 1.92304], [4.34149, 1.91417]]]] } },
34297 { type: "Feature", properties: { iso1A2: "SV", iso1A3: "SLV", iso1N3: "222", wikidata: "Q792", nameEn: "El Salvador", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["503"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-89.34776, 14.43013], [-89.39028, 14.44561], [-89.57441, 14.41637], [-89.58814, 14.33165], [-89.50614, 14.26084], [-89.52397, 14.22628], [-89.61844, 14.21937], [-89.70756, 14.1537], [-89.75569, 14.07073], [-89.73251, 14.04133], [-89.76103, 14.02923], [-89.81807, 14.07073], [-89.88937, 14.0396], [-90.10505, 13.85104], [-90.11344, 13.73679], [-90.55276, 12.8866], [-88.11443, 12.63306], [-87.7346, 13.13228], [-87.55124, 13.12523], [-87.69751, 13.25228], [-87.73714, 13.32715], [-87.80177, 13.35689], [-87.84675, 13.41078], [-87.83467, 13.44655], [-87.77354, 13.45767], [-87.73841, 13.44169], [-87.72115, 13.46083], [-87.71657, 13.50577], [-87.78148, 13.52906], [-87.73106, 13.75443], [-87.68821, 13.80829], [-87.7966, 13.91353], [-88.00331, 13.86948], [-88.07641, 13.98447], [-88.23018, 13.99915], [-88.25791, 13.91108], [-88.48982, 13.86458], [-88.49738, 13.97224], [-88.70661, 14.04317], [-88.73182, 14.10919], [-88.815, 14.11652], [-88.85785, 14.17763], [-88.94608, 14.20207], [-89.04187, 14.33644], [-89.34776, 14.43013]]]] } },
34298 { type: "Feature", properties: { iso1A2: "SX", iso1A3: "SXM", iso1N3: "534", wikidata: "Q26273", nameEn: "Sint Maarten", aliases: ["NL-SX"], country: "NL", groups: ["Q1451600", "029", "003", "419", "019", "UN"], callingCodes: ["1 721"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.33064, 17.9615], [-63.1055, 17.86651], [-62.93924, 18.02904], [-63.02323, 18.05757], [-63.04039, 18.05619], [-63.0579, 18.06614], [-63.07759, 18.04943], [-63.09686, 18.04608], [-63.11042, 18.05339], [-63.13502, 18.05445], [-63.33064, 17.9615]]]] } },
34299 { type: "Feature", properties: { iso1A2: "SY", iso1A3: "SYR", iso1N3: "760", wikidata: "Q858", nameEn: "Syria", groups: ["145", "142", "UN"], callingCodes: ["963"] }, geometry: { type: "MultiPolygon", coordinates: [[[[42.23683, 37.2863], [42.21548, 37.28026], [42.20454, 37.28715], [42.22381, 37.30238], [42.22257, 37.31395], [42.2112, 37.32491], [42.19301, 37.31323], [42.18225, 37.28569], [42.00894, 37.17209], [41.515, 37.08084], [41.21937, 37.07665], [40.90856, 37.13147], [40.69136, 37.0996], [39.81589, 36.75538], [39.21538, 36.66834], [39.03217, 36.70911], [38.74042, 36.70629], [38.55908, 36.84429], [38.38859, 36.90064], [38.21064, 36.91842], [37.81974, 36.76055], [37.68048, 36.75065], [37.49103, 36.66904], [37.47253, 36.63243], [37.21988, 36.6736], [37.16177, 36.66069], [37.10894, 36.6704], [37.08279, 36.63495], [37.02088, 36.66422], [37.01647, 36.69512], [37.04619, 36.71101], [37.04399, 36.73483], [36.99886, 36.74012], [36.99557, 36.75997], [36.66727, 36.82901], [36.61581, 36.74629], [36.62681, 36.71189], [36.57398, 36.65186], [36.58829, 36.58295], [36.54206, 36.49539], [36.6081, 36.33772], [36.65653, 36.33861], [36.68672, 36.23677], [36.6125, 36.22592], [36.50463, 36.2419], [36.4617, 36.20461], [36.39206, 36.22088], [36.37474, 36.01163], [36.33956, 35.98687], [36.30099, 36.00985], [36.28338, 36.00273], [36.29769, 35.96086], [36.27678, 35.94839], [36.25366, 35.96264], [36.19973, 35.95195], [36.17441, 35.92076], [36.1623, 35.80925], [36.14029, 35.81015], [36.13919, 35.83692], [36.11827, 35.85923], [35.99829, 35.88242], [36.01844, 35.92403], [36.00514, 35.94113], [35.98499, 35.94107], [35.931, 35.92109], [35.51152, 36.10954], [35.48515, 34.70851], [35.97386, 34.63322], [35.98718, 34.64977], [36.29165, 34.62991], [36.32399, 34.69334], [36.35135, 34.68516], [36.35384, 34.65447], [36.42941, 34.62505], [36.46003, 34.6378], [36.45299, 34.59438], [36.41429, 34.61175], [36.39846, 34.55672], [36.3369, 34.52629], [36.34745, 34.5002], [36.4442, 34.50165], [36.46179, 34.46541], [36.55853, 34.41609], [36.53039, 34.3798], [36.56556, 34.31881], [36.60778, 34.31009], [36.58667, 34.27667], [36.59195, 34.2316], [36.62537, 34.20251], [36.5128, 34.09916], [36.50576, 34.05982], [36.41078, 34.05253], [36.28589, 33.91981], [36.38263, 33.86579], [36.3967, 33.83365], [36.14517, 33.85118], [36.06778, 33.82927], [35.9341, 33.6596], [36.05723, 33.57904], [35.94465, 33.52774], [35.94816, 33.47886], [35.88668, 33.43183], [35.82577, 33.40479], [35.81324, 33.36354], [35.77477, 33.33609], [35.813, 33.3172], [35.77513, 33.27342], [35.81295, 33.24841], [35.81647, 33.2028], [35.83846, 33.19397], [35.84285, 33.16673], [35.81911, 33.1336], [35.81911, 33.11077], [35.84802, 33.1031], [35.87188, 32.98028], [35.89298, 32.9456], [35.87012, 32.91976], [35.84021, 32.8725], [35.83758, 32.82817], [35.78745, 32.77938], [35.75983, 32.74803], [35.88405, 32.71321], [35.93307, 32.71966], [35.96633, 32.66237], [36.02239, 32.65911], [36.08074, 32.51463], [36.20379, 32.52751], [36.20875, 32.49529], [36.23948, 32.50108], [36.40959, 32.37908], [36.83946, 32.31293], [38.79171, 33.37328], [40.64314, 34.31604], [40.97676, 34.39788], [41.12388, 34.65742], [41.2345, 34.80049], [41.21654, 35.1508], [41.26569, 35.42708], [41.38184, 35.62502], [41.37027, 35.84095], [41.2564, 36.06012], [41.28864, 36.35368], [41.40058, 36.52502], [41.81736, 36.58782], [42.36697, 37.0627], [42.35724, 37.10998], [42.32313, 37.17814], [42.34735, 37.22548], [42.2824, 37.2798], [42.26039, 37.27017], [42.23683, 37.2863]]]] } },
34300 { type: "Feature", properties: { iso1A2: "SZ", iso1A3: "SWZ", iso1N3: "748", wikidata: "Q1050", nameEn: "Eswatini", aliases: ["Swaziland"], groups: ["018", "202", "002", "UN"], driveSide: "left", callingCodes: ["268"] }, geometry: { type: "MultiPolygon", coordinates: [[[[31.86881, -25.99973], [31.4175, -25.71886], [31.31237, -25.7431], [31.13073, -25.91558], [30.95819, -26.26303], [30.78927, -26.48271], [30.81101, -26.84722], [30.88826, -26.79622], [30.97757, -26.92706], [30.96088, -27.0245], [31.15027, -27.20151], [31.49834, -27.31549], [31.97592, -27.31675], [31.97463, -27.11057], [32.00893, -26.8096], [32.09664, -26.80721], [32.13315, -26.84345], [32.13409, -26.5317], [32.07352, -26.40185], [32.10435, -26.15656], [32.08599, -26.00978], [32.00916, -25.999], [31.974, -25.95387], [31.86881, -25.99973]]]] } },
34301 { type: "Feature", properties: { iso1A2: "TA", iso1A3: "TAA", wikidata: "Q220982", nameEn: "Tristan da Cunha", aliases: ["SH-TA"], country: "GB", groups: ["SH", "BOTS", "011", "202", "002", "UN"], isoStatus: "excRes", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["290 8", "44 20"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-13.38232, -34.07258], [-16.67337, -41.9188], [-5.88482, -41.4829], [-13.38232, -34.07258]]]] } },
34302 { type: "Feature", properties: { iso1A2: "TC", iso1A3: "TCA", iso1N3: "796", wikidata: "Q18221", nameEn: "Turks and Caicos Islands", country: "GB", groups: ["BOTS", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 649"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-71.70065, 25.7637], [-72.98446, 20.4801], [-69.80718, 21.35956], [-71.70065, 25.7637]]]] } },
34303 { type: "Feature", properties: { iso1A2: "TD", iso1A3: "TCD", iso1N3: "148", wikidata: "Q657", nameEn: "Chad", groups: ["017", "202", "002", "UN"], callingCodes: ["235"] }, geometry: { type: "MultiPolygon", coordinates: [[[[23.99539, 19.49944], [15.99566, 23.49639], [14.99751, 23.00539], [15.19692, 21.99339], [15.20213, 21.49365], [15.28332, 21.44557], [15.62515, 20.95395], [15.57248, 20.92138], [15.55382, 20.86507], [15.56004, 20.79488], [15.59841, 20.74039], [15.6721, 20.70069], [15.99632, 20.35364], [15.75098, 19.93002], [15.6032, 18.77402], [15.50373, 16.89649], [14.37425, 15.72591], [13.86301, 15.04043], [13.78991, 14.87519], [13.809, 14.72915], [13.67878, 14.64013], [13.68573, 14.55276], [13.48259, 14.46704], [13.47559, 14.40881], [13.6302, 13.71094], [14.08251, 13.0797], [14.46881, 13.08259], [14.56101, 12.91036], [14.55058, 12.78256], [14.83314, 12.62963], [14.90827, 12.3269], [14.89019, 12.16593], [14.96952, 12.0925], [15.00146, 12.1223], [15.0349, 12.10698], [15.05786, 12.0608], [15.04808, 11.8731], [15.11579, 11.79313], [15.06595, 11.71126], [15.13149, 11.5537], [15.0585, 11.40481], [15.10021, 11.04101], [15.04957, 11.02347], [15.09127, 10.87431], [15.06737, 10.80921], [15.15532, 10.62846], [15.14936, 10.53915], [15.23724, 10.47764], [15.30874, 10.31063], [15.50535, 10.1098], [15.68761, 9.99344], [15.41408, 9.92876], [15.24618, 9.99246], [15.14043, 9.99246], [15.05999, 9.94845], [14.95722, 9.97926], [14.80082, 9.93818], [14.4673, 10.00264], [14.20411, 10.00055], [14.1317, 9.82413], [14.01793, 9.73169], [13.97544, 9.6365], [14.37094, 9.2954], [14.35707, 9.19611], [14.83566, 8.80557], [15.09484, 8.65982], [15.20426, 8.50892], [15.50743, 7.79302], [15.59272, 7.7696], [15.56964, 7.58936], [15.49743, 7.52179], [15.73118, 7.52006], [15.79942, 7.44149], [16.40703, 7.68809], [16.41583, 7.77971], [16.58315, 7.88657], [16.59415, 7.76444], [16.658, 7.75353], [16.6668, 7.67281], [16.8143, 7.53971], [17.67288, 7.98905], [17.93926, 7.95853], [18.02731, 8.01085], [18.6085, 8.05009], [18.64153, 8.08714], [18.62612, 8.14163], [18.67455, 8.22226], [18.79783, 8.25929], [19.11044, 8.68172], [18.86388, 8.87971], [19.06421, 9.00367], [20.36748, 9.11019], [20.82979, 9.44696], [21.26348, 9.97642], [21.34934, 9.95907], [21.52766, 10.2105], [21.63553, 10.217], [21.71479, 10.29932], [21.72139, 10.64136], [22.45889, 11.00246], [22.87758, 10.91915], [22.97249, 11.21955], [22.93124, 11.41645], [22.7997, 11.40424], [22.54907, 11.64372], [22.64092, 12.07485], [22.48369, 12.02766], [22.50548, 12.16769], [22.38873, 12.45514], [22.46345, 12.61925], [22.22684, 12.74682], [22.15679, 12.66634], [21.98711, 12.63292], [21.89371, 12.68001], [21.81432, 12.81362], [21.94819, 13.05637], [22.02914, 13.13976], [22.1599, 13.19281], [22.29689, 13.3731], [22.08674, 13.77863], [22.22995, 13.96754], [22.5553, 14.11704], [22.55997, 14.23024], [22.44944, 14.24986], [22.38562, 14.58907], [22.70474, 14.69149], [22.66115, 14.86308], [22.99584, 15.22989], [22.99584, 15.40105], [22.92579, 15.47007], [22.93201, 15.55107], [23.10792, 15.71297], [23.38812, 15.69649], [23.62785, 15.7804], [23.99997, 15.69575], [23.99539, 19.49944]]]] } },
34304 { type: "Feature", properties: { iso1A2: "TF", iso1A3: "ATF", iso1N3: "260", wikidata: "Q129003", nameEn: "French Southern Territories", country: "FR", groups: ["EU", "UN"] }, geometry: null },
34305 { type: "Feature", properties: { iso1A2: "TG", iso1A3: "TGO", iso1N3: "768", wikidata: "Q945", nameEn: "Togo", groups: ["011", "202", "002", "UN"], callingCodes: ["228"] }, geometry: { type: "MultiPolygon", coordinates: [[[[0.50388, 11.01011], [-0.13493, 11.14075], [-0.14462, 11.10811], [-0.05733, 11.08628], [-0.0275, 11.11202], [-514e-5, 11.10763], [342e-5, 11.08317], [0.02395, 11.06229], [0.03355, 10.9807], [-63e-4, 10.96417], [-908e-5, 10.91644], [-0.02685, 10.8783], [-0.0228, 10.81916], [-0.07183, 10.76794], [-0.07327, 10.71845], [-0.09141, 10.7147], [-0.05945, 10.63458], [0.12886, 10.53149], [0.18846, 10.4096], [0.29453, 10.41546], [0.33028, 10.30408], [0.39584, 10.31112], [0.35293, 10.09412], [0.41371, 10.06361], [0.41252, 10.02018], [0.36366, 10.03309], [0.32075, 9.72781], [0.34816, 9.71607], [0.34816, 9.66907], [0.32313, 9.6491], [0.28261, 9.69022], [0.26712, 9.66437], [0.29334, 9.59387], [0.36008, 9.6256], [0.38153, 9.58682], [0.23851, 9.57389], [0.2409, 9.52335], [0.30406, 9.521], [0.31241, 9.50337], [0.2254, 9.47869], [0.25758, 9.42696], [0.33148, 9.44812], [0.36485, 9.49749], [0.49118, 9.48339], [0.56388, 9.40697], [0.45424, 9.04581], [0.52455, 8.87746], [0.37319, 8.75262], [0.47211, 8.59945], [0.64731, 8.48866], [0.73432, 8.29529], [0.63897, 8.25873], [0.5913, 8.19622], [0.61156, 8.18324], [0.6056, 8.13959], [0.58891, 8.12779], [0.62943, 7.85751], [0.58295, 7.62368], [0.51979, 7.58706], [0.52455, 7.45354], [0.57223, 7.39326], [0.62943, 7.41099], [0.65327, 7.31643], [0.59606, 7.01252], [0.52217, 6.9723], [0.52098, 6.94391], [0.56508, 6.92971], [0.52853, 6.82921], [0.57406, 6.80348], [0.58176, 6.76049], [0.6497, 6.73682], [0.63659, 6.63857], [0.74862, 6.56517], [0.71048, 6.53083], [0.89283, 6.33779], [0.99652, 6.33779], [1.03108, 6.24064], [1.05969, 6.22998], [1.09187, 6.17074], [1.19966, 6.17069], [1.19771, 6.11522], [1.27574, 5.93551], [1.67336, 6.02702], [1.62913, 6.24075], [1.79826, 6.28221], [1.76906, 6.43189], [1.58105, 6.68619], [1.61812, 6.74843], [1.55877, 6.99737], [1.64249, 6.99562], [1.61838, 9.0527], [1.5649, 9.16941], [1.41746, 9.3226], [1.33675, 9.54765], [1.36624, 9.5951], [1.35507, 9.99525], [0.77666, 10.37665], [0.80358, 10.71459], [0.8804, 10.803], [0.91245, 10.99597], [0.66104, 10.99964], [0.4958, 10.93269], [0.50521, 10.98035], [0.48852, 10.98561], [0.50388, 11.01011]]]] } },
34306 { type: "Feature", properties: { iso1A2: "TH", iso1A3: "THA", iso1N3: "764", wikidata: "Q869", nameEn: "Thailand", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["66"] }, geometry: { type: "MultiPolygon", coordinates: [[[[100.08404, 20.36626], [99.95721, 20.46301], [99.91616, 20.44986], [99.90499, 20.4487], [99.89692, 20.44789], [99.89301, 20.44311], [99.89168, 20.44548], [99.88451, 20.44596], [99.88211, 20.44488], [99.86383, 20.44371], [99.81096, 20.33687], [99.68255, 20.32077], [99.46008, 20.39673], [99.46077, 20.36198], [99.5569, 20.20676], [99.52943, 20.14811], [99.416, 20.08614], [99.20328, 20.12877], [99.0735, 20.10298], [98.98679, 19.7419], [98.83661, 19.80931], [98.56065, 19.67807], [98.51182, 19.71303], [98.24884, 19.67876], [98.13829, 19.78541], [98.03314, 19.80941], [98.04364, 19.65755], [97.84715, 19.55782], [97.88423, 19.5041], [97.78769, 19.39429], [97.84186, 19.29526], [97.78606, 19.26769], [97.84024, 19.22217], [97.83479, 19.09972], [97.73797, 19.04261], [97.73654, 18.9812], [97.66487, 18.9371], [97.73836, 18.88478], [97.76752, 18.58097], [97.5258, 18.4939], [97.36444, 18.57138], [97.34522, 18.54596], [97.50383, 18.26844], [97.56219, 18.33885], [97.64116, 18.29778], [97.60841, 18.23846], [97.73723, 17.97912], [97.66794, 17.88005], [97.76407, 17.71595], [97.91829, 17.54504], [98.11185, 17.36829], [98.10439, 17.33847], [98.34566, 17.04822], [98.39441, 17.06266], [98.52624, 16.89979], [98.49603, 16.8446], [98.53833, 16.81934], [98.46994, 16.73613], [98.50253, 16.7139], [98.49713, 16.69022], [98.51043, 16.70107], [98.51579, 16.69433], [98.51472, 16.68521], [98.51833, 16.676], [98.51113, 16.64503], [98.5695, 16.62826], [98.57912, 16.55983], [98.63817, 16.47424], [98.68074, 16.27068], [98.84485, 16.42354], [98.92656, 16.36425], [98.8376, 16.11706], [98.69585, 16.13353], [98.57019, 16.04578], [98.59853, 15.87197], [98.541, 15.65406], [98.58598, 15.46821], [98.56027, 15.33471], [98.4866, 15.39154], [98.39351, 15.34177], [98.41906, 15.27103], [98.40522, 15.25268], [98.30446, 15.30667], [98.22, 15.21327], [98.18821, 15.13125], [98.24874, 14.83013], [98.56762, 14.37701], [98.97356, 14.04868], [99.16695, 13.72621], [99.20617, 13.20575], [99.12225, 13.19847], [99.10646, 13.05804], [99.18748, 12.9898], [99.18905, 12.84799], [99.29254, 12.68921], [99.409, 12.60603], [99.47519, 12.1353], [99.56445, 12.14805], [99.53424, 12.02317], [99.64891, 11.82699], [99.64108, 11.78948], [99.5672, 11.62732], [99.47598, 11.62434], [99.39485, 11.3925], [99.31573, 11.32081], [99.32756, 11.28545], [99.06938, 10.94857], [99.02337, 10.97217], [98.99701, 10.92962], [99.0069, 10.85485], [98.86819, 10.78336], [98.78511, 10.68351], [98.77275, 10.62548], [98.81944, 10.52761], [98.7391, 10.31488], [98.55174, 9.92804], [98.52291, 9.92389], [98.47298, 9.95782], [98.33094, 9.91973], [98.12555, 9.44056], [97.63455, 9.60854], [97.19814, 8.18901], [99.31854, 5.99868], [99.50117, 6.44501], [99.91873, 6.50233], [100.0756, 6.4045], [100.12, 6.42105], [100.19511, 6.72559], [100.29651, 6.68439], [100.30828, 6.66462], [100.31618, 6.66781], [100.31884, 6.66423], [100.32671, 6.66526], [100.32607, 6.65933], [100.31929, 6.65413], [100.35413, 6.54932], [100.41152, 6.52299], [100.41791, 6.5189], [100.42351, 6.51762], [100.43027, 6.52389], [100.66986, 6.45086], [100.74361, 6.50811], [100.74822, 6.46231], [100.81045, 6.45086], [100.85884, 6.24929], [101.10313, 6.25617], [101.12618, 6.19431], [101.06165, 6.14161], [101.12388, 6.11411], [101.087, 5.9193], [101.02708, 5.91013], [100.98815, 5.79464], [101.14062, 5.61613], [101.25755, 5.71065], [101.25524, 5.78633], [101.58019, 5.93534], [101.69773, 5.75881], [101.75074, 5.79091], [101.80144, 5.74505], [101.89188, 5.8386], [101.91776, 5.84269], [101.92819, 5.85511], [101.94712, 5.98421], [101.9714, 6.00575], [101.97114, 6.01992], [101.99209, 6.04075], [102.01835, 6.05407], [102.09182, 6.14161], [102.07732, 6.193], [102.08127, 6.22679], [102.09086, 6.23546], [102.46318, 7.22462], [102.47649, 9.66162], [102.52395, 11.25257], [102.91449, 11.65512], [102.90973, 11.75613], [102.83957, 11.8519], [102.78427, 11.98746], [102.77026, 12.06815], [102.70176, 12.1686], [102.73134, 12.37091], [102.78116, 12.40284], [102.7796, 12.43781], [102.57567, 12.65358], [102.51963, 12.66117], [102.4994, 12.71736], [102.53053, 12.77506], [102.49335, 12.92711], [102.48694, 12.97537], [102.52275, 12.99813], [102.46011, 13.08057], [102.43422, 13.09061], [102.36146, 13.26006], [102.36001, 13.31142], [102.34611, 13.35618], [102.35692, 13.38274], [102.35563, 13.47307], [102.361, 13.50551], [102.33828, 13.55613], [102.36859, 13.57488], [102.44601, 13.5637], [102.5358, 13.56933], [102.57573, 13.60461], [102.62483, 13.60883], [102.58635, 13.6286], [102.5481, 13.6589], [102.56848, 13.69366], [102.72727, 13.77806], [102.77864, 13.93374], [102.91251, 14.01531], [102.93275, 14.19044], [103.16469, 14.33075], [103.39353, 14.35639], [103.53518, 14.42575], [103.71109, 14.4348], [103.70175, 14.38052], [103.93836, 14.3398], [104.27616, 14.39861], [104.55014, 14.36091], [104.69335, 14.42726], [104.97667, 14.38806], [105.02804, 14.23722], [105.08408, 14.20402], [105.14012, 14.23873], [105.17748, 14.34432], [105.20894, 14.34967], [105.43783, 14.43865], [105.53864, 14.55731], [105.5121, 14.80802], [105.61162, 15.00037], [105.46661, 15.13132], [105.58043, 15.32724], [105.50662, 15.32054], [105.4692, 15.33709], [105.47635, 15.3796], [105.58191, 15.41031], [105.60446, 15.53301], [105.61756, 15.68792], [105.46573, 15.74742], [105.42285, 15.76971], [105.37959, 15.84074], [105.34115, 15.92737], [105.38508, 15.987], [105.42001, 16.00657], [105.06204, 16.09792], [105.00262, 16.25627], [104.88057, 16.37311], [104.73349, 16.565], [104.76099, 16.69302], [104.7397, 16.81005], [104.76442, 16.84752], [104.7373, 16.91125], [104.73712, 17.01404], [104.80716, 17.19025], [104.80061, 17.39367], [104.69867, 17.53038], [104.45404, 17.66788], [104.35432, 17.82871], [104.2757, 17.86139], [104.21776, 17.99335], [104.10927, 18.10826], [104.06533, 18.21656], [103.97725, 18.33631], [103.93916, 18.33914], [103.85642, 18.28666], [103.82449, 18.33979], [103.699, 18.34125], [103.60957, 18.40528], [103.47773, 18.42841], [103.41044, 18.4486], [103.30977, 18.4341], [103.24779, 18.37807], [103.23818, 18.34875], [103.29757, 18.30475], [103.17093, 18.2618], [103.14994, 18.23172], [103.1493, 18.17799], [103.07343, 18.12351], [103.07823, 18.03833], [103.0566, 18.00144], [103.01998, 17.97095], [102.9912, 17.9949], [102.95812, 18.0054], [102.86323, 17.97531], [102.81988, 17.94233], [102.79044, 17.93612], [102.75954, 17.89561], [102.68538, 17.86653], [102.67543, 17.84529], [102.69946, 17.81686], [102.68194, 17.80151], [102.59485, 17.83537], [102.5896, 17.84889], [102.61432, 17.92273], [102.60971, 17.95411], [102.59234, 17.96127], [102.45523, 17.97106], [102.11359, 18.21532], [101.88485, 18.02474], [101.78087, 18.07559], [101.72294, 17.92867], [101.44667, 17.7392], [101.15108, 17.47586], [100.96541, 17.57926], [101.02185, 17.87637], [101.1793, 18.0544], [101.19118, 18.2125], [101.15108, 18.25624], [101.18227, 18.34367], [101.06047, 18.43247], [101.27585, 18.68875], [101.22832, 18.73377], [101.25803, 18.89545], [101.35606, 19.04716], [101.261, 19.12717], [101.24911, 19.33334], [101.20604, 19.35296], [101.21347, 19.46223], [101.26991, 19.48324], [101.26545, 19.59242], [101.08928, 19.59748], [100.90302, 19.61901], [100.77231, 19.48324], [100.64606, 19.55884], [100.58219, 19.49164], [100.49604, 19.53504], [100.398, 19.75047], [100.5094, 19.87904], [100.58808, 20.15791], [100.55218, 20.17741], [100.51052, 20.14928], [100.47567, 20.19133], [100.4537, 20.19971], [100.44992, 20.23644], [100.41473, 20.25625], [100.37439, 20.35156], [100.33383, 20.4028], [100.25769, 20.3992], [100.22076, 20.31598], [100.16668, 20.2986], [100.1712, 20.24324], [100.11785, 20.24787], [100.09337, 20.26293], [100.09999, 20.31614], [100.08404, 20.36626]]]] } },
34307 { type: "Feature", properties: { iso1A2: "TJ", iso1A3: "TJK", iso1N3: "762", wikidata: "Q863", nameEn: "Tajikistan", groups: ["143", "142", "UN"], callingCodes: ["992"] }, geometry: { type: "MultiPolygon", coordinates: [[[[70.45251, 41.04438], [70.38028, 41.02014], [70.36655, 40.90296], [69.69434, 40.62615], [69.59441, 40.70181], [69.53021, 40.77621], [69.38327, 40.7918], [69.32834, 40.70233], [69.3455, 40.57988], [69.2643, 40.57506], [69.21063, 40.54469], [69.27066, 40.49274], [69.28525, 40.41894], [69.30774, 40.36102], [69.33794, 40.34819], [69.32833, 40.29794], [69.30808, 40.2821], [69.24817, 40.30357], [69.25229, 40.26362], [69.30104, 40.24502], [69.30448, 40.18774], [69.2074, 40.21488], [69.15659, 40.2162], [69.04544, 40.22904], [68.85832, 40.20885], [68.84357, 40.18604], [68.79276, 40.17555], [68.77902, 40.20492], [68.5332, 40.14826], [68.52771, 40.11676], [68.62796, 40.07789], [69.01523, 40.15771], [69.01935, 40.11466], [68.96579, 40.06949], [68.84906, 40.04952], [68.93695, 39.91167], [68.88889, 39.87163], [68.63071, 39.85265], [68.61972, 39.68905], [68.54166, 39.53929], [68.12053, 39.56317], [67.70992, 39.66156], [67.62889, 39.60234], [67.44899, 39.57799], [67.46547, 39.53564], [67.39681, 39.52505], [67.46822, 39.46146], [67.45998, 39.315], [67.36522, 39.31287], [67.33226, 39.23739], [67.67833, 39.14479], [67.68915, 39.00775], [68.09704, 39.02589], [68.19743, 38.85985], [68.06948, 38.82115], [68.12877, 38.73677], [68.05598, 38.71641], [68.0807, 38.64136], [68.05873, 38.56087], [68.11366, 38.47169], [68.06274, 38.39435], [68.13289, 38.40822], [68.40343, 38.19484], [68.27159, 37.91477], [68.12635, 37.93], [67.81566, 37.43107], [67.8474, 37.31594], [67.78329, 37.1834], [67.7803, 37.08978], [67.87917, 37.0591], [68.02194, 36.91923], [68.18542, 37.02074], [68.27605, 37.00977], [68.29253, 37.10621], [68.41201, 37.10402], [68.41888, 37.13906], [68.61851, 37.19815], [68.6798, 37.27906], [68.81438, 37.23862], [68.80889, 37.32494], [68.91189, 37.26704], [68.88168, 37.33368], [68.96407, 37.32603], [69.03274, 37.25174], [69.25152, 37.09426], [69.39529, 37.16752], [69.45022, 37.23315], [69.36645, 37.40462], [69.44954, 37.4869], [69.51888, 37.5844], [69.80041, 37.5746], [69.84435, 37.60616], [69.93362, 37.61378], [69.95971, 37.5659], [70.15015, 37.52519], [70.28243, 37.66706], [70.27694, 37.81258], [70.1863, 37.84296], [70.17206, 37.93276], [70.4898, 38.12546], [70.54673, 38.24541], [70.60407, 38.28046], [70.61526, 38.34774], [70.64966, 38.34999], [70.69189, 38.37031], [70.6761, 38.39144], [70.67438, 38.40597], [70.69807, 38.41861], [70.72485, 38.4131], [70.75455, 38.4252], [70.77132, 38.45548], [70.78581, 38.45502], [70.78702, 38.45031], [70.79766, 38.44944], [70.80521, 38.44447], [70.81697, 38.44507], [70.82538, 38.45394], [70.84376, 38.44688], [70.88719, 38.46826], [70.92728, 38.43021], [70.98693, 38.48862], [71.03545, 38.44779], [71.0556, 38.40176], [71.09542, 38.42517], [71.10592, 38.42077], [71.10957, 38.40671], [71.1451, 38.40106], [71.21291, 38.32797], [71.33114, 38.30339], [71.33869, 38.27335], [71.37803, 38.25641], [71.36444, 38.15358], [71.29878, 38.04429], [71.28922, 38.01272], [71.27622, 37.99946], [71.27278, 37.96496], [71.24969, 37.93031], [71.2809, 37.91995], [71.296, 37.93403], [71.32871, 37.88564], [71.51565, 37.95349], [71.58843, 37.92425], [71.59255, 37.79956], [71.55752, 37.78677], [71.54324, 37.77104], [71.53053, 37.76534], [71.55234, 37.73209], [71.54186, 37.69691], [71.51972, 37.61945], [71.5065, 37.60912], [71.49693, 37.53527], [71.50616, 37.50733], [71.5256, 37.47971], [71.49612, 37.4279], [71.47685, 37.40281], [71.4862, 37.33405], [71.49821, 37.31975], [71.50674, 37.31502], [71.48536, 37.26017], [71.4824, 37.24921], [71.48339, 37.23937], [71.47386, 37.2269], [71.4555, 37.21418], [71.4494, 37.18137], [71.44127, 37.11856], [71.43097, 37.05855], [71.45578, 37.03094], [71.46923, 36.99925], [71.48481, 36.93218], [71.51502, 36.89128], [71.57195, 36.74943], [71.67083, 36.67346], [71.83229, 36.68084], [72.31676, 36.98115], [72.54095, 37.00007], [72.66381, 37.02014], [72.79693, 37.22222], [73.06884, 37.31729], [73.29633, 37.46495], [73.77197, 37.4417], [73.76647, 37.33913], [73.61129, 37.27469], [73.64974, 37.23643], [73.82552, 37.22659], [73.8564, 37.26158], [74.20308, 37.34208], [74.23339, 37.41116], [74.41055, 37.3948], [74.56161, 37.37734], [74.68383, 37.3948], [74.8294, 37.3435], [74.88887, 37.23275], [75.12328, 37.31839], [75.09719, 37.37297], [75.15899, 37.41443], [75.06011, 37.52779], [74.94338, 37.55501], [74.8912, 37.67576], [75.00935, 37.77486], [74.92416, 37.83428], [74.9063, 38.03033], [74.82665, 38.07359], [74.80331, 38.19889], [74.69894, 38.22155], [74.69619, 38.42947], [74.51217, 38.47034], [74.17022, 38.65504], [73.97933, 38.52945], [73.79806, 38.61106], [73.80656, 38.66449], [73.7033, 38.84782], [73.7445, 38.93867], [73.82964, 38.91517], [73.81728, 39.04007], [73.75823, 39.023], [73.60638, 39.24534], [73.54572, 39.27567], [73.55396, 39.3543], [73.5004, 39.38402], [73.59241, 39.40843], [73.59831, 39.46425], [73.45096, 39.46677], [73.31912, 39.38615], [73.18454, 39.35536], [72.85934, 39.35116], [72.62027, 39.39696], [72.33173, 39.33093], [72.23834, 39.17248], [72.17242, 39.2661], [72.09689, 39.26823], [72.04059, 39.36704], [71.90601, 39.27674], [71.79202, 39.27355], [71.7522, 39.32031], [71.80164, 39.40631], [71.76816, 39.45456], [71.62688, 39.44056], [71.5517, 39.45722], [71.55856, 39.57588], [71.49814, 39.61397], [71.08752, 39.50704], [71.06418, 39.41586], [70.7854, 39.38933], [70.64087, 39.58792], [70.44757, 39.60128], [70.2869, 39.53141], [70.11111, 39.58223], [69.87491, 39.53882], [69.68677, 39.59281], [69.3594, 39.52516], [69.26938, 39.8127], [69.35649, 40.01994], [69.43134, 39.98431], [69.43557, 39.92877], [69.53615, 39.93991], [69.5057, 40.03277], [69.53855, 40.0887], [69.53794, 40.11833], [69.55555, 40.12296], [69.57615, 40.10524], [69.64704, 40.12165], [69.67001, 40.10639], [70.01283, 40.23288], [70.58297, 40.00891], [70.57384, 39.99394], [70.47557, 39.93216], [70.55033, 39.96619], [70.58912, 39.95211], [70.65946, 39.9878], [70.65827, 40.0981], [70.7928, 40.12797], [70.80495, 40.16813], [70.9818, 40.22392], [70.8607, 40.217], [70.62342, 40.17396], [70.56394, 40.26421], [70.57149, 40.3442], [70.37511, 40.38605], [70.32626, 40.45174], [70.49871, 40.52503], [70.80009, 40.72825], [70.45251, 41.04438]]], [[[70.68112, 40.90612], [70.6158, 40.97661], [70.56077, 41.00642], [70.54223, 40.98787], [70.57501, 40.98941], [70.6721, 40.90555], [70.68112, 40.90612]]], [[[70.74189, 39.86319], [70.53651, 39.89155], [70.52631, 39.86989], [70.54998, 39.85137], [70.59667, 39.83542], [70.63105, 39.77923], [70.74189, 39.86319]]]] } },
34308 { type: "Feature", properties: { iso1A2: "TK", iso1A3: "TKL", iso1N3: "772", wikidata: "Q36823", nameEn: "Tokelau", country: "NZ", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["690"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-168.251, -9.44289], [-174.18635, -7.80441], [-174.17993, -10.13616], [-168.251, -9.44289]]]] } },
34309 { type: "Feature", properties: { iso1A2: "TL", iso1A3: "TLS", iso1N3: "626", wikidata: "Q574", nameEn: "East Timor", aliases: ["Timor-Leste", "TP"], groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["670"] }, geometry: { type: "MultiPolygon", coordinates: [[[[124.46701, -9.13002], [124.94011, -8.85617], [124.97742, -9.08128], [125.11764, -8.96359], [125.18632, -9.03142], [125.18907, -9.16434], [125.09434, -9.19669], [125.04044, -9.17093], [124.97892, -9.19281], [125.09025, -9.46406], [125.68138, -9.85176], [127.55165, -9.05052], [127.42116, -8.22471], [125.87691, -8.31789], [125.58506, -7.95311], [124.92337, -8.75859], [124.33472, -9.11416], [124.04628, -9.22671], [124.04286, -9.34243], [124.10539, -9.41206], [124.14517, -9.42324], [124.21247, -9.36904], [124.28115, -9.42189], [124.28115, -9.50453], [124.3535, -9.48493], [124.35258, -9.43002], [124.38554, -9.3582], [124.45971, -9.30263], [124.46701, -9.13002]]]] } },
34310 { type: "Feature", properties: { iso1A2: "TM", iso1A3: "TKM", iso1N3: "795", wikidata: "Q874", nameEn: "Turkmenistan", groups: ["143", "142", "UN"], callingCodes: ["993"] }, geometry: { type: "MultiPolygon", coordinates: [[[[60.5078, 41.21694], [60.06581, 41.4363], [60.18117, 41.60082], [60.06032, 41.76287], [60.08504, 41.80997], [60.33223, 41.75058], [59.95046, 41.97966], [60.0356, 42.01028], [60.04659, 42.08982], [59.96419, 42.1428], [60.00539, 42.212], [59.94633, 42.27655], [59.4341, 42.29738], [59.2955, 42.37064], [59.17317, 42.52248], [58.93422, 42.5407], [58.6266, 42.79314], [58.57991, 42.64988], [58.27504, 42.69632], [58.14321, 42.62159], [58.29427, 42.56497], [58.51674, 42.30348], [58.40688, 42.29535], [58.3492, 42.43335], [57.99214, 42.50021], [57.90975, 42.4374], [57.92897, 42.24047], [57.84932, 42.18555], [57.6296, 42.16519], [57.30275, 42.14076], [57.03633, 41.92043], [56.96218, 41.80383], [57.03359, 41.41777], [57.13796, 41.36625], [57.03423, 41.25435], [56.00314, 41.32584], [55.45471, 41.25609], [54.95182, 41.92424], [54.20635, 42.38477], [52.97575, 42.1308], [52.47884, 41.78034], [52.26048, 41.69249], [51.7708, 40.29239], [53.89734, 37.3464], [54.24565, 37.32047], [54.36211, 37.34912], [54.58664, 37.45809], [54.67247, 37.43532], [54.77822, 37.51597], [54.81804, 37.61285], [54.77684, 37.62264], [54.851, 37.75739], [55.13412, 37.94705], [55.44152, 38.08564], [55.76561, 38.12238], [55.97847, 38.08024], [56.33278, 38.08132], [56.32454, 38.18502], [56.43303, 38.26054], [56.62255, 38.24005], [56.73928, 38.27887], [57.03453, 38.18717], [57.21169, 38.28965], [57.37236, 38.09321], [57.35042, 37.98546], [57.79534, 37.89299], [58.21399, 37.77281], [58.22999, 37.6856], [58.39959, 37.63134], [58.47786, 37.6433], [58.5479, 37.70526], [58.6921, 37.64548], [58.9338, 37.67374], [59.22905, 37.51161], [59.33507, 37.53146], [59.39797, 37.47892], [59.39385, 37.34257], [59.55178, 37.13594], [59.74678, 37.12499], [60.00768, 37.04102], [60.34767, 36.63214], [61.14516, 36.64644], [61.18187, 36.55348], [61.1393, 36.38782], [61.22719, 36.12759], [61.12007, 35.95992], [61.22444, 35.92879], [61.26152, 35.80749], [61.22719, 35.67038], [61.27371, 35.61482], [61.58742, 35.43803], [61.77693, 35.41341], [61.97743, 35.4604], [62.05709, 35.43803], [62.15871, 35.33278], [62.29191, 35.25964], [62.29878, 35.13312], [62.48006, 35.28796], [62.62288, 35.22067], [62.74098, 35.25432], [62.90853, 35.37086], [63.0898, 35.43131], [63.12276, 35.53196], [63.10079, 35.63024], [63.23262, 35.67487], [63.10318, 35.81782], [63.12276, 35.86208], [63.29579, 35.85985], [63.53475, 35.90881], [63.56496, 35.95106], [63.98519, 36.03773], [64.05385, 36.10433], [64.43288, 36.24401], [64.57295, 36.34362], [64.62514, 36.44311], [64.61141, 36.6351], [64.97945, 37.21913], [65.51778, 37.23881], [65.64263, 37.34388], [65.64137, 37.45061], [65.72274, 37.55438], [66.30993, 37.32409], [66.55743, 37.35409], [66.52303, 37.39827], [66.65761, 37.45497], [66.52852, 37.58568], [66.53676, 37.80084], [66.67684, 37.96776], [66.56697, 38.0435], [66.41042, 38.02403], [66.24013, 38.16238], [65.83913, 38.25733], [65.55873, 38.29052], [64.32576, 38.98691], [64.19086, 38.95561], [63.70778, 39.22349], [63.6913, 39.27666], [62.43337, 39.98528], [62.34273, 40.43206], [62.11751, 40.58242], [61.87856, 41.12257], [61.4446, 41.29407], [61.39732, 41.19873], [61.33199, 41.14946], [61.22212, 41.14946], [61.03261, 41.25691], [60.5078, 41.21694]]]] } },
34311 { type: "Feature", properties: { iso1A2: "TN", iso1A3: "TUN", iso1N3: "788", wikidata: "Q948", nameEn: "Tunisia", groups: ["015", "002", "UN"], callingCodes: ["216"] }, geometry: { type: "MultiPolygon", coordinates: [[[[11.2718, 37.6713], [7.89009, 38.19924], [8.59123, 37.14286], [8.64044, 36.9401], [8.62972, 36.86499], [8.67706, 36.8364], [8.57613, 36.78062], [8.46537, 36.7706], [8.47609, 36.66607], [8.16167, 36.48817], [8.18936, 36.44939], [8.40731, 36.42208], [8.2626, 35.91733], [8.26472, 35.73669], [8.35371, 35.66373], [8.36086, 35.47774], [8.30329, 35.29884], [8.47318, 35.23376], [8.3555, 35.10007], [8.30727, 34.95378], [8.25189, 34.92009], [8.29655, 34.72798], [8.20482, 34.57575], [7.86264, 34.3987], [7.81242, 34.21841], [7.74207, 34.16492], [7.66174, 34.20167], [7.52851, 34.06493], [7.54088, 33.7726], [7.73687, 33.42114], [7.83028, 33.18851], [8.11433, 33.10175], [8.1179, 33.05086], [8.31895, 32.83483], [8.35999, 32.50101], [9.07483, 32.07865], [9.55544, 30.23971], [9.76848, 30.34366], [9.88152, 30.34074], [10.29516, 30.90337], [10.12239, 31.42098], [10.31364, 31.72648], [10.48497, 31.72956], [10.62788, 31.96629], [10.7315, 31.97235], [11.04234, 32.2145], [11.53898, 32.4138], [11.57828, 32.48013], [11.46037, 32.6307], [11.51549, 33.09826], [11.55852, 33.1409], [11.58941, 33.36891], [11.2718, 37.6713]]]] } },
34312 { type: "Feature", properties: { iso1A2: "TO", iso1A3: "TON", iso1N3: "776", wikidata: "Q678", nameEn: "Tonga", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["676"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-176.74538, -22.89767], [-180, -22.90585], [-180, -24.21376], [-173.10761, -24.19665], [-173.13438, -14.94228], [-176.76826, -14.95183], [-176.74538, -22.89767]]]] } },
34313 { type: "Feature", properties: { iso1A2: "TR", iso1A3: "TUR", iso1N3: "792", wikidata: "Q43", nameEn: "Turkey", groups: ["145", "142", "UN"], callingCodes: ["90"] }, geometry: { type: "MultiPolygon", coordinates: [[[[41.54366, 41.52185], [40.89217, 41.72528], [34.8305, 42.4581], [28.32297, 41.98371], [28.02971, 41.98066], [27.91479, 41.97902], [27.83492, 41.99709], [27.81235, 41.94803], [27.69949, 41.97515], [27.55191, 41.90928], [27.52379, 41.93756], [27.45478, 41.96591], [27.27411, 42.10409], [27.22376, 42.10152], [27.19251, 42.06028], [27.08486, 42.08735], [27.03277, 42.0809], [26.95638, 42.00741], [26.79143, 41.97386], [26.62996, 41.97644], [26.56051, 41.92995], [26.57961, 41.90024], [26.53968, 41.82653], [26.36952, 41.82265], [26.33589, 41.76802], [26.32952, 41.73637], [26.35957, 41.71149], [26.47958, 41.67037], [26.5209, 41.62592], [26.59196, 41.60491], [26.59742, 41.48058], [26.61767, 41.42281], [26.62997, 41.34613], [26.5837, 41.32131], [26.5209, 41.33993], [26.39861, 41.25053], [26.32259, 41.24929], [26.31928, 41.07386], [26.3606, 41.02027], [26.33297, 40.98388], [26.35894, 40.94292], [26.32259, 40.94042], [26.28623, 40.93005], [26.29441, 40.89119], [26.26169, 40.9168], [26.20856, 40.86048], [26.21351, 40.83298], [26.15685, 40.80709], [26.12854, 40.77339], [26.12495, 40.74283], [26.08638, 40.73214], [26.0754, 40.72772], [26.03489, 40.73051], [25.94795, 40.72797], [26.04292, 40.3958], [25.61285, 40.17161], [25.94257, 39.39358], [26.43357, 39.43096], [26.70773, 39.0312], [26.61814, 38.81372], [26.21136, 38.65436], [26.32173, 38.48731], [26.24183, 38.44695], [26.21136, 38.17558], [27.05537, 37.9131], [27.16428, 37.72343], [26.99377, 37.69034], [26.95583, 37.64989], [27.14757, 37.32], [27.20312, 36.94571], [27.45627, 36.9008], [27.24613, 36.71622], [27.46117, 36.53789], [27.89482, 36.69898], [27.95037, 36.46155], [28.23708, 36.56812], [29.30783, 36.01033], [29.48192, 36.18377], [29.61002, 36.1731], [29.61805, 36.14179], [29.69611, 36.10365], [29.73302, 35.92555], [32.82353, 35.70297], [35.51152, 36.10954], [35.931, 35.92109], [35.98499, 35.94107], [36.00514, 35.94113], [36.01844, 35.92403], [35.99829, 35.88242], [36.11827, 35.85923], [36.13919, 35.83692], [36.14029, 35.81015], [36.1623, 35.80925], [36.17441, 35.92076], [36.19973, 35.95195], [36.25366, 35.96264], [36.27678, 35.94839], [36.29769, 35.96086], [36.28338, 36.00273], [36.30099, 36.00985], [36.33956, 35.98687], [36.37474, 36.01163], [36.39206, 36.22088], [36.4617, 36.20461], [36.50463, 36.2419], [36.6125, 36.22592], [36.68672, 36.23677], [36.65653, 36.33861], [36.6081, 36.33772], [36.54206, 36.49539], [36.58829, 36.58295], [36.57398, 36.65186], [36.62681, 36.71189], [36.61581, 36.74629], [36.66727, 36.82901], [36.99557, 36.75997], [36.99886, 36.74012], [37.04399, 36.73483], [37.04619, 36.71101], [37.01647, 36.69512], [37.02088, 36.66422], [37.08279, 36.63495], [37.10894, 36.6704], [37.16177, 36.66069], [37.21988, 36.6736], [37.47253, 36.63243], [37.49103, 36.66904], [37.68048, 36.75065], [37.81974, 36.76055], [38.21064, 36.91842], [38.38859, 36.90064], [38.55908, 36.84429], [38.74042, 36.70629], [39.03217, 36.70911], [39.21538, 36.66834], [39.81589, 36.75538], [40.69136, 37.0996], [40.90856, 37.13147], [41.21937, 37.07665], [41.515, 37.08084], [42.00894, 37.17209], [42.18225, 37.28569], [42.19301, 37.31323], [42.2112, 37.32491], [42.22257, 37.31395], [42.22381, 37.30238], [42.20454, 37.28715], [42.21548, 37.28026], [42.23683, 37.2863], [42.26039, 37.27017], [42.2824, 37.2798], [42.34735, 37.22548], [42.32313, 37.17814], [42.35724, 37.10998], [42.56725, 37.14878], [42.78887, 37.38615], [42.93705, 37.32015], [43.11403, 37.37436], [43.30083, 37.30629], [43.33508, 37.33105], [43.50787, 37.24436], [43.56702, 37.25675], [43.63085, 37.21957], [43.7009, 37.23692], [43.8052, 37.22825], [43.82699, 37.19477], [43.84878, 37.22205], [43.90949, 37.22453], [44.02002, 37.33229], [44.13521, 37.32486], [44.2613, 37.25055], [44.27998, 37.16501], [44.22239, 37.15756], [44.18503, 37.09551], [44.25975, 36.98119], [44.30645, 36.97373], [44.35937, 37.02843], [44.35315, 37.04955], [44.38117, 37.05825], [44.42631, 37.05825], [44.63179, 37.19229], [44.76698, 37.16162], [44.78319, 37.1431], [44.7868, 37.16644], [44.75986, 37.21549], [44.81021, 37.2915], [44.58449, 37.45018], [44.61401, 37.60165], [44.56887, 37.6429], [44.62096, 37.71985], [44.55498, 37.783], [44.45948, 37.77065], [44.3883, 37.85433], [44.22509, 37.88859], [44.42476, 38.25763], [44.50115, 38.33939], [44.44386, 38.38295], [44.38309, 38.36117], [44.3119, 38.37887], [44.3207, 38.49799], [44.32058, 38.62752], [44.28065, 38.6465], [44.26155, 38.71427], [44.30322, 38.81581], [44.18863, 38.93881], [44.20946, 39.13975], [44.1043, 39.19842], [44.03667, 39.39223], [44.22452, 39.4169], [44.29818, 39.378], [44.37921, 39.4131], [44.42832, 39.4131], [44.41849, 39.56659], [44.48111, 39.61579], [44.47298, 39.68788], [44.6137, 39.78393], [44.65422, 39.72163], [44.71806, 39.71124], [44.81043, 39.62677], [44.80977, 39.65768], [44.75779, 39.7148], [44.61845, 39.8281], [44.46635, 39.97733], [44.26973, 40.04866], [44.1778, 40.02845], [44.1057, 40.03555], [43.92307, 40.01787], [43.65688, 40.11199], [43.65221, 40.14889], [43.71136, 40.16673], [43.59928, 40.34019], [43.60862, 40.43267], [43.54791, 40.47413], [43.63664, 40.54159], [43.7425, 40.66805], [43.74872, 40.7365], [43.67712, 40.84846], [43.67712, 40.93084], [43.58683, 40.98961], [43.47319, 41.02251], [43.44984, 41.0988], [43.4717, 41.12611], [43.44973, 41.17666], [43.36118, 41.2028], [43.23096, 41.17536], [43.1945, 41.25242], [43.13373, 41.25503], [43.21707, 41.30331], [43.02956, 41.37891], [42.8785, 41.50516], [42.84899, 41.47265], [42.78995, 41.50126], [42.84471, 41.58912], [42.72794, 41.59714], [42.59202, 41.58183], [42.51772, 41.43606], [42.26387, 41.49346], [41.95134, 41.52466], [41.81939, 41.43621], [41.7124, 41.47417], [41.7148, 41.4932], [41.54366, 41.52185]]]] } },
34314 { type: "Feature", properties: { iso1A2: "TT", iso1A3: "TTO", iso1N3: "780", wikidata: "Q754", nameEn: "Trinidad and Tobago", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", callingCodes: ["1 868"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-61.62505, 11.18974], [-62.08693, 10.04435], [-60.89962, 9.81445], [-60.07172, 11.77667], [-61.62505, 11.18974]]]] } },
34315 { type: "Feature", properties: { iso1A2: "TV", iso1A3: "TUV", iso1N3: "798", wikidata: "Q672", nameEn: "Tuvalu", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["688"] }, geometry: { type: "MultiPolygon", coordinates: [[[[174, -5], [174, -11.5], [179.99999, -11.5], [179.99999, -5], [174, -5]]]] } },
34316 { type: "Feature", properties: { iso1A2: "TW", iso1A3: "TWN", iso1N3: "158", wikidata: "Q865", nameEn: "Taiwan", aliases: ["RC"], groups: ["030", "142"], callingCodes: ["886"] }, geometry: { type: "MultiPolygon", coordinates: [[[[121.8109, 21.77688], [122.26612, 25.98197], [120.5128, 26.536], [120.0693, 26.3959], [119.78816, 26.2348], [119.98511, 25.37624], [119.42295, 25.0886], [118.6333, 24.46259], [118.42453, 24.54644], [118.35291, 24.51645], [118.28244, 24.51231], [118.11703, 24.39734], [120.69238, 21.52331], [121.8109, 21.77688]]]] } },
34317 { type: "Feature", properties: { iso1A2: "TZ", iso1A3: "TZA", iso1N3: "834", wikidata: "Q924", nameEn: "Tanzania", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["255"] }, geometry: { type: "MultiPolygon", coordinates: [[[[30.80408, -0.99911], [30.76635, -0.9852], [30.70631, -1.01175], [30.64166, -1.06601], [30.47194, -1.0555], [30.45116, -1.10641], [30.50889, -1.16412], [30.57123, -1.33264], [30.71974, -1.43244], [30.84079, -1.64652], [30.80802, -1.91477], [30.89303, -2.08223], [30.83915, -2.35795], [30.54501, -2.41404], [30.41789, -2.66266], [30.52747, -2.65841], [30.40662, -2.86151], [30.4987, -2.9573], [30.57926, -2.89791], [30.6675, -2.98987], [30.83823, -2.97837], [30.84165, -3.25152], [30.45915, -3.56532], [30.22042, -4.01738], [30.03323, -4.26631], [29.88172, -4.35743], [29.82885, -4.36153], [29.77289, -4.41733], [29.75109, -4.45836], [29.63827, -4.44681], [29.43673, -4.44845], [29.52552, -6.2731], [30.2567, -7.14121], [30.79243, -8.27382], [31.00796, -8.58615], [31.37533, -8.60769], [31.57147, -8.70619], [31.57147, -8.81388], [31.71158, -8.91386], [31.81587, -8.88618], [31.94663, -8.93846], [31.94196, -9.02303], [31.98866, -9.07069], [32.08206, -9.04609], [32.16146, -9.05993], [32.25486, -9.13371], [32.43543, -9.11988], [32.49147, -9.14754], [32.53661, -9.24281], [32.75611, -9.28583], [32.76233, -9.31963], [32.95389, -9.40138], [32.99397, -9.36712], [33.14925, -9.49322], [33.31581, -9.48554], [33.48052, -9.62442], [33.76677, -9.58516], [33.93298, -9.71647], [33.9638, -9.62206], [33.95829, -9.54066], [34.03865, -9.49398], [34.54499, -10.0678], [34.51911, -10.12279], [34.57581, -10.56271], [34.65946, -10.6828], [34.67047, -10.93796], [34.61161, -11.01611], [34.63305, -11.11731], [34.79375, -11.32245], [34.91153, -11.39799], [34.96296, -11.57354], [35.63599, -11.55927], [35.82767, -11.41081], [36.19094, -11.57593], [36.19094, -11.70008], [36.62068, -11.72884], [36.80309, -11.56836], [37.3936, -11.68949], [37.76614, -11.53352], [37.8388, -11.3123], [37.93618, -11.26228], [38.21598, -11.27289], [38.47258, -11.4199], [38.88996, -11.16978], [39.24395, -11.17433], [39.58249, -10.96043], [40.00295, -10.80255], [40.44265, -10.4618], [40.74206, -10.25691], [40.14328, -4.64201], [39.62121, -4.68136], [39.44306, -4.93877], [39.21631, -4.67835], [37.81321, -3.69179], [37.75036, -3.54243], [37.63099, -3.50723], [37.5903, -3.42735], [37.71745, -3.304], [37.67199, -3.06222], [34.0824, -1.02264], [34.03084, -1.05101], [34.02286, -1.00779], [33.93107, -0.99298], [30.80408, -0.99911]]]] } },
34318 { type: "Feature", properties: { iso1A2: "UA", iso1A3: "UKR", iso1N3: "804", wikidata: "Q212", nameEn: "Ukraine", groups: ["151", "150", "UN"], callingCodes: ["380"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.57318, 46.10317], [33.6147, 46.1356], [33.63854, 46.14147], [33.6152, 46.2261], [33.646, 46.23028], [33.7405, 46.1855], [33.7972, 46.2048], [33.8523, 46.1986], [33.91549, 46.15938], [34.05272, 46.10838], [34.07311, 46.11769], [34.1293, 46.1049], [34.181, 46.068], [34.2511, 46.0532], [34.3391, 46.0611], [34.41221, 46.00245], [34.4415, 45.9599], [34.48729, 45.94267], [34.52011, 45.95097], [34.55889, 45.99347], [34.60861, 45.99347], [34.66679, 45.97136], [34.75479, 45.90705], [34.8015, 45.9005], [34.79905, 45.81009], [34.9601, 45.7563], [35.04991, 45.76827], [35.23066, 45.79231], [37.62608, 46.82615], [38.12112, 46.86078], [38.3384, 46.98085], [38.22955, 47.12069], [38.23049, 47.2324], [38.32112, 47.2585], [38.33074, 47.30508], [38.22225, 47.30788], [38.28954, 47.39255], [38.28679, 47.53552], [38.35062, 47.61631], [38.76379, 47.69346], [38.79628, 47.81109], [38.87979, 47.87719], [39.73935, 47.82876], [39.82213, 47.96396], [39.77544, 48.04206], [39.88256, 48.04482], [39.83724, 48.06501], [39.94847, 48.22811], [40.00752, 48.22445], [39.99241, 48.31768], [39.97325, 48.31399], [39.9693, 48.29904], [39.95248, 48.29972], [39.91465, 48.26743], [39.90041, 48.3049], [39.84273, 48.30947], [39.84136, 48.33321], [39.94847, 48.35055], [39.88794, 48.44226], [39.86196, 48.46633], [39.84548, 48.57821], [39.79764, 48.58668], [39.67226, 48.59368], [39.71765, 48.68673], [39.73104, 48.7325], [39.79466, 48.83739], [39.97182, 48.79398], [40.08168, 48.87443], [40.03636, 48.91957], [39.98967, 48.86901], [39.78368, 48.91596], [39.74874, 48.98675], [39.72649, 48.9754], [39.71353, 48.98959], [39.6683, 48.99454], [39.6836, 49.05121], [39.93437, 49.05709], [40.01988, 49.1761], [40.22176, 49.25683], [40.18331, 49.34996], [40.14912, 49.37681], [40.1141, 49.38798], [40.03087, 49.45452], [40.03636, 49.52321], [40.16683, 49.56865], [40.13249, 49.61672], [39.84548, 49.56064], [39.65047, 49.61761], [39.59142, 49.73758], [39.44496, 49.76067], [39.27968, 49.75976], [39.1808, 49.88911], [38.9391, 49.79524], [38.90477, 49.86787], [38.73311, 49.90238], [38.68677, 50.00904], [38.65688, 49.97176], [38.35408, 50.00664], [38.32524, 50.08866], [38.18517, 50.08161], [38.21675, 49.98104], [38.02999, 49.90592], [38.02999, 49.94482], [37.90776, 50.04194], [37.79515, 50.08425], [37.75807, 50.07896], [37.61113, 50.21976], [37.62879, 50.24481], [37.62486, 50.29966], [37.47243, 50.36277], [37.48204, 50.46079], [37.08468, 50.34935], [36.91762, 50.34963], [36.69377, 50.26982], [36.64571, 50.218], [36.56655, 50.2413], [36.58371, 50.28563], [36.47817, 50.31457], [36.30101, 50.29088], [36.20763, 50.3943], [36.06893, 50.45205], [35.8926, 50.43829], [35.80388, 50.41356], [35.73659, 50.35489], [35.61711, 50.35707], [35.58003, 50.45117], [35.47463, 50.49247], [35.39464, 50.64751], [35.48116, 50.66405], [35.47704, 50.77274], [35.41367, 50.80227], [35.39307, 50.92145], [35.32598, 50.94524], [35.40837, 51.04119], [35.31774, 51.08434], [35.20375, 51.04723], [35.12685, 51.16191], [35.14058, 51.23162], [34.97304, 51.2342], [34.82472, 51.17483], [34.6874, 51.18], [34.6613, 51.25053], [34.38802, 51.2746], [34.31661, 51.23936], [34.23009, 51.26429], [34.33446, 51.363], [34.22048, 51.4187], [34.30562, 51.5205], [34.17599, 51.63253], [34.07765, 51.67065], [34.42922, 51.72852], [34.41136, 51.82793], [34.09413, 52.00835], [34.11199, 52.14087], [34.05239, 52.20132], [33.78789, 52.37204], [33.55718, 52.30324], [33.48027, 52.31499], [33.51323, 52.35779], [33.18913, 52.3754], [32.89937, 52.2461], [32.85405, 52.27888], [32.69475, 52.25535], [32.54781, 52.32423], [32.3528, 52.32842], [32.38988, 52.24946], [32.33083, 52.23685], [32.34044, 52.1434], [32.2777, 52.10266], [32.23331, 52.08085], [32.08813, 52.03319], [31.92159, 52.05144], [31.96141, 52.08015], [31.85018, 52.11305], [31.81722, 52.09955], [31.7822, 52.11406], [31.38326, 52.12991], [31.25142, 52.04131], [31.13332, 52.1004], [30.95589, 52.07775], [30.90897, 52.00699], [30.76443, 51.89739], [30.68804, 51.82806], [30.51946, 51.59649], [30.64992, 51.35014], [30.56203, 51.25655], [30.36153, 51.33984], [30.34642, 51.42555], [30.17888, 51.51025], [29.77376, 51.4461], [29.7408, 51.53417], [29.54372, 51.48372], [29.49773, 51.39814], [29.42357, 51.4187], [29.32881, 51.37843], [29.25191, 51.49828], [29.25603, 51.57089], [29.20659, 51.56918], [29.16402, 51.64679], [29.1187, 51.65872], [28.99098, 51.56833], [28.95528, 51.59222], [28.81795, 51.55552], [28.76027, 51.48802], [28.78224, 51.45294], [28.75615, 51.41442], [28.73143, 51.46236], [28.69161, 51.44695], [28.64429, 51.5664], [28.47051, 51.59734], [28.37592, 51.54505], [28.23452, 51.66988], [28.10658, 51.57857], [27.95827, 51.56065], [27.91844, 51.61952], [27.85253, 51.62293], [27.76052, 51.47604], [27.67125, 51.50854], [27.71932, 51.60672], [27.55727, 51.63486], [27.51058, 51.5854], [27.47212, 51.61184], [27.24828, 51.60161], [27.26613, 51.65957], [27.20948, 51.66713], [27.20602, 51.77291], [26.99422, 51.76933], [26.9489, 51.73788], [26.80043, 51.75777], [26.69759, 51.82284], [26.46962, 51.80501], [26.39367, 51.87315], [26.19084, 51.86781], [26.00408, 51.92967], [25.83217, 51.92587], [25.80574, 51.94556], [25.73673, 51.91973], [25.46163, 51.92205], [25.20228, 51.97143], [24.98784, 51.91273], [24.37123, 51.88222], [24.29021, 51.80841], [24.3163, 51.75063], [24.13075, 51.66979], [23.99907, 51.58369], [23.8741, 51.59734], [23.91118, 51.63316], [23.7766, 51.66809], [23.60906, 51.62122], [23.6736, 51.50255], [23.62751, 51.50512], [23.69905, 51.40871], [23.63858, 51.32182], [23.80678, 51.18405], [23.90376, 51.07697], [23.92217, 51.00836], [24.04576, 50.90196], [24.14524, 50.86128], [24.0952, 50.83262], [23.99254, 50.83847], [23.95925, 50.79271], [24.0595, 50.71625], [24.0996, 50.60752], [24.07048, 50.5071], [24.03668, 50.44507], [23.99563, 50.41289], [23.79445, 50.40481], [23.71382, 50.38248], [23.67635, 50.33385], [23.28221, 50.0957], [22.99329, 49.84249], [22.83179, 49.69875], [22.80261, 49.69098], [22.78304, 49.65543], [22.64534, 49.53094], [22.69444, 49.49378], [22.748, 49.32759], [22.72009, 49.20288], [22.86336, 49.10513], [22.89122, 49.00725], [22.56155, 49.08865], [22.54338, 49.01424], [22.48296, 48.99172], [22.42934, 48.92857], [22.34151, 48.68893], [22.21379, 48.6218], [22.16023, 48.56548], [22.14689, 48.4005], [22.2083, 48.42534], [22.38133, 48.23726], [22.49806, 48.25189], [22.59007, 48.15121], [22.58733, 48.10813], [22.66835, 48.09162], [22.73427, 48.12005], [22.81804, 48.11363], [22.87847, 48.04665], [22.84276, 47.98602], [22.89849, 47.95851], [22.94301, 47.96672], [22.92241, 48.02002], [23.0158, 47.99338], [23.08858, 48.00716], [23.1133, 48.08061], [23.15999, 48.12188], [23.27397, 48.08245], [23.33577, 48.0237], [23.4979, 47.96858], [23.52803, 48.01818], [23.5653, 48.00499], [23.63894, 48.00293], [23.66262, 47.98786], [23.75188, 47.99705], [23.80904, 47.98142], [23.8602, 47.9329], [23.89352, 47.94512], [23.94192, 47.94868], [23.96337, 47.96672], [23.98553, 47.96076], [24.00801, 47.968], [24.02999, 47.95087], [24.06466, 47.95317], [24.11281, 47.91487], [24.22566, 47.90231], [24.34926, 47.9244], [24.43578, 47.97131], [24.61994, 47.95062], [24.70632, 47.84428], [24.81893, 47.82031], [24.88896, 47.7234], [25.11144, 47.75203], [25.23778, 47.89403], [25.63878, 47.94924], [25.77723, 47.93919], [26.05901, 47.9897], [26.17711, 47.99246], [26.33504, 48.18418], [26.55202, 48.22445], [26.62823, 48.25804], [26.6839, 48.35828], [26.79239, 48.29071], [26.82809, 48.31629], [26.71274, 48.40388], [26.85556, 48.41095], [26.93384, 48.36558], [27.03821, 48.37653], [27.0231, 48.42485], [27.08078, 48.43214], [27.13434, 48.37288], [27.27855, 48.37534], [27.32159, 48.4434], [27.37604, 48.44398], [27.37741, 48.41026], [27.44333, 48.41209], [27.46942, 48.454], [27.5889, 48.49224], [27.59027, 48.46311], [27.6658, 48.44034], [27.74422, 48.45926], [27.79225, 48.44244], [27.81902, 48.41874], [27.87533, 48.4037], [27.88391, 48.36699], [27.95883, 48.32368], [28.04527, 48.32661], [28.09873, 48.3124], [28.07504, 48.23494], [28.17666, 48.25963], [28.19314, 48.20749], [28.2856, 48.23202], [28.32508, 48.23384], [28.35519, 48.24957], [28.36996, 48.20543], [28.34912, 48.1787], [28.30586, 48.1597], [28.30609, 48.14018], [28.34009, 48.13147], [28.38712, 48.17567], [28.43701, 48.15832], [28.42454, 48.12047], [28.48428, 48.0737], [28.53921, 48.17453], [28.69896, 48.13106], [28.85232, 48.12506], [28.8414, 48.03392], [28.9306, 47.96255], [29.1723, 47.99013], [29.19839, 47.89261], [29.27804, 47.88893], [29.20663, 47.80367], [29.27255, 47.79953], [29.22242, 47.73607], [29.22414, 47.60012], [29.11743, 47.55001], [29.18603, 47.43387], [29.3261, 47.44664], [29.39889, 47.30179], [29.47854, 47.30366], [29.48678, 47.36043], [29.5733, 47.36508], [29.59665, 47.25521], [29.54996, 47.24962], [29.57696, 47.13581], [29.49732, 47.12878], [29.53044, 47.07851], [29.61038, 47.09932], [29.62137, 47.05069], [29.57056, 46.94766], [29.72986, 46.92234], [29.75458, 46.8604], [29.87405, 46.88199], [29.98814, 46.82358], [29.94522, 46.80055], [29.9743, 46.75325], [29.94409, 46.56002], [29.88916, 46.54302], [30.02511, 46.45132], [30.16794, 46.40967], [30.09103, 46.38694], [29.94114, 46.40114], [29.88329, 46.35851], [29.74496, 46.45605], [29.66359, 46.4215], [29.6763, 46.36041], [29.5939, 46.35472], [29.49914, 46.45889], [29.35357, 46.49505], [29.24886, 46.37912], [29.23547, 46.55435], [29.02409, 46.49582], [29.01241, 46.46177], [28.9306, 46.45699], [29.004, 46.31495], [28.98478, 46.31803], [28.94953, 46.25852], [29.06656, 46.19716], [28.94643, 46.09176], [29.00613, 46.04962], [28.98004, 46.00385], [28.74383, 45.96664], [28.78503, 45.83475], [28.69852, 45.81753], [28.70401, 45.78019], [28.52823, 45.73803], [28.47879, 45.66994], [28.51587, 45.6613], [28.54196, 45.58062], [28.49252, 45.56716], [28.51449, 45.49982], [28.43072, 45.48538], [28.41836, 45.51715], [28.30201, 45.54744], [28.21139, 45.46895], [28.28504, 45.43907], [28.34554, 45.32102], [28.5735, 45.24759], [28.71358, 45.22631], [28.78911, 45.24179], [28.81383, 45.3384], [28.94292, 45.28045], [28.96077, 45.33164], [29.24779, 45.43388], [29.42632, 45.44545], [29.59798, 45.38857], [29.68175, 45.26885], [29.65428, 45.25629], [29.69272, 45.19227], [30.04414, 45.08461], [31.52705, 45.47997], [33.54017, 46.0123], [33.5909, 46.0601], [33.57318, 46.10317]]]] } },
34319 { type: "Feature", properties: { iso1A2: "UG", iso1A3: "UGA", iso1N3: "800", wikidata: "Q1036", nameEn: "Uganda", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["256"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.93107, -0.99298], [33.9264, -0.54188], [33.98449, -0.13079], [33.90936, 0.10581], [34.10067, 0.36372], [34.08727, 0.44713], [34.11408, 0.48884], [34.13493, 0.58118], [34.20196, 0.62289], [34.27345, 0.63182], [34.31516, 0.75693], [34.40041, 0.80266], [34.43349, 0.85254], [34.52369, 1.10692], [34.57427, 1.09868], [34.58029, 1.14712], [34.67562, 1.21265], [34.80223, 1.22754], [34.82606, 1.26626], [34.82606, 1.30944], [34.7918, 1.36752], [34.87819, 1.5596], [34.92734, 1.56109], [34.9899, 1.6668], [34.98692, 1.97348], [34.90947, 2.42447], [34.95267, 2.47209], [34.77244, 2.70272], [34.78137, 2.76223], [34.73967, 2.85447], [34.65774, 2.8753], [34.60114, 2.93034], [34.56242, 3.11478], [34.45815, 3.18319], [34.40006, 3.37949], [34.41794, 3.44342], [34.39112, 3.48802], [34.44922, 3.51627], [34.45815, 3.67385], [34.15429, 3.80464], [34.06046, 4.15235], [33.9873, 4.23316], [33.51264, 3.75068], [33.18356, 3.77812], [33.02852, 3.89296], [32.89746, 3.81339], [32.72021, 3.77327], [32.41337, 3.748], [32.20782, 3.6053], [32.19888, 3.50867], [32.08866, 3.53543], [32.08491, 3.56287], [32.05187, 3.589], [31.95907, 3.57408], [31.96205, 3.6499], [31.86821, 3.78664], [31.81459, 3.82083], [31.72075, 3.74354], [31.50776, 3.63652], [31.50478, 3.67814], [31.29476, 3.8015], [31.16666, 3.79853], [30.97601, 3.693], [30.85153, 3.48867], [30.94081, 3.50847], [30.93486, 3.40737], [30.84251, 3.26908], [30.77101, 3.04897], [30.8574, 2.9508], [30.8857, 2.83923], [30.75612, 2.5863], [30.74271, 2.43601], [30.83059, 2.42559], [30.91102, 2.33332], [30.96911, 2.41071], [31.06593, 2.35862], [31.07934, 2.30207], [31.12104, 2.27676], [31.1985, 2.29462], [31.20148, 2.2217], [31.28042, 2.17853], [31.30127, 2.11006], [30.48503, 1.21675], [30.24671, 1.14974], [30.22139, 0.99635], [30.1484, 0.89805], [29.98307, 0.84295], [29.95477, 0.64486], [29.97413, 0.52124], [29.87284, 0.39166], [29.81922, 0.16824], [29.77454, 0.16675], [29.7224, 0.07291], [29.72687, -0.08051], [29.65091, -0.46777], [29.67474, -0.47969], [29.67176, -0.55714], [29.62708, -0.71055], [29.63006, -0.8997], [29.58388, -0.89821], [29.59061, -1.39016], [29.82657, -1.31187], [29.912, -1.48269], [30.16369, -1.34303], [30.35212, -1.06896], [30.47194, -1.0555], [30.64166, -1.06601], [30.70631, -1.01175], [30.76635, -0.9852], [30.80408, -0.99911], [33.93107, -0.99298]]]] } },
34320 { type: "Feature", properties: { iso1A2: "UM", iso1A3: "UMI", iso1N3: "581", wikidata: "Q16645", nameEn: "United States Minor Outlying Islands", country: "US" }, geometry: null },
34321 { type: "Feature", properties: { iso1A2: "UN", wikidata: "Q1065", nameEn: "United Nations", level: "unitedNations", isoStatus: "excRes" }, geometry: null },
34322 { type: "Feature", properties: { iso1A2: "US", iso1A3: "USA", iso1N3: "840", wikidata: "Q30", nameEn: "United States of America" }, geometry: null },
34323 { type: "Feature", properties: { iso1A2: "UY", iso1A3: "URY", iso1N3: "858", wikidata: "Q77", nameEn: "Uruguay", groups: ["005", "419", "019", "UN"], callingCodes: ["598"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-57.65132, -30.19229], [-57.61478, -30.25165], [-57.64859, -30.35095], [-57.89115, -30.49572], [-57.8024, -30.77193], [-57.89476, -30.95994], [-57.86729, -31.06352], [-57.9908, -31.34924], [-57.98127, -31.3872], [-58.07569, -31.44916], [-58.0023, -31.53084], [-58.00076, -31.65016], [-58.20252, -31.86966], [-58.10036, -32.25338], [-58.22362, -32.52416], [-58.1224, -32.98842], [-58.40475, -33.11777], [-58.44442, -33.84033], [-58.34425, -34.15035], [-57.83001, -34.69099], [-54.78916, -36.21945], [-52.83257, -34.01481], [-53.37138, -33.74313], [-53.39593, -33.75169], [-53.44031, -33.69344], [-53.52794, -33.68908], [-53.53459, -33.16843], [-53.1111, -32.71147], [-53.37671, -32.57005], [-53.39572, -32.58596], [-53.76024, -32.0751], [-54.15721, -31.87458], [-54.45458, -31.65285], [-55.50823, -30.9145], [-55.50841, -30.9027], [-55.51862, -30.89828], [-55.52712, -30.89997], [-55.53276, -30.90218], [-55.53431, -30.89714], [-55.54572, -30.89051], [-55.55218, -30.88193], [-55.55373, -30.8732], [-55.5634, -30.8686], [-55.58866, -30.84117], [-55.87388, -31.05053], [-56.4619, -30.38457], [-56.4795, -30.3899], [-56.49267, -30.39471], [-56.90236, -30.02578], [-57.22502, -30.26121], [-57.65132, -30.19229]]]] } },
34324 { type: "Feature", properties: { iso1A2: "UZ", iso1A3: "UZB", iso1N3: "860", wikidata: "Q265", nameEn: "Uzbekistan", groups: ["143", "142", "UN"], callingCodes: ["998"] }, geometry: { type: "MultiPolygon", coordinates: [[[[65.85194, 42.85481], [65.53277, 43.31856], [65.18666, 43.48835], [64.96464, 43.74748], [64.53885, 43.56941], [63.34656, 43.64003], [62.01711, 43.51008], [61.01475, 44.41383], [58.59711, 45.58671], [55.97842, 44.99622], [55.97832, 44.99622], [55.97822, 44.99617], [55.97811, 44.99617], [55.97801, 44.99612], [55.97801, 44.99607], [55.97791, 44.99607], [55.9778, 44.99607], [55.9777, 44.99601], [55.9777, 44.99596], [55.9776, 44.99591], [55.97749, 44.99591], [55.97739, 44.99591], [55.97739, 44.99586], [55.97729, 44.99586], [55.97718, 44.99581], [55.97708, 44.99576], [55.97698, 44.9957], [55.97698, 44.99565], [55.97687, 44.9956], [55.97677, 44.9956], [55.97677, 44.99555], [55.97677, 44.9955], [55.97667, 44.99545], [55.97656, 44.99539], [55.97646, 44.99534], [55.97646, 44.99529], [55.97636, 44.99524], [55.97636, 44.99519], [55.97625, 44.99514], [55.97615, 44.99508], [55.97615, 44.99503], [55.97615, 44.99498], [55.97615, 44.99493], [55.97615, 44.99483], [55.97615, 44.99477], [55.97605, 44.99477], [55.97605, 44.99467], [55.97605, 44.99462], [55.97605, 44.99457], [55.97605, 44.99452], [55.97594, 44.99446], [55.97584, 44.99441], [55.97584, 44.99436], [55.97584, 44.99431], [55.97584, 44.99426], [55.97584, 44.99421], [55.97584, 44.99415], [55.97584, 44.99405], [55.97584, 44.994], [55.97584, 44.9939], [55.97584, 44.99384], [55.97584, 44.99374], [55.97584, 44.99369], [55.97584, 44.99359], [55.97584, 44.99353], [55.97584, 44.99348], [55.97584, 44.99343], [55.97584, 44.99338], [55.97584, 44.99328], [55.97584, 44.99322], [56.00314, 41.32584], [57.03423, 41.25435], [57.13796, 41.36625], [57.03359, 41.41777], [56.96218, 41.80383], [57.03633, 41.92043], [57.30275, 42.14076], [57.6296, 42.16519], [57.84932, 42.18555], [57.92897, 42.24047], [57.90975, 42.4374], [57.99214, 42.50021], [58.3492, 42.43335], [58.40688, 42.29535], [58.51674, 42.30348], [58.29427, 42.56497], [58.14321, 42.62159], [58.27504, 42.69632], [58.57991, 42.64988], [58.6266, 42.79314], [58.93422, 42.5407], [59.17317, 42.52248], [59.2955, 42.37064], [59.4341, 42.29738], [59.94633, 42.27655], [60.00539, 42.212], [59.96419, 42.1428], [60.04659, 42.08982], [60.0356, 42.01028], [59.95046, 41.97966], [60.33223, 41.75058], [60.08504, 41.80997], [60.06032, 41.76287], [60.18117, 41.60082], [60.06581, 41.4363], [60.5078, 41.21694], [61.03261, 41.25691], [61.22212, 41.14946], [61.33199, 41.14946], [61.39732, 41.19873], [61.4446, 41.29407], [61.87856, 41.12257], [62.11751, 40.58242], [62.34273, 40.43206], [62.43337, 39.98528], [63.6913, 39.27666], [63.70778, 39.22349], [64.19086, 38.95561], [64.32576, 38.98691], [65.55873, 38.29052], [65.83913, 38.25733], [66.24013, 38.16238], [66.41042, 38.02403], [66.56697, 38.0435], [66.67684, 37.96776], [66.53676, 37.80084], [66.52852, 37.58568], [66.65761, 37.45497], [66.52303, 37.39827], [66.55743, 37.35409], [66.64699, 37.32958], [66.95598, 37.40162], [67.08232, 37.35469], [67.13039, 37.27168], [67.2224, 37.24545], [67.2581, 37.17216], [67.51868, 37.26102], [67.78329, 37.1834], [67.8474, 37.31594], [67.81566, 37.43107], [68.12635, 37.93], [68.27159, 37.91477], [68.40343, 38.19484], [68.13289, 38.40822], [68.06274, 38.39435], [68.11366, 38.47169], [68.05873, 38.56087], [68.0807, 38.64136], [68.05598, 38.71641], [68.12877, 38.73677], [68.06948, 38.82115], [68.19743, 38.85985], [68.09704, 39.02589], [67.68915, 39.00775], [67.67833, 39.14479], [67.33226, 39.23739], [67.36522, 39.31287], [67.45998, 39.315], [67.46822, 39.46146], [67.39681, 39.52505], [67.46547, 39.53564], [67.44899, 39.57799], [67.62889, 39.60234], [67.70992, 39.66156], [68.12053, 39.56317], [68.54166, 39.53929], [68.61972, 39.68905], [68.63071, 39.85265], [68.88889, 39.87163], [68.93695, 39.91167], [68.84906, 40.04952], [68.96579, 40.06949], [69.01935, 40.11466], [69.01523, 40.15771], [68.62796, 40.07789], [68.52771, 40.11676], [68.5332, 40.14826], [68.77902, 40.20492], [68.79276, 40.17555], [68.84357, 40.18604], [68.85832, 40.20885], [69.04544, 40.22904], [69.15659, 40.2162], [69.2074, 40.21488], [69.30448, 40.18774], [69.30104, 40.24502], [69.25229, 40.26362], [69.24817, 40.30357], [69.30808, 40.2821], [69.32833, 40.29794], [69.33794, 40.34819], [69.30774, 40.36102], [69.28525, 40.41894], [69.27066, 40.49274], [69.21063, 40.54469], [69.2643, 40.57506], [69.3455, 40.57988], [69.32834, 40.70233], [69.38327, 40.7918], [69.53021, 40.77621], [69.59441, 40.70181], [69.69434, 40.62615], [70.36655, 40.90296], [70.38028, 41.02014], [70.45251, 41.04438], [70.80009, 40.72825], [70.49871, 40.52503], [70.32626, 40.45174], [70.37511, 40.38605], [70.57149, 40.3442], [70.56394, 40.26421], [70.62342, 40.17396], [70.8607, 40.217], [70.9818, 40.22392], [70.95789, 40.28761], [71.05901, 40.28765], [71.13042, 40.34106], [71.36663, 40.31593], [71.4246, 40.28619], [71.51215, 40.26943], [71.51549, 40.22986], [71.61725, 40.20615], [71.61931, 40.26775], [71.68386, 40.26984], [71.70569, 40.20391], [71.69621, 40.18492], [71.71719, 40.17886], [71.73054, 40.14818], [71.82646, 40.21872], [71.85002, 40.25647], [72.05464, 40.27586], [71.96401, 40.31907], [72.18648, 40.49893], [72.24368, 40.46091], [72.40346, 40.4007], [72.44191, 40.48222], [72.41513, 40.50856], [72.38384, 40.51535], [72.41714, 40.55736], [72.34406, 40.60144], [72.40517, 40.61917], [72.47795, 40.5532], [72.66713, 40.5219], [72.66713, 40.59076], [72.69579, 40.59778], [72.73995, 40.58409], [72.74768, 40.58051], [72.74862, 40.57131], [72.75982, 40.57273], [72.74894, 40.59592], [72.74866, 40.60873], [72.80137, 40.67856], [72.84754, 40.67229], [72.85372, 40.7116], [72.8722, 40.71111], [72.93296, 40.73089], [72.99133, 40.76457], [73.0612, 40.76678], [73.13412, 40.79122], [73.13267, 40.83512], [73.01869, 40.84681], [72.94454, 40.8094], [72.84291, 40.85512], [72.68157, 40.84942], [72.59136, 40.86947], [72.55109, 40.96046], [72.48742, 40.97136], [72.45206, 41.03018], [72.38511, 41.02785], [72.36138, 41.04384], [72.34757, 41.06104], [72.34026, 41.04539], [72.324, 41.03381], [72.18339, 40.99571], [72.17594, 41.02377], [72.21061, 41.05607], [72.1792, 41.10621], [72.14864, 41.13363], [72.17594, 41.15522], [72.16433, 41.16483], [72.10745, 41.15483], [72.07249, 41.11739], [71.85964, 41.19081], [71.91457, 41.2982], [71.83914, 41.3546], [71.76625, 41.4466], [71.71132, 41.43012], [71.73054, 41.54713], [71.65914, 41.49599], [71.6787, 41.42111], [71.57227, 41.29175], [71.46688, 41.31883], [71.43814, 41.19644], [71.46148, 41.13958], [71.40198, 41.09436], [71.34877, 41.16807], [71.27187, 41.11015], [71.25813, 41.18796], [71.11806, 41.15359], [71.02193, 41.19494], [70.9615, 41.16393], [70.86263, 41.23833], [70.77885, 41.24813], [70.78572, 41.36419], [70.67586, 41.47953], [70.48909, 41.40335], [70.17682, 41.5455], [70.69777, 41.92554], [71.28719, 42.18033], [71.13263, 42.28356], [70.94483, 42.26238], [69.49545, 41.545], [69.45751, 41.56863], [69.39485, 41.51518], [69.45081, 41.46246], [69.37468, 41.46555], [69.35554, 41.47211], [69.29778, 41.43673], [69.25059, 41.46693], [69.23332, 41.45847], [69.22671, 41.46298], [69.20439, 41.45391], [69.18528, 41.45175], [69.17701, 41.43769], [69.15137, 41.43078], [69.05006, 41.36183], [69.01308, 41.22804], [68.7217, 41.05025], [68.73945, 40.96989], [68.65662, 40.93861], [68.62221, 41.03019], [68.49983, 40.99669], [68.58444, 40.91447], [68.63, 40.59358], [68.49983, 40.56437], [67.96736, 40.83798], [68.1271, 41.0324], [68.08273, 41.08148], [67.98511, 41.02794], [67.9644, 41.14611], [66.69129, 41.1311], [66.53302, 41.87388], [66.00546, 41.94455], [66.09482, 42.93426], [65.85194, 42.85481]], [[70.68112, 40.90612], [70.6721, 40.90555], [70.57501, 40.98941], [70.54223, 40.98787], [70.56077, 41.00642], [70.6158, 40.97661], [70.68112, 40.90612]]], [[[71.21139, 40.03369], [71.12218, 40.03052], [71.06305, 40.1771], [71.00236, 40.18154], [71.01035, 40.05481], [71.11037, 40.01984], [71.11668, 39.99291], [71.09063, 39.99], [71.10501, 39.95568], [71.04979, 39.89808], [71.10531, 39.91354], [71.16101, 39.88423], [71.23067, 39.93581], [71.1427, 39.95026], [71.21139, 40.03369]]], [[[71.86463, 39.98598], [71.78838, 40.01404], [71.71511, 39.96348], [71.7504, 39.93701], [71.84316, 39.95582], [71.86463, 39.98598]]]] } },
34325 { type: "Feature", properties: { iso1A2: "VA", iso1A3: "VAT", iso1N3: "336", wikidata: "Q237", nameEn: "Vatican City", aliases: ["Holy See"], groups: ["039", "150"], callingCodes: ["379", "39 06"] }, geometry: { type: "MultiPolygon", coordinates: [[[[12.45181, 41.90056], [12.45446, 41.90028], [12.45435, 41.90143], [12.45626, 41.90172], [12.45691, 41.90125], [12.4577, 41.90115], [12.45834, 41.90174], [12.45826, 41.90281], [12.45755, 41.9033], [12.45762, 41.9058], [12.45561, 41.90629], [12.45543, 41.90738], [12.45091, 41.90625], [12.44984, 41.90545], [12.44815, 41.90326], [12.44582, 41.90194], [12.44834, 41.90095], [12.45181, 41.90056]]]] } },
34326 { type: "Feature", properties: { iso1A2: "VC", iso1A3: "VCT", iso1N3: "670", wikidata: "Q757", nameEn: "St. Vincent and the Grenadines", aliases: ["WV"], groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 784"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-62.64026, 12.69984], [-59.94058, 12.34011], [-61.69315, 14.26451], [-62.64026, 12.69984]]]] } },
34327 { type: "Feature", properties: { iso1A2: "VE", iso1A3: "VEN", iso1N3: "862", wikidata: "Q717", nameEn: "Venezuela", aliases: ["YV"], groups: ["005", "419", "019", "UN"], callingCodes: ["58"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-71.22331, 13.01387], [-70.92579, 11.96275], [-71.3275, 11.85], [-71.9675, 11.65536], [-72.24983, 11.14138], [-72.4767, 11.1117], [-72.88002, 10.44309], [-72.98085, 9.85253], [-73.36905, 9.16636], [-73.02119, 9.27584], [-72.94052, 9.10663], [-72.77415, 9.10165], [-72.65474, 8.61428], [-72.4042, 8.36513], [-72.36987, 8.19976], [-72.35163, 8.01163], [-72.39137, 8.03534], [-72.47213, 7.96106], [-72.48801, 7.94329], [-72.48183, 7.92909], [-72.47042, 7.92306], [-72.45806, 7.91141], [-72.46183, 7.90682], [-72.44454, 7.86031], [-72.46763, 7.79518], [-72.47827, 7.65604], [-72.45321, 7.57232], [-72.47415, 7.48928], [-72.43132, 7.40034], [-72.19437, 7.37034], [-72.04895, 7.03837], [-71.82441, 7.04314], [-71.44118, 7.02116], [-71.42212, 7.03854], [-71.37234, 7.01588], [-71.03941, 6.98163], [-70.7596, 7.09799], [-70.10716, 6.96516], [-69.41843, 6.1072], [-67.60654, 6.2891], [-67.4625, 6.20625], [-67.43513, 5.98835], [-67.58558, 5.84537], [-67.63914, 5.64963], [-67.59141, 5.5369], [-67.83341, 5.31104], [-67.85358, 4.53249], [-67.62671, 3.74303], [-67.50067, 3.75812], [-67.30945, 3.38393], [-67.85862, 2.86727], [-67.85862, 2.79173], [-67.65696, 2.81691], [-67.21967, 2.35778], [-66.85795, 1.22998], [-66.28507, 0.74585], [-65.6727, 1.01353], [-65.50158, 0.92086], [-65.57288, 0.62856], [-65.11657, 1.12046], [-64.38932, 1.5125], [-64.34654, 1.35569], [-64.08274, 1.64792], [-64.06135, 1.94722], [-63.39827, 2.16098], [-63.39114, 2.4317], [-64.0257, 2.48156], [-64.02908, 2.79797], [-64.48379, 3.7879], [-64.84028, 4.24665], [-64.72977, 4.28931], [-64.57648, 4.12576], [-64.14512, 4.12932], [-63.99183, 3.90172], [-63.86082, 3.94796], [-63.70218, 3.91417], [-63.67099, 4.01731], [-63.50611, 3.83592], [-63.42233, 3.89995], [-63.4464, 3.9693], [-63.21111, 3.96219], [-62.98296, 3.59935], [-62.7655, 3.73099], [-62.74411, 4.03331], [-62.57656, 4.04754], [-62.44822, 4.18621], [-62.13094, 4.08309], [-61.54629, 4.2822], [-61.48569, 4.43149], [-61.29675, 4.44216], [-61.31457, 4.54167], [-61.15703, 4.49839], [-60.98303, 4.54167], [-60.86539, 4.70512], [-60.5802, 4.94312], [-60.73204, 5.20931], [-61.4041, 5.95304], [-61.15058, 6.19558], [-61.20762, 6.58174], [-61.13632, 6.70922], [-60.54873, 6.8631], [-60.39419, 6.94847], [-60.28074, 7.1162], [-60.44116, 7.20817], [-60.54098, 7.14804], [-60.63367, 7.25061], [-60.59802, 7.33194], [-60.71923, 7.55817], [-60.64793, 7.56877], [-60.51959, 7.83373], [-60.38056, 7.8302], [-60.02407, 8.04557], [-59.97059, 8.20791], [-59.83156, 8.23261], [-59.80661, 8.28906], [-59.85562, 8.35213], [-59.98508, 8.53046], [-59.54058, 8.6862], [-60.89962, 9.81445], [-62.08693, 10.04435], [-61.62505, 11.18974], [-63.73917, 11.92623], [-63.19938, 16.44103], [-67.89186, 12.4116], [-68.01417, 11.77722], [-68.33524, 11.78151], [-68.99639, 11.79035], [-71.22331, 13.01387]]]] } },
34328 { type: "Feature", properties: { iso1A2: "VG", iso1A3: "VGB", iso1N3: "092", wikidata: "Q25305", nameEn: "British Virgin Islands", country: "GB", groups: ["BOTS", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 284"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-64.47127, 17.55688], [-63.88746, 19.15706], [-65.02435, 18.73231], [-64.86027, 18.39056], [-64.64673, 18.36549], [-64.47127, 17.55688]]]] } },
34329 { type: "Feature", properties: { iso1A2: "VI", iso1A3: "VIR", iso1N3: "850", wikidata: "Q11703", nameEn: "United States Virgin Islands", aliases: ["US-VI"], country: "US", groups: ["Q1352230", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 340"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-65.02435, 18.73231], [-65.27974, 17.56928], [-64.47127, 17.55688], [-64.64673, 18.36549], [-64.86027, 18.39056], [-65.02435, 18.73231]]]] } },
34330 { type: "Feature", properties: { iso1A2: "VN", iso1A3: "VNM", iso1N3: "704", wikidata: "Q881", nameEn: "Vietnam", groups: ["035", "142", "UN"], callingCodes: ["84"] }, geometry: { type: "MultiPolygon", coordinates: [[[[108.10003, 21.47338], [108.0569, 21.53604], [108.02926, 21.54997], [107.97932, 21.54503], [107.97383, 21.53961], [107.97074, 21.54072], [107.96774, 21.53601], [107.95232, 21.5388], [107.92652, 21.58906], [107.90006, 21.5905], [107.86114, 21.65128], [107.80355, 21.66141], [107.66967, 21.60787], [107.56537, 21.61945], [107.54047, 21.5934], [107.49065, 21.59774], [107.49532, 21.62958], [107.47197, 21.6672], [107.41593, 21.64839], [107.38636, 21.59774], [107.35989, 21.60063], [107.35834, 21.6672], [107.29296, 21.74674], [107.24625, 21.7077], [107.20734, 21.71493], [107.10771, 21.79879], [107.02615, 21.81981], [107.00964, 21.85948], [107.06101, 21.88982], [107.05634, 21.92303], [106.99252, 21.95191], [106.97228, 21.92592], [106.92714, 21.93459], [106.9178, 21.97357], [106.81038, 21.97934], [106.74345, 22.00965], [106.72551, 21.97923], [106.69276, 21.96013], [106.68274, 21.99811], [106.70142, 22.02409], [106.6983, 22.15102], [106.67495, 22.1885], [106.69986, 22.22309], [106.6516, 22.33977], [106.55976, 22.34841], [106.57221, 22.37], [106.55665, 22.46498], [106.58395, 22.474], [106.61269, 22.60301], [106.65316, 22.5757], [106.71698, 22.58432], [106.72321, 22.63606], [106.76293, 22.73491], [106.82404, 22.7881], [106.83685, 22.8098], [106.81271, 22.8226], [106.78422, 22.81532], [106.71128, 22.85982], [106.71387, 22.88296], [106.6734, 22.89587], [106.6516, 22.86862], [106.60179, 22.92884], [106.55976, 22.92311], [106.51306, 22.94891], [106.49749, 22.91164], [106.34961, 22.86718], [106.27022, 22.87722], [106.19705, 22.98475], [106.00179, 22.99049], [105.99568, 22.94178], [105.90119, 22.94168], [105.8726, 22.92756], [105.72382, 23.06641], [105.57594, 23.075], [105.56037, 23.16806], [105.49966, 23.20669], [105.42805, 23.30824], [105.40782, 23.28107], [105.32376, 23.39684], [105.22569, 23.27249], [105.17276, 23.28679], [105.11672, 23.25247], [105.07002, 23.26248], [104.98712, 23.19176], [104.96532, 23.20463], [104.9486, 23.17235], [104.91435, 23.18666], [104.87992, 23.17141], [104.87382, 23.12854], [104.79478, 23.12934], [104.8334, 23.01484], [104.86765, 22.95178], [104.84942, 22.93631], [104.77114, 22.90017], [104.72755, 22.81984], [104.65283, 22.83419], [104.60457, 22.81841], [104.58122, 22.85571], [104.47225, 22.75813], [104.35593, 22.69353], [104.25683, 22.76534], [104.27084, 22.8457], [104.11384, 22.80363], [104.03734, 22.72945], [104.01088, 22.51823], [103.99247, 22.51958], [103.97384, 22.50634], [103.96783, 22.51173], [103.96352, 22.50584], [103.95191, 22.5134], [103.94513, 22.52553], [103.93286, 22.52703], [103.87904, 22.56683], [103.64506, 22.79979], [103.56255, 22.69499], [103.57812, 22.65764], [103.52675, 22.59155], [103.43646, 22.70648], [103.43179, 22.75816], [103.32282, 22.8127], [103.28079, 22.68063], [103.18895, 22.64471], [103.15782, 22.59873], [103.17961, 22.55705], [103.07843, 22.50097], [103.0722, 22.44775], [102.9321, 22.48659], [102.8636, 22.60735], [102.60675, 22.73376], [102.57095, 22.7036], [102.51802, 22.77969], [102.46665, 22.77108], [102.42618, 22.69212], [102.38415, 22.67919], [102.41061, 22.64184], [102.25339, 22.4607], [102.26428, 22.41321], [102.16621, 22.43336], [102.14099, 22.40092], [102.18712, 22.30403], [102.51734, 22.02676], [102.49092, 21.99002], [102.62301, 21.91447], [102.67145, 21.65894], [102.74189, 21.66713], [102.82115, 21.73667], [102.81894, 21.83888], [102.85637, 21.84501], [102.86077, 21.71213], [102.97965, 21.74076], [102.98846, 21.58936], [102.86297, 21.4255], [102.94223, 21.46034], [102.88939, 21.3107], [102.80794, 21.25736], [102.89825, 21.24707], [102.97745, 21.05821], [103.03469, 21.05821], [103.12055, 20.89994], [103.21497, 20.89832], [103.38032, 20.79501], [103.45737, 20.82382], [103.68633, 20.66324], [103.73478, 20.6669], [103.82282, 20.8732], [103.98024, 20.91531], [104.11121, 20.96779], [104.27412, 20.91433], [104.63957, 20.6653], [104.38199, 20.47155], [104.40621, 20.3849], [104.47886, 20.37459], [104.66158, 20.47774], [104.72102, 20.40554], [104.62195, 20.36633], [104.61315, 20.24452], [104.86852, 20.14121], [104.91695, 20.15567], [104.9874, 20.09573], [104.8465, 19.91783], [104.8355, 19.80395], [104.68359, 19.72729], [104.64837, 19.62365], [104.53169, 19.61743], [104.41281, 19.70035], [104.23229, 19.70242], [104.06498, 19.66926], [104.05617, 19.61743], [104.10832, 19.51575], [104.06058, 19.43484], [103.87125, 19.31854], [104.5361, 18.97747], [104.64617, 18.85668], [105.12829, 18.70453], [105.19654, 18.64196], [105.1327, 18.58355], [105.10408, 18.43533], [105.15942, 18.38691], [105.38366, 18.15315], [105.46292, 18.22008], [105.64784, 17.96687], [105.60381, 17.89356], [105.76612, 17.67147], [105.85744, 17.63221], [106.09019, 17.36399], [106.18991, 17.28227], [106.24444, 17.24714], [106.29287, 17.3018], [106.31929, 17.20509], [106.43597, 17.01362], [106.50862, 16.9673], [106.55045, 17.0031], [106.54824, 16.92729], [106.51963, 16.92097], [106.52183, 16.87884], [106.55265, 16.86831], [106.55485, 16.68704], [106.59013, 16.62259], [106.58267, 16.6012], [106.61477, 16.60713], [106.66052, 16.56892], [106.65832, 16.47816], [106.74418, 16.41904], [106.84104, 16.55415], [106.88727, 16.52671], [106.88067, 16.43594], [106.96638, 16.34938], [106.97385, 16.30204], [107.02597, 16.31132], [107.09091, 16.3092], [107.15035, 16.26271], [107.14595, 16.17816], [107.25822, 16.13587], [107.33968, 16.05549], [107.44975, 16.08511], [107.46296, 16.01106], [107.39471, 15.88829], [107.34188, 15.89464], [107.21419, 15.83747], [107.21859, 15.74638], [107.27143, 15.71459], [107.27583, 15.62769], [107.34408, 15.62345], [107.3815, 15.49832], [107.50699, 15.48771], [107.53341, 15.40496], [107.62367, 15.42193], [107.60605, 15.37524], [107.62587, 15.2266], [107.58844, 15.20111], [107.61926, 15.13949], [107.61486, 15.0566], [107.46516, 15.00982], [107.48277, 14.93751], [107.59285, 14.87795], [107.51579, 14.79282], [107.54361, 14.69092], [107.55371, 14.628], [107.52102, 14.59034], [107.52569, 14.54665], [107.48521, 14.40346], [107.44941, 14.41552], [107.39493, 14.32655], [107.40427, 14.24509], [107.33577, 14.11832], [107.37158, 14.07906], [107.35757, 14.02319], [107.38247, 13.99147], [107.44318, 13.99751], [107.46498, 13.91593], [107.45252, 13.78897], [107.53503, 13.73908], [107.61909, 13.52577], [107.62843, 13.3668], [107.49144, 13.01215], [107.49611, 12.88926], [107.55993, 12.7982], [107.5755, 12.52177], [107.55059, 12.36824], [107.4463, 12.29373], [107.42917, 12.24657], [107.34511, 12.33327], [107.15831, 12.27547], [106.99953, 12.08983], [106.92325, 12.06548], [106.79405, 12.0807], [106.70687, 11.96956], [106.4111, 11.97413], [106.4687, 11.86751], [106.44068, 11.86294], [106.44535, 11.8279], [106.41577, 11.76999], [106.45158, 11.68616], [106.44691, 11.66787], [106.37219, 11.69836], [106.30525, 11.67549], [106.26478, 11.72122], [106.18539, 11.75171], [106.13158, 11.73283], [106.06708, 11.77761], [106.02038, 11.77457], [106.00792, 11.7197], [105.95188, 11.63738], [105.88962, 11.67854], [105.8507, 11.66635], [105.80867, 11.60536], [105.81645, 11.56876], [105.87328, 11.55953], [105.88962, 11.43605], [105.86782, 11.28343], [106.10444, 11.07879], [106.1527, 11.10476], [106.1757, 11.07301], [106.20095, 10.97795], [106.14301, 10.98176], [106.18539, 10.79451], [106.06708, 10.8098], [105.94535, 10.9168], [105.93403, 10.83853], [105.84603, 10.85873], [105.86376, 10.89839], [105.77751, 11.03671], [105.50045, 10.94586], [105.42884, 10.96878], [105.34011, 10.86179], [105.11449, 10.96332], [105.08326, 10.95656], [105.02722, 10.89236], [105.09571, 10.72722], [104.95094, 10.64003], [104.87933, 10.52833], [104.59018, 10.53073], [104.49869, 10.4057], [104.47963, 10.43046], [104.43778, 10.42386], [103.99198, 10.48391], [102.47649, 9.66162], [104.81582, 8.03101], [109.55486, 8.10026], [111.60491, 13.57105], [108.00365, 17.98159], [108.10003, 21.47338]]]] } },
34331 { type: "Feature", properties: { iso1A2: "VU", iso1A3: "VUT", iso1N3: "548", wikidata: "Q686", nameEn: "Vanuatu", groups: ["054", "009", "UN"], callingCodes: ["678"] }, geometry: { type: "MultiPolygon", coordinates: [[[[156.73836, -14.50464], [174.245, -23.1974], [172.71443, -12.01327], [156.73836, -14.50464]]]] } },
34332 { type: "Feature", properties: { iso1A2: "WF", iso1A3: "WLF", iso1N3: "876", wikidata: "Q35555", nameEn: "Wallis and Futuna", country: "FR", groups: ["EU", "Q1451600", "061", "009", "UN"], callingCodes: ["681"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-178.66551, -14.32452], [-176.76826, -14.95183], [-175.59809, -12.61507], [-178.66551, -14.32452]]]] } },
34333 { type: "Feature", properties: { iso1A2: "WS", iso1A3: "WSM", iso1N3: "882", wikidata: "Q683", nameEn: "Samoa", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["685"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-173.74402, -14.26669], [-170.99605, -15.1275], [-171.39864, -10.21587], [-173.74402, -14.26669]]]] } },
34334 { type: "Feature", properties: { iso1A2: "XK", iso1A3: "XKX", wikidata: "Q1246", nameEn: "Kosovo", aliases: ["KV"], groups: ["039", "150"], isoStatus: "usrAssn", callingCodes: ["383"] }, geometry: { type: "MultiPolygon", coordinates: [[[[21.39045, 42.74888], [21.44047, 42.87276], [21.36941, 42.87397], [21.32974, 42.90424], [21.2719, 42.8994], [21.23534, 42.95523], [21.23877, 43.00848], [21.2041, 43.02277], [21.16734, 42.99694], [21.14465, 43.11089], [21.08952, 43.13471], [21.05378, 43.10707], [21.00749, 43.13984], [20.96287, 43.12416], [20.83727, 43.17842], [20.88685, 43.21697], [20.82145, 43.26769], [20.73811, 43.25068], [20.68688, 43.21335], [20.59929, 43.20492], [20.69515, 43.09641], [20.64557, 43.00826], [20.59929, 43.01067], [20.48692, 42.93208], [20.53484, 42.8885], [20.43734, 42.83157], [20.40594, 42.84853], [20.35692, 42.8335], [20.27869, 42.81945], [20.2539, 42.76245], [20.04898, 42.77701], [20.02088, 42.74789], [20.02915, 42.71147], [20.0969, 42.65559], [20.07761, 42.55582], [20.17127, 42.50469], [20.21797, 42.41237], [20.24399, 42.32168], [20.34479, 42.32656], [20.3819, 42.3029], [20.48857, 42.25444], [20.56955, 42.12097], [20.55633, 42.08173], [20.59434, 42.03879], [20.63069, 41.94913], [20.57946, 41.91593], [20.59524, 41.8818], [20.68523, 41.85318], [20.76786, 41.91839], [20.75464, 42.05229], [21.11491, 42.20794], [21.16614, 42.19815], [21.22728, 42.08909], [21.31983, 42.10993], [21.29913, 42.13954], [21.30496, 42.1418], [21.38428, 42.24465], [21.43882, 42.23609], [21.43882, 42.2789], [21.50823, 42.27156], [21.52145, 42.24465], [21.58992, 42.25915], [21.56772, 42.30946], [21.5264, 42.33634], [21.53467, 42.36809], [21.57021, 42.3647], [21.59029, 42.38042], [21.62887, 42.37664], [21.64209, 42.41081], [21.62556, 42.45106], [21.7035, 42.51899], [21.70522, 42.54176], [21.7327, 42.55041], [21.75672, 42.62695], [21.79413, 42.65923], [21.75025, 42.70125], [21.6626, 42.67813], [21.58755, 42.70418], [21.59154, 42.72643], [21.47498, 42.74695], [21.39045, 42.74888]]]] } },
34335 { type: "Feature", properties: { iso1A2: "YE", iso1A3: "YEM", iso1N3: "887", wikidata: "Q805", nameEn: "Yemen", groups: ["145", "142", "UN"], callingCodes: ["967"] }, geometry: { type: "MultiPolygon", coordinates: [[[[57.49095, 8.14549], [52.81185, 17.28568], [52.74267, 17.29519], [52.78009, 17.35124], [52.00311, 19.00083], [49.04884, 18.59899], [48.19996, 18.20584], [47.58351, 17.50366], [47.48245, 17.10808], [47.00571, 16.94765], [46.76494, 17.29151], [46.31018, 17.20464], [44.50126, 17.47475], [43.70631, 17.35762], [43.43005, 17.56148], [43.29185, 17.53224], [43.22533, 17.38343], [43.32653, 17.31179], [43.20156, 17.25901], [43.17787, 17.14717], [43.23967, 17.03428], [43.18233, 17.02673], [43.1813, 16.98438], [43.19328, 16.94703], [43.1398, 16.90696], [43.18338, 16.84852], [43.22012, 16.83932], [43.22956, 16.80613], [43.24801, 16.80613], [43.26303, 16.79479], [43.25857, 16.75304], [43.21325, 16.74416], [43.22066, 16.65179], [43.15274, 16.67248], [43.11601, 16.53166], [42.97215, 16.51093], [42.94351, 16.49467], [42.94625, 16.39721], [42.76801, 16.40371], [42.15205, 16.40211], [40.99158, 15.81743], [43.29075, 12.79154], [43.32909, 12.59711], [43.90659, 12.3823], [51.12877, 12.56479], [57.49095, 8.14549]]]] } },
34336 { type: "Feature", properties: { iso1A2: "YT", iso1A3: "MYT", iso1N3: "175", wikidata: "Q17063", nameEn: "Mayotte", country: "FR", groups: ["Q3320166", "EU", "014", "202", "002", "UN"], callingCodes: ["262"] }, geometry: { type: "MultiPolygon", coordinates: [[[[43.28731, -13.97126], [45.54824, -13.22353], [45.4971, -11.75965], [43.28731, -13.97126]]]] } },
34337 { type: "Feature", properties: { iso1A2: "ZA", iso1A3: "ZAF", iso1N3: "710", wikidata: "Q258", nameEn: "South Africa", groups: ["018", "202", "002", "UN"], driveSide: "left", callingCodes: ["27"] }, geometry: { type: "MultiPolygon", coordinates: [[[[31.30611, -22.422], [31.16344, -22.32599], [31.08932, -22.34884], [30.86696, -22.28907], [30.6294, -22.32599], [30.48686, -22.31368], [30.38614, -22.34533], [30.28351, -22.35587], [30.2265, -22.2961], [30.13147, -22.30841], [29.92242, -22.19408], [29.76848, -22.14128], [29.64609, -22.12917], [29.37703, -22.19581], [29.21955, -22.17771], [29.18974, -22.18599], [29.15268, -22.21399], [29.10881, -22.21202], [29.0151, -22.22907], [28.91889, -22.44299], [28.63287, -22.55887], [28.34874, -22.5694], [28.04562, -22.8394], [28.04752, -22.90243], [27.93729, -22.96194], [27.93539, -23.04941], [27.74154, -23.2137], [27.6066, -23.21894], [27.52393, -23.37952], [27.33768, -23.40917], [26.99749, -23.65486], [26.84165, -24.24885], [26.51667, -24.47219], [26.46346, -24.60358], [26.39409, -24.63468], [25.8515, -24.75727], [25.84295, -24.78661], [25.88571, -24.87802], [25.72702, -25.25503], [25.69661, -25.29284], [25.6643, -25.4491], [25.58543, -25.6343], [25.33076, -25.76616], [25.12266, -25.75931], [25.01718, -25.72507], [24.8946, -25.80723], [24.67319, -25.81749], [24.44703, -25.73021], [24.36531, -25.773], [24.18287, -25.62916], [23.9244, -25.64286], [23.47588, -25.29971], [23.03497, -25.29971], [22.86012, -25.50572], [22.70808, -25.99186], [22.56365, -26.19668], [22.41921, -26.23078], [22.21206, -26.3773], [22.06192, -26.61882], [21.90703, -26.66808], [21.83291, -26.65959], [21.77114, -26.69015], [21.7854, -26.79199], [21.69322, -26.86152], [21.37869, -26.82083], [21.13353, -26.86661], [20.87031, -26.80047], [20.68596, -26.9039], [20.63275, -26.78181], [20.61754, -26.4692], [20.86081, -26.14892], [20.64795, -25.47827], [20.29826, -24.94869], [20.03678, -24.81004], [20.02809, -24.78725], [19.99817, -24.76768], [19.99882, -28.42622], [18.99885, -28.89165], [17.4579, -28.68718], [17.15405, -28.08573], [16.90446, -28.057], [16.59922, -28.53246], [16.46592, -28.57126], [16.45332, -28.63117], [12.51595, -32.27486], [38.88176, -48.03306], [34.51034, -26.91792], [32.35222, -26.86027], [32.29584, -26.852], [32.22302, -26.84136], [32.19409, -26.84032], [32.13315, -26.84345], [32.09664, -26.80721], [32.00893, -26.8096], [31.97463, -27.11057], [31.97592, -27.31675], [31.49834, -27.31549], [31.15027, -27.20151], [30.96088, -27.0245], [30.97757, -26.92706], [30.88826, -26.79622], [30.81101, -26.84722], [30.78927, -26.48271], [30.95819, -26.26303], [31.13073, -25.91558], [31.31237, -25.7431], [31.4175, -25.71886], [31.86881, -25.99973], [31.974, -25.95387], [31.92649, -25.84216], [32.00631, -25.65044], [31.97875, -25.46356], [32.01676, -25.38117], [32.03196, -25.10785], [31.9835, -24.29983], [31.90368, -24.18892], [31.87707, -23.95293], [31.77445, -23.90082], [31.70223, -23.72695], [31.67942, -23.60858], [31.56539, -23.47268], [31.55779, -23.176], [31.30611, -22.422]], [[29.33204, -29.45598], [29.28545, -29.58456], [29.12553, -29.76266], [29.16548, -29.91706], [28.9338, -30.05072], [28.80222, -30.10579], [28.68627, -30.12885], [28.399, -30.1592], [28.2319, -30.28476], [28.12073, -30.68072], [27.74814, -30.60635], [27.69467, -30.55862], [27.67819, -30.53437], [27.6521, -30.51707], [27.62137, -30.50509], [27.56781, -30.44562], [27.56901, -30.42504], [27.45452, -30.32239], [27.38108, -30.33456], [27.36649, -30.27246], [27.37293, -30.19401], [27.40778, -30.14577], [27.32555, -30.14785], [27.29603, -30.05473], [27.22719, -30.00718], [27.09489, -29.72796], [27.01016, -29.65439], [27.33464, -29.48161], [27.4358, -29.33465], [27.47254, -29.31968], [27.45125, -29.29708], [27.48679, -29.29349], [27.54258, -29.25575], [27.5158, -29.2261], [27.55974, -29.18954], [27.75458, -28.89839], [27.8907, -28.91612], [27.88933, -28.88156], [27.9392, -28.84864], [27.98675, -28.8787], [28.02503, -28.85991], [28.1317, -28.7293], [28.2348, -28.69471], [28.30518, -28.69531], [28.40612, -28.6215], [28.65091, -28.57025], [28.68043, -28.58744], [29.40524, -29.21246], [29.44883, -29.3772], [29.33204, -29.45598]]]] } },
34338 { type: "Feature", properties: { iso1A2: "ZM", iso1A3: "ZMB", iso1N3: "894", wikidata: "Q953", nameEn: "Zambia", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["260"] }, geometry: { type: "MultiPolygon", coordinates: [[[[32.95389, -9.40138], [32.76233, -9.31963], [32.75611, -9.28583], [32.53661, -9.24281], [32.49147, -9.14754], [32.43543, -9.11988], [32.25486, -9.13371], [32.16146, -9.05993], [32.08206, -9.04609], [31.98866, -9.07069], [31.94196, -9.02303], [31.94663, -8.93846], [31.81587, -8.88618], [31.71158, -8.91386], [31.57147, -8.81388], [31.57147, -8.70619], [31.37533, -8.60769], [31.00796, -8.58615], [30.79243, -8.27382], [28.88917, -8.4831], [28.9711, -8.66935], [28.38526, -9.23393], [28.36562, -9.30091], [28.52636, -9.35379], [28.51627, -9.44726], [28.56208, -9.49122], [28.68532, -9.78], [28.62795, -9.92942], [28.65032, -10.65133], [28.37241, -11.57848], [28.48357, -11.87532], [29.18592, -12.37921], [29.4992, -12.43843], [29.48404, -12.23604], [29.8139, -12.14898], [29.81551, -13.44683], [29.65078, -13.41844], [29.60531, -13.21685], [29.01918, -13.41353], [28.33199, -12.41375], [27.59932, -12.22123], [27.21025, -11.76157], [27.22541, -11.60323], [27.04351, -11.61312], [26.88687, -12.01868], [26.01777, -11.91488], [25.33058, -11.65767], [25.34069, -11.19707], [24.42612, -11.44975], [24.34528, -11.06816], [24.00027, -10.89356], [24.02603, -11.15368], [23.98804, -12.13149], [24.06672, -12.29058], [23.90937, -12.844], [24.03339, -12.99091], [21.97988, -13.00148], [22.00323, -16.18028], [22.17217, -16.50269], [23.20038, -17.47563], [23.47474, -17.62877], [24.23619, -17.47489], [24.32811, -17.49082], [24.38712, -17.46818], [24.5621, -17.52963], [24.70864, -17.49501], [25.00198, -17.58221], [25.26433, -17.79571], [25.51646, -17.86232], [25.6827, -17.81987], [25.85738, -17.91403], [25.85892, -17.97726], [26.08925, -17.98168], [26.0908, -17.93021], [26.21601, -17.88608], [26.55918, -17.99638], [26.68403, -18.07411], [26.74314, -18.0199], [26.89926, -17.98756], [27.14196, -17.81398], [27.30736, -17.60487], [27.61377, -17.34378], [27.62795, -17.24365], [27.83141, -16.96274], [28.73725, -16.5528], [28.76199, -16.51575], [28.81454, -16.48611], [28.8501, -16.04537], [28.9243, -15.93987], [29.01298, -15.93805], [29.21955, -15.76589], [29.4437, -15.68702], [29.8317, -15.6126], [30.35574, -15.6513], [30.41902, -15.62269], [30.22098, -14.99447], [33.24249, -14.00019], [33.16749, -13.93992], [33.07568, -13.98447], [33.02977, -14.05022], [32.99042, -13.95689], [32.88985, -13.82956], [32.79015, -13.80755], [32.76962, -13.77224], [32.84528, -13.71576], [32.7828, -13.64805], [32.68654, -13.64268], [32.66468, -13.60019], [32.68436, -13.55769], [32.73683, -13.57682], [32.84176, -13.52794], [32.86113, -13.47292], [33.0078, -13.19492], [32.98289, -13.12671], [33.02181, -12.88707], [32.96733, -12.88251], [32.94397, -12.76868], [33.05917, -12.59554], [33.18837, -12.61377], [33.28177, -12.54692], [33.37517, -12.54085], [33.54485, -12.35996], [33.47636, -12.32498], [33.3705, -12.34931], [33.25998, -12.14242], [33.33937, -11.91252], [33.32692, -11.59248], [33.24252, -11.59302], [33.23663, -11.40637], [33.29267, -11.43536], [33.29267, -11.3789], [33.39697, -11.15296], [33.25998, -10.88862], [33.28022, -10.84428], [33.47636, -10.78465], [33.70675, -10.56896], [33.54797, -10.36077], [33.53863, -10.20148], [33.31297, -10.05133], [33.37902, -9.9104], [33.36581, -9.81063], [33.31517, -9.82364], [33.2095, -9.61099], [33.12144, -9.58929], [33.10163, -9.66525], [33.05485, -9.61316], [33.00256, -9.63053], [33.00476, -9.5133], [32.95389, -9.40138]]]] } },
34339 { type: "Feature", properties: { iso1A2: "ZW", iso1A3: "ZWE", iso1N3: "716", wikidata: "Q954", nameEn: "Zimbabwe", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["263"] }, geometry: { type: "MultiPolygon", coordinates: [[[[30.41902, -15.62269], [30.35574, -15.6513], [29.8317, -15.6126], [29.4437, -15.68702], [29.21955, -15.76589], [29.01298, -15.93805], [28.9243, -15.93987], [28.8501, -16.04537], [28.81454, -16.48611], [28.76199, -16.51575], [28.73725, -16.5528], [27.83141, -16.96274], [27.62795, -17.24365], [27.61377, -17.34378], [27.30736, -17.60487], [27.14196, -17.81398], [26.89926, -17.98756], [26.74314, -18.0199], [26.68403, -18.07411], [26.55918, -17.99638], [26.21601, -17.88608], [26.0908, -17.93021], [26.08925, -17.98168], [25.85892, -17.97726], [25.85738, -17.91403], [25.6827, -17.81987], [25.51646, -17.86232], [25.26433, -17.79571], [25.23909, -17.90832], [25.31799, -18.07091], [25.39972, -18.12691], [25.53465, -18.39041], [25.68859, -18.56165], [25.79217, -18.6355], [25.82353, -18.82808], [25.94326, -18.90362], [25.99837, -19.02943], [25.96226, -19.08152], [26.17227, -19.53709], [26.72246, -19.92707], [27.21278, -20.08244], [27.29831, -20.28935], [27.28865, -20.49873], [27.69361, -20.48531], [27.72972, -20.51735], [27.69171, -21.08409], [27.91407, -21.31621], [28.01669, -21.57624], [28.29416, -21.59037], [28.49942, -21.66634], [28.58114, -21.63455], [29.07763, -21.81877], [29.04023, -21.85864], [29.02191, -21.90647], [29.02191, -21.95665], [29.04108, -22.00563], [29.08495, -22.04867], [29.14501, -22.07275], [29.1974, -22.07472], [29.24648, -22.05967], [29.3533, -22.18363], [29.37703, -22.19581], [29.64609, -22.12917], [29.76848, -22.14128], [29.92242, -22.19408], [30.13147, -22.30841], [30.2265, -22.2961], [30.28351, -22.35587], [30.38614, -22.34533], [30.48686, -22.31368], [30.6294, -22.32599], [30.86696, -22.28907], [31.08932, -22.34884], [31.16344, -22.32599], [31.30611, -22.422], [31.38336, -22.36919], [32.41234, -21.31246], [32.48236, -21.32873], [32.37115, -21.133], [32.51644, -20.91929], [32.48122, -20.63319], [32.55167, -20.56312], [32.66174, -20.56106], [32.85987, -20.27841], [32.85987, -20.16686], [32.93032, -20.03868], [33.01178, -20.02007], [33.06461, -19.77787], [32.95013, -19.67219], [32.84666, -19.68462], [32.84446, -19.48343], [32.78282, -19.47513], [32.77966, -19.36098], [32.85107, -19.29238], [32.87088, -19.09279], [32.84006, -19.0262], [32.72118, -19.02204], [32.69917, -18.94293], [32.73439, -18.92628], [32.70137, -18.84712], [32.82465, -18.77419], [32.9017, -18.7992], [32.95013, -18.69079], [32.88629, -18.58023], [32.88629, -18.51344], [33.02278, -18.4696], [33.03159, -18.35054], [32.94133, -17.99705], [33.0492, -17.60298], [32.98536, -17.55891], [32.96554, -17.48964], [33.0426, -17.3468], [33.00517, -17.30477], [32.96554, -17.11971], [32.84113, -16.92259], [32.91051, -16.89446], [32.97655, -16.70689], [32.78943, -16.70267], [32.69917, -16.66893], [32.71017, -16.59932], [32.42838, -16.4727], [32.28529, -16.43892], [32.02772, -16.43892], [31.91324, -16.41569], [31.90223, -16.34388], [31.67988, -16.19595], [31.42451, -16.15154], [31.30563, -16.01193], [31.13171, -15.98019], [30.97761, -16.05848], [30.91597, -15.99924], [30.42568, -15.9962], [30.41902, -15.62269]]]] } }
34341 borders = borders_default;
34342 _whichPolygon = {};
34343 _featuresByCode = {};
34344 idFilterRegex = /(?=(?!^(and|the|of|el|la|de)$))(\b(and|the|of|el|la|de)\b)|[-_ .,'()&[\]/]/gi;
34351 "intermediateRegion",
34359 loadDerivedDataAndCaches(borders);
34368 // modules/services/pannellum_photo.js
34369 var pannellum_photo_exports = {};
34370 __export(pannellum_photo_exports, {
34371 default: () => pannellum_photo_default
34373 var pannellumViewerCSS, pannellumViewerJS, dispatch6, _currScenes, _pannellumViewer, _activeSceneKey, pannellum_photo_default;
34374 var init_pannellum_photo = __esm({
34375 "modules/services/pannellum_photo.js"() {
34380 pannellumViewerCSS = "pannellum/pannellum.css";
34381 pannellumViewerJS = "pannellum/pannellum.js";
34382 dispatch6 = dispatch_default("viewerChanged");
34384 pannellum_photo_default = {
34385 init: async function(context, selection2) {
34386 selection2.append("div").attr("class", "photo-frame pannellum-frame").attr("id", "ideditor-pannellum-viewer").classed("hide", true).on("mousedown", function(e3) {
34387 e3.stopPropagation();
34389 if (!window.pannellum) {
34390 await this.loadPannellum(context);
34393 "default": { firstScene: "" },
34396 disableKeyboardCtrl: true,
34397 sceneFadeDuration: 0
34399 _pannellumViewer = window.pannellum.viewer("ideditor-pannellum-viewer", options);
34400 _pannellumViewer.on("mousedown", () => {
34401 select_default2(window).on("pointermove.pannellum mousemove.pannellum", () => {
34402 dispatch6.call("viewerChanged");
34404 }).on("mouseup", () => {
34405 select_default2(window).on("pointermove.pannellum mousemove.pannellum", null);
34406 }).on("animatefinished", () => {
34407 dispatch6.call("viewerChanged");
34409 context.ui().photoviewer.on("resize.pannellum", () => {
34410 _pannellumViewer.resize();
34412 this.event = utilRebind(this, dispatch6, "on");
34415 loadPannellum: function(context) {
34416 const head = select_default2("head");
34417 return Promise.all([
34418 new Promise((resolve, reject) => {
34419 head.selectAll("#ideditor-pannellum-viewercss").data([0]).enter().append("link").attr("id", "ideditor-pannellum-viewercss").attr("rel", "stylesheet").attr("crossorigin", "anonymous").attr("href", context.asset(pannellumViewerCSS)).on("load.pannellum", resolve).on("error.pannellum", reject);
34421 new Promise((resolve, reject) => {
34422 head.selectAll("#ideditor-pannellum-viewerjs").data([0]).enter().append("script").attr("id", "ideditor-pannellum-viewerjs").attr("crossorigin", "anonymous").attr("src", context.asset(pannellumViewerJS)).on("load.pannellum", resolve).on("error.pannellum", reject);
34427 * Shows the photo frame if hidden
34428 * @param {*} context the HTML wrap of the frame
34430 showPhotoFrame: function(context) {
34431 const isHidden = context.selectAll(".photo-frame.pannellum-frame.hide").size();
34433 context.selectAll(".photo-frame:not(.pannellum-frame)").classed("hide", true);
34434 context.selectAll(".photo-frame.pannellum-frame").classed("hide", false);
34439 * Hides the photo frame if shown
34440 * @param {*} context the HTML wrap of the frame
34442 hidePhotoFrame: function(viewerContext) {
34443 viewerContext.select("photo-frame.pannellum-frame").classed("hide", false);
34447 * Renders an image inside the frame
34448 * @param {*} data the image data, it should contain an image_path attribute, a link to the actual image.
34449 * @param {boolean} keepOrientation if true, HFOV, pitch and yaw will be kept between images
34451 selectPhoto: function(data, keepOrientation) {
34452 const key = _activeSceneKey = data.image_path;
34453 if (!_currScenes.includes(key)) {
34454 let newSceneOptions = {
34455 showFullscreenCtrl: false,
34459 type: "equirectangular",
34460 preview: data.preview_path,
34461 panorama: data.image_path,
34462 northOffset: data.ca
34464 _currScenes.push(key);
34465 _pannellumViewer.addScene(key, newSceneOptions);
34470 if (keepOrientation) {
34471 yaw = this.getYaw();
34472 pitch = this.getPitch();
34473 hfov = this.getHfov();
34475 if (_pannellumViewer.isLoaded() !== false) {
34476 _pannellumViewer.loadScene(key, pitch, yaw, hfov);
34477 dispatch6.call("viewerChanged");
34479 const retry = setInterval(() => {
34480 if (_pannellumViewer.isLoaded() === false) {
34483 if (_activeSceneKey === key) {
34484 _pannellumViewer.loadScene(key, pitch, yaw, hfov);
34485 dispatch6.call("viewerChanged");
34487 clearInterval(retry);
34490 if (_currScenes.length > 3) {
34491 const old_key = _currScenes.shift();
34492 _pannellumViewer.removeScene(old_key);
34494 _pannellumViewer.resize();
34497 getYaw: function() {
34498 return _pannellumViewer.getYaw();
34500 getPitch: function() {
34501 return _pannellumViewer.getPitch();
34503 getHfov: function() {
34504 return _pannellumViewer.getHfov();
34510 // modules/services/plane_photo.js
34511 var plane_photo_exports = {};
34512 __export(plane_photo_exports, {
34513 default: () => plane_photo_default
34515 function zoomPan(d3_event) {
34516 let t2 = d3_event.transform;
34517 _imageWrapper.call(utilSetTransform, t2.x, t2.y, t2.k);
34519 function loadImage(selection2, path) {
34520 return new Promise((resolve) => {
34521 selection2.attr("src", path);
34522 selection2.on("load", () => {
34523 resolve(selection2);
34527 var dispatch7, _photo, _imageWrapper, _planeWrapper, _imgZoom, plane_photo_default;
34528 var init_plane_photo = __esm({
34529 "modules/services/plane_photo.js"() {
34534 dispatch7 = dispatch_default("viewerChanged");
34535 _imgZoom = zoom_default2().extent([[0, 0], [320, 240]]).translateExtent([[0, 0], [320, 240]]).scaleExtent([1, 15]);
34536 plane_photo_default = {
34537 init: async function(context, selection2) {
34538 this.event = utilRebind(this, dispatch7, "on");
34539 _planeWrapper = selection2;
34540 _planeWrapper.call(_imgZoom.on("zoom", zoomPan));
34541 _imageWrapper = _planeWrapper.append("div").attr("class", "photo-frame plane-frame").classed("hide", true);
34542 _photo = _imageWrapper.append("img").attr("class", "plane-photo");
34543 context.ui().photoviewer.on("resize.plane", function(dimensions) {
34544 _imgZoom.extent([[0, 0], dimensions]).translateExtent([[0, 0], dimensions]);
34546 await Promise.resolve();
34550 * Shows the photo frame if hidden
34551 * @param {*} context the HTML wrap of the frame
34553 showPhotoFrame: function(context) {
34554 const isHidden = context.selectAll(".photo-frame.plane-frame.hide").size();
34556 context.selectAll(".photo-frame:not(.plane-frame)").classed("hide", true);
34557 context.selectAll(".photo-frame.plane-frame").classed("hide", false);
34562 * Hides the photo frame if shown
34563 * @param {*} context the HTML wrap of the frame
34565 hidePhotoFrame: function(context) {
34566 context.select("photo-frame.plane-frame").classed("hide", false);
34570 * Renders an image inside the frame
34571 * @param {*} data the image data, it should contain an image_path attribute, a link to the actual image.
34573 selectPhoto: function(data) {
34574 dispatch7.call("viewerChanged");
34575 loadImage(_photo, "");
34576 loadImage(_photo, data.image_path).then(() => {
34577 _planeWrapper.call(_imgZoom.transform, identity2);
34581 getYaw: function() {
34588 // modules/services/vegbilder.js
34589 var vegbilder_exports = {};
34590 __export(vegbilder_exports, {
34591 default: () => vegbilder_default
34593 async function fetchAvailableLayers() {
34597 request: "GetCapabilities",
34600 const urlForRequest = owsEndpoint + utilQsString(params);
34601 const response = await xml_default(urlForRequest);
34602 const regexMatcher = /^vegbilder_1_0:Vegbilder(?<image_type>_360)?_(?<year>\d{4})$/;
34603 const availableLayers = [];
34604 for (const node of response.querySelectorAll("FeatureType > Name")) {
34605 const match = (_a4 = node.textContent) == null ? void 0 : _a4.match(regexMatcher);
34607 availableLayers.push({
34609 is_sphere: !!((_b2 = match.groups) == null ? void 0 : _b2.image_type),
34610 year: parseInt((_c = match.groups) == null ? void 0 : _c.year, 10)
34614 return availableLayers;
34616 function filterAvailableLayers(photoContex) {
34617 const fromDateString = photoContex.fromDate();
34618 const toDateString = photoContex.toDate();
34619 const fromYear = fromDateString ? new Date(fromDateString).getFullYear() : 2016;
34620 const toYear = toDateString ? new Date(toDateString).getFullYear() : null;
34621 const showsFlat = photoContex.showsFlat();
34622 const showsPano = photoContex.showsPanoramic();
34623 return Array.from(_vegbilderCache.wfslayers.values()).filter(({ layerInfo }) => layerInfo.year >= fromYear && (!toYear || layerInfo.year <= toYear) && (!layerInfo.is_sphere && showsFlat || layerInfo.is_sphere && showsPano));
34625 function loadWFSLayers(projection2, margin, wfslayers) {
34626 const tiles = tiler4.margin(margin).getTiles(projection2);
34627 for (const cache of wfslayers) {
34628 loadWFSLayer(projection2, cache, tiles);
34631 function loadWFSLayer(projection2, cache, tiles) {
34632 for (const [key, controller] of cache.inflight.entries()) {
34633 const wanted = tiles.some((tile) => key === tile.id);
34635 controller.abort();
34636 cache.inflight.delete(key);
34639 Promise.all(tiles.map(
34640 (tile) => loadTile2(cache, cache.layerInfo.name, tile)
34641 )).then(() => orderSequences(projection2, cache));
34643 async function loadTile2(cache, typename, tile) {
34644 const bbox2 = tile.extent.bbox();
34645 const tileid = tile.id;
34646 if (cache.loaded.get(tileid) === true || cache.inflight.has(tileid)) return;
34649 request: "GetFeature",
34651 typenames: typename,
34652 bbox: [bbox2.minY, bbox2.minX, bbox2.maxY, bbox2.maxX].join(","),
34653 outputFormat: "json"
34655 const controller = new AbortController();
34656 cache.inflight.set(tileid, controller);
34659 signal: controller.signal
34661 const urlForRequest = owsEndpoint + utilQsString(params);
34662 let featureCollection;
34664 featureCollection = await json_default(urlForRequest, options);
34666 cache.loaded.set(tileid, false);
34669 cache.inflight.delete(tileid);
34671 cache.loaded.set(tileid, true);
34672 if (featureCollection.features.length === 0) {
34675 const features = featureCollection.features.map((feature3) => {
34676 const loc = feature3.geometry.coordinates;
34677 const key = feature3.id;
34678 const properties = feature3.properties;
34681 TIDSPUNKT: captured_at,
34683 URLPREVIEW: preview_path,
34684 BILDETYPE: image_type,
34686 FELTKODE: lane_code
34688 const lane_number = parseInt(lane_code.match(/^[0-9]+/)[0], 10);
34689 const direction = lane_number % 2 === 0 ? directionEnum.backward : directionEnum.forward;
34697 road_reference: roadReference(properties),
34701 captured_at: new Date(captured_at),
34702 is_sphere: image_type === "360"
34704 cache.points.set(key, data);
34713 _vegbilderCache.rtree.load(features);
34714 dispatch8.call("loadedImages");
34716 function orderSequences(projection2, cache) {
34717 const { points } = cache;
34718 const grouped = Array.from(points.values()).reduce((grouped2, image) => {
34719 const key = image.road_reference;
34720 if (grouped2.has(key)) {
34721 grouped2.get(key).push(image);
34723 grouped2.set(key, [image]);
34726 }, /* @__PURE__ */ new Map());
34727 const imageSequences = Array.from(grouped.values()).reduce((imageSequences2, imageGroup) => {
34728 imageGroup.sort((a2, b3) => {
34729 if (a2.captured_at.valueOf() > b3.captured_at.valueOf()) {
34731 } else if (a2.captured_at.valueOf() < b3.captured_at.valueOf()) {
34734 const { direction } = a2;
34735 if (direction === directionEnum.forward) {
34736 return a2.metering - b3.metering;
34738 return b3.metering - a2.metering;
34742 let imageSequence = [imageGroup[0]];
34744 for (const [lastImage, image] of pairs(imageGroup)) {
34745 if (lastImage.ca === null) {
34746 const b3 = projection2(lastImage.loc);
34747 const a2 = projection2(image.loc);
34748 if (!geoVecEqual(a2, b3)) {
34749 angle2 = geoVecAngle(a2, b3);
34750 angle2 *= 180 / Math.PI;
34752 angle2 = angle2 >= 0 ? angle2 : angle2 + 360;
34754 lastImage.ca = angle2;
34756 if (image.direction === lastImage.direction && image.captured_at.valueOf() - lastImage.captured_at.valueOf() <= 2e4) {
34757 imageSequence.push(image);
34759 imageSequences2.push(imageSequence);
34760 imageSequence = [image];
34763 imageSequences2.push(imageSequence);
34764 return imageSequences2;
34766 cache.sequences = imageSequences.map((images) => {
34769 key: images[0].key,
34771 type: "LineString",
34772 coordinates: images.map((image) => image.loc)
34775 for (const image of images) {
34776 _vegbilderCache.image2sequence_map.set(image.key, sequence);
34781 function roadReference(properties) {
34783 FYLKENUMMER: county_number,
34784 VEGKATEGORI: road_class,
34785 VEGSTATUS: road_status,
34786 VEGNUMMER: road_number,
34787 STREKNING: section,
34788 DELSTREKNING: subsection,
34790 KRYSSDEL: junction_part,
34791 SIDEANLEGGSDEL: services_part,
34792 ANKERPUNKT: anker_point,
34796 if (year >= 2020) {
34797 reference = `${road_class}${road_status}${road_number} S${section}D${subsection}`;
34798 if (junction_part) {
34799 reference = `${reference} M${anker_point} KD${junction_part}`;
34800 } else if (services_part) {
34801 reference = `${reference} M${anker_point} SD${services_part}`;
34804 reference = `${county_number}${road_class}${road_status}${road_number} HP${parcel}`;
34808 function localeTimestamp(date) {
34817 return date.toLocaleString(_mainLocalizer.localeCode(), options);
34819 function partitionViewport3(projection2) {
34820 const zoom = geoScaleToZoom(projection2.scale());
34821 const roundZoom = Math.ceil(zoom * 2) / 2 + 2.5;
34822 const tiler8 = utilTiler().zoomExtent([roundZoom, roundZoom]);
34823 return tiler8.getTiles(projection2).map((tile) => tile.extent);
34825 function searchLimited3(limit, projection2, rtree) {
34826 limit != null ? limit : limit = 5;
34827 return partitionViewport3(projection2).reduce((result, extent) => {
34828 const found = rtree.search(extent.bbox()).slice(0, limit).map((d4) => d4.data);
34829 return result.concat(found);
34832 var owsEndpoint, tileZoom2, tiler4, dispatch8, directionEnum, _planeFrame, _pannellumFrame, _currentFrame, _loadViewerPromise3, _vegbilderCache, vegbilder_default;
34833 var init_vegbilder = __esm({
34834 "modules/services/vegbilder.js"() {
34840 init_country_coder();
34844 init_pannellum_photo();
34845 init_plane_photo();
34847 owsEndpoint = "https://www.vegvesen.no/kart/ogc/vegbilder_1_0/ows?";
34849 tiler4 = utilTiler().zoomExtent([tileZoom2, tileZoom2]).skipNullIsland(true);
34850 dispatch8 = dispatch_default("loadedImages", "viewerChanged");
34851 directionEnum = Object.freeze({
34852 forward: Symbol(0),
34853 backward: Symbol(1)
34855 vegbilder_default = {
34857 this.event = utilRebind(this, dispatch8, "on");
34859 reset: async function() {
34860 if (_vegbilderCache) {
34861 for (const layer of _vegbilderCache.wfslayers.values()) {
34862 for (const controller of layer.inflight.values()) {
34863 controller.abort();
34867 _vegbilderCache = {
34868 wfslayers: /* @__PURE__ */ new Map(),
34869 rtree: new RBush(),
34870 image2sequence_map: /* @__PURE__ */ new Map()
34872 const availableLayers = await fetchAvailableLayers();
34873 const { wfslayers } = _vegbilderCache;
34874 for (const layerInfo of availableLayers) {
34877 loaded: /* @__PURE__ */ new Map(),
34878 inflight: /* @__PURE__ */ new Map(),
34879 points: /* @__PURE__ */ new Map(),
34882 wfslayers.set(layerInfo.name, cache);
34885 images: function(projection2) {
34887 return searchLimited3(limit, projection2, _vegbilderCache.rtree);
34889 sequences: function(projection2) {
34890 const viewport = projection2.clipExtent();
34891 const min3 = [viewport[0][0], viewport[1][1]];
34892 const max3 = [viewport[1][0], viewport[0][1]];
34893 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
34894 const seen = /* @__PURE__ */ new Set();
34895 const line_strings = [];
34896 for (const { data } of _vegbilderCache.rtree.search(bbox2)) {
34897 const sequence = _vegbilderCache.image2sequence_map.get(data.key);
34898 if (!sequence) continue;
34899 const { key, geometry, images } = sequence;
34900 if (seen.has(key)) continue;
34903 type: "LineString",
34904 coordinates: geometry.coordinates,
34908 line_strings.push(line);
34910 return line_strings;
34912 cachedImage: function(key) {
34913 for (const { points } of _vegbilderCache.wfslayers.values()) {
34914 if (points.has(key)) return points.get(key);
34917 getSequenceForImage: function(image) {
34918 return _vegbilderCache == null ? void 0 : _vegbilderCache.image2sequence_map.get(image == null ? void 0 : image.key);
34920 loadImages: async function(context, margin) {
34921 if (!_vegbilderCache) {
34922 await this.reset();
34924 margin != null ? margin : margin = 1;
34925 const wfslayers = filterAvailableLayers(context.photos());
34926 loadWFSLayers(context.projection, margin, wfslayers);
34928 photoFrame: function() {
34929 return _currentFrame;
34931 ensureViewerLoaded: function(context) {
34932 if (_loadViewerPromise3) return _loadViewerPromise3;
34933 const step = (stepBy) => () => {
34934 const viewer = context.container().select(".photoviewer");
34935 const selected = viewer.empty() ? void 0 : viewer.datum();
34936 if (!selected) return;
34937 const sequence = this.getSequenceForImage(selected);
34938 const nextIndex = sequence.images.indexOf(selected) + stepBy;
34939 const nextImage = sequence.images[nextIndex];
34940 if (!nextImage) return;
34941 context.map().centerEase(nextImage.loc);
34942 this.selectImage(context, nextImage.key, true);
34944 const wrap2 = context.container().select(".photoviewer").selectAll(".vegbilder-wrapper").data([0]);
34945 const wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper vegbilder-wrapper").classed("hide", true);
34946 wrapEnter.append("div").attr("class", "photo-attribution fillD");
34947 const controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
34948 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
34949 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
34950 _loadViewerPromise3 = Promise.all([
34951 pannellum_photo_default.init(context, wrapEnter),
34952 plane_photo_default.init(context, wrapEnter)
34953 ]).then(([pannellumPhotoFrame, planePhotoFrame]) => {
34954 _pannellumFrame = pannellumPhotoFrame;
34955 _pannellumFrame.event.on("viewerChanged", () => dispatch8.call("viewerChanged"));
34956 _planeFrame = planePhotoFrame;
34957 _planeFrame.event.on("viewerChanged", () => dispatch8.call("viewerChanged"));
34959 return _loadViewerPromise3;
34961 selectImage: function(context, key, keepOrientation) {
34962 const d4 = this.cachedImage(key);
34963 this.updateUrlImage(key);
34964 const viewer = context.container().select(".photoviewer");
34965 if (!viewer.empty()) {
34968 this.setStyles(context, null, true);
34969 if (!d4) return this;
34970 const wrap2 = context.container().select(".photoviewer .vegbilder-wrapper");
34971 const attribution = wrap2.selectAll(".photo-attribution").text("");
34972 if (d4.captured_at) {
34973 attribution.append("span").attr("class", "captured_at").text(localeTimestamp(d4.captured_at));
34975 attribution.append("a").attr("target", "_blank").attr("href", "https://vegvesen.no").call(_t.append("vegbilder.publisher"));
34976 attribution.append("a").attr("target", "_blank").attr("href", `https://vegbilder.atlas.vegvesen.no/?year=${d4.captured_at.getFullYear()}&lat=${d4.loc[1]}&lng=${d4.loc[0]}&view=image&imageId=${d4.key}`).call(_t.append("vegbilder.view_on"));
34977 _currentFrame = d4.is_sphere ? _pannellumFrame : _planeFrame;
34978 _currentFrame.showPhotoFrame(wrap2).selectPhoto(d4, keepOrientation);
34981 showViewer: function(context) {
34982 const viewer = context.container().select(".photoviewer");
34983 const isHidden = viewer.selectAll(".photo-wrapper.vegbilder-wrapper.hide").size();
34985 for (const service of Object.values(services)) {
34986 if (service === this) continue;
34987 if (typeof service.hideViewer === "function") {
34988 service.hideViewer(context);
34991 viewer.classed("hide", false).selectAll(".photo-wrapper.vegbilder-wrapper").classed("hide", false);
34995 hideViewer: function(context) {
34996 this.updateUrlImage(null);
34997 const viewer = context.container().select(".photoviewer");
34998 if (!viewer.empty()) viewer.datum(null);
34999 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
35000 context.container().selectAll(".viewfield-group, .sequence").classed("currentView", false);
35001 return this.setStyles(context, null, true);
35003 // Updates the currently highlighted sequence and selected bubble.
35004 // Reset is only necessary when interacting with the viewport because
35005 // this implicitly changes the currently selected bubble/sequence
35006 setStyles: function(context, hovered, reset) {
35009 context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
35010 context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
35012 const hoveredImageKey = hovered == null ? void 0 : hovered.key;
35013 const hoveredSequence = this.getSequenceForImage(hovered);
35014 const hoveredSequenceKey = hoveredSequence == null ? void 0 : hoveredSequence.key;
35015 const hoveredImageKeys = (_a4 = hoveredSequence == null ? void 0 : hoveredSequence.images.map((d4) => d4.key)) != null ? _a4 : [];
35016 const viewer = context.container().select(".photoviewer");
35017 const selected = viewer.empty() ? void 0 : viewer.datum();
35018 const selectedImageKey = selected == null ? void 0 : selected.key;
35019 const selectedSequence = this.getSequenceForImage(selected);
35020 const selectedSequenceKey = selectedSequence == null ? void 0 : selectedSequence.key;
35021 const selectedImageKeys = (_b2 = selectedSequence == null ? void 0 : selectedSequence.images.map((d4) => d4.key)) != null ? _b2 : [];
35022 const highlightedImageKeys = utilArrayUnion(hoveredImageKeys, selectedImageKeys);
35023 context.container().selectAll(".layer-vegbilder .viewfield-group").classed("highlighted", (d4) => highlightedImageKeys.indexOf(d4.key) !== -1).classed("hovered", (d4) => d4.key === hoveredImageKey).classed("currentView", (d4) => d4.key === selectedImageKey);
35024 context.container().selectAll(".layer-vegbilder .sequence").classed("highlighted", (d4) => d4.key === hoveredSequenceKey).classed("currentView", (d4) => d4.key === selectedSequenceKey);
35025 context.container().selectAll(".layer-vegbilder .viewfield-group .viewfield").attr("d", viewfieldPath);
35026 function viewfieldPath() {
35027 const d4 = this.parentNode.__data__;
35028 if (d4.is_sphere && d4.key !== selectedImageKey) {
35029 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
35031 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
35036 updateUrlImage: function(key) {
35037 const hash2 = utilStringQs(window.location.hash);
35039 hash2.photo = "vegbilder/" + key;
35041 delete hash2.photo;
35043 window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
35045 validHere: function(extent) {
35046 const bbox2 = Object.values(extent.bbox());
35047 return iso1A2Codes(bbox2).includes("NO");
35049 cache: function() {
35050 return _vegbilderCache;
35056 // node_modules/osm-auth/src/osm-auth.mjs
35057 function osmAuth(o2) {
35059 var CHANNEL_ID = "osm-api-auth-complete";
35062 _store = window.localStorage;
35064 var _mock = /* @__PURE__ */ new Map();
35067 hasItem: (k2) => _mock.has(k2),
35068 getItem: (k2) => _mock.get(k2),
35069 setItem: (k2, v3) => _mock.set(k2, v3),
35070 removeItem: (k2) => _mock.delete(k2),
35071 clear: () => _mock.clear()
35074 function token(k2, v3) {
35075 var key = o2.url + k2;
35076 if (arguments.length === 1) {
35077 var val = _store.getItem(key) || "";
35078 return val.replace(/"/g, "");
35079 } else if (arguments.length === 2) {
35081 return _store.setItem(key, v3);
35083 return _store.removeItem(key);
35087 oauth2.authenticated = function() {
35088 return !!token("oauth2_access_token");
35090 oauth2.logout = function() {
35091 token("oauth2_access_token", "");
35092 token("oauth_token", "");
35093 token("oauth_token_secret", "");
35094 token("oauth_request_token_secret", "");
35097 oauth2.authenticate = function(callback, options) {
35098 if (oauth2.authenticated()) {
35099 callback(null, oauth2);
35103 _preopenPopup(function(error, popup) {
35107 _generatePkceChallenge(function(pkce) {
35108 _authenticate(pkce, options, popup, callback);
35113 oauth2.authenticateAsync = function(options) {
35114 if (oauth2.authenticated()) {
35115 return Promise.resolve(oauth2);
35118 return new Promise((resolve, reject) => {
35119 var errback = (err, result) => {
35126 _preopenPopup((error, popup) => {
35130 _generatePkceChallenge((pkce) => _authenticate(pkce, options, popup, errback));
35135 function _preopenPopup(callback) {
35136 if (o2.singlepage) {
35137 callback(null, void 0);
35145 ["left", window.screen.width / 2 - w3 / 2],
35146 ["top", window.screen.height / 2 - h3 / 2]
35147 ].map(function(x2) {
35148 return x2.join("=");
35150 var popup = window.open("about:blank", "oauth_window", settings);
35152 callback(null, popup);
35154 var error = new Error("Popup was blocked");
35155 error.status = "popup-blocked";
35159 function _authenticate(pkce, options, popup, callback) {
35160 var state = generateState();
35161 var path = "/oauth2/authorize?" + utilQsString2({
35162 client_id: o2.client_id,
35163 redirect_uri: o2.redirect_uri,
35164 response_type: "code",
35167 code_challenge: pkce.code_challenge,
35168 code_challenge_method: pkce.code_challenge_method,
35169 locale: o2.locale || ""
35171 var url = (options == null ? void 0 : options.switchUser) ? `${o2.url}/logout?referer=${encodeURIComponent(`/login?referer=${encodeURIComponent(path)}`)}` : o2.url + path;
35172 if (o2.singlepage) {
35173 if (_store.isMocked) {
35174 var error = new Error("localStorage unavailable, but required in singlepage mode");
35175 error.status = "pkce-localstorage-unavailable";
35179 var params = utilStringQs2(window.location.search.slice(1));
35181 oauth2.bootstrapToken(params.code, callback);
35183 token("oauth2_state", state);
35184 token("oauth2_pkce_code_verifier", pkce.code_verifier);
35185 window.location = url;
35188 oauth2.popupWindow = popup;
35189 popup.location = url;
35191 var bc = new BroadcastChannel(CHANNEL_ID);
35192 bc.addEventListener("message", (event) => {
35193 var url2 = event.data;
35194 var params2 = utilStringQs2(url2.split("?")[1]);
35195 if (params2.state !== state) {
35196 var error2 = new Error("Invalid state");
35197 error2.status = "invalid-state";
35201 _getAccessToken(params2.code, pkce.code_verifier, accessTokenDone);
35204 function accessTokenDone(err, xhr) {
35210 var access_token = JSON.parse(xhr.response);
35211 token("oauth2_access_token", access_token.access_token);
35212 callback(null, oauth2);
35215 function _getAccessToken(auth_code, code_verifier, accessTokenDone) {
35216 var url = o2.url + "/oauth2/token?" + utilQsString2({
35217 client_id: o2.client_id,
35218 redirect_uri: o2.redirect_uri,
35219 grant_type: "authorization_code",
35223 oauth2.rawxhr("POST", url, null, null, null, accessTokenDone);
35226 oauth2.bringPopupWindowToFront = function() {
35227 var broughtPopupToFront = false;
35229 if (oauth2.popupWindow && !oauth2.popupWindow.closed) {
35230 oauth2.popupWindow.focus();
35231 broughtPopupToFront = true;
35235 return broughtPopupToFront;
35237 oauth2.bootstrapToken = function(auth_code, callback) {
35238 var state = token("oauth2_state");
35239 token("oauth2_state", "");
35240 var params = utilStringQs2(window.location.search.slice(1));
35241 if (params.state !== state) {
35242 var error = new Error("Invalid state");
35243 error.status = "invalid-state";
35247 var code_verifier = token("oauth2_pkce_code_verifier");
35248 token("oauth2_pkce_code_verifier", "");
35249 _getAccessToken(auth_code, code_verifier, accessTokenDone);
35250 function accessTokenDone(err, xhr) {
35256 var access_token = JSON.parse(xhr.response);
35257 token("oauth2_access_token", access_token.access_token);
35258 callback(null, oauth2);
35261 oauth2.fetch = function(resource, options) {
35262 if (oauth2.authenticated()) {
35266 return oauth2.authenticateAsync().then(_doFetch);
35268 return Promise.reject(new Error("not authenticated"));
35271 function _doFetch() {
35272 options = options || {};
35273 if (!options.headers) {
35274 options.headers = { "Content-Type": "application/x-www-form-urlencoded" };
35276 options.headers.Authorization = "Bearer " + token("oauth2_access_token");
35277 return fetch(resource, options);
35280 oauth2.xhr = function(options, callback) {
35281 if (oauth2.authenticated()) {
35285 oauth2.authenticate(_doXHR);
35288 callback("not authenticated", null);
35292 function _doXHR() {
35293 var url = options.prefix !== false ? o2.apiUrl + options.path : options.path;
35294 return oauth2.rawxhr(
35297 token("oauth2_access_token"),
35303 function done(err, xhr) {
35306 } else if (xhr.responseXML) {
35307 callback(err, xhr.responseXML);
35309 callback(err, xhr.response);
35313 oauth2.rawxhr = function(method, url, access_token, data, headers, callback) {
35314 headers = headers || { "Content-Type": "application/x-www-form-urlencoded" };
35315 if (access_token) {
35316 headers.Authorization = "Bearer " + access_token;
35318 var xhr = new XMLHttpRequest();
35319 xhr.onreadystatechange = function() {
35320 if (4 === xhr.readyState && 0 !== xhr.status) {
35321 if (/^20\d$/.test(xhr.status)) {
35322 callback(null, xhr);
35324 callback(xhr, null);
35328 xhr.onerror = function(e3) {
35329 callback(e3, null);
35331 xhr.open(method, url, true);
35332 for (var h3 in headers) xhr.setRequestHeader(h3, headers[h3]);
35336 oauth2.preauth = function(val) {
35337 if (val && val.access_token) {
35338 token("oauth2_access_token", val.access_token);
35342 oauth2.options = function(val) {
35343 if (!arguments.length) return o2;
35345 o2.apiUrl = o2.apiUrl || "https://api.openstreetmap.org";
35346 o2.url = o2.url || "https://www.openstreetmap.org";
35347 o2.auto = o2.auto || false;
35348 o2.singlepage = o2.singlepage || false;
35349 o2.loading = o2.loading || function() {
35351 o2.done = o2.done || function() {
35353 return oauth2.preauth(o2);
35355 oauth2.options(o2);
35358 function utilQsString2(obj) {
35359 return Object.keys(obj).filter(function(key) {
35360 return obj[key] !== void 0;
35361 }).sort().map(function(key) {
35362 return encodeURIComponent(key) + "=" + encodeURIComponent(obj[key]);
35365 function utilStringQs2(str) {
35367 while (i3 < str.length && (str[i3] === "?" || str[i3] === "#")) i3++;
35368 str = str.slice(i3);
35369 return str.split("&").reduce(function(obj, pair3) {
35370 var parts = pair3.split("=");
35371 if (parts.length === 2) {
35372 obj[parts[0]] = decodeURIComponent(parts[1]);
35377 function supportsWebCryptoAPI() {
35378 return window && window.crypto && window.crypto.getRandomValues && window.crypto.subtle && window.crypto.subtle.digest;
35380 function _generatePkceChallenge(callback) {
35382 if (supportsWebCryptoAPI()) {
35383 var random = window.crypto.getRandomValues(new Uint8Array(32));
35384 code_verifier = base64(random.buffer);
35385 var verifier = Uint8Array.from(Array.from(code_verifier).map(function(char) {
35386 return char.charCodeAt(0);
35388 window.crypto.subtle.digest("SHA-256", verifier).then(function(hash2) {
35389 var code_challenge = base64(hash2);
35393 code_challenge_method: "S256"
35397 var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
35398 code_verifier = "";
35399 for (var i3 = 0; i3 < 64; i3++) {
35400 code_verifier += chars[Math.floor(Math.random() * chars.length)];
35404 code_challenge: code_verifier,
35405 code_challenge_method: "plain"
35409 function generateState() {
35411 if (supportsWebCryptoAPI()) {
35412 var random = window.crypto.getRandomValues(new Uint8Array(32));
35413 state = base64(random.buffer);
35415 var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
35417 for (var i3 = 0; i3 < 64; i3++) {
35418 state += chars[Math.floor(Math.random() * chars.length)];
35423 function base64(buffer) {
35424 return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer))).replace(/\//g, "_").replace(/\+/g, "-").replace(/[=]/g, "");
35426 var init_osm_auth = __esm({
35427 "node_modules/osm-auth/src/osm-auth.mjs"() {
35431 // modules/util/jxon.js
35432 var jxon_exports = {};
35433 __export(jxon_exports, {
35437 var init_jxon = __esm({
35438 "modules/util/jxon.js"() {
35440 JXON = new (function() {
35441 var sValueProp = "keyValue", sAttributesProp = "keyAttributes", sAttrPref = "@", aCache = [], rIsNull = /^\s*$/, rIsBool = /^(?:true|false)$/i;
35442 function parseText(sValue) {
35443 if (rIsNull.test(sValue)) {
35446 if (rIsBool.test(sValue)) {
35447 return sValue.toLowerCase() === "true";
35449 if (isFinite(sValue)) {
35450 return parseFloat(sValue);
35452 if (isFinite(Date.parse(sValue))) {
35453 return new Date(sValue);
35457 function EmptyTree() {
35459 EmptyTree.prototype.toString = function() {
35462 EmptyTree.prototype.valueOf = function() {
35465 function objectify(vValue) {
35466 return vValue === null ? new EmptyTree() : vValue instanceof Object ? vValue : new vValue.constructor(vValue);
35468 function createObjTree(oParentNode, nVerb, bFreeze, bNesteAttr) {
35469 var nLevelStart = aCache.length, bChildren = oParentNode.hasChildNodes(), bAttributes = oParentNode.hasAttributes(), bHighVerb = Boolean(nVerb & 2);
35470 var sProp, vContent, nLength = 0, sCollectedTxt = "", vResult = bHighVerb ? {} : (
35471 /* put here the default value for empty nodes: */
35475 for (var oNode, nItem = 0; nItem < oParentNode.childNodes.length; nItem++) {
35476 oNode = oParentNode.childNodes.item(nItem);
35477 if (oNode.nodeType === 4) {
35478 sCollectedTxt += oNode.nodeValue;
35479 } else if (oNode.nodeType === 3) {
35480 sCollectedTxt += oNode.nodeValue.trim();
35481 } else if (oNode.nodeType === 1 && !oNode.prefix) {
35482 aCache.push(oNode);
35486 var nLevelEnd = aCache.length, vBuiltVal = parseText(sCollectedTxt);
35487 if (!bHighVerb && (bChildren || bAttributes)) {
35488 vResult = nVerb === 0 ? objectify(vBuiltVal) : {};
35490 for (var nElId = nLevelStart; nElId < nLevelEnd; nElId++) {
35491 sProp = aCache[nElId].nodeName.toLowerCase();
35492 vContent = createObjTree(aCache[nElId], nVerb, bFreeze, bNesteAttr);
35493 if (vResult.hasOwnProperty(sProp)) {
35494 if (vResult[sProp].constructor !== Array) {
35495 vResult[sProp] = [vResult[sProp]];
35497 vResult[sProp].push(vContent);
35499 vResult[sProp] = vContent;
35504 var nAttrLen = oParentNode.attributes.length, sAPrefix = bNesteAttr ? "" : sAttrPref, oAttrParent = bNesteAttr ? {} : vResult;
35505 for (var oAttrib, nAttrib = 0; nAttrib < nAttrLen; nLength++, nAttrib++) {
35506 oAttrib = oParentNode.attributes.item(nAttrib);
35507 oAttrParent[sAPrefix + oAttrib.name.toLowerCase()] = parseText(oAttrib.value.trim());
35511 Object.freeze(oAttrParent);
35513 vResult[sAttributesProp] = oAttrParent;
35514 nLength -= nAttrLen - 1;
35517 if (nVerb === 3 || (nVerb === 2 || nVerb === 1 && nLength > 0) && sCollectedTxt) {
35518 vResult[sValueProp] = vBuiltVal;
35519 } else if (!bHighVerb && nLength === 0 && sCollectedTxt) {
35520 vResult = vBuiltVal;
35522 if (bFreeze && (bHighVerb || nLength > 0)) {
35523 Object.freeze(vResult);
35525 aCache.length = nLevelStart;
35528 function loadObjTree(oXMLDoc, oParentEl, oParentObj) {
35529 var vValue, oChild;
35530 if (oParentObj instanceof String || oParentObj instanceof Number || oParentObj instanceof Boolean) {
35531 oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toString()));
35532 } else if (oParentObj.constructor === Date) {
35533 oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toGMTString()));
35535 for (var sName in oParentObj) {
35536 vValue = oParentObj[sName];
35537 if (isFinite(sName) || vValue instanceof Function) {
35540 if (sName === sValueProp) {
35541 if (vValue !== null && vValue !== true) {
35542 oParentEl.appendChild(oXMLDoc.createTextNode(vValue.constructor === Date ? vValue.toGMTString() : String(vValue)));
35544 } else if (sName === sAttributesProp) {
35545 for (var sAttrib in vValue) {
35546 oParentEl.setAttribute(sAttrib, vValue[sAttrib]);
35548 } else if (sName.charAt(0) === sAttrPref) {
35549 oParentEl.setAttribute(sName.slice(1), vValue);
35550 } else if (vValue.constructor === Array) {
35551 for (var nItem = 0; nItem < vValue.length; nItem++) {
35552 oChild = oXMLDoc.createElement(sName);
35553 loadObjTree(oXMLDoc, oChild, vValue[nItem]);
35554 oParentEl.appendChild(oChild);
35557 oChild = oXMLDoc.createElement(sName);
35558 if (vValue instanceof Object) {
35559 loadObjTree(oXMLDoc, oChild, vValue);
35560 } else if (vValue !== null && vValue !== true) {
35561 oChild.appendChild(oXMLDoc.createTextNode(vValue.toString()));
35563 oParentEl.appendChild(oChild);
35567 this.build = function(oXMLParent, nVerbosity, bFreeze, bNesteAttributes) {
35568 var _nVerb = arguments.length > 1 && typeof nVerbosity === "number" ? nVerbosity & 3 : (
35569 /* put here the default verbosity level: */
35572 return createObjTree(oXMLParent, _nVerb, bFreeze || false, arguments.length > 3 ? bNesteAttributes : _nVerb === 3);
35574 this.unbuild = function(oObjTree) {
35575 var oNewDoc = document.implementation.createDocument("", "", null);
35576 loadObjTree(oNewDoc, oNewDoc, oObjTree);
35579 this.stringify = function(oObjTree) {
35580 return new XMLSerializer().serializeToString(JXON.unbuild(oObjTree));
35586 // modules/services/osm.js
35587 var osm_exports2 = {};
35588 __export(osm_exports2, {
35589 default: () => osm_default
35591 function authLoading() {
35592 dispatch9.call("authLoading");
35594 function authDone() {
35595 dispatch9.call("authDone");
35597 function abortRequest4(controllerOrXHR) {
35598 if (controllerOrXHR) {
35599 controllerOrXHR.abort();
35602 function hasInflightRequests(cache) {
35603 return Object.keys(cache.inflight).length;
35605 function abortUnwantedRequests3(cache, visibleTiles) {
35606 Object.keys(cache.inflight).forEach(function(k2) {
35607 if (cache.toLoad[k2]) return;
35608 if (visibleTiles.find(function(tile) {
35609 return k2 === tile.id;
35611 abortRequest4(cache.inflight[k2]);
35612 delete cache.inflight[k2];
35615 function getLoc(attrs) {
35616 var lon = attrs.lon && attrs.lon.value;
35617 var lat = attrs.lat && attrs.lat.value;
35618 return [Number(lon), Number(lat)];
35620 function getNodes(obj) {
35621 var elems = obj.getElementsByTagName("nd");
35622 var nodes = new Array(elems.length);
35623 for (var i3 = 0, l4 = elems.length; i3 < l4; i3++) {
35624 nodes[i3] = "n" + elems[i3].attributes.ref.value;
35628 function getNodesJSON(obj) {
35629 var elems = obj.nodes;
35630 var nodes = new Array(elems.length);
35631 for (var i3 = 0, l4 = elems.length; i3 < l4; i3++) {
35632 nodes[i3] = "n" + elems[i3];
35636 function getTags(obj) {
35637 var elems = obj.getElementsByTagName("tag");
35639 for (var i3 = 0, l4 = elems.length; i3 < l4; i3++) {
35640 var attrs = elems[i3].attributes;
35641 tags[attrs.k.value] = attrs.v.value;
35645 function getMembers(obj) {
35646 var elems = obj.getElementsByTagName("member");
35647 var members = new Array(elems.length);
35648 for (var i3 = 0, l4 = elems.length; i3 < l4; i3++) {
35649 var attrs = elems[i3].attributes;
35651 id: attrs.type.value[0] + attrs.ref.value,
35652 type: attrs.type.value,
35653 role: attrs.role.value
35658 function getMembersJSON(obj) {
35659 var elems = obj.members;
35660 var members = new Array(elems.length);
35661 for (var i3 = 0, l4 = elems.length; i3 < l4; i3++) {
35662 var attrs = elems[i3];
35664 id: attrs.type[0] + attrs.ref,
35671 function getVisible(attrs) {
35672 return !attrs.visible || attrs.visible.value !== "false";
35674 function parseComments(comments) {
35675 var parsedComments = [];
35676 for (var i3 = 0; i3 < comments.length; i3++) {
35677 var comment = comments[i3];
35678 if (comment.nodeName === "comment") {
35679 var childNodes = comment.childNodes;
35680 var parsedComment = {};
35681 for (var j3 = 0; j3 < childNodes.length; j3++) {
35682 var node = childNodes[j3];
35683 var nodeName = node.nodeName;
35684 if (nodeName === "#text") continue;
35685 parsedComment[nodeName] = node.textContent;
35686 if (nodeName === "uid") {
35687 var uid = node.textContent;
35688 if (uid && !_userCache.user[uid]) {
35689 _userCache.toLoad[uid] = true;
35693 if (parsedComment) {
35694 parsedComments.push(parsedComment);
35698 return parsedComments;
35700 function encodeNoteRtree(note) {
35709 function parseJSON(payload, callback, options) {
35710 options = Object.assign({ skipSeen: true }, options);
35712 return callback({ message: "No JSON", status: -1 });
35714 var json = payload;
35715 if (typeof json !== "object") json = JSON.parse(payload);
35716 if (!json.elements) return callback({ message: "No JSON", status: -1 });
35717 var children2 = json.elements;
35718 var handle = window.requestIdleCallback(function() {
35719 _deferred.delete(handle);
35722 for (var i3 = 0; i3 < children2.length; i3++) {
35723 result = parseChild(children2[i3]);
35724 if (result) results.push(result);
35726 callback(null, results);
35728 _deferred.add(handle);
35729 function parseChild(child) {
35730 var parser2 = jsonparsers[child.type];
35731 if (!parser2) return null;
35733 uid = osmEntity.id.fromOSM(child.type, child.id);
35734 if (options.skipSeen) {
35735 if (_tileCache.seen[uid]) return null;
35736 _tileCache.seen[uid] = true;
35738 return parser2(child, uid);
35741 function parseUserJSON(payload, callback, options) {
35742 options = Object.assign({ skipSeen: true }, options);
35744 return callback({ message: "No JSON", status: -1 });
35746 var json = payload;
35747 if (typeof json !== "object") json = JSON.parse(payload);
35748 if (!json.users && !json.user) return callback({ message: "No JSON", status: -1 });
35749 var objs = json.users || [json];
35750 var handle = window.requestIdleCallback(function() {
35751 _deferred.delete(handle);
35754 for (var i3 = 0; i3 < objs.length; i3++) {
35755 result = parseObj(objs[i3]);
35756 if (result) results.push(result);
35758 callback(null, results);
35760 _deferred.add(handle);
35761 function parseObj(obj) {
35762 var uid = obj.user.id && obj.user.id.toString();
35763 if (options.skipSeen && _userCache.user[uid]) {
35764 delete _userCache.toLoad[uid];
35767 var user = jsonparsers.user(obj.user, uid);
35768 _userCache.user[uid] = user;
35769 delete _userCache.toLoad[uid];
35773 function parseXML(xml, callback, options) {
35774 options = Object.assign({ skipSeen: true }, options);
35775 if (!xml || !xml.childNodes) {
35776 return callback({ message: "No XML", status: -1 });
35778 var root3 = xml.childNodes[0];
35779 var children2 = root3.childNodes;
35780 var handle = window.requestIdleCallback(function() {
35781 _deferred.delete(handle);
35784 for (var i3 = 0; i3 < children2.length; i3++) {
35785 result = parseChild(children2[i3]);
35786 if (result) results.push(result);
35788 callback(null, results);
35790 _deferred.add(handle);
35791 function parseChild(child) {
35792 var parser2 = parsers[child.nodeName];
35793 if (!parser2) return null;
35795 if (child.nodeName === "user") {
35796 uid = child.attributes.id.value;
35797 if (options.skipSeen && _userCache.user[uid]) {
35798 delete _userCache.toLoad[uid];
35801 } else if (child.nodeName === "note") {
35802 uid = child.getElementsByTagName("id")[0].textContent;
35804 uid = osmEntity.id.fromOSM(child.nodeName, child.attributes.id.value);
35805 if (options.skipSeen) {
35806 if (_tileCache.seen[uid]) return null;
35807 _tileCache.seen[uid] = true;
35810 return parser2(child, uid);
35813 function updateRtree3(item, replace) {
35814 _noteCache.rtree.remove(item, function isEql(a2, b3) {
35815 return a2.data.id === b3.data.id;
35818 _noteCache.rtree.insert(item);
35821 function wrapcb(thisArg, callback, cid) {
35822 return function(err, result) {
35824 return callback.call(thisArg, err);
35825 } else if (thisArg.getConnectionId() !== cid) {
35826 return callback.call(thisArg, { message: "Connection Switched", status: -1 });
35828 return callback.call(thisArg, err, result);
35832 var tiler5, dispatch9, urlroot, apiUrlroot, redirectPath, oauth, _apiConnections, _imageryBlocklists, _tileCache, _noteCache, _userCache, _cachedApiStatus, _changeset, _deferred, _connectionID, _tileZoom3, _noteZoom, _rateLimitError, _userChangesets, _userDetails, _off, _maxWayNodes, jsonparsers, parsers, osm_default;
35833 var init_osm2 = __esm({
35834 "modules/services/osm.js"() {
35847 tiler5 = utilTiler();
35848 dispatch9 = dispatch_default("apiStatusChange", "authLoading", "authDone", "change", "loading", "loaded", "loadedNotes");
35849 urlroot = osmApiConnections[0].url;
35850 apiUrlroot = osmApiConnections[0].apiUrl || urlroot;
35851 redirectPath = window.location.origin + window.location.pathname;
35854 apiUrl: apiUrlroot,
35855 client_id: osmApiConnections[0].client_id,
35856 scope: "read_prefs write_prefs write_api read_gpx write_notes",
35857 redirect_uri: redirectPath + "land.html",
35858 loading: authLoading,
35861 _apiConnections = osmApiConnections;
35862 _imageryBlocklists = [/.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/];
35863 _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new RBush() };
35864 _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new RBush() };
35865 _userCache = { toLoad: {}, user: {} };
35867 _deferred = /* @__PURE__ */ new Set();
35871 _maxWayNodes = 2e3;
35873 node: function nodeData(obj, uid) {
35874 return new osmNode({
35876 visible: typeof obj.visible === "boolean" ? obj.visible : true,
35877 version: obj.version && obj.version.toString(),
35878 changeset: obj.changeset && obj.changeset.toString(),
35879 timestamp: obj.timestamp,
35881 uid: obj.uid && obj.uid.toString(),
35882 loc: [Number(obj.lon), Number(obj.lat)],
35886 way: function wayData(obj, uid) {
35887 return new osmWay({
35889 visible: typeof obj.visible === "boolean" ? obj.visible : true,
35890 version: obj.version && obj.version.toString(),
35891 changeset: obj.changeset && obj.changeset.toString(),
35892 timestamp: obj.timestamp,
35894 uid: obj.uid && obj.uid.toString(),
35896 nodes: getNodesJSON(obj)
35899 relation: function relationData(obj, uid) {
35900 return new osmRelation({
35902 visible: typeof obj.visible === "boolean" ? obj.visible : true,
35903 version: obj.version && obj.version.toString(),
35904 changeset: obj.changeset && obj.changeset.toString(),
35905 timestamp: obj.timestamp,
35907 uid: obj.uid && obj.uid.toString(),
35909 members: getMembersJSON(obj)
35912 user: function parseUser(obj, uid) {
35915 display_name: obj.display_name,
35916 account_created: obj.account_created,
35917 image_url: obj.img && obj.img.href,
35918 changesets_count: obj.changesets && obj.changesets.count && obj.changesets.count.toString() || "0",
35919 active_blocks: obj.blocks && obj.blocks.received && obj.blocks.received.active && obj.blocks.received.active.toString() || "0"
35924 node: function nodeData2(obj, uid) {
35925 var attrs = obj.attributes;
35926 return new osmNode({
35928 visible: getVisible(attrs),
35929 version: attrs.version.value,
35930 changeset: attrs.changeset && attrs.changeset.value,
35931 timestamp: attrs.timestamp && attrs.timestamp.value,
35932 user: attrs.user && attrs.user.value,
35933 uid: attrs.uid && attrs.uid.value,
35934 loc: getLoc(attrs),
35938 way: function wayData2(obj, uid) {
35939 var attrs = obj.attributes;
35940 return new osmWay({
35942 visible: getVisible(attrs),
35943 version: attrs.version.value,
35944 changeset: attrs.changeset && attrs.changeset.value,
35945 timestamp: attrs.timestamp && attrs.timestamp.value,
35946 user: attrs.user && attrs.user.value,
35947 uid: attrs.uid && attrs.uid.value,
35948 tags: getTags(obj),
35949 nodes: getNodes(obj)
35952 relation: function relationData2(obj, uid) {
35953 var attrs = obj.attributes;
35954 return new osmRelation({
35956 visible: getVisible(attrs),
35957 version: attrs.version.value,
35958 changeset: attrs.changeset && attrs.changeset.value,
35959 timestamp: attrs.timestamp && attrs.timestamp.value,
35960 user: attrs.user && attrs.user.value,
35961 uid: attrs.uid && attrs.uid.value,
35962 tags: getTags(obj),
35963 members: getMembers(obj)
35966 note: function parseNote(obj, uid) {
35967 var attrs = obj.attributes;
35968 var childNodes = obj.childNodes;
35971 props.loc = getLoc(attrs);
35972 if (!_noteCache.note[uid]) {
35973 let coincident = false;
35974 const epsilon3 = 1e-5;
35977 props.loc = geoVecAdd(props.loc, [epsilon3, epsilon3]);
35979 const bbox2 = geoExtent(props.loc).bbox();
35980 coincident = _noteCache.rtree.search(bbox2).length;
35981 } while (coincident);
35983 props.loc = _noteCache.note[uid].loc;
35985 for (var i3 = 0; i3 < childNodes.length; i3++) {
35986 var node = childNodes[i3];
35987 var nodeName = node.nodeName;
35988 if (nodeName === "#text") continue;
35989 if (nodeName === "comments") {
35990 props[nodeName] = parseComments(node.childNodes);
35992 props[nodeName] = node.textContent;
35995 var note = new osmNote(props);
35996 var item = encodeNoteRtree(note);
35997 _noteCache.note[note.id] = note;
35998 updateRtree3(item, true);
36001 user: function parseUser2(obj, uid) {
36002 var attrs = obj.attributes;
36005 display_name: attrs.display_name && attrs.display_name.value,
36006 account_created: attrs.account_created && attrs.account_created.value,
36007 changesets_count: "0",
36010 var img = obj.getElementsByTagName("img");
36011 if (img && img[0] && img[0].getAttribute("href")) {
36012 user.image_url = img[0].getAttribute("href");
36014 var changesets = obj.getElementsByTagName("changesets");
36015 if (changesets && changesets[0] && changesets[0].getAttribute("count")) {
36016 user.changesets_count = changesets[0].getAttribute("count");
36018 var blocks = obj.getElementsByTagName("blocks");
36019 if (blocks && blocks[0]) {
36020 var received = blocks[0].getElementsByTagName("received");
36021 if (received && received[0] && received[0].getAttribute("active")) {
36022 user.active_blocks = received[0].getAttribute("active");
36025 _userCache.user[uid] = user;
36026 delete _userCache.toLoad[uid];
36032 utilRebind(this, dispatch9, "on");
36034 reset: function() {
36035 Array.from(_deferred).forEach(function(handle) {
36036 window.cancelIdleCallback(handle);
36037 _deferred.delete(handle);
36040 _userChangesets = void 0;
36041 _userDetails = void 0;
36042 _rateLimitError = void 0;
36043 Object.values(_tileCache.inflight).forEach(abortRequest4);
36044 Object.values(_noteCache.inflight).forEach(abortRequest4);
36045 Object.values(_noteCache.inflightPost).forEach(abortRequest4);
36046 if (_changeset.inflight) abortRequest4(_changeset.inflight);
36047 _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new RBush() };
36048 _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new RBush() };
36049 _userCache = { toLoad: {}, user: {} };
36050 _cachedApiStatus = void 0;
36054 getConnectionId: function() {
36055 return _connectionID;
36057 getUrlRoot: function() {
36060 getApiUrlRoot: function() {
36063 changesetURL: function(changesetID) {
36064 return urlroot + "/changeset/" + changesetID;
36066 changesetsURL: function(center, zoom) {
36067 var precision3 = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
36068 return urlroot + "/history#map=" + Math.floor(zoom) + "/" + center[1].toFixed(precision3) + "/" + center[0].toFixed(precision3);
36070 entityURL: function(entity) {
36071 return urlroot + "/" + entity.type + "/" + entity.osmId();
36073 historyURL: function(entity) {
36074 return urlroot + "/" + entity.type + "/" + entity.osmId() + "/history";
36076 userURL: function(username) {
36077 return urlroot + "/user/" + encodeURIComponent(username);
36079 noteURL: function(note) {
36080 return urlroot + "/note/" + note.id;
36082 noteReportURL: function(note) {
36083 return urlroot + "/reports/new?reportable_type=Note&reportable_id=" + note.id;
36085 // Generic method to load data from the OSM API
36086 // Can handle either auth or unauth calls.
36087 loadFromAPI: function(path, callback, options) {
36088 options = Object.assign({ skipSeen: true }, options);
36090 var cid = _connectionID;
36091 function done(err, payload) {
36092 if (that.getConnectionId() !== cid) {
36093 if (callback) callback({ message: "Connection Switched", status: -1 });
36096 if (err && _cachedApiStatus === "online" || !err && _cachedApiStatus !== "online") {
36097 that.reloadApiStatus();
36101 console.error("API error:", err);
36102 return callback(err);
36104 if (path.indexOf(".json") !== -1) {
36105 return parseJSON(payload, callback, options);
36107 return parseXML(payload, callback, options);
36112 if (this.authenticated()) {
36118 var url = apiUrlroot + path;
36119 var controller = new AbortController();
36121 if (path.indexOf(".json") !== -1) {
36126 fn(url, { signal: controller.signal }).then(function(data) {
36128 }).catch(function(err) {
36129 if (err.name === "AbortError") return;
36130 var match = err.message.match(/^\d{3}/);
36132 done({ status: +match[0], statusText: err.message });
36140 // Load a single entity by id (ways and relations use the `/full` call to include
36141 // nodes and members). Parent relations are not included, see `loadEntityRelations`.
36142 // GET /api/0.6/node/#id
36143 // GET /api/0.6/[way|relation]/#id/full
36144 loadEntity: function(id2, callback) {
36145 var type2 = osmEntity.id.type(id2);
36146 var osmID = osmEntity.id.toOSM(id2);
36147 var options = { skipSeen: false };
36149 "/api/0.6/" + type2 + "/" + osmID + (type2 !== "node" ? "/full" : "") + ".json",
36150 function(err, entities) {
36151 if (callback) callback(err, { data: entities });
36156 // Load a single note by id , XML format
36157 // GET /api/0.6/notes/#id
36158 loadEntityNote: function(id2, callback) {
36159 var options = { skipSeen: false };
36161 "/api/0.6/notes/" + id2,
36162 function(err, entities) {
36163 if (callback) callback(err, { data: entities });
36168 // Load a single entity with a specific version
36169 // GET /api/0.6/[node|way|relation]/#id/#version
36170 loadEntityVersion: function(id2, version, callback) {
36171 var type2 = osmEntity.id.type(id2);
36172 var osmID = osmEntity.id.toOSM(id2);
36173 var options = { skipSeen: false };
36175 "/api/0.6/" + type2 + "/" + osmID + "/" + version + ".json",
36176 function(err, entities) {
36177 if (callback) callback(err, { data: entities });
36182 // Load the relations of a single entity with the given.
36183 // GET /api/0.6/[node|way|relation]/#id/relations
36184 loadEntityRelations: function(id2, callback) {
36185 var type2 = osmEntity.id.type(id2);
36186 var osmID = osmEntity.id.toOSM(id2);
36187 var options = { skipSeen: false };
36189 "/api/0.6/" + type2 + "/" + osmID + "/relations.json",
36190 function(err, entities) {
36191 if (callback) callback(err, { data: entities });
36196 // Load multiple entities in chunks
36197 // (note: callback may be called multiple times)
36198 // Unlike `loadEntity`, child nodes and members are not fetched
36199 // GET /api/0.6/[nodes|ways|relations]?#parameters
36200 loadMultiple: function(ids, callback) {
36202 var groups = utilArrayGroupBy(utilArrayUniq(ids), osmEntity.id.type);
36203 Object.keys(groups).forEach(function(k2) {
36204 var type2 = k2 + "s";
36205 var osmIDs = groups[k2].map(function(id2) {
36206 return osmEntity.id.toOSM(id2);
36208 var options = { skipSeen: false };
36209 utilArrayChunk(osmIDs, 150).forEach(function(arr) {
36211 "/api/0.6/" + type2 + ".json?" + type2 + "=" + arr.join(),
36212 function(err, entities) {
36213 if (callback) callback(err, { data: entities });
36220 // Create, upload, and close a changeset
36221 // PUT /api/0.6/changeset/create
36222 // POST /api/0.6/changeset/#id/upload
36223 // PUT /api/0.6/changeset/#id/close
36224 putChangeset: function(changeset, changes, callback) {
36225 var cid = _connectionID;
36226 if (_changeset.inflight) {
36227 return callback({ message: "Changeset already inflight", status: -2 }, changeset);
36228 } else if (_changeset.open) {
36229 return createdChangeset.call(this, null, _changeset.open);
36233 path: "/api/0.6/changeset/create",
36234 headers: { "Content-Type": "text/xml" },
36235 content: JXON.stringify(changeset.asJXON())
36237 _changeset.inflight = oauth.xhr(
36239 wrapcb(this, createdChangeset, cid)
36242 function createdChangeset(err, changesetID) {
36243 _changeset.inflight = null;
36245 return callback(err, changeset);
36247 _changeset.open = changesetID;
36248 changeset = changeset.update({ id: changesetID });
36251 path: "/api/0.6/changeset/" + changesetID + "/upload",
36252 headers: { "Content-Type": "text/xml" },
36253 content: JXON.stringify(changeset.osmChangeJXON(changes))
36255 _changeset.inflight = oauth.xhr(
36257 wrapcb(this, uploadedChangeset, cid)
36260 function uploadedChangeset(err) {
36261 _changeset.inflight = null;
36262 if (err) return callback(err, changeset);
36263 window.setTimeout(function() {
36264 callback(null, changeset);
36266 _changeset.open = null;
36267 if (this.getConnectionId() === cid) {
36270 path: "/api/0.6/changeset/" + changeset.id + "/close",
36271 headers: { "Content-Type": "text/xml" }
36278 /** updates the tags on an existing unclosed changeset */
36279 // PUT /api/0.6/changeset/#id
36280 updateChangesetTags: (changeset) => {
36281 return oauth.fetch(`${oauth.options().apiUrl}/api/0.6/changeset/${changeset.id}`, {
36283 headers: { "Content-Type": "text/xml" },
36284 body: JXON.stringify(changeset.asJXON())
36287 // Load multiple users in chunks
36288 // (note: callback may be called multiple times)
36289 // GET /api/0.6/users?users=#id1,#id2,...,#idn
36290 loadUsers: function(uids, callback) {
36293 utilArrayUniq(uids).forEach(function(uid) {
36294 if (_userCache.user[uid]) {
36295 delete _userCache.toLoad[uid];
36296 cached.push(_userCache.user[uid]);
36301 if (cached.length || !this.authenticated()) {
36302 callback(void 0, cached);
36303 if (!this.authenticated()) return;
36305 utilArrayChunk(toLoad, 150).forEach((function(arr) {
36308 path: "/api/0.6/users.json?users=" + arr.join()
36309 }, wrapcb(this, done, _connectionID));
36311 function done(err, payload) {
36312 if (err) return callback(err);
36313 var options = { skipSeen: true };
36314 return parseUserJSON(payload, function(err2, results) {
36315 if (err2) return callback(err2);
36316 return callback(void 0, results);
36320 // Load a given user by id
36321 // GET /api/0.6/user/#id
36322 loadUser: function(uid, callback) {
36323 if (_userCache.user[uid] || !this.authenticated()) {
36324 delete _userCache.toLoad[uid];
36325 return callback(void 0, _userCache.user[uid]);
36329 path: "/api/0.6/user/" + uid + ".json"
36330 }, wrapcb(this, done, _connectionID));
36331 function done(err, payload) {
36332 if (err) return callback(err);
36333 var options = { skipSeen: true };
36334 return parseUserJSON(payload, function(err2, results) {
36335 if (err2) return callback(err2);
36336 return callback(void 0, results[0]);
36340 // Load the details of the logged-in user
36341 // GET /api/0.6/user/details
36342 userDetails: function(callback) {
36343 if (_userDetails) {
36344 return callback(void 0, _userDetails);
36348 path: "/api/0.6/user/details.json"
36349 }, wrapcb(this, done, _connectionID));
36350 function done(err, payload) {
36351 if (err) return callback(err);
36352 var options = { skipSeen: false };
36353 return parseUserJSON(payload, function(err2, results) {
36354 if (err2) return callback(err2);
36355 _userDetails = results[0];
36356 return callback(void 0, _userDetails);
36360 // Load previous changesets for the logged in user
36361 // GET /api/0.6/changesets?user=#id
36362 userChangesets: function(callback) {
36363 if (_userChangesets) {
36364 return callback(void 0, _userChangesets);
36367 wrapcb(this, gotDetails, _connectionID)
36369 function gotDetails(err, user) {
36371 return callback(err);
36375 path: "/api/0.6/changesets?user=" + user.id
36376 }, wrapcb(this, done, _connectionID));
36378 function done(err, xml) {
36380 return callback(err);
36382 _userChangesets = Array.prototype.map.call(
36383 xml.getElementsByTagName("changeset"),
36384 function(changeset) {
36385 return { tags: getTags(changeset) };
36387 ).filter(function(changeset) {
36388 var comment = changeset.tags.comment;
36389 return comment && comment !== "";
36391 return callback(void 0, _userChangesets);
36394 // Fetch the status of the OSM API
36395 // GET /api/capabilities
36396 status: function(callback) {
36397 var url = apiUrlroot + "/api/capabilities";
36398 var errback = wrapcb(this, done, _connectionID);
36399 xml_default(url).then(function(data) {
36400 errback(null, data);
36401 }).catch(function(err) {
36402 errback(err.message);
36404 function done(err, xml) {
36406 return callback(err, null);
36408 var elements = xml.getElementsByTagName("blacklist");
36410 for (var i3 = 0; i3 < elements.length; i3++) {
36411 var regexString = elements[i3].getAttribute("regex");
36414 var regex = new RegExp(regexString, "i");
36415 regexes.push(regex);
36420 if (regexes.length) {
36421 _imageryBlocklists = regexes;
36423 if (_rateLimitError) {
36424 return callback(_rateLimitError, "rateLimited");
36426 var waynodes = xml.getElementsByTagName("waynodes");
36427 var maxWayNodes = waynodes.length && parseInt(waynodes[0].getAttribute("maximum"), 10);
36428 if (maxWayNodes && isFinite(maxWayNodes)) _maxWayNodes = maxWayNodes;
36429 var apiStatus = xml.getElementsByTagName("status");
36430 var val = apiStatus[0].getAttribute("api");
36431 return callback(void 0, val);
36435 // Calls `status` and dispatches an `apiStatusChange` event if the returned
36436 // status differs from the cached status.
36437 reloadApiStatus: function() {
36438 if (!this.throttledReloadApiStatus) {
36440 this.throttledReloadApiStatus = throttle_default(function() {
36441 that.status(function(err, status) {
36442 if (status !== _cachedApiStatus) {
36443 _cachedApiStatus = status;
36444 dispatch9.call("apiStatusChange", that, err, status);
36449 this.throttledReloadApiStatus();
36451 // Returns the maximum number of nodes a single way can have
36452 maxWayNodes: function() {
36453 return _maxWayNodes;
36455 // Load data (entities) from the API in tiles
36456 // GET /api/0.6/map?bbox=
36457 loadTiles: function(projection2, callback) {
36459 var tiles = tiler5.zoomExtent([_tileZoom3, _tileZoom3]).getTiles(projection2);
36460 var hadRequests = hasInflightRequests(_tileCache);
36461 abortUnwantedRequests3(_tileCache, tiles);
36462 if (hadRequests && !hasInflightRequests(_tileCache)) {
36463 if (_rateLimitError) {
36464 _rateLimitError = void 0;
36465 dispatch9.call("change");
36466 this.reloadApiStatus();
36468 dispatch9.call("loaded");
36470 tiles.forEach(function(tile) {
36471 this.loadTile(tile, callback);
36474 // Load a single data tile
36475 // GET /api/0.6/map?bbox=
36476 loadTile: function(tile, callback) {
36478 if (_tileCache.loaded[tile.id] || _tileCache.inflight[tile.id]) return;
36479 if (!hasInflightRequests(_tileCache)) {
36480 dispatch9.call("loading");
36482 var path = "/api/0.6/map.json?bbox=";
36483 var options = { skipSeen: true };
36484 _tileCache.inflight[tile.id] = this.loadFromAPI(
36485 path + tile.extent.toParam(),
36486 tileCallback.bind(this),
36489 function tileCallback(err, parsed) {
36491 delete _tileCache.inflight[tile.id];
36492 delete _tileCache.toLoad[tile.id];
36493 _tileCache.loaded[tile.id] = true;
36494 var bbox2 = tile.extent.bbox();
36495 bbox2.id = tile.id;
36496 _tileCache.rtree.insert(bbox2);
36498 if (!_rateLimitError && err.status === 509 || err.status === 429) {
36499 _rateLimitError = err;
36500 dispatch9.call("change");
36501 this.reloadApiStatus();
36504 delete _tileCache.inflight[tile.id];
36505 this.loadTile(tile, callback);
36509 callback(err, Object.assign({ data: parsed }, tile));
36511 if (!hasInflightRequests(_tileCache)) {
36512 if (_rateLimitError) {
36513 _rateLimitError = void 0;
36514 dispatch9.call("change");
36515 this.reloadApiStatus();
36517 dispatch9.call("loaded");
36521 isDataLoaded: function(loc) {
36522 var bbox2 = { minX: loc[0], minY: loc[1], maxX: loc[0], maxY: loc[1] };
36523 return _tileCache.rtree.collides(bbox2);
36525 // load the tile that covers the given `loc`
36526 loadTileAtLoc: function(loc, callback) {
36527 if (Object.keys(_tileCache.toLoad).length > 50) return;
36528 var k2 = geoZoomToScale(_tileZoom3 + 1);
36529 var offset = geoRawMercator().scale(k2)(loc);
36530 var projection2 = geoRawMercator().transform({ k: k2, x: -offset[0], y: -offset[1] });
36531 var tiles = tiler5.zoomExtent([_tileZoom3, _tileZoom3]).getTiles(projection2);
36532 tiles.forEach(function(tile) {
36533 if (_tileCache.toLoad[tile.id] || _tileCache.loaded[tile.id] || _tileCache.inflight[tile.id]) return;
36534 _tileCache.toLoad[tile.id] = true;
36535 this.loadTile(tile, callback);
36538 // Load notes from the API in tiles
36539 // GET /api/0.6/notes?bbox=
36540 loadNotes: function(projection2, noteOptions) {
36541 noteOptions = Object.assign({ limit: 1e4, closed: 7 }, noteOptions);
36544 var path = "/api/0.6/notes?limit=" + noteOptions.limit + "&closed=" + noteOptions.closed + "&bbox=";
36545 var throttleLoadUsers = throttle_default(function() {
36546 var uids = Object.keys(_userCache.toLoad);
36547 if (!uids.length) return;
36548 that.loadUsers(uids, function() {
36551 var tiles = tiler5.zoomExtent([_noteZoom, _noteZoom]).getTiles(projection2);
36552 abortUnwantedRequests3(_noteCache, tiles);
36553 tiles.forEach(function(tile) {
36554 if (_noteCache.loaded[tile.id] || _noteCache.inflight[tile.id]) return;
36555 var options = { skipSeen: false };
36556 _noteCache.inflight[tile.id] = that.loadFromAPI(
36557 path + tile.extent.toParam(),
36559 delete _noteCache.inflight[tile.id];
36561 _noteCache.loaded[tile.id] = true;
36563 throttleLoadUsers();
36564 dispatch9.call("loadedNotes");
36571 // POST /api/0.6/notes?params
36572 postNoteCreate: function(note, callback) {
36573 if (!this.authenticated()) {
36574 return callback({ message: "Not Authenticated", status: -3 }, note);
36576 if (_noteCache.inflightPost[note.id]) {
36577 return callback({ message: "Note update already inflight", status: -2 }, note);
36579 if (!note.loc[0] || !note.loc[1] || !note.newComment) return;
36580 var comment = note.newComment;
36581 if (note.newCategory && note.newCategory !== "None") {
36582 comment += " #" + note.newCategory;
36584 var path = "/api/0.6/notes?" + utilQsString({ lon: note.loc[0], lat: note.loc[1], text: comment });
36585 _noteCache.inflightPost[note.id] = oauth.xhr({
36588 }, wrapcb(this, done, _connectionID));
36589 function done(err, xml) {
36590 delete _noteCache.inflightPost[note.id];
36592 return callback(err);
36594 this.removeNote(note);
36595 var options = { skipSeen: false };
36596 return parseXML(xml, function(err2, results) {
36598 return callback(err2);
36600 return callback(void 0, results[0]);
36606 // POST /api/0.6/notes/#id/comment?text=comment
36607 // POST /api/0.6/notes/#id/close?text=comment
36608 // POST /api/0.6/notes/#id/reopen?text=comment
36609 postNoteUpdate: function(note, newStatus, callback) {
36610 if (!this.authenticated()) {
36611 return callback({ message: "Not Authenticated", status: -3 }, note);
36613 if (_noteCache.inflightPost[note.id]) {
36614 return callback({ message: "Note update already inflight", status: -2 }, note);
36617 if (note.status !== "closed" && newStatus === "closed") {
36619 } else if (note.status !== "open" && newStatus === "open") {
36622 action = "comment";
36623 if (!note.newComment) return;
36625 var path = "/api/0.6/notes/" + note.id + "/" + action;
36626 if (note.newComment) {
36627 path += "?" + utilQsString({ text: note.newComment });
36629 _noteCache.inflightPost[note.id] = oauth.xhr({
36632 }, wrapcb(this, done, _connectionID));
36633 function done(err, xml) {
36634 delete _noteCache.inflightPost[note.id];
36636 return callback(err);
36638 this.removeNote(note);
36639 if (action === "close") {
36640 _noteCache.closed[note.id] = true;
36641 } else if (action === "reopen") {
36642 delete _noteCache.closed[note.id];
36644 var options = { skipSeen: false };
36645 return parseXML(xml, function(err2, results) {
36647 return callback(err2);
36649 return callback(void 0, results[0]);
36654 /* connection options for source switcher (optional) */
36655 apiConnections: function(val) {
36656 if (!arguments.length) return _apiConnections;
36657 _apiConnections = val;
36660 switch: function(newOptions) {
36661 urlroot = newOptions.url;
36662 apiUrlroot = newOptions.apiUrl || urlroot;
36663 if (newOptions.url && !newOptions.apiUrl) {
36666 apiUrl: newOptions.url
36669 const oldOptions = utilObjectOmit(oauth.options(), "access_token");
36670 oauth.options({ ...oldOptions, ...newOptions });
36672 this.userChangesets(function() {
36674 dispatch9.call("change");
36677 toggle: function(val) {
36681 isChangesetInflight: function() {
36682 return !!_changeset.inflight;
36684 // get/set cached data
36685 // This is used to save/restore the state when entering/exiting the walkthrough
36686 // Also used for testing purposes.
36687 caches: function(obj) {
36688 function cloneCache(source) {
36690 Object.keys(source).forEach(function(k2) {
36691 if (k2 === "rtree") {
36692 target.rtree = new RBush().fromJSON(source.rtree.toJSON());
36693 } else if (k2 === "note") {
36695 Object.keys(source.note).forEach(function(id2) {
36696 target.note[id2] = osmNote(source.note[id2]);
36699 target[k2] = JSON.parse(JSON.stringify(source[k2]));
36704 if (!arguments.length) {
36706 tile: cloneCache(_tileCache),
36707 note: cloneCache(_noteCache),
36708 user: cloneCache(_userCache)
36711 if (obj === "get") {
36719 _tileCache = obj.tile;
36720 _tileCache.inflight = {};
36723 _noteCache = obj.note;
36724 _noteCache.inflight = {};
36725 _noteCache.inflightPost = {};
36728 _userCache = obj.user;
36732 logout: function() {
36733 _userChangesets = void 0;
36734 _userDetails = void 0;
36736 dispatch9.call("change");
36739 authenticated: function() {
36740 return oauth.authenticated();
36742 /** @param {import('osm-auth').LoginOptions} options */
36743 authenticate: function(callback, options) {
36745 var cid = _connectionID;
36746 _userChangesets = void 0;
36747 _userDetails = void 0;
36748 function done(err, res) {
36750 if (callback) callback(err);
36753 if (that.getConnectionId() !== cid) {
36754 if (callback) callback({ message: "Connection Switched", status: -1 });
36757 _rateLimitError = void 0;
36758 dispatch9.call("change");
36759 if (callback) callback(err, res);
36760 that.userChangesets(function() {
36764 ...oauth.options(),
36765 locale: _mainLocalizer.localeCode()
36767 oauth.authenticate(done, options);
36769 imageryBlocklists: function() {
36770 return _imageryBlocklists;
36772 tileZoom: function(val) {
36773 if (!arguments.length) return _tileZoom3;
36777 // get all cached notes covering the viewport
36778 notes: function(projection2) {
36779 var viewport = projection2.clipExtent();
36780 var min3 = [viewport[0][0], viewport[1][1]];
36781 var max3 = [viewport[1][0], viewport[0][1]];
36782 var bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
36783 return _noteCache.rtree.search(bbox2).map(function(d4) {
36787 // get a single note from the cache
36788 getNote: function(id2) {
36789 return _noteCache.note[id2];
36791 // remove a single note from the cache
36792 removeNote: function(note) {
36793 if (!(note instanceof osmNote) || !note.id) return;
36794 delete _noteCache.note[note.id];
36795 updateRtree3(encodeNoteRtree(note), false);
36797 // replace a single note in the cache
36798 replaceNote: function(note) {
36799 if (!(note instanceof osmNote) || !note.id) return;
36800 _noteCache.note[note.id] = note;
36801 updateRtree3(encodeNoteRtree(note), true);
36804 // Get an array of note IDs closed during this session.
36805 // Used to populate `closed:note` changeset tag
36806 getClosedIDs: function() {
36807 return Object.keys(_noteCache.closed).sort();
36813 // modules/services/osm_wikibase.js
36814 var osm_wikibase_exports = {};
36815 __export(osm_wikibase_exports, {
36816 default: () => osm_wikibase_default
36818 function request(url, callback) {
36819 if (_inflight2[url]) return;
36820 var controller = new AbortController();
36821 _inflight2[url] = controller;
36822 json_default(url, { signal: controller.signal }).then(function(result) {
36823 delete _inflight2[url];
36824 if (callback) callback(null, result);
36825 }).catch(function(err) {
36826 delete _inflight2[url];
36827 if (err.name === "AbortError") return;
36828 if (callback) callback(err.message);
36831 var apibase3, _inflight2, _wikibaseCache, _localeIDs, debouncedRequest, osm_wikibase_default;
36832 var init_osm_wikibase = __esm({
36833 "modules/services/osm_wikibase.js"() {
36839 apibase3 = "https://wiki.openstreetmap.org/w/api.php";
36841 _wikibaseCache = {};
36842 _localeIDs = { en: false };
36843 debouncedRequest = debounce_default(request, 500, { leading: false });
36844 osm_wikibase_default = {
36847 _wikibaseCache = {};
36850 reset: function() {
36851 Object.values(_inflight2).forEach(function(controller) {
36852 controller.abort();
36857 * Get the best value for the property, or undefined if not found
36858 * @param entity object from wikibase
36859 * @param property string e.g. 'P4' for image
36860 * @param langCode string e.g. 'fr' for French
36862 claimToValue: function(entity, property, langCode) {
36863 if (!entity.claims[property]) return void 0;
36864 var locale3 = _localeIDs[langCode];
36865 var preferredPick, localePick;
36866 entity.claims[property].forEach(function(stmt) {
36867 if (!preferredPick && stmt.rank === "preferred") {
36868 preferredPick = stmt;
36870 if (locale3 && stmt.qualifiers && stmt.qualifiers.P26 && stmt.qualifiers.P26[0].datavalue.value.id === locale3) {
36874 var result = localePick || preferredPick;
36876 var datavalue = result.mainsnak.datavalue;
36877 return datavalue.type === "wikibase-entityid" ? datavalue.value.id : datavalue.value;
36883 * Convert monolingual property into a key-value object (language -> value)
36884 * @param entity object from wikibase
36885 * @param property string e.g. 'P31' for monolingual wiki page title
36887 monolingualClaimToValueObj: function(entity, property) {
36888 if (!entity || !entity.claims[property]) return void 0;
36889 return entity.claims[property].reduce(function(acc, obj) {
36890 var value = obj.mainsnak.datavalue.value;
36891 acc[value.language] = value.text;
36895 toSitelink: function(key, value) {
36896 var result = value ? "Tag:" + key + "=" + value : "Key:" + key;
36897 return result.replace(/_/g, " ").trim();
36900 * Converts text like `tag:...=...` into clickable links
36902 * @param {string} unsafeText - unsanitized text
36904 linkifyWikiText(unsafeText) {
36905 return (selection2) => {
36906 const segments = unsafeText.split(/(key|tag):([\w-]+)(=([\w-]+))?/g);
36907 for (let i3 = 0; i3 < segments.length; i3 += 5) {
36908 const [plainText, , key, , value] = segments.slice(i3);
36910 selection2.append("span").text(plainText);
36913 selection2.append("a").attr("href", `https://wiki.openstreetmap.org/wiki/${this.toSitelink(key, value)}`).attr("target", "_blank").attr("rel", "noreferrer").append("code").text(`${key}=${value || "*"}`);
36919 // Pass params object of the form:
36922 // value: 'string',
36923 // langCode: 'string'
36926 getEntity: function(params, callback) {
36927 var doRequest = params.debounce ? debouncedRequest : request;
36931 var rtypeSitelink = params.key === "type" && params.value ? ("Relation:" + params.value).replace(/_/g, " ").trim() : false;
36932 var keySitelink = params.key ? this.toSitelink(params.key) : false;
36933 var tagSitelink = params.key && params.value ? this.toSitelink(params.key, params.value) : false;
36934 const localeSitelinks = [];
36935 if (params.langCodes) {
36936 params.langCodes.forEach(function(langCode) {
36937 if (_localeIDs[langCode] === void 0) {
36938 let localeSitelink = ("Locale:" + langCode).replace(/_/g, " ").trim();
36939 titles.push(localeSitelink);
36940 that.addLocale(langCode, false);
36944 if (rtypeSitelink) {
36945 if (_wikibaseCache[rtypeSitelink]) {
36946 result.rtype = _wikibaseCache[rtypeSitelink];
36948 titles.push(rtypeSitelink);
36952 if (_wikibaseCache[keySitelink]) {
36953 result.key = _wikibaseCache[keySitelink];
36955 titles.push(keySitelink);
36959 if (_wikibaseCache[tagSitelink]) {
36960 result.tag = _wikibaseCache[tagSitelink];
36962 titles.push(tagSitelink);
36965 if (!titles.length) {
36966 return callback(null, result);
36969 action: "wbgetentities",
36971 titles: titles.join("|"),
36972 languages: params.langCodes.join("|"),
36973 languagefallback: 1,
36976 // There is an MW Wikibase API bug https://phabricator.wikimedia.org/T212069
36977 // We shouldn't use v1 until it gets fixed, but should switch to it afterwards
36978 // formatversion: 2,
36980 var url = apibase3 + "?" + utilQsString(obj);
36981 doRequest(url, function(err, d4) {
36984 } else if (!d4.success || d4.error) {
36985 callback(d4.error.messages.map(function(v3) {
36986 return v3.html["*"];
36989 Object.values(d4.entities).forEach(function(res) {
36990 if (res.missing !== "") {
36991 var title = res.sitelinks.wiki.title;
36992 if (title === rtypeSitelink) {
36993 _wikibaseCache[rtypeSitelink] = res;
36994 result.rtype = res;
36995 } else if (title === keySitelink) {
36996 _wikibaseCache[keySitelink] = res;
36998 } else if (title === tagSitelink) {
36999 _wikibaseCache[tagSitelink] = res;
37001 } else if (localeSitelinks.includes(title)) {
37002 const langCode = title.replace(/ /g, "_").replace(/^Locale:/, "");
37003 that.addLocale(langCode, res.id);
37005 console.log("Unexpected title " + title);
37009 callback(null, result);
37014 // Pass params object of the form:
37016 // key: 'string', // required
37017 // value: 'string' // optional
37020 // Get an result object used to display tag documentation
37022 // title: 'string',
37023 // description: 'string',
37024 // editURL: 'string',
37025 // imageURL: 'string',
37026 // wiki: { title: 'string', text: 'string', url: 'string' }
37029 getDocs: function(params, callback) {
37031 var langCodes = _mainLocalizer.localeCodes().map(function(code) {
37032 return code.toLowerCase();
37034 params.langCodes = langCodes;
37035 this.getEntity(params, function(err, data) {
37040 var entity = data.rtype || data.tag || data.key;
37042 callback("No entity");
37047 for (i3 in langCodes) {
37048 let code2 = langCodes[i3];
37049 if (entity.descriptions[code2] && entity.descriptions[code2].language === code2) {
37050 description = entity.descriptions[code2];
37054 if (!description && Object.values(entity.descriptions).length) description = Object.values(entity.descriptions)[0];
37056 title: entity.title,
37057 description: that.linkifyWikiText((description == null ? void 0 : description.value) || ""),
37058 descriptionLocaleCode: description ? description.language : "",
37059 editURL: "https://wiki.openstreetmap.org/wiki/" + entity.title
37061 if (entity.claims) {
37063 var image = that.claimToValue(entity, "P4", langCodes[0]);
37065 imageroot = "https://commons.wikimedia.org/w/index.php";
37067 image = that.claimToValue(entity, "P28", langCodes[0]);
37069 imageroot = "https://wiki.openstreetmap.org/w/index.php";
37072 if (imageroot && image) {
37073 result.imageURL = imageroot + "?" + utilQsString({
37074 title: "Special:Redirect/file/" + image,
37079 var rtypeWiki = that.monolingualClaimToValueObj(data.rtype, "P31");
37080 var tagWiki = that.monolingualClaimToValueObj(data.tag, "P31");
37081 var keyWiki = that.monolingualClaimToValueObj(data.key, "P31");
37082 var wikis = [rtypeWiki, tagWiki, keyWiki];
37083 for (i3 in wikis) {
37084 var wiki = wikis[i3];
37085 for (var j3 in langCodes) {
37086 var code = langCodes[j3];
37087 var referenceId = langCodes[0].split("-")[0] !== "en" && code.split("-")[0] === "en" ? "inspector.wiki_en_reference" : "inspector.wiki_reference";
37088 var info = getWikiInfo(wiki, code, referenceId);
37090 result.wiki = info;
37094 if (result.wiki) break;
37096 callback(null, result);
37097 function getWikiInfo(wiki2, langCode, tKey) {
37098 if (wiki2 && wiki2[langCode]) {
37100 title: wiki2[langCode],
37102 url: "https://wiki.openstreetmap.org/wiki/" + wiki2[langCode]
37108 addLocale: function(langCode, qid) {
37109 _localeIDs[langCode] = qid;
37111 apibase: function(val) {
37112 if (!arguments.length) return apibase3;
37120 // modules/services/streetside.js
37121 var streetside_exports = {};
37122 __export(streetside_exports, {
37123 default: () => streetside_default
37125 function abortRequest5(i3) {
37128 function localeTimestamp2(s2) {
37129 if (!s2) return null;
37130 const options = { day: "numeric", month: "short", year: "numeric" };
37131 const d4 = new Date(s2);
37132 if (isNaN(d4.getTime())) return null;
37133 return d4.toLocaleString(_mainLocalizer.localeCode(), options);
37135 function loadTiles3(which, url, projection2, margin) {
37136 const tiles = tiler6.margin(margin).getTiles(projection2);
37137 const cache = _ssCache[which];
37138 Object.keys(cache.inflight).forEach((k2) => {
37139 const wanted = tiles.find((tile) => k2.indexOf(tile.id + ",") === 0);
37141 abortRequest5(cache.inflight[k2]);
37142 delete cache.inflight[k2];
37145 tiles.forEach((tile) => loadNextTilePage2(which, url, tile));
37147 function loadNextTilePage2(which, url, tile) {
37148 const cache = _ssCache[which];
37149 const nextPage = cache.nextPage[tile.id] || 0;
37150 const id2 = tile.id + "," + String(nextPage);
37151 if (cache.loaded[id2] || cache.inflight[id2]) return;
37152 cache.inflight[id2] = getBubbles(url, tile, (response) => {
37153 cache.loaded[id2] = true;
37154 delete cache.inflight[id2];
37155 if (!response) return;
37156 if (response.resourceSets[0].resources.length === maxResults2) {
37157 const split = tile.extent.split();
37158 loadNextTilePage2(which, url, { id: tile.id + ",a", extent: split[0] });
37159 loadNextTilePage2(which, url, { id: tile.id + ",b", extent: split[1] });
37160 loadNextTilePage2(which, url, { id: tile.id + ",c", extent: split[2] });
37161 loadNextTilePage2(which, url, { id: tile.id + ",d", extent: split[3] });
37163 const features = response.resourceSets[0].resources.map((bubble) => {
37164 const bubbleId = bubble.imageUrl;
37165 if (cache.points[bubbleId]) return null;
37167 bubble.lon || bubble.longitude,
37168 bubble.lat || bubble.latitude
37174 imageUrl: bubble.imageUrl.replace("{subdomain}", bubble.imageUrlSubdomains[0]),
37175 ca: bubble.he || bubble.heading,
37176 captured_at: bubble.vintageEnd,
37177 captured_by: "microsoft",
37181 cache.points[bubbleId] = d4;
37189 }).filter(Boolean);
37190 cache.rtree.load(features);
37191 if (which === "bubbles") {
37192 dispatch10.call("loadedImages");
37196 function getBubbles(url, tile, callback) {
37197 let rect = tile.extent.rectangle();
37198 let urlForRequest = url.replace("{key}", bubbleAppKey).replace("{bbox}", [rect[1], rect[0], rect[3], rect[2]].join(",")).replace("{count}", maxResults2);
37199 const controller = new AbortController();
37200 fetch(urlForRequest, { signal: controller.signal }).then(function(response) {
37201 if (!response.ok) {
37202 throw new Error(response.status + " " + response.statusText);
37204 return response.json();
37205 }).then(function(result) {
37209 return callback(result || []);
37210 }).catch(function(err) {
37211 if (err.name === "AbortError") {
37213 throw new Error(err);
37218 function partitionViewport4(projection2) {
37219 let z3 = geoScaleToZoom(projection2.scale());
37220 let z22 = Math.ceil(z3 * 2) / 2 + 2.5;
37221 let tiler8 = utilTiler().zoomExtent([z22, z22]);
37222 return tiler8.getTiles(projection2).map((tile) => tile.extent);
37224 function searchLimited4(limit, projection2, rtree) {
37225 limit = limit || 5;
37226 return partitionViewport4(projection2).reduce((result, extent) => {
37227 let found = rtree.search(extent.bbox()).slice(0, limit).map((d4) => d4.data);
37228 return found.length ? result.concat(found) : result;
37231 function loadImage2(imgInfo) {
37232 return new Promise((resolve) => {
37233 let img = new Image();
37234 img.onload = () => {
37235 let canvas = document.getElementById("ideditor-canvas" + imgInfo.face);
37236 let ctx = canvas.getContext("2d");
37237 ctx.drawImage(img, imgInfo.x, imgInfo.y);
37238 resolve({ imgInfo, status: "ok" });
37240 img.onerror = () => {
37241 resolve({ data: imgInfo, status: "error" });
37243 img.setAttribute("crossorigin", "");
37244 img.src = imgInfo.url;
37247 function loadCanvas(imageGroup) {
37248 return Promise.all(imageGroup.map(loadImage2)).then((data) => {
37249 let canvas = document.getElementById("ideditor-canvas" + data[0].imgInfo.face);
37250 const which = { "01": 0, "02": 1, "03": 2, "10": 3, "11": 4, "12": 5 };
37251 let face = data[0].imgInfo.face;
37252 _sceneOptions.cubeMap[which[face]] = canvas.toDataURL("image/jpeg", 1);
37253 return { status: "loadCanvas for face " + data[0].imgInfo.face + "ok" };
37256 function loadFaces(faceGroup) {
37257 return Promise.all(faceGroup.map(loadCanvas)).then(() => {
37258 return { status: "loadFaces done" };
37261 function setupCanvas(selection2, reset) {
37263 selection2.selectAll("#ideditor-stitcher-canvases").remove();
37265 selection2.selectAll("#ideditor-stitcher-canvases").data([0]).enter().append("div").attr("id", "ideditor-stitcher-canvases").attr("display", "none").selectAll("canvas").data(["canvas01", "canvas02", "canvas03", "canvas10", "canvas11", "canvas12"]).enter().append("canvas").attr("id", (d4) => "ideditor-" + d4).attr("width", _resolution).attr("height", _resolution);
37267 function qkToXY(qk) {
37271 for (let i3 = qk.length; i3 > 0; i3--) {
37272 const key = qk[i3 - 1];
37273 x2 += +(key === "1" || key === "3") * scale;
37274 y3 += +(key === "2" || key === "3") * scale;
37279 function getQuadKeys() {
37280 let dim = _resolution / 256;
37541 } else if (dim === 8) {
37608 } else if (dim === 4) {
37637 var streetsideApi, maxResults2, bubbleAppKey, pannellumViewerCSS2, pannellumViewerJS2, tileZoom3, tiler6, dispatch10, minHfov, maxHfov, defaultHfov, _hires, _resolution, _currScene, _ssCache, _pannellumViewer2, _sceneOptions, _loadViewerPromise4, streetside_default;
37638 var init_streetside = __esm({
37639 "modules/services/streetside.js"() {
37649 streetsideApi = "https://dev.virtualearth.net/REST/v1/Imagery/MetaData/Streetside?mapArea={bbox}&key={key}&count={count}&uriScheme=https";
37651 bubbleAppKey = utilAesDecrypt("5c875730b09c6b422433e807e1ff060b6536c791dbfffcffc4c6b18a1bdba1f14593d151adb50e19e1be1ab19aef813bf135d0f103475e5c724dec94389e45d0");
37652 pannellumViewerCSS2 = "pannellum/pannellum.css";
37653 pannellumViewerJS2 = "pannellum/pannellum.js";
37655 tiler6 = utilTiler().zoomExtent([tileZoom3, tileZoom3]).skipNullIsland(true);
37656 dispatch10 = dispatch_default("loadedImages", "viewerChanged");
37664 showFullscreenCtrl: false,
37674 streetside_default = {
37676 * init() initialize streetside.
37682 this.event = utilRebind(this, dispatch10, "on");
37685 * reset() reset the cache.
37687 reset: function() {
37689 Object.values(_ssCache.bubbles.inflight).forEach(abortRequest5);
37692 bubbles: { inflight: {}, loaded: {}, nextPage: {}, rtree: new RBush(), points: {} },
37699 bubbles: function(projection2) {
37701 return searchLimited4(limit, projection2, _ssCache.bubbles.rtree);
37703 cachedImage: function(imageKey) {
37704 return _ssCache.bubbles.points[imageKey];
37706 sequences: function(projection2) {
37707 const viewport = projection2.clipExtent();
37708 const min3 = [viewport[0][0], viewport[1][1]];
37709 const max3 = [viewport[1][0], viewport[0][1]];
37710 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
37713 _ssCache.bubbles.rtree.search(bbox2).forEach((d4) => {
37714 const key = d4.data.sequenceKey;
37715 if (key && !seen[key]) {
37717 results.push(_ssCache.sequences[key].geojson);
37725 loadBubbles: function(projection2, margin) {
37726 if (margin === void 0) margin = 2;
37727 loadTiles3("bubbles", streetsideApi, projection2, margin);
37729 viewer: function() {
37730 return _pannellumViewer2;
37732 initViewer: function() {
37733 if (!window.pannellum) return;
37734 if (_pannellumViewer2) return;
37736 const sceneID = _currScene.toString();
37738 "default": { firstScene: sceneID },
37741 options.scenes[sceneID] = _sceneOptions;
37742 _pannellumViewer2 = window.pannellum.viewer("ideditor-viewer-streetside", options);
37744 ensureViewerLoaded: function(context) {
37745 if (_loadViewerPromise4) return _loadViewerPromise4;
37746 let wrap2 = context.container().select(".photoviewer").selectAll(".ms-wrapper").data([0]);
37747 let wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper ms-wrapper").classed("hide", true);
37749 let pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
37750 wrapEnter.append("div").attr("id", "ideditor-viewer-streetside").on(pointerPrefix + "down.streetside", () => {
37751 select_default2(window).on(pointerPrefix + "move.streetside", () => {
37752 dispatch10.call("viewerChanged");
37754 }).on(pointerPrefix + "up.streetside pointercancel.streetside", () => {
37755 select_default2(window).on(pointerPrefix + "move.streetside", null);
37756 let t2 = timer((elapsed) => {
37757 dispatch10.call("viewerChanged");
37758 if (elapsed > 2e3) {
37762 }).append("div").attr("class", "photo-attribution fillD");
37763 let controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
37764 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
37765 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
37766 wrap2 = wrap2.merge(wrapEnter).call(setupCanvas, true);
37767 context.ui().photoviewer.on("resize.streetside", () => {
37768 if (_pannellumViewer2) {
37769 _pannellumViewer2.resize();
37772 _loadViewerPromise4 = new Promise((resolve, reject) => {
37773 let loadedCount = 0;
37774 function loaded() {
37776 if (loadedCount === 2) resolve();
37778 const head = select_default2("head");
37779 head.selectAll("#ideditor-streetside-viewercss").data([0]).enter().append("link").attr("id", "ideditor-streetside-viewercss").attr("rel", "stylesheet").attr("crossorigin", "anonymous").attr("href", context.asset(pannellumViewerCSS2)).on("load.serviceStreetside", loaded).on("error.serviceStreetside", function() {
37782 head.selectAll("#ideditor-streetside-viewerjs").data([0]).enter().append("script").attr("id", "ideditor-streetside-viewerjs").attr("crossorigin", "anonymous").attr("src", context.asset(pannellumViewerJS2)).on("load.serviceStreetside", loaded).on("error.serviceStreetside", function() {
37785 }).catch(function() {
37786 _loadViewerPromise4 = null;
37788 return _loadViewerPromise4;
37789 function step(stepBy) {
37791 let viewer = context.container().select(".photoviewer");
37792 let selected = viewer.empty() ? void 0 : viewer.datum();
37793 if (!selected) return;
37794 let nextID = stepBy === 1 ? selected.ne : selected.pr;
37795 let yaw = _pannellumViewer2.getYaw();
37796 let ca = selected.ca + yaw;
37797 let origin = selected.loc;
37800 origin[0] + geoMetersToLon(meters / 5, origin[1]),
37804 origin[0] + geoMetersToLon(meters / 2, origin[1]),
37805 origin[1] + geoMetersToLat(meters)
37808 origin[0] - geoMetersToLon(meters / 2, origin[1]),
37809 origin[1] + geoMetersToLat(meters)
37812 origin[0] - geoMetersToLon(meters / 5, origin[1]),
37815 let poly = [p1, p2, p3, p4, p1];
37816 let angle2 = (stepBy === 1 ? ca : ca + 180) * (Math.PI / 180);
37817 poly = geoRotate(poly, -angle2, origin);
37818 let extent = poly.reduce((extent2, point) => {
37819 return extent2.extend(geoExtent(point));
37821 let minDist = Infinity;
37822 _ssCache.bubbles.rtree.search(extent.bbox()).forEach((d4) => {
37823 if (d4.data.key === selected.key) return;
37824 if (!geoPointInPolygon(d4.data.loc, poly)) return;
37825 let dist = geoVecLength(d4.data.loc, selected.loc);
37826 let theta = selected.ca - d4.data.ca;
37827 let minTheta = Math.min(Math.abs(theta), 360 - Math.abs(theta));
37828 if (minTheta > 20) {
37831 if (dist < minDist) {
37832 nextID = d4.data.key;
37836 let nextBubble = nextID && that.cachedImage(nextID);
37837 if (!nextBubble) return;
37838 context.map().centerEase(nextBubble.loc);
37839 that.selectImage(context, nextBubble.key).yaw(yaw).showViewer(context);
37843 yaw: function(yaw) {
37844 if (typeof yaw !== "number") return yaw;
37845 _sceneOptions.yaw = yaw;
37851 showViewer: function(context) {
37852 const wrap2 = context.container().select(".photoviewer");
37853 const isHidden = wrap2.selectAll(".photo-wrapper.ms-wrapper.hide").size();
37855 for (const service of Object.values(services)) {
37856 if (service === this) continue;
37857 if (typeof service.hideViewer === "function") {
37858 service.hideViewer(context);
37861 wrap2.classed("hide", false).selectAll(".photo-wrapper.ms-wrapper").classed("hide", false);
37868 hideViewer: function(context) {
37869 let viewer = context.container().select(".photoviewer");
37870 if (!viewer.empty()) viewer.datum(null);
37871 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
37872 context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
37873 this.updateUrlImage(null);
37874 return this.setStyles(context, null, true);
37879 selectImage: function(context, key) {
37881 let d4 = this.cachedImage(key);
37882 let viewer = context.container().select(".photoviewer");
37883 if (!viewer.empty()) viewer.datum(d4);
37884 this.setStyles(context, null, true);
37885 let wrap2 = context.container().select(".photoviewer .ms-wrapper");
37886 let attribution = wrap2.selectAll(".photo-attribution").html("");
37887 wrap2.selectAll(".pnlm-load-box").style("display", "block");
37888 if (!d4) return this;
37889 this.updateUrlImage(key);
37890 _sceneOptions.northOffset = d4.ca;
37891 let line1 = attribution.append("div").attr("class", "attribution-row");
37892 const hiresDomId = utilUniqueDomId("streetside-hires");
37893 let label = line1.append("label").attr("for", hiresDomId).attr("class", "streetside-hires");
37894 label.append("input").attr("type", "checkbox").attr("id", hiresDomId).property("checked", _hires).on("click", (d3_event) => {
37895 d3_event.stopPropagation();
37897 _resolution = _hires ? 1024 : 512;
37898 wrap2.call(setupCanvas, true);
37900 yaw: _pannellumViewer2.getYaw(),
37901 pitch: _pannellumViewer2.getPitch(),
37902 hfov: _pannellumViewer2.getHfov()
37904 _sceneOptions = Object.assign(_sceneOptions, viewstate);
37905 that.selectImage(context, d4.key).showViewer(context);
37907 label.append("span").call(_t.append("streetside.hires"));
37908 let captureInfo = line1.append("div").attr("class", "attribution-capture-info");
37909 if (d4.captured_by) {
37910 const yyyy = (/* @__PURE__ */ new Date()).getFullYear();
37911 captureInfo.append("a").attr("class", "captured_by").attr("target", "_blank").attr("href", "https://www.microsoft.com/en-us/maps/streetside").text("\xA9" + yyyy + " Microsoft");
37912 captureInfo.append("span").text("|");
37914 if (d4.captured_at) {
37915 captureInfo.append("span").attr("class", "captured_at").text(localeTimestamp2(d4.captured_at));
37917 let line2 = attribution.append("div").attr("class", "attribution-row");
37918 line2.append("a").attr("class", "image-view-link").attr("target", "_blank").attr("href", "https://www.bing.com/maps?cp=" + d4.loc[1] + "~" + d4.loc[0] + "&lvl=17&dir=" + d4.ca + "&style=x&v=2&sV=1").call(_t.append("streetside.view_on_bing"));
37919 line2.append("a").attr("class", "image-report-link").attr("target", "_blank").attr("href", "https://www.bing.com/maps/privacyreport/streetsideprivacyreport?bubbleid=" + encodeURIComponent(d4.key) + "&focus=photo&lat=" + d4.loc[1] + "&lng=" + d4.loc[0] + "&z=17").call(_t.append("streetside.report"));
37920 const faceKeys = ["01", "02", "03", "10", "11", "12"];
37921 let quadKeys = getQuadKeys();
37922 let faces = faceKeys.map((faceKey) => {
37923 return quadKeys.map((quadKey) => {
37924 const xy = qkToXY(quadKey);
37927 url: d4.imageUrl.replace("{faceId}", faceKey).replace("{tileId}", quadKey),
37933 loadFaces(faces).then(function() {
37934 if (!_pannellumViewer2) {
37938 let sceneID = _currScene.toString();
37939 _pannellumViewer2.addScene(sceneID, _sceneOptions).loadScene(sceneID);
37940 if (_currScene > 2) {
37941 sceneID = (_currScene - 1).toString();
37942 _pannellumViewer2.removeScene(sceneID);
37948 getSequenceKeyForBubble: function(d4) {
37949 return d4 && d4.sequenceKey;
37951 // Updates the currently highlighted sequence and selected bubble.
37952 // Reset is only necessary when interacting with the viewport because
37953 // this implicitly changes the currently selected bubble/sequence
37954 setStyles: function(context, hovered, reset) {
37956 context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
37957 context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
37959 let hoveredBubbleKey = hovered && hovered.key;
37960 let hoveredSequenceKey = this.getSequenceKeyForBubble(hovered);
37961 let hoveredSequence = hoveredSequenceKey && _ssCache.sequences[hoveredSequenceKey];
37962 let hoveredBubbleKeys = hoveredSequence && hoveredSequence.bubbles.map((d4) => d4.key) || [];
37963 let viewer = context.container().select(".photoviewer");
37964 let selected = viewer.empty() ? void 0 : viewer.datum();
37965 let selectedBubbleKey = selected && selected.key;
37966 let selectedSequenceKey = this.getSequenceKeyForBubble(selected);
37967 let selectedSequence = selectedSequenceKey && _ssCache.sequences[selectedSequenceKey];
37968 let selectedBubbleKeys = selectedSequence && selectedSequence.bubbles.map((d4) => d4.key) || [];
37969 let highlightedBubbleKeys = utilArrayUnion(hoveredBubbleKeys, selectedBubbleKeys);
37970 context.container().selectAll(".layer-streetside-images .viewfield-group").classed("highlighted", (d4) => highlightedBubbleKeys.indexOf(d4.key) !== -1).classed("hovered", (d4) => d4.key === hoveredBubbleKey).classed("currentView", (d4) => d4.key === selectedBubbleKey);
37971 context.container().selectAll(".layer-streetside-images .sequence").classed("highlighted", (d4) => d4.properties.key === hoveredSequenceKey).classed("currentView", (d4) => d4.properties.key === selectedSequenceKey);
37972 context.container().selectAll(".layer-streetside-images .viewfield-group .viewfield").attr("d", viewfieldPath);
37973 function viewfieldPath() {
37974 let d4 = this.parentNode.__data__;
37975 if (d4.pano && d4.key !== selectedBubbleKey) {
37976 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
37978 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
37983 updateUrlImage: function(imageKey) {
37984 const hash2 = utilStringQs(window.location.hash);
37986 hash2.photo = "streetside/" + imageKey;
37988 delete hash2.photo;
37990 window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
37995 cache: function() {
38002 // modules/services/taginfo.js
38003 var taginfo_exports = {};
38004 __export(taginfo_exports, {
38005 default: () => taginfo_default
38007 function sets(params, n3, o2) {
38008 if (params.geometry && o2[params.geometry]) {
38009 params[n3] = o2[params.geometry];
38013 function setFilter(params) {
38014 return sets(params, "filter", tag_filters);
38016 function setSort(params) {
38017 return sets(params, "sortname", tag_sorts);
38019 function setSortMembers(params) {
38020 return sets(params, "sortname", tag_sort_members);
38022 function clean(params) {
38023 return utilObjectOmit(params, ["geometry", "debounce"]);
38025 function filterKeys(type2) {
38026 var count_type = type2 ? "count_" + type2 : "count_all";
38027 return function(d4) {
38028 return Number(d4[count_type]) > 2500 || d4.in_wiki;
38031 function filterMultikeys(prefix) {
38032 return function(d4) {
38033 var re4 = new RegExp("^" + prefix + "(.*)$", "i");
38034 var matches = d4.key.match(re4) || [];
38035 return matches.length === 2 && matches[1].indexOf(":") === -1;
38038 function filterValues(allowUpperCase, key) {
38039 return function(d4) {
38040 if (d4.value.match(/[;,]/) !== null) return false;
38041 if (!allowUpperCase && !(key === "type" && d4.value === "associatedStreet") && d4.value.match(/[A-Z*]/) !== null) return false;
38042 return d4.count > 100 || d4.in_wiki;
38045 function filterRoles(geometry) {
38046 return function(d4) {
38047 if (d4.role === "") return false;
38048 if (d4.role.match(/[A-Z*;,]/) !== null) return false;
38049 return Number(d4[tag_members_fractions[geometry]]) > 0;
38052 function valKey(d4) {
38058 function valKeyDescription(d4) {
38061 title: d4.description || d4.value
38065 function roleKey(d4) {
38071 function sortKeys(a2, b3) {
38072 return a2.key.indexOf(":") === -1 && b3.key.indexOf(":") !== -1 ? -1 : a2.key.indexOf(":") !== -1 && b3.key.indexOf(":") === -1 ? 1 : 0;
38074 function request2(url, params, exactMatch, callback, loaded) {
38075 if (_inflight3[url]) return;
38076 if (checkCache(url, params, exactMatch, callback)) return;
38077 var controller = new AbortController();
38078 _inflight3[url] = controller;
38079 json_default(url, { signal: controller.signal }).then(function(result) {
38080 delete _inflight3[url];
38081 if (loaded) loaded(null, result);
38082 }).catch(function(err) {
38083 delete _inflight3[url];
38084 if (err.name === "AbortError") return;
38085 if (loaded) loaded(err.message);
38088 function checkCache(url, params, exactMatch, callback) {
38089 var rp = params.rp || 25;
38090 var testQuery = params.query || "";
38093 var hit = _taginfoCache[testUrl];
38094 if (hit && (url === testUrl || hit.length < rp)) {
38095 callback(null, hit);
38098 if (exactMatch || !testQuery.length) return false;
38099 testQuery = testQuery.slice(0, -1);
38100 testUrl = url.replace(/&query=(.*?)&/, "&query=" + testQuery + "&");
38101 } while (testQuery.length >= 0);
38104 var apibase4, _inflight3, _popularKeys, _taginfoCache, tag_sorts, tag_sort_members, tag_filters, tag_members_fractions, debouncedRequest2, taginfo_default;
38105 var init_taginfo = __esm({
38106 "modules/services/taginfo.js"() {
38114 apibase4 = taginfoApiUrl;
38117 _taginfoCache = {};
38119 point: "count_nodes",
38120 vertex: "count_nodes",
38121 area: "count_ways",
38124 tag_sort_members = {
38125 point: "count_node_members",
38126 vertex: "count_node_members",
38127 area: "count_way_members",
38128 line: "count_way_members",
38129 relation: "count_relation_members"
38137 tag_members_fractions = {
38138 point: "count_node_members_fraction",
38139 vertex: "count_node_members_fraction",
38140 area: "count_way_members_fraction",
38141 line: "count_way_members_fraction",
38142 relation: "count_relation_members_fraction"
38144 debouncedRequest2 = debounce_default(request2, 300, { leading: false });
38145 taginfo_default = {
38148 _taginfoCache = {};
38150 // manually exclude some keys – #5377, #7485
38156 sorting_name: true,
38161 "bridge:name": true
38165 sortname: "values_all",
38169 lang: _mainLocalizer.languageCode()
38171 this.keys(params, function(err, data) {
38173 data.forEach(function(d4) {
38174 if (d4.value === "opening_hours") return;
38175 _popularKeys[d4.value] = true;
38179 reset: function() {
38180 Object.values(_inflight3).forEach(function(controller) {
38181 controller.abort();
38185 keys: function(params, callback) {
38186 var doRequest = params.debounce ? debouncedRequest2 : request2;
38187 params = clean(setSort(params));
38188 params = Object.assign({
38190 sortname: "count_all",
38193 lang: _mainLocalizer.languageCode()
38195 var url = apibase4 + "keys/all?" + utilQsString(params);
38196 doRequest(url, params, false, callback, function(err, d4) {
38200 var f2 = filterKeys(params.filter);
38201 var result = d4.data.filter(f2).sort(sortKeys).map(valKey);
38202 _taginfoCache[url] = result;
38203 callback(null, result);
38207 multikeys: function(params, callback) {
38208 var doRequest = params.debounce ? debouncedRequest2 : request2;
38209 params = clean(setSort(params));
38210 params = Object.assign({
38212 sortname: "count_all",
38215 lang: _mainLocalizer.languageCode()
38217 var prefix = params.query;
38218 var url = apibase4 + "keys/all?" + utilQsString(params);
38219 doRequest(url, params, true, callback, function(err, d4) {
38223 var f2 = filterMultikeys(prefix);
38224 var result = d4.data.filter(f2).map(valKey);
38225 _taginfoCache[url] = result;
38226 callback(null, result);
38230 values: function(params, callback) {
38231 var key = params.key;
38232 if (key && _popularKeys[key]) {
38233 callback(null, []);
38236 var doRequest = params.debounce ? debouncedRequest2 : request2;
38237 params = clean(setSort(setFilter(params)));
38238 params = Object.assign({
38240 sortname: "count_all",
38243 lang: _mainLocalizer.languageCode()
38245 var url = apibase4 + "key/values?" + utilQsString(params);
38246 doRequest(url, params, false, callback, function(err, d4) {
38250 var allowUpperCase = allowUpperCaseTagValues.test(params.key);
38251 var f2 = filterValues(allowUpperCase, params.key);
38252 var result = d4.data.filter(f2).map(valKeyDescription);
38253 _taginfoCache[url] = result;
38254 callback(null, result);
38258 roles: function(params, callback) {
38259 var doRequest = params.debounce ? debouncedRequest2 : request2;
38260 var geometry = params.geometry;
38261 params = clean(setSortMembers(params));
38262 params = Object.assign({
38264 sortname: "count_all_members",
38267 lang: _mainLocalizer.languageCode()
38269 var url = apibase4 + "relation/roles?" + utilQsString(params);
38270 doRequest(url, params, true, callback, function(err, d4) {
38274 var f2 = filterRoles(geometry);
38275 var result = d4.data.filter(f2).map(roleKey);
38276 _taginfoCache[url] = result;
38277 callback(null, result);
38281 docs: function(params, callback) {
38282 var doRequest = params.debounce ? debouncedRequest2 : request2;
38283 params = clean(setSort(params));
38284 var path = "key/wiki_pages?";
38285 if (params.value) {
38286 path = "tag/wiki_pages?";
38287 } else if (params.rtype) {
38288 path = "relation/wiki_pages?";
38290 var url = apibase4 + path + utilQsString(params);
38291 doRequest(url, params, true, callback, function(err, d4) {
38295 _taginfoCache[url] = d4.data;
38296 callback(null, d4.data);
38300 apibase: function(_3) {
38301 if (!arguments.length) return apibase4;
38309 // node_modules/@turf/helpers/dist/esm/index.js
38310 function feature2(geom, properties, options = {}) {
38311 const feat = { type: "Feature" };
38312 if (options.id === 0 || options.id) {
38313 feat.id = options.id;
38315 if (options.bbox) {
38316 feat.bbox = options.bbox;
38318 feat.properties = properties || {};
38319 feat.geometry = geom;
38322 function polygon(coordinates, properties, options = {}) {
38323 for (const ring of coordinates) {
38324 if (ring.length < 4) {
38326 "Each LinearRing of a Polygon must have 4 or more Positions."
38329 if (ring[ring.length - 1].length !== ring[0].length) {
38330 throw new Error("First and last Position are not equivalent.");
38332 for (let j3 = 0; j3 < ring[ring.length - 1].length; j3++) {
38333 if (ring[ring.length - 1][j3] !== ring[0][j3]) {
38334 throw new Error("First and last Position are not equivalent.");
38342 return feature2(geom, properties, options);
38344 function lineString(coordinates, properties, options = {}) {
38345 if (coordinates.length < 2) {
38346 throw new Error("coordinates must be an array of two or more positions");
38349 type: "LineString",
38352 return feature2(geom, properties, options);
38354 function multiLineString(coordinates, properties, options = {}) {
38356 type: "MultiLineString",
38359 return feature2(geom, properties, options);
38361 function multiPolygon(coordinates, properties, options = {}) {
38363 type: "MultiPolygon",
38366 return feature2(geom, properties, options);
38368 var earthRadius, factors;
38369 var init_esm = __esm({
38370 "node_modules/@turf/helpers/dist/esm/index.js"() {
38371 earthRadius = 63710088e-1;
38373 centimeters: earthRadius * 100,
38374 centimetres: earthRadius * 100,
38375 degrees: 360 / (2 * Math.PI),
38376 feet: earthRadius * 3.28084,
38377 inches: earthRadius * 39.37,
38378 kilometers: earthRadius / 1e3,
38379 kilometres: earthRadius / 1e3,
38380 meters: earthRadius,
38381 metres: earthRadius,
38382 miles: earthRadius / 1609.344,
38383 millimeters: earthRadius * 1e3,
38384 millimetres: earthRadius * 1e3,
38385 nauticalmiles: earthRadius / 1852,
38387 yards: earthRadius * 1.0936
38392 // node_modules/@turf/invariant/dist/esm/index.js
38393 function getGeom(geojson) {
38394 if (geojson.type === "Feature") {
38395 return geojson.geometry;
38399 var init_esm2 = __esm({
38400 "node_modules/@turf/invariant/dist/esm/index.js"() {
38404 // node_modules/@turf/bbox-clip/dist/esm/index.js
38405 function lineclip(points, bbox2, result) {
38406 var len = points.length, codeA = bitCode(points[0], bbox2), part = [], i3, codeB, lastCode;
38409 if (!result) result = [];
38410 for (i3 = 1; i3 < len; i3++) {
38411 a2 = points[i3 - 1];
38413 codeB = lastCode = bitCode(b3, bbox2);
38415 if (!(codeA | codeB)) {
38417 if (codeB !== lastCode) {
38419 if (i3 < len - 1) {
38423 } else if (i3 === len - 1) {
38427 } else if (codeA & codeB) {
38429 } else if (codeA) {
38430 a2 = intersect(a2, b3, codeA, bbox2);
38431 codeA = bitCode(a2, bbox2);
38433 b3 = intersect(a2, b3, codeB, bbox2);
38434 codeB = bitCode(b3, bbox2);
38439 if (part.length) result.push(part);
38442 function polygonclip(points, bbox2) {
38443 var result, edge, prev, prevInside, i3, p2, inside;
38444 for (edge = 1; edge <= 8; edge *= 2) {
38446 prev = points[points.length - 1];
38447 prevInside = !(bitCode(prev, bbox2) & edge);
38448 for (i3 = 0; i3 < points.length; i3++) {
38450 inside = !(bitCode(p2, bbox2) & edge);
38451 if (inside !== prevInside) result.push(intersect(prev, p2, edge, bbox2));
38452 if (inside) result.push(p2);
38454 prevInside = inside;
38457 if (!points.length) break;
38461 function intersect(a2, b3, edge, bbox2) {
38462 return edge & 8 ? [a2[0] + (b3[0] - a2[0]) * (bbox2[3] - a2[1]) / (b3[1] - a2[1]), bbox2[3]] : edge & 4 ? [a2[0] + (b3[0] - a2[0]) * (bbox2[1] - a2[1]) / (b3[1] - a2[1]), bbox2[1]] : edge & 2 ? [bbox2[2], a2[1] + (b3[1] - a2[1]) * (bbox2[2] - a2[0]) / (b3[0] - a2[0])] : edge & 1 ? [bbox2[0], a2[1] + (b3[1] - a2[1]) * (bbox2[0] - a2[0]) / (b3[0] - a2[0])] : null;
38464 function bitCode(p2, bbox2) {
38466 if (p2[0] < bbox2[0]) code |= 1;
38467 else if (p2[0] > bbox2[2]) code |= 2;
38468 if (p2[1] < bbox2[1]) code |= 4;
38469 else if (p2[1] > bbox2[3]) code |= 8;
38472 function bboxClip(feature3, bbox2) {
38473 const geom = getGeom(feature3);
38474 const type2 = geom.type;
38475 const properties = feature3.type === "Feature" ? feature3.properties : {};
38476 let coords = geom.coordinates;
38479 case "MultiLineString": {
38481 if (type2 === "LineString") {
38484 coords.forEach((line) => {
38485 lineclip(line, bbox2, lines);
38487 if (lines.length === 1) {
38488 return lineString(lines[0], properties);
38490 return multiLineString(lines, properties);
38493 return polygon(clipPolygon(coords, bbox2), properties);
38494 case "MultiPolygon":
38495 return multiPolygon(
38496 coords.map((poly) => {
38497 return clipPolygon(poly, bbox2);
38502 throw new Error("geometry " + type2 + " not supported");
38505 function clipPolygon(rings, bbox2) {
38506 const outRings = [];
38507 for (const ring of rings) {
38508 const clipped = polygonclip(ring, bbox2);
38509 if (clipped.length > 0) {
38510 if (clipped[0][0] !== clipped[clipped.length - 1][0] || clipped[0][1] !== clipped[clipped.length - 1][1]) {
38511 clipped.push(clipped[0]);
38513 if (clipped.length >= 4) {
38514 outRings.push(clipped);
38520 var turf_bbox_clip_default;
38521 var init_esm3 = __esm({
38522 "node_modules/@turf/bbox-clip/dist/esm/index.js"() {
38525 turf_bbox_clip_default = bboxClip;
38529 // node_modules/fast-json-stable-stringify/index.js
38530 var require_fast_json_stable_stringify = __commonJS({
38531 "node_modules/fast-json-stable-stringify/index.js"(exports2, module2) {
38533 module2.exports = function(data, opts) {
38534 if (!opts) opts = {};
38535 if (typeof opts === "function") opts = { cmp: opts };
38536 var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
38537 var cmp = opts.cmp && /* @__PURE__ */ (function(f2) {
38538 return function(node) {
38539 return function(a2, b3) {
38540 var aobj = { key: a2, value: node[a2] };
38541 var bobj = { key: b3, value: node[b3] };
38542 return f2(aobj, bobj);
38547 return (function stringify3(node) {
38548 if (node && node.toJSON && typeof node.toJSON === "function") {
38549 node = node.toJSON();
38551 if (node === void 0) return;
38552 if (typeof node == "number") return isFinite(node) ? "" + node : "null";
38553 if (typeof node !== "object") return JSON.stringify(node);
38555 if (Array.isArray(node)) {
38557 for (i3 = 0; i3 < node.length; i3++) {
38558 if (i3) out += ",";
38559 out += stringify3(node[i3]) || "null";
38563 if (node === null) return "null";
38564 if (seen.indexOf(node) !== -1) {
38565 if (cycles) return JSON.stringify("__cycle__");
38566 throw new TypeError("Converting circular structure to JSON");
38568 var seenIndex = seen.push(node) - 1;
38569 var keys2 = Object.keys(node).sort(cmp && cmp(node));
38571 for (i3 = 0; i3 < keys2.length; i3++) {
38572 var key = keys2[i3];
38573 var value = stringify3(node[key]);
38574 if (!value) continue;
38575 if (out) out += ",";
38576 out += JSON.stringify(key) + ":" + value;
38578 seen.splice(seenIndex, 1);
38579 return "{" + out + "}";
38585 // node_modules/polygon-clipping/dist/polygon-clipping.umd.js
38586 var require_polygon_clipping_umd = __commonJS({
38587 "node_modules/polygon-clipping/dist/polygon-clipping.umd.js"(exports2, module2) {
38588 (function(global2, factory) {
38589 typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.polygonClipping = factory());
38590 })(exports2, (function() {
38592 function __generator(thisArg, body) {
38596 if (t2[0] & 1) throw t2[1];
38606 }, typeof Symbol === "function" && (g3[Symbol.iterator] = function() {
38609 function verb(n3) {
38610 return function(v3) {
38611 return step([n3, v3]);
38614 function step(op) {
38615 if (f2) throw new TypeError("Generator is already executing.");
38617 if (f2 = 1, y3 && (t2 = op[0] & 2 ? y3["return"] : op[0] ? y3["throw"] || ((t2 = y3["return"]) && t2.call(y3), 0) : y3.next) && !(t2 = t2.call(y3, op[1])).done) return t2;
38618 if (y3 = 0, t2) op = [op[0] & 2, t2.value];
38640 if (!(t2 = _3.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
38644 if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
38648 if (op[0] === 6 && _3.label < t2[1]) {
38653 if (t2 && _3.label < t2[2]) {
38658 if (t2[2]) _3.ops.pop();
38662 op = body.call(thisArg, _3);
38669 if (op[0] & 5) throw op[1];
38671 value: op[0] ? op[1] : void 0,
38678 /* @__PURE__ */ (function() {
38679 function Node2(key, data) {
38689 function DEFAULT_COMPARE(a2, b3) {
38690 return a2 > b3 ? 1 : a2 < b3 ? -1 : 0;
38692 function splay(i3, t2, comparator) {
38693 var N3 = new Node(null, null);
38697 var cmp2 = comparator(i3, t2.key);
38699 if (t2.left === null) break;
38700 if (comparator(i3, t2.left.key) < 0) {
38702 t2.left = y3.right;
38705 if (t2.left === null) break;
38710 } else if (cmp2 > 0) {
38711 if (t2.right === null) break;
38712 if (comparator(i3, t2.right.key) > 0) {
38714 t2.right = y3.left;
38717 if (t2.right === null) break;
38724 l4.right = t2.left;
38725 r2.left = t2.right;
38726 t2.left = N3.right;
38727 t2.right = N3.left;
38730 function insert(i3, data, t2, comparator) {
38731 var node = new Node(i3, data);
38733 node.left = node.right = null;
38736 t2 = splay(i3, t2, comparator);
38737 var cmp2 = comparator(i3, t2.key);
38739 node.left = t2.left;
38742 } else if (cmp2 >= 0) {
38743 node.right = t2.right;
38749 function split(key, v3, comparator) {
38753 v3 = splay(key, v3, comparator);
38754 var cmp2 = comparator(v3.key, key);
38758 } else if (cmp2 < 0) {
38773 function merge3(left, right, comparator) {
38774 if (right === null) return left;
38775 if (left === null) return right;
38776 right = splay(left.key, right, comparator);
38780 function printRow(root3, prefix, isTail, out, printNode) {
38782 out("" + prefix + (isTail ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ") + printNode(root3) + "\n");
38783 var indent = prefix + (isTail ? " " : "\u2502 ");
38784 if (root3.left) printRow(root3.left, indent, false, out, printNode);
38785 if (root3.right) printRow(root3.right, indent, true, out, printNode);
38791 function Tree2(comparator) {
38792 if (comparator === void 0) {
38793 comparator = DEFAULT_COMPARE;
38797 this._comparator = comparator;
38799 Tree2.prototype.insert = function(key, data) {
38801 return this._root = insert(key, data, this._root, this._comparator);
38803 Tree2.prototype.add = function(key, data) {
38804 var node = new Node(key, data);
38805 if (this._root === null) {
38806 node.left = node.right = null;
38810 var comparator = this._comparator;
38811 var t2 = splay(key, this._root, comparator);
38812 var cmp2 = comparator(key, t2.key);
38813 if (cmp2 === 0) this._root = t2;
38816 node.left = t2.left;
38819 } else if (cmp2 > 0) {
38820 node.right = t2.right;
38829 Tree2.prototype.remove = function(key) {
38830 this._root = this._remove(key, this._root, this._comparator);
38832 Tree2.prototype._remove = function(i3, t2, comparator) {
38834 if (t2 === null) return null;
38835 t2 = splay(i3, t2, comparator);
38836 var cmp2 = comparator(i3, t2.key);
38838 if (t2.left === null) {
38841 x2 = splay(i3, t2.left, comparator);
38842 x2.right = t2.right;
38849 Tree2.prototype.pop = function() {
38850 var node = this._root;
38852 while (node.left) node = node.left;
38853 this._root = splay(node.key, this._root, this._comparator);
38854 this._root = this._remove(node.key, this._root, this._comparator);
38862 Tree2.prototype.findStatic = function(key) {
38863 var current = this._root;
38864 var compare2 = this._comparator;
38866 var cmp2 = compare2(key, current.key);
38867 if (cmp2 === 0) return current;
38868 else if (cmp2 < 0) current = current.left;
38869 else current = current.right;
38873 Tree2.prototype.find = function(key) {
38875 this._root = splay(key, this._root, this._comparator);
38876 if (this._comparator(key, this._root.key) !== 0) return null;
38880 Tree2.prototype.contains = function(key) {
38881 var current = this._root;
38882 var compare2 = this._comparator;
38884 var cmp2 = compare2(key, current.key);
38885 if (cmp2 === 0) return true;
38886 else if (cmp2 < 0) current = current.left;
38887 else current = current.right;
38891 Tree2.prototype.forEach = function(visitor, ctx) {
38892 var current = this._root;
38896 if (current !== null) {
38898 current = current.left;
38900 if (Q3.length !== 0) {
38901 current = Q3.pop();
38902 visitor.call(ctx, current);
38903 current = current.right;
38904 } else done = true;
38909 Tree2.prototype.range = function(low, high, fn, ctx) {
38911 var compare2 = this._comparator;
38912 var node = this._root;
38914 while (Q3.length !== 0 || node) {
38920 cmp2 = compare2(node.key, high);
38923 } else if (compare2(node.key, low) >= 0) {
38924 if (fn.call(ctx, node)) return this;
38931 Tree2.prototype.keys = function() {
38933 this.forEach(function(_a4) {
38935 return keys2.push(key);
38939 Tree2.prototype.values = function() {
38941 this.forEach(function(_a4) {
38942 var data = _a4.data;
38943 return values.push(data);
38947 Tree2.prototype.min = function() {
38948 if (this._root) return this.minNode(this._root).key;
38951 Tree2.prototype.max = function() {
38952 if (this._root) return this.maxNode(this._root).key;
38955 Tree2.prototype.minNode = function(t2) {
38956 if (t2 === void 0) {
38959 if (t2) while (t2.left) t2 = t2.left;
38962 Tree2.prototype.maxNode = function(t2) {
38963 if (t2 === void 0) {
38966 if (t2) while (t2.right) t2 = t2.right;
38969 Tree2.prototype.at = function(index2) {
38970 var current = this._root;
38977 current = current.left;
38979 if (Q3.length > 0) {
38980 current = Q3.pop();
38981 if (i3 === index2) return current;
38983 current = current.right;
38984 } else done = true;
38989 Tree2.prototype.next = function(d4) {
38990 var root3 = this._root;
38991 var successor = null;
38993 successor = d4.right;
38994 while (successor.left) successor = successor.left;
38997 var comparator = this._comparator;
38999 var cmp2 = comparator(d4.key, root3.key);
39000 if (cmp2 === 0) break;
39001 else if (cmp2 < 0) {
39003 root3 = root3.left;
39004 } else root3 = root3.right;
39008 Tree2.prototype.prev = function(d4) {
39009 var root3 = this._root;
39010 var predecessor = null;
39011 if (d4.left !== null) {
39012 predecessor = d4.left;
39013 while (predecessor.right) predecessor = predecessor.right;
39014 return predecessor;
39016 var comparator = this._comparator;
39018 var cmp2 = comparator(d4.key, root3.key);
39019 if (cmp2 === 0) break;
39020 else if (cmp2 < 0) root3 = root3.left;
39022 predecessor = root3;
39023 root3 = root3.right;
39026 return predecessor;
39028 Tree2.prototype.clear = function() {
39033 Tree2.prototype.toList = function() {
39034 return toList(this._root);
39036 Tree2.prototype.load = function(keys2, values, presort) {
39037 if (values === void 0) {
39040 if (presort === void 0) {
39043 var size = keys2.length;
39044 var comparator = this._comparator;
39045 if (presort) sort(keys2, values, 0, size - 1, comparator);
39046 if (this._root === null) {
39047 this._root = loadRecursive(keys2, values, 0, size);
39050 var mergedList = mergeLists(this.toList(), createList(keys2, values), comparator);
39051 size = this._size + size;
39052 this._root = sortedListToBST({
39058 Tree2.prototype.isEmpty = function() {
39059 return this._root === null;
39061 Object.defineProperty(Tree2.prototype, "size", {
39068 Object.defineProperty(Tree2.prototype, "root", {
39075 Tree2.prototype.toString = function(printNode) {
39076 if (printNode === void 0) {
39077 printNode = function(n3) {
39078 return String(n3.key);
39082 printRow(this._root, "", true, function(v3) {
39083 return out.push(v3);
39085 return out.join("");
39087 Tree2.prototype.update = function(key, newKey, newData) {
39088 var comparator = this._comparator;
39089 var _a4 = split(key, this._root, comparator), left = _a4.left, right = _a4.right;
39090 if (comparator(key, newKey) < 0) {
39091 right = insert(newKey, newData, right, comparator);
39093 left = insert(newKey, newData, left, comparator);
39095 this._root = merge3(left, right, comparator);
39097 Tree2.prototype.split = function(key) {
39098 return split(key, this._root, this._comparator);
39100 Tree2.prototype[Symbol.iterator] = function() {
39101 var current, Q3, done;
39102 return __generator(this, function(_a4) {
39103 switch (_a4.label) {
39105 current = this._root;
39110 if (!!done) return [3, 6];
39111 if (!(current !== null)) return [3, 2];
39113 current = current.left;
39116 if (!(Q3.length !== 0)) return [3, 4];
39117 current = Q3.pop();
39118 return [4, current];
39121 current = current.right;
39139 function loadRecursive(keys2, values, start2, end) {
39140 var size = end - start2;
39142 var middle = start2 + Math.floor(size / 2);
39143 var key = keys2[middle];
39144 var data = values[middle];
39145 var node = new Node(key, data);
39146 node.left = loadRecursive(keys2, values, start2, middle);
39147 node.right = loadRecursive(keys2, values, middle + 1, end);
39152 function createList(keys2, values) {
39153 var head = new Node(null, null);
39155 for (var i3 = 0; i3 < keys2.length; i3++) {
39156 p2 = p2.next = new Node(keys2[i3], values[i3]);
39161 function toList(root3) {
39162 var current = root3;
39165 var head = new Node(null, null);
39170 current = current.left;
39172 if (Q3.length > 0) {
39173 current = p2 = p2.next = Q3.pop();
39174 current = current.right;
39175 } else done = true;
39181 function sortedListToBST(list, start2, end) {
39182 var size = end - start2;
39184 var middle = start2 + Math.floor(size / 2);
39185 var left = sortedListToBST(list, start2, middle);
39186 var root3 = list.head;
39188 list.head = list.head.next;
39189 root3.right = sortedListToBST(list, middle + 1, end);
39194 function mergeLists(l1, l22, compare2) {
39195 var head = new Node(null, null);
39199 while (p1 !== null && p22 !== null) {
39200 if (compare2(p1.key, p22.key) < 0) {
39211 } else if (p22 !== null) {
39216 function sort(keys2, values, left, right, compare2) {
39217 if (left >= right) return;
39218 var pivot = keys2[left + right >> 1];
39220 var j3 = right + 1;
39224 while (compare2(keys2[i3], pivot) < 0);
39227 while (compare2(keys2[j3], pivot) > 0);
39228 if (i3 >= j3) break;
39229 var tmp = keys2[i3];
39230 keys2[i3] = keys2[j3];
39233 values[i3] = values[j3];
39236 sort(keys2, values, left, j3, compare2);
39237 sort(keys2, values, j3 + 1, right, compare2);
39239 const isInBbox2 = (bbox2, point) => {
39240 return bbox2.ll.x <= point.x && point.x <= bbox2.ur.x && bbox2.ll.y <= point.y && point.y <= bbox2.ur.y;
39242 const getBboxOverlap2 = (b1, b22) => {
39243 if (b22.ur.x < b1.ll.x || b1.ur.x < b22.ll.x || b22.ur.y < b1.ll.y || b1.ur.y < b22.ll.y) return null;
39244 const lowerX = b1.ll.x < b22.ll.x ? b22.ll.x : b1.ll.x;
39245 const upperX = b1.ur.x < b22.ur.x ? b1.ur.x : b22.ur.x;
39246 const lowerY = b1.ll.y < b22.ll.y ? b22.ll.y : b1.ll.y;
39247 const upperY = b1.ur.y < b22.ur.y ? b1.ur.y : b22.ur.y;
39259 let epsilon$1 = Number.EPSILON;
39260 if (epsilon$1 === void 0) epsilon$1 = Math.pow(2, -52);
39261 const EPSILON_SQ = epsilon$1 * epsilon$1;
39262 const cmp = (a2, b3) => {
39263 if (-epsilon$1 < a2 && a2 < epsilon$1) {
39264 if (-epsilon$1 < b3 && b3 < epsilon$1) {
39268 const ab = a2 - b3;
39269 if (ab * ab < EPSILON_SQ * a2 * b3) {
39272 return a2 < b3 ? -1 : 1;
39279 this.xRounder = new CoordRounder();
39280 this.yRounder = new CoordRounder();
39284 x: this.xRounder.round(x2),
39285 y: this.yRounder.round(y3)
39289 class CoordRounder {
39291 this.tree = new Tree();
39294 // Note: this can rounds input values backwards or forwards.
39295 // You might ask, why not restrict this to just rounding
39296 // forwards? Wouldn't that allow left endpoints to always
39297 // remain left endpoints during splitting (never change to
39298 // right). No - it wouldn't, because we snap intersections
39299 // to endpoints (to establish independence from the segment
39300 // angle for t-intersections).
39302 const node = this.tree.add(coord2);
39303 const prevNode = this.tree.prev(node);
39304 if (prevNode !== null && cmp(node.key, prevNode.key) === 0) {
39305 this.tree.remove(coord2);
39306 return prevNode.key;
39308 const nextNode = this.tree.next(node);
39309 if (nextNode !== null && cmp(node.key, nextNode.key) === 0) {
39310 this.tree.remove(coord2);
39311 return nextNode.key;
39316 const rounder = new PtRounder();
39317 const epsilon3 = 11102230246251565e-32;
39318 const splitter = 134217729;
39319 const resulterrbound = (3 + 8 * epsilon3) * epsilon3;
39320 function sum(elen, e3, flen, f2, h3) {
39321 let Q3, Qnew, hh, bvirt;
39326 if (fnow > enow === fnow > -enow) {
39328 enow = e3[++eindex];
39331 fnow = f2[++findex];
39334 if (eindex < elen && findex < flen) {
39335 if (fnow > enow === fnow > -enow) {
39337 hh = Q3 - (Qnew - enow);
39338 enow = e3[++eindex];
39341 hh = Q3 - (Qnew - fnow);
39342 fnow = f2[++findex];
39348 while (eindex < elen && findex < flen) {
39349 if (fnow > enow === fnow > -enow) {
39352 hh = Q3 - (Qnew - bvirt) + (enow - bvirt);
39353 enow = e3[++eindex];
39357 hh = Q3 - (Qnew - bvirt) + (fnow - bvirt);
39358 fnow = f2[++findex];
39366 while (eindex < elen) {
39369 hh = Q3 - (Qnew - bvirt) + (enow - bvirt);
39370 enow = e3[++eindex];
39376 while (findex < flen) {
39379 hh = Q3 - (Qnew - bvirt) + (fnow - bvirt);
39380 fnow = f2[++findex];
39386 if (Q3 !== 0 || hindex === 0) {
39391 function estimate(elen, e3) {
39393 for (let i3 = 1; i3 < elen; i3++) Q3 += e3[i3];
39397 return new Float64Array(n3);
39399 const ccwerrboundA = (3 + 16 * epsilon3) * epsilon3;
39400 const ccwerrboundB = (2 + 12 * epsilon3) * epsilon3;
39401 const ccwerrboundC = (9 + 64 * epsilon3) * epsilon3 * epsilon3;
39404 const C22 = vec(12);
39405 const D3 = vec(16);
39407 function orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {
39408 let acxtail, acytail, bcxtail, bcytail;
39409 let bvirt, c2, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t12, t02, u3;
39410 const acx = ax - cx;
39411 const bcx = bx - cx;
39412 const acy = ay - cy;
39413 const bcy = by - cy;
39415 c2 = splitter * acx;
39416 ahi = c2 - (c2 - acx);
39418 c2 = splitter * bcy;
39419 bhi = c2 - (c2 - bcy);
39421 s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
39423 c2 = splitter * acy;
39424 ahi = c2 - (c2 - acy);
39426 c2 = splitter * bcx;
39427 bhi = c2 - (c2 - bcx);
39429 t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo);
39432 B3[0] = s0 - (_i + bvirt) + (bvirt - t02);
39435 _0 = s1 - (_j - bvirt) + (_i - bvirt);
39438 B3[1] = _0 - (_i + bvirt) + (bvirt - t12);
39441 B3[2] = _j - (u3 - bvirt) + (_i - bvirt);
39443 let det = estimate(4, B3);
39444 let errbound = ccwerrboundB * detsum;
39445 if (det >= errbound || -det >= errbound) {
39449 acxtail = ax - (acx + bvirt) + (bvirt - cx);
39451 bcxtail = bx - (bcx + bvirt) + (bvirt - cx);
39453 acytail = ay - (acy + bvirt) + (bvirt - cy);
39455 bcytail = by - (bcy + bvirt) + (bvirt - cy);
39456 if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {
39459 errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);
39460 det += acx * bcytail + bcy * acxtail - (acy * bcxtail + bcx * acytail);
39461 if (det >= errbound || -det >= errbound) return det;
39462 s1 = acxtail * bcy;
39463 c2 = splitter * acxtail;
39464 ahi = c2 - (c2 - acxtail);
39465 alo = acxtail - ahi;
39466 c2 = splitter * bcy;
39467 bhi = c2 - (c2 - bcy);
39469 s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
39470 t12 = acytail * bcx;
39471 c2 = splitter * acytail;
39472 ahi = c2 - (c2 - acytail);
39473 alo = acytail - ahi;
39474 c2 = splitter * bcx;
39475 bhi = c2 - (c2 - bcx);
39477 t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo);
39480 u2[0] = s0 - (_i + bvirt) + (bvirt - t02);
39483 _0 = s1 - (_j - bvirt) + (_i - bvirt);
39486 u2[1] = _0 - (_i + bvirt) + (bvirt - t12);
39489 u2[2] = _j - (u3 - bvirt) + (_i - bvirt);
39491 const C1len = sum(4, B3, 4, u2, C1);
39492 s1 = acx * bcytail;
39493 c2 = splitter * acx;
39494 ahi = c2 - (c2 - acx);
39496 c2 = splitter * bcytail;
39497 bhi = c2 - (c2 - bcytail);
39498 blo = bcytail - bhi;
39499 s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
39500 t12 = acy * bcxtail;
39501 c2 = splitter * acy;
39502 ahi = c2 - (c2 - acy);
39504 c2 = splitter * bcxtail;
39505 bhi = c2 - (c2 - bcxtail);
39506 blo = bcxtail - bhi;
39507 t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo);
39510 u2[0] = s0 - (_i + bvirt) + (bvirt - t02);
39513 _0 = s1 - (_j - bvirt) + (_i - bvirt);
39516 u2[1] = _0 - (_i + bvirt) + (bvirt - t12);
39519 u2[2] = _j - (u3 - bvirt) + (_i - bvirt);
39521 const C2len = sum(C1len, C1, 4, u2, C22);
39522 s1 = acxtail * bcytail;
39523 c2 = splitter * acxtail;
39524 ahi = c2 - (c2 - acxtail);
39525 alo = acxtail - ahi;
39526 c2 = splitter * bcytail;
39527 bhi = c2 - (c2 - bcytail);
39528 blo = bcytail - bhi;
39529 s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
39530 t12 = acytail * bcxtail;
39531 c2 = splitter * acytail;
39532 ahi = c2 - (c2 - acytail);
39533 alo = acytail - ahi;
39534 c2 = splitter * bcxtail;
39535 bhi = c2 - (c2 - bcxtail);
39536 blo = bcxtail - bhi;
39537 t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo);
39540 u2[0] = s0 - (_i + bvirt) + (bvirt - t02);
39543 _0 = s1 - (_j - bvirt) + (_i - bvirt);
39546 u2[1] = _0 - (_i + bvirt) + (bvirt - t12);
39549 u2[2] = _j - (u3 - bvirt) + (_i - bvirt);
39551 const Dlen = sum(C2len, C22, 4, u2, D3);
39552 return D3[Dlen - 1];
39554 function orient2d(ax, ay, bx, by, cx, cy) {
39555 const detleft = (ay - cy) * (bx - cx);
39556 const detright = (ax - cx) * (by - cy);
39557 const det = detleft - detright;
39558 const detsum = Math.abs(detleft + detright);
39559 if (Math.abs(det) >= ccwerrboundA * detsum) return det;
39560 return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);
39562 const crossProduct2 = (a2, b3) => a2.x * b3.y - a2.y * b3.x;
39563 const dotProduct2 = (a2, b3) => a2.x * b3.x + a2.y * b3.y;
39564 const compareVectorAngles = (basePt, endPt1, endPt2) => {
39565 const res = orient2d(basePt.x, basePt.y, endPt1.x, endPt1.y, endPt2.x, endPt2.y);
39566 if (res > 0) return -1;
39567 if (res < 0) return 1;
39570 const length2 = (v3) => Math.sqrt(dotProduct2(v3, v3));
39571 const sineOfAngle2 = (pShared, pBase, pAngle) => {
39573 x: pBase.x - pShared.x,
39574 y: pBase.y - pShared.y
39577 x: pAngle.x - pShared.x,
39578 y: pAngle.y - pShared.y
39580 return crossProduct2(vAngle, vBase) / length2(vAngle) / length2(vBase);
39582 const cosineOfAngle2 = (pShared, pBase, pAngle) => {
39584 x: pBase.x - pShared.x,
39585 y: pBase.y - pShared.y
39588 x: pAngle.x - pShared.x,
39589 y: pAngle.y - pShared.y
39591 return dotProduct2(vAngle, vBase) / length2(vAngle) / length2(vBase);
39593 const horizontalIntersection2 = (pt2, v3, y3) => {
39594 if (v3.y === 0) return null;
39596 x: pt2.x + v3.x / v3.y * (y3 - pt2.y),
39600 const verticalIntersection2 = (pt2, v3, x2) => {
39601 if (v3.x === 0) return null;
39604 y: pt2.y + v3.y / v3.x * (x2 - pt2.x)
39607 const intersection$1 = (pt1, v1, pt2, v22) => {
39608 if (v1.x === 0) return verticalIntersection2(pt2, v22, pt1.x);
39609 if (v22.x === 0) return verticalIntersection2(pt1, v1, pt2.x);
39610 if (v1.y === 0) return horizontalIntersection2(pt2, v22, pt1.y);
39611 if (v22.y === 0) return horizontalIntersection2(pt1, v1, pt2.y);
39612 const kross = crossProduct2(v1, v22);
39613 if (kross == 0) return null;
39618 const d1 = crossProduct2(ve3, v1) / kross;
39619 const d22 = crossProduct2(ve3, v22) / kross;
39620 const x12 = pt1.x + d22 * v1.x, x2 = pt2.x + d1 * v22.x;
39621 const y12 = pt1.y + d22 * v1.y, y22 = pt2.y + d1 * v22.y;
39622 const x3 = (x12 + x2) / 2;
39623 const y3 = (y12 + y22) / 2;
39629 class SweepEvent2 {
39630 // for ordering sweep events in the sweep event queue
39631 static compare(a2, b3) {
39632 const ptCmp = SweepEvent2.comparePoints(a2.point, b3.point);
39633 if (ptCmp !== 0) return ptCmp;
39634 if (a2.point !== b3.point) a2.link(b3);
39635 if (a2.isLeft !== b3.isLeft) return a2.isLeft ? 1 : -1;
39636 return Segment2.compare(a2.segment, b3.segment);
39638 // for ordering points in sweep line order
39639 static comparePoints(aPt, bPt) {
39640 if (aPt.x < bPt.x) return -1;
39641 if (aPt.x > bPt.x) return 1;
39642 if (aPt.y < bPt.y) return -1;
39643 if (aPt.y > bPt.y) return 1;
39646 // Warning: 'point' input will be modified and re-used (for performance)
39647 constructor(point, isLeft) {
39648 if (point.events === void 0) point.events = [this];
39649 else point.events.push(this);
39650 this.point = point;
39651 this.isLeft = isLeft;
39654 if (other.point === this.point) {
39655 throw new Error("Tried to link already linked events");
39657 const otherEvents = other.point.events;
39658 for (let i3 = 0, iMax = otherEvents.length; i3 < iMax; i3++) {
39659 const evt = otherEvents[i3];
39660 this.point.events.push(evt);
39661 evt.point = this.point;
39663 this.checkForConsuming();
39665 /* Do a pass over our linked events and check to see if any pair
39666 * of segments match, and should be consumed. */
39667 checkForConsuming() {
39668 const numEvents = this.point.events.length;
39669 for (let i3 = 0; i3 < numEvents; i3++) {
39670 const evt1 = this.point.events[i3];
39671 if (evt1.segment.consumedBy !== void 0) continue;
39672 for (let j3 = i3 + 1; j3 < numEvents; j3++) {
39673 const evt2 = this.point.events[j3];
39674 if (evt2.consumedBy !== void 0) continue;
39675 if (evt1.otherSE.point.events !== evt2.otherSE.point.events) continue;
39676 evt1.segment.consume(evt2.segment);
39680 getAvailableLinkedEvents() {
39682 for (let i3 = 0, iMax = this.point.events.length; i3 < iMax; i3++) {
39683 const evt = this.point.events[i3];
39684 if (evt !== this && !evt.segment.ringOut && evt.segment.isInResult()) {
39691 * Returns a comparator function for sorting linked events that will
39692 * favor the event that will give us the smallest left-side angle.
39693 * All ring construction starts as low as possible heading to the right,
39694 * so by always turning left as sharp as possible we'll get polygons
39695 * without uncessary loops & holes.
39697 * The comparator function has a compute cache such that it avoids
39698 * re-computing already-computed values.
39700 getLeftmostComparator(baseEvent) {
39701 const cache = /* @__PURE__ */ new Map();
39702 const fillCache = (linkedEvent) => {
39703 const nextEvent = linkedEvent.otherSE;
39704 cache.set(linkedEvent, {
39705 sine: sineOfAngle2(this.point, baseEvent.point, nextEvent.point),
39706 cosine: cosineOfAngle2(this.point, baseEvent.point, nextEvent.point)
39709 return (a2, b3) => {
39710 if (!cache.has(a2)) fillCache(a2);
39711 if (!cache.has(b3)) fillCache(b3);
39720 if (asine >= 0 && bsine >= 0) {
39721 if (acosine < bcosine) return 1;
39722 if (acosine > bcosine) return -1;
39725 if (asine < 0 && bsine < 0) {
39726 if (acosine < bcosine) return -1;
39727 if (acosine > bcosine) return 1;
39730 if (bsine < asine) return -1;
39731 if (bsine > asine) return 1;
39736 let segmentId2 = 0;
39738 /* This compare() function is for ordering segments in the sweep
39739 * line tree, and does so according to the following criteria:
39741 * Consider the vertical line that lies an infinestimal step to the
39742 * right of the right-more of the two left endpoints of the input
39743 * segments. Imagine slowly moving a point up from negative infinity
39744 * in the increasing y direction. Which of the two segments will that
39745 * point intersect first? That segment comes 'before' the other one.
39747 * If neither segment would be intersected by such a line, (if one
39748 * or more of the segments are vertical) then the line to be considered
39749 * is directly on the right-more of the two left inputs.
39751 static compare(a2, b3) {
39752 const alx = a2.leftSE.point.x;
39753 const blx = b3.leftSE.point.x;
39754 const arx = a2.rightSE.point.x;
39755 const brx = b3.rightSE.point.x;
39756 if (brx < alx) return 1;
39757 if (arx < blx) return -1;
39758 const aly = a2.leftSE.point.y;
39759 const bly = b3.leftSE.point.y;
39760 const ary = a2.rightSE.point.y;
39761 const bry = b3.rightSE.point.y;
39763 if (bly < aly && bly < ary) return 1;
39764 if (bly > aly && bly > ary) return -1;
39765 const aCmpBLeft = a2.comparePoint(b3.leftSE.point);
39766 if (aCmpBLeft < 0) return 1;
39767 if (aCmpBLeft > 0) return -1;
39768 const bCmpARight = b3.comparePoint(a2.rightSE.point);
39769 if (bCmpARight !== 0) return bCmpARight;
39773 if (aly < bly && aly < bry) return -1;
39774 if (aly > bly && aly > bry) return 1;
39775 const bCmpALeft = b3.comparePoint(a2.leftSE.point);
39776 if (bCmpALeft !== 0) return bCmpALeft;
39777 const aCmpBRight = a2.comparePoint(b3.rightSE.point);
39778 if (aCmpBRight < 0) return 1;
39779 if (aCmpBRight > 0) return -1;
39782 if (aly < bly) return -1;
39783 if (aly > bly) return 1;
39785 const bCmpARight = b3.comparePoint(a2.rightSE.point);
39786 if (bCmpARight !== 0) return bCmpARight;
39789 const aCmpBRight = a2.comparePoint(b3.rightSE.point);
39790 if (aCmpBRight < 0) return 1;
39791 if (aCmpBRight > 0) return -1;
39794 const ay = ary - aly;
39795 const ax = arx - alx;
39796 const by = bry - bly;
39797 const bx = brx - blx;
39798 if (ay > ax && by < bx) return 1;
39799 if (ay < ax && by > bx) return -1;
39801 if (arx > brx) return 1;
39802 if (arx < brx) return -1;
39803 if (ary < bry) return -1;
39804 if (ary > bry) return 1;
39805 if (a2.id < b3.id) return -1;
39806 if (a2.id > b3.id) return 1;
39809 /* Warning: a reference to ringWindings input will be stored,
39810 * and possibly will be later modified */
39811 constructor(leftSE, rightSE, rings, windings) {
39812 this.id = ++segmentId2;
39813 this.leftSE = leftSE;
39814 leftSE.segment = this;
39815 leftSE.otherSE = rightSE;
39816 this.rightSE = rightSE;
39817 rightSE.segment = this;
39818 rightSE.otherSE = leftSE;
39819 this.rings = rings;
39820 this.windings = windings;
39822 static fromRing(pt1, pt2, ring) {
39823 let leftPt, rightPt, winding;
39824 const cmpPts = SweepEvent2.comparePoints(pt1, pt2);
39829 } else if (cmpPts > 0) {
39833 } else throw new Error(`Tried to create degenerate segment at [${pt1.x}, ${pt1.y}]`);
39834 const leftSE = new SweepEvent2(leftPt, true);
39835 const rightSE = new SweepEvent2(rightPt, false);
39836 return new Segment2(leftSE, rightSE, [ring], [winding]);
39838 /* When a segment is split, the rightSE is replaced with a new sweep event */
39839 replaceRightSE(newRightSE) {
39840 this.rightSE = newRightSE;
39841 this.rightSE.segment = this;
39842 this.rightSE.otherSE = this.leftSE;
39843 this.leftSE.otherSE = this.rightSE;
39846 const y12 = this.leftSE.point.y;
39847 const y22 = this.rightSE.point.y;
39850 x: this.leftSE.point.x,
39851 y: y12 < y22 ? y12 : y22
39854 x: this.rightSE.point.x,
39855 y: y12 > y22 ? y12 : y22
39859 /* A vector from the left point to the right */
39862 x: this.rightSE.point.x - this.leftSE.point.x,
39863 y: this.rightSE.point.y - this.leftSE.point.y
39866 isAnEndpoint(pt2) {
39867 return pt2.x === this.leftSE.point.x && pt2.y === this.leftSE.point.y || pt2.x === this.rightSE.point.x && pt2.y === this.rightSE.point.y;
39869 /* Compare this segment with a point.
39871 * A point P is considered to be colinear to a segment if there
39872 * exists a distance D such that if we travel along the segment
39873 * from one * endpoint towards the other a distance D, we find
39874 * ourselves at point P.
39876 * Return value indicates:
39878 * 1: point lies above the segment (to the left of vertical)
39879 * 0: point is colinear to segment
39880 * -1: point lies below the segment (to the right of vertical)
39882 comparePoint(point) {
39883 if (this.isAnEndpoint(point)) return 0;
39884 const lPt = this.leftSE.point;
39885 const rPt = this.rightSE.point;
39886 const v3 = this.vector();
39887 if (lPt.x === rPt.x) {
39888 if (point.x === lPt.x) return 0;
39889 return point.x < lPt.x ? 1 : -1;
39891 const yDist = (point.y - lPt.y) / v3.y;
39892 const xFromYDist = lPt.x + yDist * v3.x;
39893 if (point.x === xFromYDist) return 0;
39894 const xDist = (point.x - lPt.x) / v3.x;
39895 const yFromXDist = lPt.y + xDist * v3.y;
39896 if (point.y === yFromXDist) return 0;
39897 return point.y < yFromXDist ? -1 : 1;
39900 * Given another segment, returns the first non-trivial intersection
39901 * between the two segments (in terms of sweep line ordering), if it exists.
39903 * A 'non-trivial' intersection is one that will cause one or both of the
39904 * segments to be split(). As such, 'trivial' vs. 'non-trivial' intersection:
39906 * * endpoint of segA with endpoint of segB --> trivial
39907 * * endpoint of segA with point along segB --> non-trivial
39908 * * endpoint of segB with point along segA --> non-trivial
39909 * * point along segA with point along segB --> non-trivial
39911 * If no non-trivial intersection exists, return null
39912 * Else, return null.
39914 getIntersection(other) {
39915 const tBbox = this.bbox();
39916 const oBbox = other.bbox();
39917 const bboxOverlap = getBboxOverlap2(tBbox, oBbox);
39918 if (bboxOverlap === null) return null;
39919 const tlp = this.leftSE.point;
39920 const trp = this.rightSE.point;
39921 const olp = other.leftSE.point;
39922 const orp = other.rightSE.point;
39923 const touchesOtherLSE = isInBbox2(tBbox, olp) && this.comparePoint(olp) === 0;
39924 const touchesThisLSE = isInBbox2(oBbox, tlp) && other.comparePoint(tlp) === 0;
39925 const touchesOtherRSE = isInBbox2(tBbox, orp) && this.comparePoint(orp) === 0;
39926 const touchesThisRSE = isInBbox2(oBbox, trp) && other.comparePoint(trp) === 0;
39927 if (touchesThisLSE && touchesOtherLSE) {
39928 if (touchesThisRSE && !touchesOtherRSE) return trp;
39929 if (!touchesThisRSE && touchesOtherRSE) return orp;
39932 if (touchesThisLSE) {
39933 if (touchesOtherRSE) {
39934 if (tlp.x === orp.x && tlp.y === orp.y) return null;
39938 if (touchesOtherLSE) {
39939 if (touchesThisRSE) {
39940 if (trp.x === olp.x && trp.y === olp.y) return null;
39944 if (touchesThisRSE && touchesOtherRSE) return null;
39945 if (touchesThisRSE) return trp;
39946 if (touchesOtherRSE) return orp;
39947 const pt2 = intersection$1(tlp, this.vector(), olp, other.vector());
39948 if (pt2 === null) return null;
39949 if (!isInBbox2(bboxOverlap, pt2)) return null;
39950 return rounder.round(pt2.x, pt2.y);
39953 * Split the given segment into multiple segments on the given points.
39954 * * Each existing segment will retain its leftSE and a new rightSE will be
39955 * generated for it.
39956 * * A new segment will be generated which will adopt the original segment's
39957 * rightSE, and a new leftSE will be generated for it.
39958 * * If there are more than two points given to split on, new segments
39959 * in the middle will be generated with new leftSE and rightSE's.
39960 * * An array of the newly generated SweepEvents will be returned.
39962 * Warning: input array of points is modified
39965 const newEvents = [];
39966 const alreadyLinked = point.events !== void 0;
39967 const newLeftSE = new SweepEvent2(point, true);
39968 const newRightSE = new SweepEvent2(point, false);
39969 const oldRightSE = this.rightSE;
39970 this.replaceRightSE(newRightSE);
39971 newEvents.push(newRightSE);
39972 newEvents.push(newLeftSE);
39973 const newSeg = new Segment2(newLeftSE, oldRightSE, this.rings.slice(), this.windings.slice());
39974 if (SweepEvent2.comparePoints(newSeg.leftSE.point, newSeg.rightSE.point) > 0) {
39975 newSeg.swapEvents();
39977 if (SweepEvent2.comparePoints(this.leftSE.point, this.rightSE.point) > 0) {
39980 if (alreadyLinked) {
39981 newLeftSE.checkForConsuming();
39982 newRightSE.checkForConsuming();
39986 /* Swap which event is left and right */
39988 const tmpEvt = this.rightSE;
39989 this.rightSE = this.leftSE;
39990 this.leftSE = tmpEvt;
39991 this.leftSE.isLeft = true;
39992 this.rightSE.isLeft = false;
39993 for (let i3 = 0, iMax = this.windings.length; i3 < iMax; i3++) {
39994 this.windings[i3] *= -1;
39997 /* Consume another segment. We take their rings under our wing
39998 * and mark them as consumed. Use for perfectly overlapping segments */
40000 let consumer = this;
40001 let consumee = other;
40002 while (consumer.consumedBy) consumer = consumer.consumedBy;
40003 while (consumee.consumedBy) consumee = consumee.consumedBy;
40004 const cmp2 = Segment2.compare(consumer, consumee);
40005 if (cmp2 === 0) return;
40007 const tmp = consumer;
40008 consumer = consumee;
40011 if (consumer.prev === consumee) {
40012 const tmp = consumer;
40013 consumer = consumee;
40016 for (let i3 = 0, iMax = consumee.rings.length; i3 < iMax; i3++) {
40017 const ring = consumee.rings[i3];
40018 const winding = consumee.windings[i3];
40019 const index2 = consumer.rings.indexOf(ring);
40020 if (index2 === -1) {
40021 consumer.rings.push(ring);
40022 consumer.windings.push(winding);
40023 } else consumer.windings[index2] += winding;
40025 consumee.rings = null;
40026 consumee.windings = null;
40027 consumee.consumedBy = consumer;
40028 consumee.leftSE.consumedBy = consumer.leftSE;
40029 consumee.rightSE.consumedBy = consumer.rightSE;
40031 /* The first segment previous segment chain that is in the result */
40033 if (this._prevInResult !== void 0) return this._prevInResult;
40034 if (!this.prev) this._prevInResult = null;
40035 else if (this.prev.isInResult()) this._prevInResult = this.prev;
40036 else this._prevInResult = this.prev.prevInResult();
40037 return this._prevInResult;
40040 if (this._beforeState !== void 0) return this._beforeState;
40041 if (!this.prev) this._beforeState = {
40047 const seg = this.prev.consumedBy || this.prev;
40048 this._beforeState = seg.afterState();
40050 return this._beforeState;
40053 if (this._afterState !== void 0) return this._afterState;
40054 const beforeState = this.beforeState();
40055 this._afterState = {
40056 rings: beforeState.rings.slice(0),
40057 windings: beforeState.windings.slice(0),
40060 const ringsAfter = this._afterState.rings;
40061 const windingsAfter = this._afterState.windings;
40062 const mpsAfter = this._afterState.multiPolys;
40063 for (let i3 = 0, iMax = this.rings.length; i3 < iMax; i3++) {
40064 const ring = this.rings[i3];
40065 const winding = this.windings[i3];
40066 const index2 = ringsAfter.indexOf(ring);
40067 if (index2 === -1) {
40068 ringsAfter.push(ring);
40069 windingsAfter.push(winding);
40070 } else windingsAfter[index2] += winding;
40072 const polysAfter = [];
40073 const polysExclude = [];
40074 for (let i3 = 0, iMax = ringsAfter.length; i3 < iMax; i3++) {
40075 if (windingsAfter[i3] === 0) continue;
40076 const ring = ringsAfter[i3];
40077 const poly = ring.poly;
40078 if (polysExclude.indexOf(poly) !== -1) continue;
40079 if (ring.isExterior) polysAfter.push(poly);
40081 if (polysExclude.indexOf(poly) === -1) polysExclude.push(poly);
40082 const index2 = polysAfter.indexOf(ring.poly);
40083 if (index2 !== -1) polysAfter.splice(index2, 1);
40086 for (let i3 = 0, iMax = polysAfter.length; i3 < iMax; i3++) {
40087 const mp = polysAfter[i3].multiPoly;
40088 if (mpsAfter.indexOf(mp) === -1) mpsAfter.push(mp);
40090 return this._afterState;
40092 /* Is this segment part of the final result? */
40094 if (this.consumedBy) return false;
40095 if (this._isInResult !== void 0) return this._isInResult;
40096 const mpsBefore = this.beforeState().multiPolys;
40097 const mpsAfter = this.afterState().multiPolys;
40098 switch (operation2.type) {
40100 const noBefores = mpsBefore.length === 0;
40101 const noAfters = mpsAfter.length === 0;
40102 this._isInResult = noBefores !== noAfters;
40105 case "intersection": {
40108 if (mpsBefore.length < mpsAfter.length) {
40109 least = mpsBefore.length;
40110 most = mpsAfter.length;
40112 least = mpsAfter.length;
40113 most = mpsBefore.length;
40115 this._isInResult = most === operation2.numMultiPolys && least < most;
40119 const diff = Math.abs(mpsBefore.length - mpsAfter.length);
40120 this._isInResult = diff % 2 === 1;
40123 case "difference": {
40124 const isJustSubject = (mps) => mps.length === 1 && mps[0].isSubject;
40125 this._isInResult = isJustSubject(mpsBefore) !== isJustSubject(mpsAfter);
40129 throw new Error(`Unrecognized operation type found ${operation2.type}`);
40131 return this._isInResult;
40135 constructor(geomRing, poly, isExterior) {
40136 if (!Array.isArray(geomRing) || geomRing.length === 0) {
40137 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
40140 this.isExterior = isExterior;
40141 this.segments = [];
40142 if (typeof geomRing[0][0] !== "number" || typeof geomRing[0][1] !== "number") {
40143 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
40145 const firstPoint = rounder.round(geomRing[0][0], geomRing[0][1]);
40156 let prevPoint = firstPoint;
40157 for (let i3 = 1, iMax = geomRing.length; i3 < iMax; i3++) {
40158 if (typeof geomRing[i3][0] !== "number" || typeof geomRing[i3][1] !== "number") {
40159 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
40161 let point = rounder.round(geomRing[i3][0], geomRing[i3][1]);
40162 if (point.x === prevPoint.x && point.y === prevPoint.y) continue;
40163 this.segments.push(Segment2.fromRing(prevPoint, point, this));
40164 if (point.x < this.bbox.ll.x) this.bbox.ll.x = point.x;
40165 if (point.y < this.bbox.ll.y) this.bbox.ll.y = point.y;
40166 if (point.x > this.bbox.ur.x) this.bbox.ur.x = point.x;
40167 if (point.y > this.bbox.ur.y) this.bbox.ur.y = point.y;
40170 if (firstPoint.x !== prevPoint.x || firstPoint.y !== prevPoint.y) {
40171 this.segments.push(Segment2.fromRing(prevPoint, firstPoint, this));
40175 const sweepEvents = [];
40176 for (let i3 = 0, iMax = this.segments.length; i3 < iMax; i3++) {
40177 const segment = this.segments[i3];
40178 sweepEvents.push(segment.leftSE);
40179 sweepEvents.push(segment.rightSE);
40181 return sweepEvents;
40185 constructor(geomPoly, multiPoly) {
40186 if (!Array.isArray(geomPoly)) {
40187 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
40189 this.exteriorRing = new RingIn2(geomPoly[0], this, true);
40192 x: this.exteriorRing.bbox.ll.x,
40193 y: this.exteriorRing.bbox.ll.y
40196 x: this.exteriorRing.bbox.ur.x,
40197 y: this.exteriorRing.bbox.ur.y
40200 this.interiorRings = [];
40201 for (let i3 = 1, iMax = geomPoly.length; i3 < iMax; i3++) {
40202 const ring = new RingIn2(geomPoly[i3], this, false);
40203 if (ring.bbox.ll.x < this.bbox.ll.x) this.bbox.ll.x = ring.bbox.ll.x;
40204 if (ring.bbox.ll.y < this.bbox.ll.y) this.bbox.ll.y = ring.bbox.ll.y;
40205 if (ring.bbox.ur.x > this.bbox.ur.x) this.bbox.ur.x = ring.bbox.ur.x;
40206 if (ring.bbox.ur.y > this.bbox.ur.y) this.bbox.ur.y = ring.bbox.ur.y;
40207 this.interiorRings.push(ring);
40209 this.multiPoly = multiPoly;
40212 const sweepEvents = this.exteriorRing.getSweepEvents();
40213 for (let i3 = 0, iMax = this.interiorRings.length; i3 < iMax; i3++) {
40214 const ringSweepEvents = this.interiorRings[i3].getSweepEvents();
40215 for (let j3 = 0, jMax = ringSweepEvents.length; j3 < jMax; j3++) {
40216 sweepEvents.push(ringSweepEvents[j3]);
40219 return sweepEvents;
40222 class MultiPolyIn2 {
40223 constructor(geom, isSubject) {
40224 if (!Array.isArray(geom)) {
40225 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
40228 if (typeof geom[0][0][0] === "number") geom = [geom];
40234 x: Number.POSITIVE_INFINITY,
40235 y: Number.POSITIVE_INFINITY
40238 x: Number.NEGATIVE_INFINITY,
40239 y: Number.NEGATIVE_INFINITY
40242 for (let i3 = 0, iMax = geom.length; i3 < iMax; i3++) {
40243 const poly = new PolyIn2(geom[i3], this);
40244 if (poly.bbox.ll.x < this.bbox.ll.x) this.bbox.ll.x = poly.bbox.ll.x;
40245 if (poly.bbox.ll.y < this.bbox.ll.y) this.bbox.ll.y = poly.bbox.ll.y;
40246 if (poly.bbox.ur.x > this.bbox.ur.x) this.bbox.ur.x = poly.bbox.ur.x;
40247 if (poly.bbox.ur.y > this.bbox.ur.y) this.bbox.ur.y = poly.bbox.ur.y;
40248 this.polys.push(poly);
40250 this.isSubject = isSubject;
40253 const sweepEvents = [];
40254 for (let i3 = 0, iMax = this.polys.length; i3 < iMax; i3++) {
40255 const polySweepEvents = this.polys[i3].getSweepEvents();
40256 for (let j3 = 0, jMax = polySweepEvents.length; j3 < jMax; j3++) {
40257 sweepEvents.push(polySweepEvents[j3]);
40260 return sweepEvents;
40264 /* Given the segments from the sweep line pass, compute & return a series
40265 * of closed rings from all the segments marked to be part of the result */
40266 static factory(allSegments) {
40267 const ringsOut = [];
40268 for (let i3 = 0, iMax = allSegments.length; i3 < iMax; i3++) {
40269 const segment = allSegments[i3];
40270 if (!segment.isInResult() || segment.ringOut) continue;
40271 let prevEvent = null;
40272 let event = segment.leftSE;
40273 let nextEvent = segment.rightSE;
40274 const events = [event];
40275 const startingPoint = event.point;
40276 const intersectionLEs = [];
40280 events.push(event);
40281 if (event.point === startingPoint) break;
40283 const availableLEs = event.getAvailableLinkedEvents();
40284 if (availableLEs.length === 0) {
40285 const firstPt = events[0].point;
40286 const lastPt = events[events.length - 1].point;
40287 throw new Error(`Unable to complete output ring starting at [${firstPt.x}, ${firstPt.y}]. Last matching segment found ends at [${lastPt.x}, ${lastPt.y}].`);
40289 if (availableLEs.length === 1) {
40290 nextEvent = availableLEs[0].otherSE;
40293 let indexLE = null;
40294 for (let j3 = 0, jMax = intersectionLEs.length; j3 < jMax; j3++) {
40295 if (intersectionLEs[j3].point === event.point) {
40300 if (indexLE !== null) {
40301 const intersectionLE = intersectionLEs.splice(indexLE)[0];
40302 const ringEvents = events.splice(intersectionLE.index);
40303 ringEvents.unshift(ringEvents[0].otherSE);
40304 ringsOut.push(new RingOut2(ringEvents.reverse()));
40307 intersectionLEs.push({
40308 index: events.length,
40311 const comparator = event.getLeftmostComparator(prevEvent);
40312 nextEvent = availableLEs.sort(comparator)[0].otherSE;
40316 ringsOut.push(new RingOut2(events));
40320 constructor(events) {
40321 this.events = events;
40322 for (let i3 = 0, iMax = events.length; i3 < iMax; i3++) {
40323 events[i3].segment.ringOut = this;
40328 let prevPt = this.events[0].point;
40329 const points = [prevPt];
40330 for (let i3 = 1, iMax = this.events.length - 1; i3 < iMax; i3++) {
40331 const pt3 = this.events[i3].point;
40332 const nextPt2 = this.events[i3 + 1].point;
40333 if (compareVectorAngles(pt3, prevPt, nextPt2) === 0) continue;
40337 if (points.length === 1) return null;
40338 const pt2 = points[0];
40339 const nextPt = points[1];
40340 if (compareVectorAngles(pt2, prevPt, nextPt) === 0) points.shift();
40341 points.push(points[0]);
40342 const step = this.isExteriorRing() ? 1 : -1;
40343 const iStart = this.isExteriorRing() ? 0 : points.length - 1;
40344 const iEnd = this.isExteriorRing() ? points.length : -1;
40345 const orderedPoints = [];
40346 for (let i3 = iStart; i3 != iEnd; i3 += step) orderedPoints.push([points[i3].x, points[i3].y]);
40347 return orderedPoints;
40350 if (this._isExteriorRing === void 0) {
40351 const enclosing = this.enclosingRing();
40352 this._isExteriorRing = enclosing ? !enclosing.isExteriorRing() : true;
40354 return this._isExteriorRing;
40357 if (this._enclosingRing === void 0) {
40358 this._enclosingRing = this._calcEnclosingRing();
40360 return this._enclosingRing;
40362 /* Returns the ring that encloses this one, if any */
40363 _calcEnclosingRing() {
40364 let leftMostEvt = this.events[0];
40365 for (let i3 = 1, iMax = this.events.length; i3 < iMax; i3++) {
40366 const evt = this.events[i3];
40367 if (SweepEvent2.compare(leftMostEvt, evt) > 0) leftMostEvt = evt;
40369 let prevSeg = leftMostEvt.segment.prevInResult();
40370 let prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
40372 if (!prevSeg) return null;
40373 if (!prevPrevSeg) return prevSeg.ringOut;
40374 if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
40375 if (prevPrevSeg.ringOut.enclosingRing() !== prevSeg.ringOut) {
40376 return prevSeg.ringOut;
40377 } else return prevSeg.ringOut.enclosingRing();
40379 prevSeg = prevPrevSeg.prevInResult();
40380 prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
40385 constructor(exteriorRing) {
40386 this.exteriorRing = exteriorRing;
40387 exteriorRing.poly = this;
40388 this.interiorRings = [];
40390 addInterior(ring) {
40391 this.interiorRings.push(ring);
40395 const geom = [this.exteriorRing.getGeom()];
40396 if (geom[0] === null) return null;
40397 for (let i3 = 0, iMax = this.interiorRings.length; i3 < iMax; i3++) {
40398 const ringGeom = this.interiorRings[i3].getGeom();
40399 if (ringGeom === null) continue;
40400 geom.push(ringGeom);
40405 class MultiPolyOut2 {
40406 constructor(rings) {
40407 this.rings = rings;
40408 this.polys = this._composePolys(rings);
40412 for (let i3 = 0, iMax = this.polys.length; i3 < iMax; i3++) {
40413 const polyGeom = this.polys[i3].getGeom();
40414 if (polyGeom === null) continue;
40415 geom.push(polyGeom);
40419 _composePolys(rings) {
40421 for (let i3 = 0, iMax = rings.length; i3 < iMax; i3++) {
40422 const ring = rings[i3];
40423 if (ring.poly) continue;
40424 if (ring.isExteriorRing()) polys.push(new PolyOut2(ring));
40426 const enclosingRing = ring.enclosingRing();
40427 if (!enclosingRing.poly) polys.push(new PolyOut2(enclosingRing));
40428 enclosingRing.poly.addInterior(ring);
40435 constructor(queue) {
40436 let comparator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Segment2.compare;
40437 this.queue = queue;
40438 this.tree = new Tree(comparator);
40439 this.segments = [];
40442 const segment = event.segment;
40443 const newEvents = [];
40444 if (event.consumedBy) {
40445 if (event.isLeft) this.queue.remove(event.otherSE);
40446 else this.tree.remove(segment);
40449 const node = event.isLeft ? this.tree.add(segment) : this.tree.find(segment);
40450 if (!node) throw new Error(`Unable to find segment #${segment.id} [${segment.leftSE.point.x}, ${segment.leftSE.point.y}] -> [${segment.rightSE.point.x}, ${segment.rightSE.point.y}] in SweepLine tree.`);
40451 let prevNode = node;
40452 let nextNode = node;
40453 let prevSeg = void 0;
40454 let nextSeg = void 0;
40455 while (prevSeg === void 0) {
40456 prevNode = this.tree.prev(prevNode);
40457 if (prevNode === null) prevSeg = null;
40458 else if (prevNode.key.consumedBy === void 0) prevSeg = prevNode.key;
40460 while (nextSeg === void 0) {
40461 nextNode = this.tree.next(nextNode);
40462 if (nextNode === null) nextSeg = null;
40463 else if (nextNode.key.consumedBy === void 0) nextSeg = nextNode.key;
40465 if (event.isLeft) {
40466 let prevMySplitter = null;
40468 const prevInter = prevSeg.getIntersection(segment);
40469 if (prevInter !== null) {
40470 if (!segment.isAnEndpoint(prevInter)) prevMySplitter = prevInter;
40471 if (!prevSeg.isAnEndpoint(prevInter)) {
40472 const newEventsFromSplit = this._splitSafely(prevSeg, prevInter);
40473 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
40474 newEvents.push(newEventsFromSplit[i3]);
40479 let nextMySplitter = null;
40481 const nextInter = nextSeg.getIntersection(segment);
40482 if (nextInter !== null) {
40483 if (!segment.isAnEndpoint(nextInter)) nextMySplitter = nextInter;
40484 if (!nextSeg.isAnEndpoint(nextInter)) {
40485 const newEventsFromSplit = this._splitSafely(nextSeg, nextInter);
40486 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
40487 newEvents.push(newEventsFromSplit[i3]);
40492 if (prevMySplitter !== null || nextMySplitter !== null) {
40493 let mySplitter = null;
40494 if (prevMySplitter === null) mySplitter = nextMySplitter;
40495 else if (nextMySplitter === null) mySplitter = prevMySplitter;
40497 const cmpSplitters = SweepEvent2.comparePoints(prevMySplitter, nextMySplitter);
40498 mySplitter = cmpSplitters <= 0 ? prevMySplitter : nextMySplitter;
40500 this.queue.remove(segment.rightSE);
40501 newEvents.push(segment.rightSE);
40502 const newEventsFromSplit = segment.split(mySplitter);
40503 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
40504 newEvents.push(newEventsFromSplit[i3]);
40507 if (newEvents.length > 0) {
40508 this.tree.remove(segment);
40509 newEvents.push(event);
40511 this.segments.push(segment);
40512 segment.prev = prevSeg;
40515 if (prevSeg && nextSeg) {
40516 const inter = prevSeg.getIntersection(nextSeg);
40517 if (inter !== null) {
40518 if (!prevSeg.isAnEndpoint(inter)) {
40519 const newEventsFromSplit = this._splitSafely(prevSeg, inter);
40520 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
40521 newEvents.push(newEventsFromSplit[i3]);
40524 if (!nextSeg.isAnEndpoint(inter)) {
40525 const newEventsFromSplit = this._splitSafely(nextSeg, inter);
40526 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
40527 newEvents.push(newEventsFromSplit[i3]);
40532 this.tree.remove(segment);
40536 /* Safely split a segment that is currently in the datastructures
40537 * IE - a segment other than the one that is currently being processed. */
40538 _splitSafely(seg, pt2) {
40539 this.tree.remove(seg);
40540 const rightSE = seg.rightSE;
40541 this.queue.remove(rightSE);
40542 const newEvents = seg.split(pt2);
40543 newEvents.push(rightSE);
40544 if (seg.consumedBy === void 0) this.tree.add(seg);
40548 const POLYGON_CLIPPING_MAX_QUEUE_SIZE = typeof process !== "undefined" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6;
40549 const POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS = typeof process !== "undefined" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
40551 run(type2, geom, moreGeoms) {
40552 operation2.type = type2;
40554 const multipolys = [new MultiPolyIn2(geom, true)];
40555 for (let i3 = 0, iMax = moreGeoms.length; i3 < iMax; i3++) {
40556 multipolys.push(new MultiPolyIn2(moreGeoms[i3], false));
40558 operation2.numMultiPolys = multipolys.length;
40559 if (operation2.type === "difference") {
40560 const subject = multipolys[0];
40562 while (i3 < multipolys.length) {
40563 if (getBboxOverlap2(multipolys[i3].bbox, subject.bbox) !== null) i3++;
40564 else multipolys.splice(i3, 1);
40567 if (operation2.type === "intersection") {
40568 for (let i3 = 0, iMax = multipolys.length; i3 < iMax; i3++) {
40569 const mpA = multipolys[i3];
40570 for (let j3 = i3 + 1, jMax = multipolys.length; j3 < jMax; j3++) {
40571 if (getBboxOverlap2(mpA.bbox, multipolys[j3].bbox) === null) return [];
40575 const queue = new Tree(SweepEvent2.compare);
40576 for (let i3 = 0, iMax = multipolys.length; i3 < iMax; i3++) {
40577 const sweepEvents = multipolys[i3].getSweepEvents();
40578 for (let j3 = 0, jMax = sweepEvents.length; j3 < jMax; j3++) {
40579 queue.insert(sweepEvents[j3]);
40580 if (queue.size > POLYGON_CLIPPING_MAX_QUEUE_SIZE) {
40581 throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).");
40585 const sweepLine = new SweepLine2(queue);
40586 let prevQueueSize = queue.size;
40587 let node = queue.pop();
40589 const evt = node.key;
40590 if (queue.size === prevQueueSize) {
40591 const seg = evt.segment;
40592 throw new Error(`Unable to pop() ${evt.isLeft ? "left" : "right"} SweepEvent [${evt.point.x}, ${evt.point.y}] from segment #${seg.id} [${seg.leftSE.point.x}, ${seg.leftSE.point.y}] -> [${seg.rightSE.point.x}, ${seg.rightSE.point.y}] from queue.`);
40594 if (queue.size > POLYGON_CLIPPING_MAX_QUEUE_SIZE) {
40595 throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");
40597 if (sweepLine.segments.length > POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS) {
40598 throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
40600 const newEvents = sweepLine.process(evt);
40601 for (let i3 = 0, iMax = newEvents.length; i3 < iMax; i3++) {
40602 const evt2 = newEvents[i3];
40603 if (evt2.consumedBy === void 0) queue.insert(evt2);
40605 prevQueueSize = queue.size;
40606 node = queue.pop();
40609 const ringsOut = RingOut2.factory(sweepLine.segments);
40610 const result = new MultiPolyOut2(ringsOut);
40611 return result.getGeom();
40614 const operation2 = new Operation2();
40615 const union2 = function(geom) {
40616 for (var _len = arguments.length, moreGeoms = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
40617 moreGeoms[_key - 1] = arguments[_key];
40619 return operation2.run("union", geom, moreGeoms);
40621 const intersection2 = function(geom) {
40622 for (var _len2 = arguments.length, moreGeoms = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
40623 moreGeoms[_key2 - 1] = arguments[_key2];
40625 return operation2.run("intersection", geom, moreGeoms);
40627 const xor = function(geom) {
40628 for (var _len3 = arguments.length, moreGeoms = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
40629 moreGeoms[_key3 - 1] = arguments[_key3];
40631 return operation2.run("xor", geom, moreGeoms);
40633 const difference2 = function(subjectGeom) {
40634 for (var _len4 = arguments.length, clippingGeoms = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
40635 clippingGeoms[_key4 - 1] = arguments[_key4];
40637 return operation2.run("difference", subjectGeom, clippingGeoms);
40641 intersection: intersection2,
40643 difference: difference2
40650 // modules/services/vector_tile.js
40651 var vector_tile_exports = {};
40652 __export(vector_tile_exports, {
40653 default: () => vector_tile_default
40655 function abortRequest6(controller) {
40656 controller.abort();
40658 function vtToGeoJSON(data, tile, mergeCache) {
40659 var vectorTile = new VectorTile(new Pbf(data));
40660 var layers = Object.keys(vectorTile.layers);
40661 if (!Array.isArray(layers)) {
40665 layers.forEach(function(layerID) {
40666 var layer = vectorTile.layers[layerID];
40668 for (var i3 = 0; i3 < layer.length; i3++) {
40669 var feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
40670 var geometry = feature3.geometry;
40671 if (geometry.type === "Polygon") {
40672 geometry.type = "MultiPolygon";
40673 geometry.coordinates = [geometry.coordinates];
40675 var isClipped = false;
40676 if (geometry.type === "MultiPolygon") {
40677 var featureClip = turf_bbox_clip_default(feature3, tile.extent.rectangle());
40678 if (!(0, import_fast_deep_equal4.default)(feature3.geometry, featureClip.geometry)) {
40681 if (!feature3.geometry.coordinates.length) continue;
40682 if (!feature3.geometry.coordinates[0].length) continue;
40684 var featurehash = utilHashcode((0, import_fast_json_stable_stringify.default)(feature3));
40685 var propertyhash = utilHashcode((0, import_fast_json_stable_stringify.default)(feature3.properties || {}));
40686 feature3.__layerID__ = layerID.replace(/[^_a-zA-Z0-9\-]/g, "_");
40687 feature3.__featurehash__ = featurehash;
40688 feature3.__propertyhash__ = propertyhash;
40689 features.push(feature3);
40690 if (isClipped && geometry.type === "MultiPolygon") {
40691 var merged = mergeCache[propertyhash];
40692 if (merged && merged.length) {
40693 var other = merged[0];
40694 var coords = import_polygon_clipping.default.union(
40695 feature3.geometry.coordinates,
40696 other.geometry.coordinates
40698 if (!coords || !coords.length) {
40701 merged.push(feature3);
40702 for (var j3 = 0; j3 < merged.length; j3++) {
40703 merged[j3].geometry.coordinates = coords;
40704 merged[j3].__featurehash__ = featurehash;
40707 mergeCache[propertyhash] = [feature3];
40715 function loadTile3(source, tile) {
40716 if (source.loaded[tile.id] || source.inflight[tile.id]) return;
40717 var url = source.template.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace(/\{[t-]y\}/, Math.pow(2, tile.xyz[2]) - tile.xyz[1] - 1).replace(/\{z(oom)?\}/, tile.xyz[2]).replace(/\{switch:([^}]+)\}/, function(s2, r2) {
40718 var subdomains = r2.split(",");
40719 return subdomains[(tile.xyz[0] + tile.xyz[1]) % subdomains.length];
40721 var controller = new AbortController();
40722 source.inflight[tile.id] = controller;
40723 fetch(url, { signal: controller.signal }).then(function(response) {
40724 if (!response.ok) {
40725 throw new Error(response.status + " " + response.statusText);
40727 source.loaded[tile.id] = [];
40728 delete source.inflight[tile.id];
40729 return response.arrayBuffer();
40730 }).then(function(data) {
40732 throw new Error("No Data");
40734 var z3 = tile.xyz[2];
40735 if (!source.canMerge[z3]) {
40736 source.canMerge[z3] = {};
40738 source.loaded[tile.id] = vtToGeoJSON(data, tile, source.canMerge[z3]);
40739 dispatch11.call("loadedData");
40740 }).catch(function() {
40741 source.loaded[tile.id] = [];
40742 delete source.inflight[tile.id];
40745 var import_fast_deep_equal4, import_fast_json_stable_stringify, import_polygon_clipping, tiler7, dispatch11, _vtCache, vector_tile_default;
40746 var init_vector_tile2 = __esm({
40747 "modules/services/vector_tile.js"() {
40750 import_fast_deep_equal4 = __toESM(require_fast_deep_equal(), 1);
40752 import_fast_json_stable_stringify = __toESM(require_fast_json_stable_stringify(), 1);
40753 import_polygon_clipping = __toESM(require_polygon_clipping_umd(), 1);
40755 init_vector_tile();
40757 tiler7 = utilTiler().tileSize(512).margin(1);
40758 dispatch11 = dispatch_default("loadedData");
40759 vector_tile_default = {
40764 this.event = utilRebind(this, dispatch11, "on");
40766 reset: function() {
40767 for (var sourceID in _vtCache) {
40768 var source = _vtCache[sourceID];
40769 if (source && source.inflight) {
40770 Object.values(source.inflight).forEach(abortRequest6);
40775 addSource: function(sourceID, template) {
40776 _vtCache[sourceID] = { template, inflight: {}, loaded: {}, canMerge: {} };
40777 return _vtCache[sourceID];
40779 data: function(sourceID, projection2) {
40780 var source = _vtCache[sourceID];
40781 if (!source) return [];
40782 var tiles = tiler7.getTiles(projection2);
40785 for (var i3 = 0; i3 < tiles.length; i3++) {
40786 var features = source.loaded[tiles[i3].id];
40787 if (!features || !features.length) continue;
40788 for (var j3 = 0; j3 < features.length; j3++) {
40789 var feature3 = features[j3];
40790 var hash2 = feature3.__featurehash__;
40791 if (seen[hash2]) continue;
40792 seen[hash2] = true;
40793 results.push(Object.assign({}, feature3));
40798 loadTiles: function(sourceID, template, projection2) {
40799 var source = _vtCache[sourceID];
40801 source = this.addSource(sourceID, template);
40803 var tiles = tiler7.getTiles(projection2);
40804 Object.keys(source.inflight).forEach(function(k2) {
40805 var wanted = tiles.find(function(tile) {
40806 return k2 === tile.id;
40809 abortRequest6(source.inflight[k2]);
40810 delete source.inflight[k2];
40813 tiles.forEach(function(tile) {
40814 loadTile3(source, tile);
40817 cache: function() {
40824 // modules/services/wikidata.js
40825 var wikidata_exports = {};
40826 __export(wikidata_exports, {
40827 default: () => wikidata_default
40829 var apibase5, _wikidataCache, wikidata_default;
40830 var init_wikidata = __esm({
40831 "modules/services/wikidata.js"() {
40836 apibase5 = "https://www.wikidata.org/w/api.php?";
40837 _wikidataCache = {};
40838 wikidata_default = {
40841 reset: function() {
40842 _wikidataCache = {};
40844 // Search for Wikidata items matching the query
40845 itemsForSearchQuery: function(query, callback, language) {
40847 if (callback) callback("No query", {});
40850 var lang = this.languagesToQuery()[0];
40851 var url = apibase5 + utilQsString({
40852 action: "wbsearchentities",
40857 // the language to search
40858 language: language || lang,
40859 // the language for the label and description in the result
40864 json_default(url).then((result) => {
40865 if (result && result.error) {
40866 if (result.error.code === "badvalue" && result.error.info.includes(lang) && !language && lang.includes("-")) {
40867 this.itemsForSearchQuery(query, callback, lang.split("-")[0]);
40870 throw new Error(result.error);
40873 if (callback) callback(null, result.search || {});
40874 }).catch(function(err) {
40875 if (callback) callback(err.message, {});
40878 // Given a Wikipedia language and article title,
40879 // return an array of corresponding Wikidata entities.
40880 itemsByTitle: function(lang, title, callback) {
40882 if (callback) callback("No title", {});
40885 lang = lang || "en";
40886 var url = apibase5 + utilQsString({
40887 action: "wbgetentities",
40890 sites: lang.replace(/-/g, "_") + "wiki",
40893 // shrink response by filtering to one language
40896 json_default(url).then(function(result) {
40897 if (result && result.error) {
40898 throw new Error(result.error);
40900 if (callback) callback(null, result.entities || {});
40901 }).catch(function(err) {
40902 if (callback) callback(err.message, {});
40905 languagesToQuery: function() {
40906 return _mainLocalizer.localeCodes().map(function(code) {
40907 return code.toLowerCase();
40908 }).filter(function(code) {
40909 return code !== "en-us";
40912 entityByQID: function(qid, callback) {
40914 callback("No qid", {});
40917 if (_wikidataCache[qid]) {
40918 if (callback) callback(null, _wikidataCache[qid]);
40921 var langs = this.languagesToQuery();
40922 var url = apibase5 + utilQsString({
40923 action: "wbgetentities",
40927 props: "labels|descriptions|claims|sitelinks",
40928 sitefilter: langs.map(function(d4) {
40929 return d4 + "wiki";
40931 languages: langs.join("|"),
40932 languagefallback: 1,
40935 json_default(url).then(function(result) {
40936 if (result && result.error) {
40937 throw new Error(result.error);
40939 if (callback) callback(null, result.entities[qid] || {});
40940 }).catch(function(err) {
40941 if (callback) callback(err.message, {});
40944 // Pass `params` object of the form:
40946 // qid: 'string' // brand wikidata (e.g. 'Q37158')
40949 // Get an result object used to display tag documentation
40951 // title: 'string',
40952 // description: 'string',
40953 // editURL: 'string',
40954 // imageURL: 'string',
40955 // wiki: { title: 'string', text: 'string', url: 'string' }
40958 getDocs: function(params, callback) {
40959 var langs = this.languagesToQuery();
40960 this.entityByQID(params.qid, function(err, entity) {
40961 if (err || !entity) {
40962 callback(err || "No entity");
40967 for (i3 in langs) {
40968 let code = langs[i3];
40969 if (entity.descriptions[code] && entity.descriptions[code].language === code) {
40970 description = entity.descriptions[code];
40974 if (!description && Object.values(entity.descriptions).length) description = Object.values(entity.descriptions)[0];
40977 description: (selection2) => selection2.text(description ? description.value : ""),
40978 descriptionLocaleCode: description ? description.language : "",
40979 editURL: "https://www.wikidata.org/wiki/" + entity.id
40981 if (entity.claims) {
40982 var imageroot = "https://commons.wikimedia.org/w/index.php";
40983 var props = ["P154", "P18"];
40985 for (i3 = 0; i3 < props.length; i3++) {
40986 prop = entity.claims[props[i3]];
40987 if (prop && Object.keys(prop).length > 0) {
40988 image = prop[Object.keys(prop)[0]].mainsnak.datavalue.value;
40990 result.imageURL = imageroot + "?" + utilQsString({
40991 title: "Special:Redirect/file/" + image,
40999 if (entity.sitelinks) {
41000 var englishLocale = _mainLocalizer.languageCode().toLowerCase() === "en";
41001 for (i3 = 0; i3 < langs.length; i3++) {
41002 var w3 = langs[i3] + "wiki";
41003 if (entity.sitelinks[w3]) {
41004 var title = entity.sitelinks[w3].title;
41005 var tKey = "inspector.wiki_reference";
41006 if (!englishLocale && langs[i3] === "en") {
41007 tKey = "inspector.wiki_en_reference";
41012 url: "https://" + langs[i3] + ".wikipedia.org/wiki/" + title.replace(/ /g, "_")
41018 callback(null, result);
41025 // modules/services/wikipedia.js
41026 var wikipedia_exports = {};
41027 __export(wikipedia_exports, {
41028 default: () => wikipedia_default
41030 var endpoint, wikipedia_default;
41031 var init_wikipedia = __esm({
41032 "modules/services/wikipedia.js"() {
41036 endpoint = "https://en.wikipedia.org/w/api.php?";
41037 wikipedia_default = {
41040 reset: function() {
41042 search: function(lang, query, callback) {
41044 if (callback) callback("No Query", []);
41047 lang = lang || "en";
41048 var url = endpoint.replace("en", lang) + utilQsString({
41052 srinfo: "suggestion",
41057 json_default(url).then(function(result) {
41058 if (result && result.error) {
41059 throw new Error(result.error);
41060 } else if (!result || !result.query || !result.query.search) {
41061 throw new Error("No Results");
41064 var titles = result.query.search.map(function(d4) {
41067 callback(null, titles);
41069 }).catch(function(err) {
41070 if (callback) callback(err, []);
41073 suggestions: function(lang, query, callback) {
41075 if (callback) callback("", []);
41078 lang = lang || "en";
41079 var url = endpoint.replace("en", lang) + utilQsString({
41080 action: "opensearch",
41087 json_default(url).then(function(result) {
41088 if (result && result.error) {
41089 throw new Error(result.error);
41090 } else if (!result || result.length < 2) {
41091 throw new Error("No Results");
41093 if (callback) callback(null, result[1] || []);
41094 }).catch(function(err) {
41095 if (callback) callback(err.message, []);
41098 translations: function(lang, title, callback) {
41100 if (callback) callback("No Title");
41103 var url = endpoint.replace("en", lang) + utilQsString({
41111 json_default(url).then(function(result) {
41112 if (result && result.error) {
41113 throw new Error(result.error);
41114 } else if (!result || !result.query || !result.query.pages) {
41115 throw new Error("No Results");
41118 var list = result.query.pages[Object.keys(result.query.pages)[0]];
41119 var translations = {};
41120 if (list && list.langlinks) {
41121 list.langlinks.forEach(function(d4) {
41122 translations[d4.lang] = d4["*"];
41125 callback(null, translations);
41127 }).catch(function(err) {
41128 if (callback) callback(err.message);
41135 // modules/services/mapilio.js
41136 var mapilio_exports = {};
41137 __export(mapilio_exports, {
41138 default: () => mapilio_default
41140 function partitionViewport5(projection2) {
41141 const z3 = geoScaleToZoom(projection2.scale());
41142 const z22 = Math.ceil(z3 * 2) / 2 + 2.5;
41143 const tiler8 = utilTiler().zoomExtent([z22, z22]);
41144 return tiler8.getTiles(projection2).map(function(tile) {
41145 return tile.extent;
41148 function searchLimited5(limit, projection2, rtree) {
41149 limit = limit || 5;
41150 return partitionViewport5(projection2).reduce(function(result, extent) {
41151 const found = rtree.search(extent.bbox()).slice(0, limit).map(function(d4) {
41154 return found.length ? result.concat(found) : result;
41157 function loadTiles4(which, url, maxZoom2, projection2) {
41158 const tiler8 = utilTiler().zoomExtent([minZoom2, maxZoom2]).skipNullIsland(true);
41159 const tiles = tiler8.getTiles(projection2);
41160 tiles.forEach(function(tile) {
41161 loadTile4(which, url, tile);
41164 function loadTile4(which, url, tile) {
41165 const cache = _cache3.requests;
41166 const tileId = `${tile.id}-${which}`;
41167 if (cache.loaded[tileId] || cache.inflight[tileId]) return;
41168 const controller = new AbortController();
41169 cache.inflight[tileId] = controller;
41170 const requestUrl = url.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace("{z}", tile.xyz[2]);
41171 fetch(requestUrl, { signal: controller.signal }).then(function(response) {
41172 if (!response.ok) {
41173 throw new Error(response.status + " " + response.statusText);
41175 cache.loaded[tileId] = true;
41176 delete cache.inflight[tileId];
41177 return response.arrayBuffer();
41178 }).then(function(data) {
41179 if (data.byteLength === 0) {
41180 throw new Error("No Data");
41182 loadTileDataToCache2(data, tile, which);
41183 if (which === "images") {
41184 dispatch12.call("loadedImages");
41186 dispatch12.call("loadedLines");
41188 }).catch(function(e3) {
41189 if (e3.message === "No Data") {
41190 cache.loaded[tileId] = true;
41196 function loadTileDataToCache2(data, tile) {
41197 const vectorTile = new VectorTile(new Pbf(data));
41198 if (vectorTile.layers.hasOwnProperty(pointLayer)) {
41199 const features = [];
41200 const cache = _cache3.images;
41201 const layer = vectorTile.layers[pointLayer];
41202 for (let i3 = 0; i3 < layer.length; i3++) {
41203 const feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
41204 const loc = feature3.geometry.coordinates;
41205 let resolutionArr = feature3.properties.resolution.split("x");
41206 let sourceWidth = Math.max(resolutionArr[0], resolutionArr[1]);
41207 let sourceHeight = Math.min(resolutionArr[0], resolutionArr[1]);
41208 let isPano = sourceWidth % sourceHeight === 0;
41212 capture_time: feature3.properties.capture_time,
41213 id: feature3.properties.id,
41214 sequence_id: feature3.properties.sequence_uuid,
41215 heading: feature3.properties.heading,
41216 resolution: feature3.properties.resolution,
41219 cache.forImageId[d4.id] = d4;
41229 cache.rtree.load(features);
41232 if (vectorTile.layers.hasOwnProperty(lineLayer)) {
41233 const cache = _cache3.sequences;
41234 const layer = vectorTile.layers[lineLayer];
41235 for (let i3 = 0; i3 < layer.length; i3++) {
41236 const feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
41237 if (cache.lineString[feature3.properties.sequence_uuid]) {
41238 const cacheEntry = cache.lineString[feature3.properties.sequence_uuid];
41239 if (cacheEntry.some((f2) => {
41240 const cachedCoords = f2.geometry.coordinates;
41241 const featureCoords = feature3.geometry.coordinates;
41242 return isEqual_default(cachedCoords, featureCoords);
41244 cacheEntry.push(feature3);
41246 cache.lineString[feature3.properties.sequence_uuid] = [feature3];
41251 function getImageData(imageId, sequenceId) {
41252 return fetch(apiUrl2 + `/api/sequence-detail?sequence_uuid=${sequenceId}`, { method: "GET" }).then(function(response) {
41253 if (!response.ok) {
41254 throw new Error(response.status + " " + response.statusText);
41256 return response.json();
41257 }).then(function(data) {
41258 let index = data.data.findIndex((feature3) => feature3.id === imageId);
41259 const { filename, uploaded_hash } = data.data[index];
41260 _sceneOptions2.panorama = imageBaseUrl + "/" + uploaded_hash + "/" + filename + "/" + resolution;
41263 var apiUrl2, imageBaseUrl, baseTileUrl2, pointLayer, lineLayer, tileStyle, minZoom2, dispatch12, imgZoom2, pannellumViewerCSS3, pannellumViewerJS3, resolution, _activeImage, _cache3, _loadViewerPromise5, _pannellumViewer3, _sceneOptions2, _currScene2, mapilio_default;
41264 var init_mapilio = __esm({
41265 "modules/services/mapilio.js"() {
41272 init_vector_tile();
41278 apiUrl2 = "https://end.mapilio.com";
41279 imageBaseUrl = "https://cdn.mapilio.com/im";
41280 baseTileUrl2 = "https://geo.mapilio.com/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=mapilio:";
41281 pointLayer = "map_points";
41282 lineLayer = "map_roads_line";
41283 tileStyle = "&STYLE=&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=application/vnd.mapbox-vector-tile&TILECOL={x}&TILEROW={y}";
41285 dispatch12 = dispatch_default("loadedImages", "loadedLines");
41286 imgZoom2 = zoom_default2().extent([[0, 0], [320, 240]]).translateExtent([[0, 0], [320, 240]]).scaleExtent([1, 15]);
41287 pannellumViewerCSS3 = "pannellum/pannellum.css";
41288 pannellumViewerJS3 = "pannellum/pannellum.js";
41291 showFullscreenCtrl: false,
41299 mapilio_default = {
41300 // Initialize Mapilio
41305 this.event = utilRebind(this, dispatch12, "on");
41307 // Reset cache and state
41308 reset: function() {
41310 Object.values(_cache3.requests.inflight).forEach(function(request3) {
41315 images: { rtree: new RBush(), forImageId: {} },
41316 sequences: { rtree: new RBush(), lineString: {} },
41317 requests: { loaded: {}, inflight: {} }
41320 // Get visible images
41321 images: function(projection2) {
41323 return searchLimited5(limit, projection2, _cache3.images.rtree);
41325 cachedImage: function(imageKey) {
41326 return _cache3.images.forImageId[imageKey];
41328 // Load images in the visible area
41329 loadImages: function(projection2) {
41330 let url = baseTileUrl2 + pointLayer + tileStyle;
41331 loadTiles4("images", url, 14, projection2);
41333 // Load line in the visible area
41334 loadLines: function(projection2) {
41335 let url = baseTileUrl2 + lineLayer + tileStyle;
41336 loadTiles4("line", url, 14, projection2);
41338 // Get visible sequences
41339 sequences: function(projection2) {
41340 const viewport = projection2.clipExtent();
41341 const min3 = [viewport[0][0], viewport[1][1]];
41342 const max3 = [viewport[1][0], viewport[0][1]];
41343 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
41344 const sequenceIds = {};
41345 let lineStrings = [];
41346 _cache3.images.rtree.search(bbox2).forEach(function(d4) {
41347 if (d4.data.sequence_id) {
41348 sequenceIds[d4.data.sequence_id] = true;
41351 Object.keys(sequenceIds).forEach(function(sequenceId) {
41352 if (_cache3.sequences.lineString[sequenceId]) {
41353 lineStrings = lineStrings.concat(_cache3.sequences.lineString[sequenceId]);
41356 return lineStrings;
41358 // Set the currently visible image
41359 setActiveImage: function(image) {
41363 sequence_id: image.sequence_id
41366 _activeImage = null;
41369 // Update the currently highlighted sequence and selected bubble.
41370 setStyles: function(context, hovered) {
41371 const hoveredImageId = hovered && hovered.id;
41372 const hoveredSequenceId = hovered && hovered.sequence_id;
41373 const selectedSequenceId = _activeImage && _activeImage.sequence_id;
41374 const selectedImageId = _activeImage && _activeImage.id;
41375 const markers = context.container().selectAll(".layer-mapilio .viewfield-group");
41376 const sequences = context.container().selectAll(".layer-mapilio .sequence");
41377 markers.classed("highlighted", function(d4) {
41378 return d4.id === hoveredImageId;
41379 }).classed("hovered", function(d4) {
41380 return d4.id === hoveredImageId;
41381 }).classed("currentView", function(d4) {
41382 return d4.id === selectedImageId;
41384 sequences.classed("highlighted", function(d4) {
41385 return d4.properties.sequence_uuid === hoveredSequenceId;
41386 }).classed("currentView", function(d4) {
41387 return d4.properties.sequence_uuid === selectedSequenceId;
41391 updateUrlImage: function(imageKey) {
41392 const hash2 = utilStringQs(window.location.hash);
41394 hash2.photo = "mapilio/" + imageKey;
41396 delete hash2.photo;
41398 window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
41400 initViewer: function() {
41401 if (!window.pannellum) return;
41402 if (_pannellumViewer3) return;
41404 const sceneID = _currScene2.toString();
41406 "default": { firstScene: sceneID },
41409 options.scenes[sceneID] = _sceneOptions2;
41410 _pannellumViewer3 = window.pannellum.viewer("ideditor-viewer-mapilio-pnlm", options);
41412 selectImage: function(context, id2) {
41414 let d4 = this.cachedImage(id2);
41415 this.setActiveImage(d4);
41416 this.updateUrlImage(d4.id);
41417 let viewer = context.container().select(".photoviewer");
41418 if (!viewer.empty()) viewer.datum(d4);
41419 this.setStyles(context, null);
41420 if (!d4) return this;
41421 let wrap2 = context.container().select(".photoviewer .mapilio-wrapper");
41422 let attribution = wrap2.selectAll(".photo-attribution").text("");
41423 if (d4.capture_time) {
41424 attribution.append("span").attr("class", "captured_at").text(localeDateString2(d4.capture_time));
41425 attribution.append("span").text("|");
41427 attribution.append("a").attr("class", "image-link").attr("target", "_blank").attr("href", `https://mapilio.com/app?lat=${d4.loc[1]}&lng=${d4.loc[0]}&zoom=17&pId=${d4.id}`).text("mapilio.com");
41428 wrap2.transition().duration(100).call(imgZoom2.transform, identity2);
41429 wrap2.selectAll("img").remove();
41430 wrap2.selectAll("button.back").classed("hide", !_cache3.images.forImageId.hasOwnProperty(+id2 - 1));
41431 wrap2.selectAll("button.forward").classed("hide", !_cache3.images.forImageId.hasOwnProperty(+id2 + 1));
41432 getImageData(d4.id, d4.sequence_id).then(function() {
41434 if (!_pannellumViewer3) {
41438 let sceneID = _currScene2.toString();
41439 _pannellumViewer3.addScene(sceneID, _sceneOptions2).loadScene(sceneID);
41440 if (_currScene2 > 2) {
41441 sceneID = (_currScene2 - 1).toString();
41442 _pannellumViewer3.removeScene(sceneID);
41446 that.initOnlyPhoto(context);
41449 function localeDateString2(s2) {
41450 if (!s2) return null;
41451 var options = { day: "numeric", month: "short", year: "numeric" };
41452 var d5 = new Date(s2);
41453 if (isNaN(d5.getTime())) return null;
41454 return d5.toLocaleDateString(_mainLocalizer.localeCode(), options);
41458 initOnlyPhoto: function(context) {
41459 if (_pannellumViewer3) {
41460 _pannellumViewer3.destroy();
41461 _pannellumViewer3 = null;
41463 let wrap2 = context.container().select("#ideditor-viewer-mapilio-simple");
41464 let imgWrap = wrap2.select("img");
41465 if (!imgWrap.empty()) {
41466 imgWrap.attr("src", _sceneOptions2.panorama);
41468 wrap2.append("img").attr("src", _sceneOptions2.panorama);
41471 ensureViewerLoaded: function(context) {
41473 let imgWrap = context.container().select("#ideditor-viewer-mapilio-simple > img");
41474 if (!imgWrap.empty()) {
41477 if (_loadViewerPromise5) return _loadViewerPromise5;
41478 let wrap2 = context.container().select(".photoviewer").selectAll(".mapilio-wrapper").data([0]);
41479 let wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper mapilio-wrapper").classed("hide", true).on("dblclick.zoom", null);
41480 wrapEnter.append("div").attr("class", "photo-attribution fillD");
41481 const controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls-mapilio");
41482 controlsEnter.append("button").classed("back", true).on("click.back", step(-1)).text("\u25C4");
41483 controlsEnter.append("button").classed("forward", true).on("click.forward", step(1)).text("\u25BA");
41484 wrapEnter.append("div").attr("id", "ideditor-viewer-mapilio-pnlm");
41485 wrapEnter.append("div").attr("id", "ideditor-viewer-mapilio-simple-wrap").call(imgZoom2.on("zoom", zoomPan2)).append("div").attr("id", "ideditor-viewer-mapilio-simple");
41486 context.ui().photoviewer.on("resize.mapilio", () => {
41487 if (_pannellumViewer3) {
41488 _pannellumViewer3.resize();
41491 _loadViewerPromise5 = new Promise((resolve, reject) => {
41492 let loadedCount = 0;
41493 function loaded() {
41495 if (loadedCount === 2) resolve();
41497 const head = select_default2("head");
41498 head.selectAll("#ideditor-mapilio-viewercss").data([0]).enter().append("link").attr("id", "ideditor-mapilio-viewercss").attr("rel", "stylesheet").attr("crossorigin", "anonymous").attr("href", context.asset(pannellumViewerCSS3)).on("load.serviceMapilio", loaded).on("error.serviceMapilio", function() {
41501 head.selectAll("#ideditor-mapilio-viewerjs").data([0]).enter().append("script").attr("id", "ideditor-mapilio-viewerjs").attr("crossorigin", "anonymous").attr("src", context.asset(pannellumViewerJS3)).on("load.serviceMapilio", loaded).on("error.serviceMapilio", function() {
41504 }).catch(function() {
41505 _loadViewerPromise5 = null;
41507 function step(stepBy) {
41508 return function() {
41509 if (!_activeImage) return;
41510 const imageId = _activeImage.id;
41511 const nextIndex = imageId + stepBy;
41512 if (!nextIndex) return;
41513 const nextImage = _cache3.images.forImageId[nextIndex];
41514 context.map().centerEase(nextImage.loc);
41515 that.selectImage(context, nextImage.id);
41518 function zoomPan2(d3_event) {
41519 var t2 = d3_event.transform;
41520 context.container().select(".photoviewer #ideditor-viewer-mapilio-simple").call(utilSetTransform, t2.x, t2.y, t2.k);
41522 return _loadViewerPromise5;
41524 showViewer: function(context) {
41525 const wrap2 = context.container().select(".photoviewer");
41526 const isHidden = wrap2.selectAll(".photo-wrapper.mapilio-wrapper.hide").size();
41528 for (const service of Object.values(services)) {
41529 if (service === this) continue;
41530 if (typeof service.hideViewer === "function") {
41531 service.hideViewer(context);
41534 wrap2.classed("hide", false).selectAll(".photo-wrapper.mapilio-wrapper").classed("hide", false);
41541 hideViewer: function(context) {
41542 let viewer = context.container().select(".photoviewer");
41543 if (!viewer.empty()) viewer.datum(null);
41544 this.updateUrlImage(null);
41545 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
41546 context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
41547 this.setActiveImage();
41548 return this.setStyles(context, null);
41550 // Return the current cache
41551 cache: function() {
41558 // modules/services/panoramax.js
41559 var panoramax_exports = {};
41560 __export(panoramax_exports, {
41561 default: () => panoramax_default
41563 function partitionViewport6(projection2) {
41564 const z3 = geoScaleToZoom(projection2.scale());
41565 const z22 = Math.ceil(z3 * 2) / 2 + 2.5;
41566 const tiler8 = utilTiler().zoomExtent([z22, z22]);
41567 return tiler8.getTiles(projection2).map(function(tile) {
41568 return tile.extent;
41571 function searchLimited6(limit, projection2, rtree) {
41572 limit = limit || 5;
41573 return partitionViewport6(projection2).reduce(function(result, extent) {
41574 let found = rtree.search(extent.bbox());
41575 const spacing = Math.max(1, Math.floor(found.length / limit));
41576 found = found.filter((d4, idx) => idx % spacing === 0 || d4.data.id === (_activeImage2 == null ? void 0 : _activeImage2.id)).sort((a2, b3) => {
41577 if (a2.data.id === (_activeImage2 == null ? void 0 : _activeImage2.id)) return -1;
41578 if (b3.data.id === (_activeImage2 == null ? void 0 : _activeImage2.id)) return 1;
41580 }).slice(0, limit).map((d4) => d4.data);
41581 return found.length ? result.concat(found) : result;
41584 function loadTiles5(which, url, maxZoom2, projection2, zoom) {
41585 const tiler8 = utilTiler().zoomExtent([minZoom3, maxZoom2]).skipNullIsland(true);
41586 const tiles = tiler8.getTiles(projection2);
41587 tiles.forEach(function(tile) {
41588 loadTile5(which, url, tile, zoom);
41591 function loadTile5(which, url, tile, zoom) {
41592 const cache = _cache4.requests;
41593 const tileId = `${tile.id}-${which}`;
41594 if (cache.loaded[tileId] || cache.inflight[tileId]) return;
41595 const controller = new AbortController();
41596 cache.inflight[tileId] = controller;
41597 const requestUrl = url.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace("{z}", tile.xyz[2]);
41598 fetch(requestUrl, { signal: controller.signal }).then(function(response) {
41599 if (!response.ok) {
41600 throw new Error(response.status + " " + response.statusText);
41602 cache.loaded[tileId] = true;
41603 delete cache.inflight[tileId];
41604 return response.arrayBuffer();
41605 }).then(function(data) {
41606 if (data.byteLength === 0) {
41607 throw new Error("No Data");
41609 loadTileDataToCache3(data, tile, zoom);
41610 if (which === "images") {
41611 dispatch13.call("loadedImages");
41613 dispatch13.call("loadedLines");
41615 }).catch(function(e3) {
41616 if (e3.message === "No Data") {
41617 cache.loaded[tileId] = true;
41623 function loadTileDataToCache3(data, tile, zoom) {
41624 const vectorTile = new VectorTile(new Pbf(data));
41625 let features, cache, layer, i3, feature3, loc, d4;
41626 if (vectorTile.layers.hasOwnProperty(pictureLayer)) {
41628 cache = _cache4.images;
41629 layer = vectorTile.layers[pictureLayer];
41630 for (i3 = 0; i3 < layer.length; i3++) {
41631 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
41632 loc = feature3.geometry.coordinates;
41636 capture_time: feature3.properties.ts,
41637 capture_time_parsed: new Date(feature3.properties.ts),
41638 id: feature3.properties.id,
41639 account_id: feature3.properties.account_id,
41640 sequence_id: feature3.properties.first_sequence,
41641 heading: parseInt(feature3.properties.heading, 10),
41643 isPano: feature3.properties.type === "equirectangular",
41644 model: feature3.properties.model
41646 cache.forImageId[d4.id] = d4;
41656 cache.rtree.load(features);
41659 if (vectorTile.layers.hasOwnProperty(sequenceLayer)) {
41660 cache = _cache4.sequences;
41661 if (zoom >= lineMinZoom && zoom < imageMinZoom) cache = _cache4.mockSequences;
41662 layer = vectorTile.layers[sequenceLayer];
41663 for (i3 = 0; i3 < layer.length; i3++) {
41664 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
41665 if (cache.lineString[feature3.properties.id]) {
41666 cache.lineString[feature3.properties.id].push(feature3);
41668 cache.lineString[feature3.properties.id] = [feature3];
41673 async function getUsername(userId) {
41674 const cache = _cache4.users;
41675 if (cache[userId]) return cache[userId].name;
41676 const requestUrl = usernameURL.replace("{userId}", userId);
41677 const response = await fetch(requestUrl, { method: "GET" });
41678 if (!response.ok) {
41679 throw new Error(response.status + " " + response.statusText);
41681 const data = await response.json();
41682 cache[userId] = data;
41685 var apiUrl3, tileUrl2, imageDataUrl, sequenceDataUrl, userIdUrl, usernameURL, viewerUrl, highDefinition, standardDefinition, pictureLayer, sequenceLayer, minZoom3, imageMinZoom, lineMinZoom, dispatch13, _cache4, _loadViewerPromise6, _definition, _isHD, _planeFrame2, _pannellumFrame2, _currentFrame2, _currentScene, _activeImage2, _isViewerOpen2, panoramax_default;
41686 var init_panoramax = __esm({
41687 "modules/services/panoramax.js"() {
41692 init_vector_tile();
41696 init_pannellum_photo();
41697 init_plane_photo();
41699 apiUrl3 = "https://api.panoramax.xyz/";
41700 tileUrl2 = apiUrl3 + "api/map/{z}/{x}/{y}.mvt";
41701 imageDataUrl = apiUrl3 + "api/collections/{collectionId}/items/{itemId}";
41702 sequenceDataUrl = apiUrl3 + "api/collections/{collectionId}/items?limit=1000";
41703 userIdUrl = apiUrl3 + "api/users/search?q={username}";
41704 usernameURL = apiUrl3 + "api/users/{userId}";
41705 viewerUrl = apiUrl3;
41706 highDefinition = "hd";
41707 standardDefinition = "sd";
41708 pictureLayer = "pictures";
41709 sequenceLayer = "sequences";
41713 dispatch13 = dispatch_default("loadedImages", "loadedLines", "viewerChanged");
41714 _definition = standardDefinition;
41717 currentImage: null,
41721 _isViewerOpen2 = false;
41722 panoramax_default = {
41727 this.event = utilRebind(this, dispatch13, "on");
41729 reset: function() {
41731 Object.values(_cache4.requests.inflight).forEach(function(request3) {
41736 images: { rtree: new RBush(), forImageId: {} },
41737 sequences: { rtree: new RBush(), lineString: {}, items: {} },
41739 mockSequences: { rtree: new RBush(), lineString: {} },
41740 requests: { loaded: {}, inflight: {} }
41744 * Get visible images from cache
41745 * @param {*} projection Current Projection
41746 * @returns images data for the current projection
41748 images: function(projection2) {
41750 return searchLimited6(limit, projection2, _cache4.images.rtree);
41753 * Get a specific image from cache
41754 * @param {*} imageKey the image id
41757 cachedImage: function(imageKey) {
41758 return _cache4.images.forImageId[imageKey];
41761 * Fetches images data for the visible area
41762 * @param {*} projection Current Projection
41764 loadImages: function(projection2) {
41765 loadTiles5("images", tileUrl2, imageMinZoom, projection2);
41768 * Fetches sequences data for the visible area
41769 * @param {*} projection Current Projection
41771 loadLines: function(projection2, zoom) {
41772 loadTiles5("line", tileUrl2, lineMinZoom, projection2, zoom);
41775 * Fetches all possible userIDs from Panoramax
41776 * @param {string} usernames one or multiple usernames
41779 getUserIds: async function(usernames) {
41780 const requestUrls = usernames.map((username) => userIdUrl.replace("{username}", username));
41781 const responses = await Promise.all(requestUrls.map((requestUrl) => fetch(requestUrl, { method: "GET" })));
41782 if (responses.some((response) => !response.ok)) {
41783 const response = responses.find((response2) => !response2.ok);
41784 throw new Error(response.status + " " + response.statusText);
41786 const data = await Promise.all(responses.map((response) => response.json()));
41787 return data.flatMap((d4, i3) => d4.features.filter((f2) => f2.name === usernames[i3]).map((f2) => f2.id));
41790 * Get visible sequences from cache
41791 * @param {*} projection Current Projection
41792 * @param {number} zoom Current zoom (if zoom < `lineMinZoom` less accurate lines will be drawn)
41793 * @returns sequences data for the current projection
41795 sequences: function(projection2, zoom) {
41796 const viewport = projection2.clipExtent();
41797 const min3 = [viewport[0][0], viewport[1][1]];
41798 const max3 = [viewport[1][0], viewport[0][1]];
41799 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
41800 const sequenceIds = {};
41801 let lineStrings = [];
41802 if (zoom >= imageMinZoom) {
41803 _cache4.images.rtree.search(bbox2).forEach(function(d4) {
41804 if (d4.data.sequence_id) {
41805 sequenceIds[d4.data.sequence_id] = true;
41808 Object.keys(sequenceIds).forEach(function(sequenceId) {
41809 if (_cache4.sequences.lineString[sequenceId]) {
41810 lineStrings = lineStrings.concat(_cache4.sequences.lineString[sequenceId]);
41813 return lineStrings;
41815 if (zoom >= lineMinZoom) {
41816 Object.keys(_cache4.mockSequences.lineString).forEach(function(sequenceId) {
41817 lineStrings = lineStrings.concat(_cache4.mockSequences.lineString[sequenceId]);
41820 return lineStrings;
41823 * Updates the data for the currently visible image
41824 * @param {*} image Image data
41826 setActiveImage: function(image) {
41827 if (image && image.id && image.sequence_id) {
41830 sequence_id: image.sequence_id,
41834 _activeImage2 = null;
41837 getActiveImage: function() {
41838 return _activeImage2;
41841 * Update the currently highlighted sequence and selected bubble
41842 * @param {*} context Current HTML context
41843 * @param {*} [hovered] The hovered bubble image
41845 setStyles: function(context, hovered) {
41846 const hoveredImageId = hovered && hovered.id;
41847 const hoveredSequenceId = hovered && hovered.sequence_id;
41848 const selectedSequenceId = _activeImage2 && _activeImage2.sequence_id;
41849 const selectedImageId = _activeImage2 && _activeImage2.id;
41850 const markers = context.container().selectAll(".layer-panoramax .viewfield-group");
41851 const sequences = context.container().selectAll(".layer-panoramax .sequence");
41852 markers.classed("highlighted", function(d4) {
41853 return d4.sequence_id === selectedSequenceId || d4.id === hoveredImageId;
41854 }).classed("hovered", function(d4) {
41855 return d4.id === hoveredImageId;
41856 }).classed("currentView", function(d4) {
41857 return d4.id === selectedImageId;
41859 sequences.classed("highlighted", function(d4) {
41860 return d4.properties.id === hoveredSequenceId;
41861 }).classed("currentView", function(d4) {
41862 return d4.properties.id === selectedSequenceId;
41864 context.container().selectAll(".layer-panoramax .viewfield-group .viewfield").attr("d", viewfieldPath);
41865 function viewfieldPath() {
41866 let d4 = this.parentNode.__data__;
41867 if (d4.isPano && d4.id !== selectedImageId) {
41868 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
41870 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
41875 // Get viewer status
41876 isViewerOpen: function() {
41877 return _isViewerOpen2;
41880 * Updates the URL to save the current shown image
41881 * @param {*} imageKey
41883 updateUrlImage: function(imageKey) {
41884 const hash2 = utilStringQs(window.location.hash);
41886 hash2.photo = "panoramax/" + imageKey;
41888 delete hash2.photo;
41890 window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
41893 * Loads the selected image in the frame
41894 * @param {*} context Current HTML context
41895 * @param {*} id of the selected image
41898 selectImage: function(context, id2) {
41900 let d4 = that.cachedImage(id2);
41901 that.setActiveImage(d4);
41902 that.updateUrlImage(d4.id);
41903 const viewerLink = `${viewerUrl}#pic=${d4.id}&focus=pic`;
41904 let viewer = context.container().select(".photoviewer");
41905 if (!viewer.empty()) viewer.datum(d4);
41906 this.setStyles(context, null);
41907 if (!d4) return this;
41908 let wrap2 = context.container().select(".photoviewer .panoramax-wrapper");
41909 let attribution = wrap2.selectAll(".photo-attribution").text("");
41910 let line1 = attribution.append("div").attr("class", "attribution-row");
41911 const hdDomId = utilUniqueDomId("panoramax-hd");
41912 let label = line1.append("label").attr("for", hdDomId).attr("class", "panoramax-hd");
41913 label.append("input").attr("type", "checkbox").attr("id", hdDomId).property("checked", _isHD).on("click", (d3_event) => {
41914 d3_event.stopPropagation();
41916 _definition = _isHD ? highDefinition : standardDefinition;
41917 that.selectImage(context, d4.id).showViewer(context);
41919 label.append("span").call(_t.append("panoramax.hd"));
41920 if (d4.capture_time) {
41921 attribution.append("span").attr("class", "captured_at").text(localeDateString2(d4.capture_time));
41922 attribution.append("span").text("|");
41924 attribution.append("a").attr("class", "report-photo").attr("href", "mailto:signalement.ign@panoramax.fr").call(_t.append("panoramax.report"));
41925 attribution.append("span").text("|");
41926 attribution.append("a").attr("class", "image-link").attr("target", "_blank").attr("href", viewerLink).text("panoramax.xyz");
41927 this.getImageData(d4.sequence_id, d4.id).then(function(data) {
41929 currentImage: null,
41933 _currentScene.currentImage = data.assets[_definition];
41934 const nextIndex = data.links.findIndex((x2) => x2.rel === "next");
41935 const prevIndex = data.links.findIndex((x2) => x2.rel === "prev");
41936 if (nextIndex !== -1) {
41937 _currentScene.nextImage = data.links[nextIndex];
41939 if (prevIndex !== -1) {
41940 _currentScene.prevImage = data.links[prevIndex];
41942 d4.image_path = _currentScene.currentImage.href;
41943 wrap2.selectAll("button.back").classed("hide", _currentScene.prevImage === null);
41944 wrap2.selectAll("button.forward").classed("hide", _currentScene.nextImage === null);
41945 _currentFrame2 = d4.isPano ? _pannellumFrame2 : _planeFrame2;
41946 _currentFrame2.showPhotoFrame(wrap2).selectPhoto(d4, true);
41948 function localeDateString2(s2) {
41949 if (!s2) return null;
41950 var options = { day: "numeric", month: "short", year: "numeric" };
41951 var d5 = new Date(s2);
41952 if (isNaN(d5.getTime())) return null;
41953 return d5.toLocaleDateString(_mainLocalizer.localeCode(), options);
41955 if (d4.account_id) {
41956 attribution.append("span").text("|");
41957 let line2 = attribution.append("span").attr("class", "attribution-row");
41958 getUsername(d4.account_id).then(function(username) {
41959 line2.append("span").attr("class", "captured_by").text("@" + username);
41964 photoFrame: function() {
41965 return _currentFrame2;
41968 * Fetches the data for a specific image
41969 * @param {*} collectionId
41970 * @param {*} imageId
41971 * @returns The fetched image data
41973 getImageData: async function(collectionId, imageId) {
41974 const cache = _cache4.sequences.items;
41975 if (cache[collectionId]) {
41976 const cached = cache[collectionId].find((d4) => d4.id === imageId);
41977 if (cached) return cached;
41979 const response = await fetch(
41980 sequenceDataUrl.replace("{collectionId}", collectionId),
41983 if (!response.ok) {
41984 throw new Error(response.status + " " + response.statusText);
41986 const data = (await response.json()).features;
41987 cache[collectionId] = data;
41989 const result = cache[collectionId].find((d4) => d4.id === imageId);
41990 if (result) return result;
41991 const itemResponse = await fetch(
41992 imageDataUrl.replace("{collectionId}", collectionId).replace("{itemId}", imageId),
41995 if (!itemResponse.ok) {
41996 throw new Error(itemResponse.status + " " + itemResponse.statusText);
41998 const itemData = await itemResponse.json();
41999 cache[collectionId].push(itemData);
42002 ensureViewerLoaded: function(context) {
42004 let imgWrap = context.container().select("#ideditor-viewer-panoramax-simple > img");
42005 if (!imgWrap.empty()) {
42008 if (_loadViewerPromise6) return _loadViewerPromise6;
42009 let wrap2 = context.container().select(".photoviewer").selectAll(".panoramax-wrapper").data([0]);
42010 let wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper panoramax-wrapper").classed("hide", true).on("dblclick.zoom", null);
42011 wrapEnter.append("div").attr("class", "photo-attribution fillD");
42012 const controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls-panoramax");
42013 controlsEnter.append("button").classed("back", true).on("click.back", step(-1)).text("\u25C4");
42014 controlsEnter.append("button").classed("forward", true).on("click.forward", step(1)).text("\u25BA");
42015 _loadViewerPromise6 = Promise.all([
42016 pannellum_photo_default.init(context, wrapEnter),
42017 plane_photo_default.init(context, wrapEnter)
42018 ]).then(([pannellumPhotoFrame, planePhotoFrame]) => {
42019 _pannellumFrame2 = pannellumPhotoFrame;
42020 _pannellumFrame2.event.on("viewerChanged", () => dispatch13.call("viewerChanged"));
42021 _planeFrame2 = planePhotoFrame;
42022 _planeFrame2.event.on("viewerChanged", () => dispatch13.call("viewerChanged"));
42024 function step(stepBy) {
42025 return function() {
42026 if (!_currentScene.currentImage) return;
42028 if (stepBy === 1) nextId = _currentScene.nextImage.id;
42029 else nextId = _currentScene.prevImage.id;
42030 if (!nextId) return;
42031 const nextImage = _cache4.images.forImageId[nextId];
42033 context.map().centerEase(nextImage.loc);
42034 that.selectImage(context, nextImage.id);
42038 return _loadViewerPromise6;
42041 * Shows the current viewer if hidden
42042 * @param {*} context
42044 showViewer: function(context) {
42045 const wrap2 = context.container().select(".photoviewer");
42046 const isHidden = wrap2.selectAll(".photo-wrapper.panoramax-wrapper.hide").size();
42048 for (const service of Object.values(services)) {
42049 if (service === this) continue;
42050 if (typeof service.hideViewer === "function") {
42051 service.hideViewer(context);
42054 wrap2.classed("hide", false).selectAll(".photo-wrapper.panoramax-wrapper").classed("hide", false);
42056 _isViewerOpen2 = true;
42060 * Hides the current viewer if shown, resets the active image and sequence
42061 * @param {*} context
42063 hideViewer: function(context) {
42064 let viewer = context.container().select(".photoviewer");
42065 if (!viewer.empty()) viewer.datum(null);
42066 this.updateUrlImage(null);
42067 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
42068 context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
42069 this.setActiveImage(null);
42070 _isViewerOpen2 = false;
42071 return this.setStyles(context, null);
42073 cache: function() {
42080 // modules/services/index.js
42081 var services_exports = {};
42082 __export(services_exports, {
42083 serviceKartaview: () => kartaview_default,
42084 serviceKeepRight: () => keepRight_default,
42085 serviceMapRules: () => maprules_default,
42086 serviceMapilio: () => mapilio_default,
42087 serviceMapillary: () => mapillary_default,
42088 serviceNominatim: () => nominatim_default,
42089 serviceNsi: () => nsi_default,
42090 serviceOsm: () => osm_default,
42091 serviceOsmWikibase: () => osm_wikibase_default,
42092 serviceOsmose: () => osmose_default,
42093 servicePanoramax: () => panoramax_default,
42094 serviceStreetside: () => streetside_default,
42095 serviceTaginfo: () => taginfo_default,
42096 serviceVectorTile: () => vector_tile_default,
42097 serviceVegbilder: () => vegbilder_default,
42098 serviceWikidata: () => wikidata_default,
42099 serviceWikipedia: () => wikipedia_default,
42100 services: () => services
42103 var init_services = __esm({
42104 "modules/services/index.js"() {
42115 init_osm_wikibase();
42118 init_vector_tile2();
42124 geocoder: nominatim_default,
42125 keepRight: keepRight_default,
42126 osmose: osmose_default,
42127 mapillary: mapillary_default,
42129 kartaview: kartaview_default,
42130 vegbilder: vegbilder_default,
42132 osmWikibase: osm_wikibase_default,
42133 maprules: maprules_default,
42134 streetside: streetside_default,
42135 taginfo: taginfo_default,
42136 vectorTile: vector_tile_default,
42137 wikidata: wikidata_default,
42138 wikipedia: wikipedia_default,
42139 mapilio: mapilio_default,
42140 panoramax: panoramax_default
42145 // modules/validations/almost_junction.js
42146 var almost_junction_exports = {};
42147 __export(almost_junction_exports, {
42148 validationAlmostJunction: () => validationAlmostJunction
42150 function validationAlmostJunction(context) {
42151 const type2 = "almost_junction";
42152 const EXTEND_TH_METERS = 5;
42153 const WELD_TH_METERS = 0.75;
42154 const CLOSE_NODE_TH = EXTEND_TH_METERS - WELD_TH_METERS;
42155 const SIG_ANGLE_TH = Math.atan(WELD_TH_METERS / EXTEND_TH_METERS);
42156 function isHighway(entity) {
42157 return entity.type === "way" && osmRoutableHighwayTagValues[entity.tags.highway];
42159 function isTaggedAsNotContinuing(node) {
42160 return node.tags.noexit === "yes" || node.tags.amenity === "parking_entrance" || node.tags.entrance && node.tags.entrance !== "no";
42162 const validation = function checkAlmostJunction(entity, graph) {
42163 if (!isHighway(entity)) return [];
42164 if (entity.isDegenerate()) return [];
42165 const tree = context.history().tree();
42166 const extendableNodeInfos = findConnectableEndNodesByExtension(entity);
42168 extendableNodeInfos.forEach((extendableNodeInfo) => {
42169 issues.push(new validationIssue({
42171 subtype: "highway-highway",
42172 severity: "warning",
42173 message: function(context2) {
42174 const entity1 = context2.hasEntity(this.entityIds[0]);
42175 if (this.entityIds[0] === this.entityIds[2]) {
42176 return entity1 ? _t.append("issues.almost_junction.self.message", {
42177 feature: utilDisplayLabel(entity1, context2.graph())
42180 const entity2 = context2.hasEntity(this.entityIds[2]);
42181 return entity1 && entity2 ? _t.append("issues.almost_junction.message", {
42182 feature: utilDisplayLabel(entity1, context2.graph()),
42183 feature2: utilDisplayLabel(entity2, context2.graph())
42187 reference: showReference,
42190 extendableNodeInfo.node.id,
42191 extendableNodeInfo.wid
42193 loc: extendableNodeInfo.node.loc,
42194 hash: JSON.stringify(extendableNodeInfo.node.loc),
42196 midId: extendableNodeInfo.mid.id,
42197 edge: extendableNodeInfo.edge,
42198 cross_loc: extendableNodeInfo.cross_loc
42200 dynamicFixes: makeFixes
42204 function makeFixes(context2) {
42205 let fixes = [new validationIssueFix({
42206 icon: "iD-icon-abutment",
42207 title: _t.append("issues.fix.connect_features.title"),
42208 onClick: function(context3) {
42209 const annotation = _t("issues.fix.connect_almost_junction.annotation");
42210 const [, endNodeId, crossWayId] = this.issue.entityIds;
42211 const midNode = context3.entity(this.issue.data.midId);
42212 const endNode = context3.entity(endNodeId);
42213 const crossWay = context3.entity(crossWayId);
42214 const nearEndNodes = findNearbyEndNodes(endNode, crossWay);
42215 if (nearEndNodes.length > 0) {
42216 const collinear = findSmallJoinAngle(midNode, endNode, nearEndNodes);
42219 actionMergeNodes([collinear.id, endNode.id], collinear.loc),
42225 const targetEdge = this.issue.data.edge;
42226 const crossLoc = this.issue.data.cross_loc;
42227 const edgeNodes = [context3.entity(targetEdge[0]), context3.entity(targetEdge[1])];
42228 const closestNodeInfo = geoSphericalClosestNode(edgeNodes, crossLoc);
42229 if (closestNodeInfo.distance < WELD_TH_METERS) {
42231 actionMergeNodes([closestNodeInfo.node.id, endNode.id], closestNodeInfo.node.loc),
42236 actionAddMidpoint({ loc: crossLoc, edge: targetEdge }, endNode),
42242 const node = context2.hasEntity(this.entityIds[1]);
42243 if (node && !node.hasInterestingTags()) {
42244 fixes.push(new validationIssueFix({
42245 icon: "maki-barrier",
42246 title: _t.append("issues.fix.tag_as_disconnected.title"),
42247 onClick: function(context3) {
42248 const nodeID = this.issue.entityIds[1];
42249 const tags = Object.assign({}, context3.entity(nodeID).tags);
42250 tags.noexit = "yes";
42252 actionChangeTags(nodeID, tags),
42253 _t("issues.fix.tag_as_disconnected.annotation")
42260 function showReference(selection2) {
42261 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.almost_junction.highway-highway.reference"));
42263 function isExtendableCandidate(node, way) {
42264 const osm = services.osm;
42265 if (osm && !osm.isDataLoaded(node.loc)) {
42268 if (isTaggedAsNotContinuing(node) || graph.parentWays(node).length !== 1) {
42271 let occurrences = 0;
42272 for (const index in way.nodes) {
42273 if (way.nodes[index] === node.id) {
42275 if (occurrences > 1) {
42282 function findConnectableEndNodesByExtension(way) {
42284 if (way.isClosed()) return results;
42286 const indices = [0, way.nodes.length - 1];
42287 indices.forEach((nodeIndex) => {
42288 const nodeID = way.nodes[nodeIndex];
42289 const node = graph.entity(nodeID);
42290 if (!isExtendableCandidate(node, way)) return;
42291 const connectionInfo = canConnectByExtend(way, nodeIndex);
42292 if (!connectionInfo) return;
42293 testNodes = graph.childNodes(way).slice();
42294 testNodes[nodeIndex] = testNodes[nodeIndex].move(connectionInfo.cross_loc);
42295 if (geoHasSelfIntersections(testNodes, nodeID)) return;
42296 results.push(connectionInfo);
42300 function findNearbyEndNodes(node, way) {
42303 way.nodes[way.nodes.length - 1]
42304 ].map((d4) => graph.entity(d4)).filter((d4) => {
42305 return d4.id !== node.id && geoSphericalDistance(node.loc, d4.loc) <= CLOSE_NODE_TH;
42308 function findSmallJoinAngle(midNode, tipNode, endNodes) {
42310 let minAngle = Infinity;
42311 endNodes.forEach((endNode) => {
42312 const a1 = geoAngle(midNode, tipNode, context.projection) + Math.PI;
42313 const a2 = geoAngle(midNode, endNode, context.projection) + Math.PI;
42314 const diff = Math.max(a1, a2) - Math.min(a1, a2);
42315 if (diff < minAngle) {
42320 if (minAngle <= SIG_ANGLE_TH) return joinTo;
42323 function hasTag(tags, key) {
42324 return tags[key] !== void 0 && tags[key] !== "no";
42326 function canConnectWays(way, way2) {
42327 if (way.id === way2.id) return true;
42328 if ((hasTag(way.tags, "bridge") || hasTag(way2.tags, "bridge")) && !(hasTag(way.tags, "bridge") && hasTag(way2.tags, "bridge"))) return false;
42329 if ((hasTag(way.tags, "tunnel") || hasTag(way2.tags, "tunnel")) && !(hasTag(way.tags, "tunnel") && hasTag(way2.tags, "tunnel"))) return false;
42330 const layer1 = way.tags.layer || "0", layer2 = way2.tags.layer || "0";
42331 if (layer1 !== layer2) return false;
42332 const level1 = way.tags.level || "0", level2 = way2.tags.level || "0";
42333 if (level1 !== level2) return false;
42336 function canConnectByExtend(way, endNodeIdx) {
42337 const tipNid = way.nodes[endNodeIdx];
42338 const midNid = endNodeIdx === 0 ? way.nodes[1] : way.nodes[way.nodes.length - 2];
42339 const tipNode = graph.entity(tipNid);
42340 const midNode = graph.entity(midNid);
42341 const lon = tipNode.loc[0];
42342 const lat = tipNode.loc[1];
42343 const lon_range = geoMetersToLon(EXTEND_TH_METERS, lat) / 2;
42344 const lat_range = geoMetersToLat(EXTEND_TH_METERS) / 2;
42345 const queryExtent = geoExtent([
42346 [lon - lon_range, lat - lat_range],
42347 [lon + lon_range, lat + lat_range]
42349 const edgeLen = geoSphericalDistance(midNode.loc, tipNode.loc);
42350 const t2 = EXTEND_TH_METERS / edgeLen + 1;
42351 const extTipLoc = geoVecInterp(midNode.loc, tipNode.loc, t2);
42352 const segmentInfos = tree.waySegments(queryExtent, graph);
42353 for (let i3 = 0; i3 < segmentInfos.length; i3++) {
42354 let segmentInfo = segmentInfos[i3];
42355 let way2 = graph.entity(segmentInfo.wayId);
42356 if (!isHighway(way2)) continue;
42357 if (!canConnectWays(way, way2)) continue;
42358 let nAid = segmentInfo.nodes[0], nBid = segmentInfo.nodes[1];
42359 if (nAid === tipNid || nBid === tipNid) continue;
42360 let nA = graph.entity(nAid), nB = graph.entity(nBid);
42361 let crossLoc = geoLineIntersection([tipNode.loc, extTipLoc], [nA.loc, nB.loc]);
42367 edge: [nA.id, nB.id],
42368 cross_loc: crossLoc
42375 validation.type = type2;
42378 var init_almost_junction = __esm({
42379 "modules/validations/almost_junction.js"() {
42382 init_add_midpoint();
42383 init_change_tags();
42384 init_merge_nodes();
42386 init_utilDisplayLabel();
42393 // modules/validations/close_nodes.js
42394 var close_nodes_exports = {};
42395 __export(close_nodes_exports, {
42396 validationCloseNodes: () => validationCloseNodes
42398 function validationCloseNodes(context) {
42399 var type2 = "close_nodes";
42400 var pointThresholdMeters = 0.2;
42401 var validation = function(entity, graph) {
42402 if (entity.type === "node") {
42403 return getIssuesForNode(entity);
42404 } else if (entity.type === "way") {
42405 return getIssuesForWay(entity);
42408 function getIssuesForNode(node) {
42409 var parentWays = graph.parentWays(node);
42410 if (parentWays.length) {
42411 return getIssuesForVertex(node, parentWays);
42413 return getIssuesForDetachedPoint(node);
42416 function wayTypeFor(way) {
42417 if (way.tags.boundary && way.tags.boundary !== "no") return "boundary";
42418 if (way.tags.indoor && way.tags.indoor !== "no") return "indoor";
42419 if (way.tags.building && way.tags.building !== "no" || way.tags["building:part"] && way.tags["building:part"] !== "no") return "building";
42420 if (osmPathHighwayTagValues[way.tags.highway]) return "path";
42421 var parentRelations = graph.parentRelations(way);
42422 for (var i3 in parentRelations) {
42423 var relation = parentRelations[i3];
42424 if (relation.tags.type === "boundary") return "boundary";
42425 if (relation.isMultipolygon()) {
42426 if (relation.tags.indoor && relation.tags.indoor !== "no") return "indoor";
42427 if (relation.tags.building && relation.tags.building !== "no" || relation.tags["building:part"] && relation.tags["building:part"] !== "no") return "building";
42432 function shouldCheckWay(way) {
42433 if (way.nodes.length <= 2 || way.isClosed() && way.nodes.length <= 4) return false;
42434 var bbox2 = way.extent(graph).bbox();
42435 var hypotenuseMeters = geoSphericalDistance([bbox2.minX, bbox2.minY], [bbox2.maxX, bbox2.maxY]);
42436 if (hypotenuseMeters < 1.5) return false;
42439 function getIssuesForWay(way) {
42440 if (!shouldCheckWay(way)) return [];
42441 var issues = [], nodes = graph.childNodes(way);
42442 for (var i3 = 0; i3 < nodes.length - 1; i3++) {
42443 var node1 = nodes[i3];
42444 var node2 = nodes[i3 + 1];
42445 var issue = getWayIssueIfAny(node1, node2, way);
42446 if (issue) issues.push(issue);
42450 function getIssuesForVertex(node, parentWays) {
42452 function checkForCloseness(node1, node2, way) {
42453 var issue = getWayIssueIfAny(node1, node2, way);
42454 if (issue) issues.push(issue);
42456 for (var i3 = 0; i3 < parentWays.length; i3++) {
42457 var parentWay = parentWays[i3];
42458 if (!shouldCheckWay(parentWay)) continue;
42459 var lastIndex = parentWay.nodes.length - 1;
42460 for (var j3 = 0; j3 < parentWay.nodes.length; j3++) {
42462 if (parentWay.nodes[j3 - 1] === node.id) {
42463 checkForCloseness(node, graph.entity(parentWay.nodes[j3]), parentWay);
42466 if (j3 !== lastIndex) {
42467 if (parentWay.nodes[j3 + 1] === node.id) {
42468 checkForCloseness(graph.entity(parentWay.nodes[j3]), node, parentWay);
42475 function thresholdMetersForWay(way) {
42476 if (!shouldCheckWay(way)) return 0;
42477 var wayType = wayTypeFor(way);
42478 if (wayType === "boundary") return 0;
42479 if (wayType === "indoor") return 0.01;
42480 if (wayType === "building") return 0.05;
42481 if (wayType === "path") return 0.1;
42484 function getIssuesForDetachedPoint(node) {
42486 var lon = node.loc[0];
42487 var lat = node.loc[1];
42488 var lon_range = geoMetersToLon(pointThresholdMeters, lat) / 2;
42489 var lat_range = geoMetersToLat(pointThresholdMeters) / 2;
42490 var queryExtent = geoExtent([
42491 [lon - lon_range, lat - lat_range],
42492 [lon + lon_range, lat + lat_range]
42494 var intersected = context.history().tree().intersects(queryExtent, graph);
42495 for (var j3 = 0; j3 < intersected.length; j3++) {
42496 var nearby = intersected[j3];
42497 if (nearby.id === node.id) continue;
42498 if (nearby.type !== "node" || nearby.geometry(graph) !== "point") continue;
42499 if (nearby.loc === node.loc || geoSphericalDistance(node.loc, nearby.loc) < pointThresholdMeters) {
42500 if ("memorial:type" in node.tags && "memorial:type" in nearby.tags && node.tags["memorial:type"] === "stolperstein" && nearby.tags["memorial:type"] === "stolperstein") continue;
42501 if ("memorial" in node.tags && "memorial" in nearby.tags && node.tags.memorial === "stolperstein" && nearby.tags.memorial === "stolperstein") continue;
42502 var zAxisKeys = { layer: true, level: true, "addr:housenumber": true, "addr:unit": true };
42503 var zAxisDifferentiates = false;
42504 for (var key in zAxisKeys) {
42505 var nodeValue = node.tags[key] || "0";
42506 var nearbyValue = nearby.tags[key] || "0";
42507 if (nodeValue !== nearbyValue) {
42508 zAxisDifferentiates = true;
42512 if (zAxisDifferentiates) continue;
42513 issues.push(new validationIssue({
42515 subtype: "detached",
42516 severity: "warning",
42517 message: function(context2) {
42518 var entity2 = context2.hasEntity(this.entityIds[0]), entity22 = context2.hasEntity(this.entityIds[1]);
42519 return entity2 && entity22 ? _t.append("issues.close_nodes.detached.message", {
42520 feature: utilDisplayLabel(entity2, context2.graph()),
42521 feature2: utilDisplayLabel(entity22, context2.graph())
42524 reference: showReference,
42525 entityIds: [node.id, nearby.id],
42526 dynamicFixes: function() {
42528 new validationIssueFix({
42529 icon: "iD-operation-disconnect",
42530 title: _t.append("issues.fix.move_points_apart.title")
42532 new validationIssueFix({
42533 icon: "iD-icon-layers",
42534 title: _t.append("issues.fix.use_different_layers_or_levels.title")
42542 function showReference(selection2) {
42543 var referenceText = _t("issues.close_nodes.detached.reference");
42544 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").html(referenceText);
42547 function getWayIssueIfAny(node1, node2, way) {
42548 if (node1.id === node2.id || node1.hasInterestingTags() && node2.hasInterestingTags()) {
42551 if (node1.loc !== node2.loc) {
42552 var parentWays1 = graph.parentWays(node1);
42553 var parentWays2 = new Set(graph.parentWays(node2));
42554 var sharedWays = parentWays1.filter(function(parentWay) {
42555 return parentWays2.has(parentWay);
42557 var thresholds = sharedWays.map(function(parentWay) {
42558 return thresholdMetersForWay(parentWay);
42560 var threshold = Math.min(...thresholds);
42561 var distance = geoSphericalDistance(node1.loc, node2.loc);
42562 if (distance > threshold) return null;
42564 return new validationIssue({
42566 subtype: "vertices",
42567 severity: "warning",
42568 message: function(context2) {
42569 var entity2 = context2.hasEntity(this.entityIds[0]);
42570 return entity2 ? _t.append("issues.close_nodes.message", { way: utilDisplayLabel(entity2, context2.graph()) }) : "";
42572 reference: showReference,
42573 entityIds: [way.id, node1.id, node2.id],
42575 dynamicFixes: function() {
42577 new validationIssueFix({
42578 icon: "iD-icon-plus",
42579 title: _t.append("issues.fix.merge_points.title"),
42580 onClick: function(context2) {
42581 var entityIds = this.issue.entityIds;
42582 var action = actionMergeNodes([entityIds[1], entityIds[2]]);
42583 context2.perform(action, _t("issues.fix.merge_close_vertices.annotation"));
42586 new validationIssueFix({
42587 icon: "iD-operation-disconnect",
42588 title: _t.append("issues.fix.move_points_apart.title")
42593 function showReference(selection2) {
42594 var referenceText = _t("issues.close_nodes.reference");
42595 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").html(referenceText);
42599 validation.type = type2;
42602 var init_close_nodes = __esm({
42603 "modules/validations/close_nodes.js"() {
42605 init_merge_nodes();
42606 init_utilDisplayLabel();
42615 // modules/validations/crossing_ways.js
42616 var crossing_ways_exports = {};
42617 __export(crossing_ways_exports, {
42618 validationCrossingWays: () => validationCrossingWays
42620 function validationCrossingWays(context) {
42621 var type2 = "crossing_ways";
42622 function getFeatureWithFeatureTypeTagsForWay(way, graph) {
42623 if (getFeatureType(way, graph) === null) {
42624 var parentRels = graph.parentRelations(way);
42625 for (var i3 = 0; i3 < parentRels.length; i3++) {
42626 var rel = parentRels[i3];
42627 if (getFeatureType(rel, graph) !== null) {
42634 function hasTag(tags, key) {
42635 return tags[key] !== void 0 && tags[key] !== "no";
42637 function taggedAsIndoor(tags) {
42638 return hasTag(tags, "indoor") || hasTag(tags, "level") || tags.highway === "corridor";
42640 function allowsBridge(featureType) {
42641 return featureType === "highway" || featureType === "railway" || featureType === "waterway" || featureType === "aeroway";
42643 function allowsTunnel(featureType) {
42644 return featureType === "highway" || featureType === "railway" || featureType === "waterway";
42646 var ignoredBuildings = {
42652 function getFeatureType(entity, graph) {
42653 var geometry = entity.geometry(graph);
42654 if (geometry !== "line" && geometry !== "area") return null;
42655 var tags = entity.tags;
42656 if (tags.aeroway in osmRoutableAerowayTags) return "aeroway";
42657 if (hasTag(tags, "building") && !ignoredBuildings[tags.building]) return "building";
42658 if (hasTag(tags, "highway") && osmRoutableHighwayTagValues[tags.highway]) return "highway";
42659 if (geometry !== "line") return null;
42660 if (hasTag(tags, "railway") && osmRailwayTrackTagValues[tags.railway]) return "railway";
42661 if (hasTag(tags, "waterway") && osmFlowingWaterwayTagValues[tags.waterway]) return "waterway";
42664 function isLegitCrossing(tags1, featureType1, tags2, featureType2) {
42665 var level1 = tags1.level || "0";
42666 var level2 = tags2.level || "0";
42667 if (taggedAsIndoor(tags1) && taggedAsIndoor(tags2) && level1 !== level2) {
42670 var layer1 = tags1.layer || "0";
42671 var layer2 = tags2.layer || "0";
42672 if (allowsBridge(featureType1) && allowsBridge(featureType2)) {
42673 if (hasTag(tags1, "bridge") && !hasTag(tags2, "bridge")) return true;
42674 if (!hasTag(tags1, "bridge") && hasTag(tags2, "bridge")) return true;
42675 if (hasTag(tags1, "bridge") && hasTag(tags2, "bridge") && layer1 !== layer2) return true;
42676 } else if (allowsBridge(featureType1) && hasTag(tags1, "bridge")) return true;
42677 else if (allowsBridge(featureType2) && hasTag(tags2, "bridge")) return true;
42678 if (allowsTunnel(featureType1) && allowsTunnel(featureType2)) {
42679 if (hasTag(tags1, "tunnel") && !hasTag(tags2, "tunnel")) return true;
42680 if (!hasTag(tags1, "tunnel") && hasTag(tags2, "tunnel")) return true;
42681 if (hasTag(tags1, "tunnel") && hasTag(tags2, "tunnel") && layer1 !== layer2) return true;
42682 } else if (allowsTunnel(featureType1) && hasTag(tags1, "tunnel")) return true;
42683 else if (allowsTunnel(featureType2) && hasTag(tags2, "tunnel")) return true;
42684 if (featureType1 === "waterway" && featureType2 === "highway" && tags2.man_made === "pier") return true;
42685 if (featureType2 === "waterway" && featureType1 === "highway" && tags1.man_made === "pier") return true;
42686 if (featureType1 === "building" || featureType2 === "building" || taggedAsIndoor(tags1) || taggedAsIndoor(tags2)) {
42687 if (layer1 !== layer2) return true;
42691 var highwaysDisallowingFords = {
42693 motorway_link: true,
42697 primary_link: true,
42699 secondary_link: true
42701 function tagsForConnectionNodeIfAllowed(entity1, entity2, graph, lessLikelyTags) {
42702 var featureType1 = getFeatureType(entity1, graph);
42703 var featureType2 = getFeatureType(entity2, graph);
42704 var geometry1 = entity1.geometry(graph);
42705 var geometry2 = entity2.geometry(graph);
42706 var bothLines = geometry1 === "line" && geometry2 === "line";
42707 const featureTypes = [featureType1, featureType2].sort().join("-");
42708 if (featureTypes === "aeroway-aeroway") return {};
42709 if (featureTypes === "aeroway-highway") {
42710 const isServiceRoad = entity1.tags.highway === "service" || entity2.tags.highway === "service";
42711 const isPath = entity1.tags.highway in osmPathHighwayTagValues || entity2.tags.highway in osmPathHighwayTagValues;
42712 return isServiceRoad || isPath ? {} : { aeroway: "aircraft_crossing" };
42714 if (featureTypes === "aeroway-railway") {
42715 return { aeroway: "aircraft_crossing", railway: "level_crossing" };
42717 if (featureTypes === "aeroway-waterway") return null;
42718 if (featureType1 === featureType2) {
42719 if (featureType1 === "highway") {
42720 var entity1IsPath = osmPathHighwayTagValues[entity1.tags.highway];
42721 var entity2IsPath = osmPathHighwayTagValues[entity2.tags.highway];
42722 if ((entity1IsPath || entity2IsPath) && entity1IsPath !== entity2IsPath) {
42723 if (!bothLines) return {};
42724 var roadFeature = entity1IsPath ? entity2 : entity1;
42725 var pathFeature = entity1IsPath ? entity1 : entity2;
42726 if (roadFeature.tags.highway === "track") {
42729 if (!lessLikelyTags && roadFeature.tags.highway === "service" && pathFeature.tags.highway === "footway" && pathFeature.tags.footway === "sidewalk") {
42732 if (["marked", "unmarked", "traffic_signals", "uncontrolled"].indexOf(pathFeature.tags.crossing) !== -1) {
42733 var tags = { highway: "crossing", crossing: pathFeature.tags.crossing };
42734 if ("crossing:markings" in pathFeature.tags) {
42735 tags["crossing:markings"] = pathFeature.tags["crossing:markings"];
42739 return { highway: "crossing" };
42743 if (featureType1 === "waterway") return {};
42744 if (featureType1 === "railway") return {};
42746 if (featureTypes.indexOf("highway") !== -1) {
42747 if (featureTypes.indexOf("railway") !== -1) {
42748 if (!bothLines) return {};
42749 var isTram = entity1.tags.railway === "tram" || entity2.tags.railway === "tram";
42750 if (osmPathHighwayTagValues[entity1.tags.highway] || osmPathHighwayTagValues[entity2.tags.highway]) {
42751 if (isTram) return { railway: "tram_crossing" };
42752 return { railway: "crossing" };
42754 if (isTram) return { railway: "tram_level_crossing" };
42755 return { railway: "level_crossing" };
42758 if (featureTypes.indexOf("waterway") !== -1) {
42759 if (hasTag(entity1.tags, "tunnel") && hasTag(entity2.tags, "tunnel")) return null;
42760 if (hasTag(entity1.tags, "bridge") && hasTag(entity2.tags, "bridge")) return null;
42761 if (highwaysDisallowingFords[entity1.tags.highway] || highwaysDisallowingFords[entity2.tags.highway]) {
42764 return bothLines ? { ford: "yes" } : {};
42770 function findCrossingsByWay(way1, graph, tree) {
42771 var edgeCrossInfos = [];
42772 if (way1.type !== "way") return edgeCrossInfos;
42773 var taggedFeature1 = getFeatureWithFeatureTypeTagsForWay(way1, graph);
42774 var way1FeatureType = getFeatureType(taggedFeature1, graph);
42775 if (way1FeatureType === null) return edgeCrossInfos;
42776 var checkedSingleCrossingWays = {};
42779 var n1, n22, nA, nB, nAId, nBId;
42780 var segment1, segment2;
42782 var segmentInfos, segment2Info, way2, taggedFeature2, way2FeatureType;
42783 var way1Nodes = graph.childNodes(way1);
42784 var comparedWays = {};
42785 for (i3 = 0; i3 < way1Nodes.length - 1; i3++) {
42786 n1 = way1Nodes[i3];
42787 n22 = way1Nodes[i3 + 1];
42788 extent = geoExtent([
42790 Math.min(n1.loc[0], n22.loc[0]),
42791 Math.min(n1.loc[1], n22.loc[1])
42794 Math.max(n1.loc[0], n22.loc[0]),
42795 Math.max(n1.loc[1], n22.loc[1])
42798 segmentInfos = tree.waySegments(extent, graph);
42799 for (j3 = 0; j3 < segmentInfos.length; j3++) {
42800 segment2Info = segmentInfos[j3];
42801 if (segment2Info.wayId === way1.id) continue;
42802 if (checkedSingleCrossingWays[segment2Info.wayId]) continue;
42803 comparedWays[segment2Info.wayId] = true;
42804 way2 = graph.hasEntity(segment2Info.wayId);
42805 if (!way2) continue;
42806 taggedFeature2 = getFeatureWithFeatureTypeTagsForWay(way2, graph);
42807 way2FeatureType = getFeatureType(taggedFeature2, graph);
42808 if (way2FeatureType === null || isLegitCrossing(taggedFeature1.tags, way1FeatureType, taggedFeature2.tags, way2FeatureType)) {
42811 oneOnly = way1FeatureType === "building" || way2FeatureType === "building";
42812 nAId = segment2Info.nodes[0];
42813 nBId = segment2Info.nodes[1];
42814 if (nAId === n1.id || nAId === n22.id || nBId === n1.id || nBId === n22.id) {
42817 nA = graph.hasEntity(nAId);
42819 nB = graph.hasEntity(nBId);
42821 segment1 = [n1.loc, n22.loc];
42822 segment2 = [nA.loc, nB.loc];
42823 var point = geoLineIntersection(segment1, segment2);
42825 edgeCrossInfos.push({
42829 featureType: way1FeatureType,
42830 edge: [n1.id, n22.id]
42834 featureType: way2FeatureType,
42835 edge: [nA.id, nB.id]
42841 checkedSingleCrossingWays[way2.id] = true;
42847 return edgeCrossInfos;
42849 function waysToCheck(entity, graph) {
42850 var featureType = getFeatureType(entity, graph);
42851 if (!featureType) return [];
42852 if (entity.type === "way") {
42854 } else if (entity.type === "relation") {
42855 return entity.members.reduce(function(array2, member) {
42856 if (member.type === "way" && // only look at geometry ways
42857 (!member.role || member.role === "outer" || member.role === "inner")) {
42858 var entity2 = graph.hasEntity(member.id);
42859 if (entity2 && array2.indexOf(entity2) === -1) {
42860 array2.push(entity2);
42868 var validation = function checkCrossingWays(entity, graph) {
42869 var tree = context.history().tree();
42870 var ways = waysToCheck(entity, graph);
42872 var wayIndex, crossingIndex, crossings;
42873 for (wayIndex in ways) {
42874 crossings = findCrossingsByWay(ways[wayIndex], graph, tree);
42875 for (crossingIndex in crossings) {
42876 issues.push(createIssue(crossings[crossingIndex], graph));
42881 function createIssue(crossing, graph) {
42882 crossing.wayInfos.sort(function(way1Info, way2Info) {
42883 var type1 = way1Info.featureType;
42884 var type22 = way2Info.featureType;
42885 if (type1 === type22) {
42886 return utilDisplayLabel(way1Info.way, graph) > utilDisplayLabel(way2Info.way, graph);
42887 } else if (type1 === "waterway") {
42889 } else if (type22 === "waterway") {
42892 return type1 < type22;
42894 var entities = crossing.wayInfos.map(function(wayInfo) {
42895 return getFeatureWithFeatureTypeTagsForWay(wayInfo.way, graph);
42897 var edges = [crossing.wayInfos[0].edge, crossing.wayInfos[1].edge];
42898 var featureTypes = [crossing.wayInfos[0].featureType, crossing.wayInfos[1].featureType];
42899 var connectionTags = tagsForConnectionNodeIfAllowed(entities[0], entities[1], graph);
42900 var featureType1 = crossing.wayInfos[0].featureType;
42901 var featureType2 = crossing.wayInfos[1].featureType;
42902 var isCrossingIndoors = taggedAsIndoor(entities[0].tags) && taggedAsIndoor(entities[1].tags);
42903 var isCrossingTunnels = allowsTunnel(featureType1) && hasTag(entities[0].tags, "tunnel") && allowsTunnel(featureType2) && hasTag(entities[1].tags, "tunnel");
42904 var isCrossingBridges = allowsBridge(featureType1) && hasTag(entities[0].tags, "bridge") && allowsBridge(featureType2) && hasTag(entities[1].tags, "bridge");
42905 var subtype = [featureType1, featureType2].sort().join("-");
42906 var crossingTypeID = subtype;
42907 if (isCrossingIndoors) {
42908 crossingTypeID = "indoor-indoor";
42909 } else if (isCrossingTunnels) {
42910 crossingTypeID = "tunnel-tunnel";
42911 } else if (isCrossingBridges) {
42912 crossingTypeID = "bridge-bridge";
42914 if (connectionTags && (isCrossingIndoors || isCrossingTunnels || isCrossingBridges)) {
42915 crossingTypeID += "_connectable";
42917 var uniqueID = crossing.crossPoint[0].toFixed(4) + "," + crossing.crossPoint[1].toFixed(4);
42918 return new validationIssue({
42921 severity: "warning",
42922 message: function(context2) {
42923 var graph2 = context2.graph();
42924 var entity1 = graph2.hasEntity(this.entityIds[0]), entity2 = graph2.hasEntity(this.entityIds[1]);
42925 return entity1 && entity2 ? _t.append("issues.crossing_ways.message", {
42926 feature: utilDisplayLabel(entity1, graph2, featureType1 === "building"),
42927 feature2: utilDisplayLabel(entity2, graph2, featureType2 === "building")
42930 reference: showReference,
42931 entityIds: entities.map(function(entity) {
42940 loc: crossing.crossPoint,
42941 dynamicFixes: function(context2) {
42942 var mode = context2.mode();
42943 if (!mode || mode.id !== "select" || mode.selectedIDs().length !== 1) return [];
42944 var selectedIndex = this.entityIds[0] === mode.selectedIDs()[0] ? 0 : 1;
42945 var selectedFeatureType = this.data.featureTypes[selectedIndex];
42946 var otherFeatureType = this.data.featureTypes[selectedIndex === 0 ? 1 : 0];
42948 if (connectionTags) {
42949 fixes.push(makeConnectWaysFix(this.data.connectionTags));
42950 let lessLikelyConnectionTags = tagsForConnectionNodeIfAllowed(entities[0], entities[1], graph, true);
42951 if (lessLikelyConnectionTags && !isEqual_default(connectionTags, lessLikelyConnectionTags)) {
42952 fixes.push(makeConnectWaysFix(lessLikelyConnectionTags));
42955 if (isCrossingIndoors) {
42956 fixes.push(new validationIssueFix({
42957 icon: "iD-icon-layers",
42958 title: _t.append("issues.fix.use_different_levels.title")
42960 } else if (isCrossingTunnels || isCrossingBridges || featureType1 === "building" || featureType2 === "building") {
42961 fixes.push(makeChangeLayerFix("higher"));
42962 fixes.push(makeChangeLayerFix("lower"));
42963 } else if (context2.graph().geometry(this.entityIds[0]) === "line" && context2.graph().geometry(this.entityIds[1]) === "line") {
42964 if (allowsBridge(selectedFeatureType) && selectedFeatureType !== "waterway") {
42965 fixes.push(makeAddBridgeOrTunnelFix("add_a_bridge", "temaki-bridge", "bridge"));
42967 var skipTunnelFix = otherFeatureType === "waterway" && selectedFeatureType !== "waterway";
42968 if (allowsTunnel(selectedFeatureType) && !skipTunnelFix) {
42969 if (selectedFeatureType === "waterway") {
42970 fixes.push(makeAddBridgeOrTunnelFix("add_a_culvert", "temaki-waste", "tunnel"));
42972 fixes.push(makeAddBridgeOrTunnelFix("add_a_tunnel", "temaki-tunnel", "tunnel"));
42976 fixes.push(new validationIssueFix({
42977 icon: "iD-operation-move",
42978 title: _t.append("issues.fix.reposition_features.title")
42983 function showReference(selection2) {
42984 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.crossing_ways." + crossingTypeID + ".reference"));
42987 function makeAddBridgeOrTunnelFix(fixTitleID, iconName, bridgeOrTunnel) {
42988 return new validationIssueFix({
42990 title: _t.append("issues.fix." + fixTitleID + ".title"),
42991 onClick: function(context2) {
42992 var mode = context2.mode();
42993 if (!mode || mode.id !== "select") return;
42994 var selectedIDs = mode.selectedIDs();
42995 if (selectedIDs.length !== 1) return;
42996 var selectedWayID = selectedIDs[0];
42997 if (!context2.hasEntity(selectedWayID)) return;
42998 var resultWayIDs = [selectedWayID];
42999 var edge, crossedEdge, crossedWayID;
43000 if (this.issue.entityIds[0] === selectedWayID) {
43001 edge = this.issue.data.edges[0];
43002 crossedEdge = this.issue.data.edges[1];
43003 crossedWayID = this.issue.entityIds[1];
43005 edge = this.issue.data.edges[1];
43006 crossedEdge = this.issue.data.edges[0];
43007 crossedWayID = this.issue.entityIds[0];
43009 var crossingLoc = this.issue.loc;
43010 var projection2 = context2.projection;
43011 var action = function actionAddStructure(graph) {
43012 var edgeNodes = [graph.entity(edge[0]), graph.entity(edge[1])];
43013 var crossedWay = graph.hasEntity(crossedWayID);
43014 var structLengthMeters = crossedWay && isFinite(crossedWay.tags.width) && Number(crossedWay.tags.width);
43015 if (!structLengthMeters) {
43016 structLengthMeters = crossedWay && crossedWay.impliedLineWidthMeters();
43018 if (structLengthMeters) {
43019 if (getFeatureType(crossedWay, graph) === "railway") {
43020 structLengthMeters *= 2;
43023 structLengthMeters = 8;
43025 var a1 = geoAngle(edgeNodes[0], edgeNodes[1], projection2) + Math.PI;
43026 var a2 = geoAngle(graph.entity(crossedEdge[0]), graph.entity(crossedEdge[1]), projection2) + Math.PI;
43027 var crossingAngle = Math.max(a1, a2) - Math.min(a1, a2);
43028 if (crossingAngle > Math.PI) crossingAngle -= Math.PI;
43029 structLengthMeters = structLengthMeters / 2 / Math.sin(crossingAngle) * 2;
43030 structLengthMeters += 4;
43031 structLengthMeters = Math.min(Math.max(structLengthMeters, 4), 50);
43032 function geomToProj(geoPoint) {
43034 geoLonToMeters(geoPoint[0], geoPoint[1]),
43035 geoLatToMeters(geoPoint[1])
43038 function projToGeom(projPoint) {
43039 var lat = geoMetersToLat(projPoint[1]);
43041 geoMetersToLon(projPoint[0], lat),
43045 var projEdgeNode1 = geomToProj(edgeNodes[0].loc);
43046 var projEdgeNode2 = geomToProj(edgeNodes[1].loc);
43047 var projectedAngle = geoVecAngle(projEdgeNode1, projEdgeNode2);
43048 var projectedCrossingLoc = geomToProj(crossingLoc);
43049 var linearToSphericalMetersRatio = geoVecLength(projEdgeNode1, projEdgeNode2) / geoSphericalDistance(edgeNodes[0].loc, edgeNodes[1].loc);
43050 function locSphericalDistanceFromCrossingLoc(angle2, distanceMeters) {
43051 var lengthSphericalMeters = distanceMeters * linearToSphericalMetersRatio;
43052 return projToGeom([
43053 projectedCrossingLoc[0] + Math.cos(angle2) * lengthSphericalMeters,
43054 projectedCrossingLoc[1] + Math.sin(angle2) * lengthSphericalMeters
43057 var endpointLocGetter1 = function(lengthMeters) {
43058 return locSphericalDistanceFromCrossingLoc(projectedAngle, lengthMeters);
43060 var endpointLocGetter2 = function(lengthMeters) {
43061 return locSphericalDistanceFromCrossingLoc(projectedAngle + Math.PI, lengthMeters);
43063 var minEdgeLengthMeters = 0.55;
43064 function determineEndpoint(edge2, endNode, locGetter) {
43066 var idealLengthMeters = structLengthMeters / 2;
43067 var crossingToEdgeEndDistance = geoSphericalDistance(crossingLoc, endNode.loc);
43068 if (crossingToEdgeEndDistance - idealLengthMeters > minEdgeLengthMeters) {
43069 var idealNodeLoc = locGetter(idealLengthMeters);
43070 newNode = osmNode();
43071 graph = actionAddMidpoint({ loc: idealNodeLoc, edge: edge2 }, newNode)(graph);
43074 endNode.parentIntersectionWays(graph).forEach(function(way) {
43075 way.nodes.forEach(function(nodeID) {
43076 if (nodeID === endNode.id) {
43077 if (endNode.id === way.first() && endNode.id !== way.last() || endNode.id === way.last() && endNode.id !== way.first()) {
43085 if (edgeCount >= 3) {
43086 var insetLength = crossingToEdgeEndDistance - minEdgeLengthMeters;
43087 if (insetLength > minEdgeLengthMeters) {
43088 var insetNodeLoc = locGetter(insetLength);
43089 newNode = osmNode();
43090 graph = actionAddMidpoint({ loc: insetNodeLoc, edge: edge2 }, newNode)(graph);
43094 if (!newNode) newNode = endNode;
43095 var splitAction = actionSplit([newNode.id]).limitWays(resultWayIDs);
43096 graph = splitAction(graph);
43097 if (splitAction.getCreatedWayIDs().length) {
43098 resultWayIDs.push(splitAction.getCreatedWayIDs()[0]);
43102 var structEndNode1 = determineEndpoint(edge, edgeNodes[1], endpointLocGetter1);
43103 var structEndNode2 = determineEndpoint([edgeNodes[0].id, structEndNode1.id], edgeNodes[0], endpointLocGetter2);
43104 var structureWay = resultWayIDs.map(function(id2) {
43105 return graph.entity(id2);
43106 }).find(function(way) {
43107 return way.nodes.indexOf(structEndNode1.id) !== -1 && way.nodes.indexOf(structEndNode2.id) !== -1;
43109 var tags = Object.assign({}, structureWay.tags);
43110 if (bridgeOrTunnel === "bridge") {
43111 tags.bridge = "yes";
43114 var tunnelValue = "yes";
43115 if (getFeatureType(structureWay, graph) === "waterway") {
43116 tunnelValue = "culvert";
43118 tags.tunnel = tunnelValue;
43121 graph = actionChangeTags(structureWay.id, tags)(graph);
43124 context2.perform(action, _t("issues.fix." + fixTitleID + ".annotation"));
43125 context2.enter(modeSelect(context2, resultWayIDs));
43129 function makeConnectWaysFix(connectionTags) {
43130 var fixTitleID = "connect_features";
43131 var fixIcon = "iD-icon-crossing";
43132 if (connectionTags.highway === "crossing") {
43133 fixTitleID = "connect_using_crossing";
43134 fixIcon = "temaki-pedestrian";
43136 if (connectionTags.ford) {
43137 fixTitleID = "connect_using_ford";
43138 fixIcon = "roentgen-ford";
43140 const fix = new validationIssueFix({
43142 title: _t.append("issues.fix." + fixTitleID + ".title"),
43143 onClick: function(context2) {
43144 var loc = this.issue.loc;
43145 var edges = this.issue.data.edges;
43147 function actionConnectCrossingWays(graph) {
43148 var node = osmNode({ loc, tags: connectionTags });
43149 graph = graph.replace(node);
43150 var nodesToMerge = [node.id];
43151 var mergeThresholdInMeters = 0.75;
43152 edges.forEach(function(edge) {
43153 var edgeNodes = [graph.entity(edge[0]), graph.entity(edge[1])];
43154 var nearby = geoSphericalClosestNode(edgeNodes, loc);
43155 if ((!nearby.node.hasInterestingTags() || nearby.node.isCrossing()) && nearby.distance < mergeThresholdInMeters) {
43156 nodesToMerge.push(nearby.node.id);
43158 graph = actionAddMidpoint({ loc, edge }, node)(graph);
43161 if (nodesToMerge.length > 1) {
43162 graph = actionMergeNodes(nodesToMerge, loc)(graph);
43166 _t("issues.fix.connect_crossing_features.annotation")
43170 fix._connectionTags = connectionTags;
43173 function makeChangeLayerFix(higherOrLower) {
43174 return new validationIssueFix({
43175 icon: "iD-icon-" + (higherOrLower === "higher" ? "up" : "down"),
43176 title: _t.append("issues.fix.tag_this_as_" + higherOrLower + ".title"),
43177 onClick: function(context2) {
43178 var mode = context2.mode();
43179 if (!mode || mode.id !== "select") return;
43180 var selectedIDs = mode.selectedIDs();
43181 if (selectedIDs.length !== 1) return;
43182 var selectedID = selectedIDs[0];
43183 if (!this.issue.entityIds.some(function(entityId) {
43184 return entityId === selectedID;
43186 var entity = context2.hasEntity(selectedID);
43187 if (!entity) return;
43188 var tags = Object.assign({}, entity.tags);
43189 var layer = tags.layer && Number(tags.layer);
43190 if (layer && !isNaN(layer)) {
43191 if (higherOrLower === "higher") {
43197 if (higherOrLower === "higher") {
43203 tags.layer = layer.toString();
43205 actionChangeTags(entity.id, tags),
43206 _t("operations.change_tags.annotation")
43211 validation.type = type2;
43214 var init_crossing_ways = __esm({
43215 "modules/validations/crossing_ways.js"() {
43218 init_add_midpoint();
43219 init_change_tags();
43220 init_merge_nodes();
43227 init_utilDisplayLabel();
43232 // modules/behavior/draw_way.js
43233 var draw_way_exports = {};
43234 __export(draw_way_exports, {
43235 behaviorDrawWay: () => behaviorDrawWay
43237 function behaviorDrawWay(context, wayID, mode, startGraph) {
43238 const keybinding = utilKeybinding("drawWay");
43239 var dispatch14 = dispatch_default("rejectedSelfIntersection");
43240 var behavior = behaviorDraw(context);
43246 var _pointerHasMoved = false;
43248 var _didResolveTempEdit = false;
43249 function createDrawNode(loc) {
43250 _drawNode = osmNode({ loc });
43251 context.pauseChangeDispatch();
43252 context.replace(function actionAddDrawNode(graph) {
43253 var way = graph.entity(wayID);
43254 return graph.replace(_drawNode).replace(way.addNode(_drawNode.id, _nodeIndex));
43256 context.resumeChangeDispatch();
43257 setActiveElements();
43259 function removeDrawNode() {
43260 context.pauseChangeDispatch();
43262 function actionDeleteDrawNode(graph) {
43263 var way = graph.entity(wayID);
43264 return graph.replace(way.removeNode(_drawNode.id)).remove(_drawNode);
43268 _drawNode = void 0;
43269 context.resumeChangeDispatch();
43271 function keydown(d3_event) {
43272 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
43273 if (context.surface().classed("nope")) {
43274 context.surface().classed("nope-suppressed", true);
43276 context.surface().classed("nope", false).classed("nope-disabled", true);
43279 function keyup(d3_event) {
43280 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
43281 if (context.surface().classed("nope-suppressed")) {
43282 context.surface().classed("nope", true);
43284 context.surface().classed("nope-suppressed", false).classed("nope-disabled", false);
43287 function allowsVertex(d4) {
43288 return d4.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d4, context.graph());
43290 function move(d3_event, datum2) {
43291 var loc = context.map().mouseCoordinates();
43292 if (!_drawNode) createDrawNode(loc);
43293 context.surface().classed("nope-disabled", d3_event.altKey);
43294 var targetLoc = datum2 && datum2.properties && datum2.properties.entity && allowsVertex(datum2.properties.entity) && datum2.properties.entity.loc;
43295 var targetNodes = datum2 && datum2.properties && datum2.properties.nodes;
43298 } else if (targetNodes) {
43299 var choice = geoChooseEdge(targetNodes, context.map().mouse(), context.projection, _drawNode.id);
43304 context.replace(actionMoveNode(_drawNode.id, loc), _annotation);
43305 _drawNode = context.entity(_drawNode.id);
43308 /* includeDrawNode */
43311 function checkGeometry(includeDrawNode) {
43312 var nopeDisabled = context.surface().classed("nope-disabled");
43313 var isInvalid = isInvalidGeometry(includeDrawNode);
43314 if (nopeDisabled) {
43315 context.surface().classed("nope", false).classed("nope-suppressed", isInvalid);
43317 context.surface().classed("nope", isInvalid).classed("nope-suppressed", false);
43320 function isInvalidGeometry(includeDrawNode) {
43321 var testNode = _drawNode;
43322 var parentWay = context.graph().entity(wayID);
43323 var nodes = context.graph().childNodes(parentWay).slice();
43324 if (includeDrawNode) {
43325 if (parentWay.isClosed()) {
43329 if (parentWay.isClosed()) {
43330 if (nodes.length < 3) return false;
43331 if (_drawNode) nodes.splice(-2, 1);
43332 testNode = nodes[nodes.length - 2];
43337 return testNode && geoHasSelfIntersections(nodes, testNode.id);
43339 function undone() {
43340 _didResolveTempEdit = true;
43341 context.pauseChangeDispatch();
43343 if (context.graph() === startGraph) {
43344 nextMode = modeSelect(context, [wayID]);
43349 context.perform(actionNoop());
43351 context.resumeChangeDispatch();
43352 context.enter(nextMode);
43354 function setActiveElements() {
43355 if (!_drawNode) return;
43356 context.surface().selectAll("." + _drawNode.id).classed("active", true);
43358 function resetToStartGraph() {
43359 while (context.graph() !== startGraph) {
43363 var drawWay = function(surface) {
43364 _drawNode = void 0;
43365 _didResolveTempEdit = false;
43366 _origWay = context.entity(wayID);
43367 if (typeof _nodeIndex === "number") {
43368 _headNodeID = _origWay.nodes[_nodeIndex];
43369 } else if (_origWay.isClosed()) {
43370 _headNodeID = _origWay.nodes[_origWay.nodes.length - 2];
43372 _headNodeID = _origWay.nodes[_origWay.nodes.length - 1];
43374 _wayGeometry = _origWay.geometry(context.graph());
43376 (_origWay.nodes.length === (_origWay.isClosed() ? 2 : 1) ? "operations.start.annotation." : "operations.continue.annotation.") + _wayGeometry
43378 _pointerHasMoved = false;
43379 context.pauseChangeDispatch();
43380 context.perform(actionNoop(), _annotation);
43381 context.resumeChangeDispatch();
43382 behavior.hover().initialNodeID(_headNodeID);
43383 behavior.on("move", function() {
43384 _pointerHasMoved = true;
43385 move.apply(this, arguments);
43386 }).on("down", function() {
43387 move.apply(this, arguments);
43388 }).on("downcancel", function() {
43389 if (_drawNode) removeDrawNode();
43390 }).on("click", drawWay.add).on("clickWay", drawWay.addWay).on("clickNode", drawWay.addNode).on("undo", context.undo).on("cancel", drawWay.cancel).on("finish", drawWay.finish);
43391 select_default2(window).on("keydown.drawWay", keydown).on("keyup.drawWay", keyup);
43392 context.map().dblclickZoomEnable(false).on("drawn.draw", setActiveElements);
43393 setActiveElements();
43394 surface.call(behavior);
43395 context.history().on("undone.draw", undone);
43397 drawWay.off = function(surface) {
43398 if (!_didResolveTempEdit) {
43399 context.pauseChangeDispatch();
43400 resetToStartGraph();
43401 context.resumeChangeDispatch();
43403 _drawNode = void 0;
43404 _nodeIndex = void 0;
43405 context.map().on("drawn.draw", null);
43406 surface.call(behavior.off).selectAll(".active").classed("active", false);
43407 surface.classed("nope", false).classed("nope-suppressed", false).classed("nope-disabled", false);
43408 select_default2(window).on("keydown.drawWay", null).on("keyup.drawWay", null);
43409 context.history().on("undone.draw", null);
43411 function attemptAdd(d4, loc, doAdd) {
43413 context.replace(actionMoveNode(_drawNode.id, loc), _annotation);
43414 _drawNode = context.entity(_drawNode.id);
43416 createDrawNode(loc);
43420 /* includeDrawNode */
43422 if (d4 && d4.properties && d4.properties.nope || context.surface().classed("nope")) {
43423 if (!_pointerHasMoved) {
43426 dispatch14.call("rejectedSelfIntersection", this);
43429 context.pauseChangeDispatch();
43431 _didResolveTempEdit = true;
43432 context.resumeChangeDispatch();
43433 context.enter(mode);
43435 drawWay.add = function(loc, d4) {
43436 attemptAdd(d4, loc, function() {
43439 drawWay.addWay = function(loc, edge, d4) {
43440 attemptAdd(d4, loc, function() {
43442 actionAddMidpoint({ loc, edge }, _drawNode),
43447 drawWay.addNode = function(node, d4) {
43448 if (node.id === _headNodeID || // or the first node when drawing an area
43449 _origWay.isClosed() && node.id === _origWay.first()) {
43453 attemptAdd(d4, node.loc, function() {
43455 function actionReplaceDrawNode(graph) {
43456 graph = graph.replace(graph.entity(wayID).removeNode(_drawNode.id)).remove(_drawNode);
43457 return graph.replace(graph.entity(wayID).addNode(node.id, _nodeIndex));
43463 function getFeatureType(ways) {
43464 if (ways.every((way) => way.isClosed())) return "area";
43465 if (ways.every((way) => !way.isClosed())) return "line";
43468 function followMode() {
43469 if (_didResolveTempEdit) return;
43471 const isDrawingArea = _origWay.nodes[0] === _origWay.nodes.slice(-1)[0];
43472 const [secondLastNodeId, lastNodeId] = _origWay.nodes.slice(isDrawingArea ? -3 : -2);
43473 const historyGraph = context.history().graph();
43474 if (!lastNodeId || !secondLastNodeId || !historyGraph.hasEntity(lastNodeId) || !historyGraph.hasEntity(secondLastNodeId)) {
43475 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("operations.follow.error.needs_more_initial_nodes"))();
43478 const lastNodesParents = historyGraph.parentWays(historyGraph.entity(lastNodeId)).filter((w3) => w3.id !== wayID);
43479 const secondLastNodesParents = historyGraph.parentWays(historyGraph.entity(secondLastNodeId)).filter((w3) => w3.id !== wayID);
43480 const featureType = getFeatureType(lastNodesParents);
43481 if (lastNodesParents.length !== 1 || secondLastNodesParents.length === 0) {
43482 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append(`operations.follow.error.intersection_of_multiple_ways.${featureType}`))();
43485 if (!secondLastNodesParents.some((n3) => n3.id === lastNodesParents[0].id)) {
43486 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append(`operations.follow.error.intersection_of_different_ways.${featureType}`))();
43489 const way = lastNodesParents[0];
43490 const indexOfLast = way.nodes.indexOf(lastNodeId);
43491 const indexOfSecondLast = way.nodes.indexOf(secondLastNodeId);
43492 const isDescendingPastZero = indexOfLast === way.nodes.length - 2 && indexOfSecondLast === 0;
43493 let nextNodeIndex = indexOfLast + (indexOfLast > indexOfSecondLast && !isDescendingPastZero ? 1 : -1);
43494 if (nextNodeIndex === -1) nextNodeIndex = indexOfSecondLast === 1 ? way.nodes.length - 2 : 1;
43495 const nextNode = historyGraph.entity(way.nodes[nextNodeIndex]);
43496 drawWay.addNode(nextNode, {
43497 geometry: { type: "Point", coordinates: nextNode.loc },
43499 properties: { target: true, entity: nextNode }
43502 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("operations.follow.error.unknown"))();
43505 keybinding.on(_t("operations.follow.key"), followMode);
43506 select_default2(document).call(keybinding);
43507 drawWay.finish = function() {
43510 /* includeDrawNode */
43512 if (context.surface().classed("nope")) {
43513 dispatch14.call("rejectedSelfIntersection", this);
43516 context.pauseChangeDispatch();
43518 _didResolveTempEdit = true;
43519 context.resumeChangeDispatch();
43520 var way = context.hasEntity(wayID);
43521 if (!way || way.isDegenerate()) {
43525 window.setTimeout(function() {
43526 context.map().dblclickZoomEnable(true);
43528 var isNewFeature = !mode.isContinuing;
43529 context.enter(modeSelect(context, [wayID]).newFeature(isNewFeature));
43531 drawWay.cancel = function() {
43532 context.pauseChangeDispatch();
43533 resetToStartGraph();
43534 context.resumeChangeDispatch();
43535 window.setTimeout(function() {
43536 context.map().dblclickZoomEnable(true);
43538 context.surface().classed("nope", false).classed("nope-disabled", false).classed("nope-suppressed", false);
43539 context.enter(modeBrowse(context));
43541 drawWay.nodeIndex = function(val) {
43542 if (!arguments.length) return _nodeIndex;
43546 drawWay.activeID = function() {
43547 if (!arguments.length) return _drawNode && _drawNode.id;
43550 return utilRebind(drawWay, dispatch14, "on");
43552 var init_draw_way = __esm({
43553 "modules/behavior/draw_way.js"() {
43559 init_add_midpoint();
43572 // modules/modes/draw_line.js
43573 var draw_line_exports = {};
43574 __export(draw_line_exports, {
43575 modeDrawLine: () => modeDrawLine
43577 function modeDrawLine(context, wayID, startGraph, button, affix, continuing) {
43582 var behavior = behaviorDrawWay(context, wayID, mode, startGraph).on("rejectedSelfIntersection.modeDrawLine", function() {
43583 context.ui().flash.iconName("#iD-icon-no").label(_t.append("self_intersection.error.lines"))();
43585 mode.wayID = wayID;
43586 mode.isContinuing = continuing;
43587 mode.enter = function() {
43588 behavior.nodeIndex(affix === "prefix" ? 0 : void 0);
43589 context.install(behavior);
43591 mode.exit = function() {
43592 context.uninstall(behavior);
43594 mode.selectedIDs = function() {
43597 mode.activeID = function() {
43598 return behavior && behavior.activeID() || [];
43602 var init_draw_line = __esm({
43603 "modules/modes/draw_line.js"() {
43610 // modules/ui/cmd.js
43611 var cmd_exports = {};
43612 __export(cmd_exports, {
43616 var init_cmd = __esm({
43617 "modules/ui/cmd.js"() {
43621 uiCmd = function(code) {
43622 var detected = utilDetect();
43623 if (detected.os === "mac") {
43626 if (detected.os === "win") {
43627 if (code === "\u2318\u21E7Z") return "Ctrl+Y";
43629 var result = "", replacements = {
43633 "\u232B": "Backspace",
43636 for (var i3 = 0; i3 < code.length; i3++) {
43637 if (code[i3] in replacements) {
43638 result += replacements[code[i3]] + (i3 < code.length - 1 ? "+" : "");
43640 result += code[i3];
43645 uiCmd.display = function(code) {
43646 if (code.length !== 1) return code;
43647 var detected = utilDetect();
43648 var mac = detected.os === "mac";
43649 var replacements = {
43650 "\u2318": mac ? "\u2318 " + _t("shortcuts.key.cmd") : _t("shortcuts.key.ctrl"),
43651 "\u21E7": mac ? "\u21E7 " + _t("shortcuts.key.shift") : _t("shortcuts.key.shift"),
43652 "\u2325": mac ? "\u2325 " + _t("shortcuts.key.option") : _t("shortcuts.key.alt"),
43653 "\u2303": mac ? "\u2303 " + _t("shortcuts.key.ctrl") : _t("shortcuts.key.ctrl"),
43654 "\u232B": mac ? "\u232B " + _t("shortcuts.key.delete") : _t("shortcuts.key.backspace"),
43655 "\u2326": mac ? "\u2326 " + _t("shortcuts.key.del") : _t("shortcuts.key.del"),
43656 "\u2196": mac ? "\u2196 " + _t("shortcuts.key.pgup") : _t("shortcuts.key.pgup"),
43657 "\u2198": mac ? "\u2198 " + _t("shortcuts.key.pgdn") : _t("shortcuts.key.pgdn"),
43658 "\u21DE": mac ? "\u21DE " + _t("shortcuts.key.home") : _t("shortcuts.key.home"),
43659 "\u21DF": mac ? "\u21DF " + _t("shortcuts.key.end") : _t("shortcuts.key.end"),
43660 "\u21B5": mac ? "\u23CE " + _t("shortcuts.key.return") : _t("shortcuts.key.enter"),
43661 "\u238B": mac ? "\u238B " + _t("shortcuts.key.esc") : _t("shortcuts.key.esc"),
43662 "\u2630": mac ? "\u2630 " + _t("shortcuts.key.menu") : _t("shortcuts.key.menu")
43664 return replacements[code] || code;
43669 // modules/operations/delete.js
43670 var delete_exports = {};
43671 __export(delete_exports, {
43672 operationDelete: () => operationDelete
43674 function operationDelete(context, selectedIDs) {
43675 var multi = selectedIDs.length === 1 ? "single" : "multiple";
43676 var action = actionDeleteMultiple(selectedIDs);
43677 var nodes = utilGetAllNodes(selectedIDs, context.graph());
43678 var coords = nodes.map(function(n3) {
43681 var extent = utilTotalExtent(selectedIDs, context.graph());
43682 var operation2 = function() {
43683 var nextSelectedID;
43684 var nextSelectedLoc;
43685 if (selectedIDs.length === 1) {
43686 var id2 = selectedIDs[0];
43687 var entity = context.entity(id2);
43688 var geometry = entity.geometry(context.graph());
43689 var parents = context.graph().parentWays(entity);
43690 var parent2 = parents[0];
43691 if (geometry === "vertex") {
43692 var nodes2 = parent2.nodes;
43693 var i3 = nodes2.indexOf(id2);
43696 } else if (i3 === nodes2.length - 1) {
43699 var a2 = geoSphericalDistance(entity.loc, context.entity(nodes2[i3 - 1]).loc);
43700 var b3 = geoSphericalDistance(entity.loc, context.entity(nodes2[i3 + 1]).loc);
43701 i3 = a2 < b3 ? i3 - 1 : i3 + 1;
43703 nextSelectedID = nodes2[i3];
43704 nextSelectedLoc = context.entity(nextSelectedID).loc;
43707 context.perform(action, operation2.annotation());
43708 context.validator().validate();
43709 if (nextSelectedID && nextSelectedLoc) {
43710 if (context.hasEntity(nextSelectedID)) {
43711 context.enter(modeSelect(context, [nextSelectedID]).follow(true));
43713 context.map().centerEase(nextSelectedLoc);
43714 context.enter(modeBrowse(context));
43717 context.enter(modeBrowse(context));
43720 operation2.available = function() {
43723 operation2.disabled = function() {
43724 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
43725 return "too_large";
43726 } else if (someMissing()) {
43727 return "not_downloaded";
43728 } else if (selectedIDs.some(context.hasHiddenConnections)) {
43729 return "connected_to_hidden";
43730 } else if (selectedIDs.some(protectedMember)) {
43731 return "part_of_relation";
43732 } else if (selectedIDs.some(incompleteRelation)) {
43733 return "incomplete_relation";
43734 } else if (selectedIDs.some(hasWikidataTag)) {
43735 return "has_wikidata_tag";
43738 function someMissing() {
43739 if (context.inIntro()) return false;
43740 var osm = context.connection();
43742 var missing = coords.filter(function(loc) {
43743 return !osm.isDataLoaded(loc);
43745 if (missing.length) {
43746 missing.forEach(function(loc) {
43747 context.loadTileAtLoc(loc);
43754 function hasWikidataTag(id2) {
43755 var entity = context.entity(id2);
43756 return entity.tags.wikidata && entity.tags.wikidata.trim().length > 0;
43758 function incompleteRelation(id2) {
43759 var entity = context.entity(id2);
43760 return entity.type === "relation" && !entity.isComplete(context.graph());
43762 function protectedMember(id2) {
43763 var entity = context.entity(id2);
43764 if (entity.type !== "way") return false;
43765 var parents = context.graph().parentRelations(entity);
43766 for (var i3 = 0; i3 < parents.length; i3++) {
43767 var parent2 = parents[i3];
43768 var type2 = parent2.tags.type;
43769 var role = parent2.memberById(id2).role || "outer";
43770 if (type2 === "route" || type2 === "boundary" || type2 === "multipolygon" && role === "outer") {
43777 operation2.tooltip = function() {
43778 var disable = operation2.disabled();
43779 return disable ? _t.append("operations.delete." + disable + "." + multi) : _t.append("operations.delete.description." + multi);
43781 operation2.annotation = function() {
43782 return selectedIDs.length === 1 ? _t("operations.delete.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.delete.annotation.feature", { n: selectedIDs.length });
43784 operation2.id = "delete";
43785 operation2.keys = [uiCmd("\u2318\u232B"), uiCmd("\u2318\u2326"), uiCmd("\u2326")];
43786 operation2.title = _t.append("operations.delete.title");
43787 operation2.behavior = behaviorOperation(context).which(operation2);
43790 var init_delete = __esm({
43791 "modules/operations/delete.js"() {
43794 init_delete_multiple();
43804 // modules/validations/disconnected_way.js
43805 var disconnected_way_exports = {};
43806 __export(disconnected_way_exports, {
43807 validationDisconnectedWay: () => validationDisconnectedWay
43809 function validationDisconnectedWay() {
43810 var type2 = "disconnected_way";
43811 function isTaggedAsHighway(entity) {
43812 return osmRoutableHighwayTagValues[entity.tags.highway];
43814 var validation = function checkDisconnectedWay(entity, graph) {
43815 var routingIslandWays = routingIslandForEntity(entity);
43816 if (!routingIslandWays) return [];
43817 return [new validationIssue({
43819 subtype: "highway",
43820 severity: "warning",
43821 message: function(context) {
43822 var entity2 = this.entityIds.length && context.hasEntity(this.entityIds[0]);
43823 var label = entity2 && utilDisplayLabel(entity2, context.graph());
43824 return _t.append("issues.disconnected_way.routable.message", { count: this.entityIds.length, highway: label });
43826 reference: showReference,
43827 entityIds: Array.from(routingIslandWays).map(function(way) {
43830 dynamicFixes: makeFixes
43832 function makeFixes(context) {
43834 var singleEntity = this.entityIds.length === 1 && context.hasEntity(this.entityIds[0]);
43835 if (singleEntity) {
43836 if (singleEntity.type === "way" && !singleEntity.isClosed()) {
43837 var textDirection = _mainLocalizer.textDirection();
43838 var startFix = makeContinueDrawingFixIfAllowed(textDirection, singleEntity.first(), "start");
43839 if (startFix) fixes.push(startFix);
43840 var endFix = makeContinueDrawingFixIfAllowed(textDirection, singleEntity.last(), "end");
43841 if (endFix) fixes.push(endFix);
43843 if (!fixes.length) {
43844 fixes.push(new validationIssueFix({
43845 title: _t.append("issues.fix.connect_feature.title")
43848 fixes.push(new validationIssueFix({
43849 icon: "iD-operation-delete",
43850 title: _t.append("issues.fix.delete_feature.title"),
43851 entityIds: [singleEntity.id],
43852 onClick: function(context2) {
43853 var id2 = this.issue.entityIds[0];
43854 var operation2 = operationDelete(context2, [id2]);
43855 if (!operation2.disabled()) {
43861 fixes.push(new validationIssueFix({
43862 title: _t.append("issues.fix.connect_features.title")
43867 function showReference(selection2) {
43868 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.disconnected_way.routable.reference"));
43870 function routingIslandForEntity(entity2) {
43871 var routingIsland = /* @__PURE__ */ new Set();
43872 var waysToCheck = [];
43873 function queueParentWays(node) {
43874 graph.parentWays(node).forEach(function(parentWay) {
43875 if (!routingIsland.has(parentWay) && // only check each feature once
43876 isRoutableWay(parentWay, false)) {
43877 routingIsland.add(parentWay);
43878 waysToCheck.push(parentWay);
43882 if (entity2.type === "way" && isRoutableWay(entity2, true)) {
43883 routingIsland.add(entity2);
43884 waysToCheck.push(entity2);
43885 } else if (entity2.type === "node" && isRoutableNode(entity2)) {
43886 routingIsland.add(entity2);
43887 queueParentWays(entity2);
43891 while (waysToCheck.length) {
43892 var wayToCheck = waysToCheck.pop();
43893 var childNodes = graph.childNodes(wayToCheck);
43894 for (var i3 in childNodes) {
43895 var vertex = childNodes[i3];
43896 if (isConnectedVertex(vertex)) {
43899 if (isRoutableNode(vertex)) {
43900 routingIsland.add(vertex);
43902 queueParentWays(vertex);
43905 return routingIsland;
43907 function isConnectedVertex(vertex) {
43908 var osm = services.osm;
43909 if (osm && !osm.isDataLoaded(vertex.loc)) return true;
43910 if (vertex.tags.entrance && vertex.tags.entrance !== "no") return true;
43911 if (vertex.tags.amenity === "parking_entrance") return true;
43914 function isRoutableNode(node) {
43915 if (node.tags.highway === "elevator") return true;
43918 function isRoutableWay(way, ignoreInnerWays) {
43919 if (isTaggedAsHighway(way) || way.tags.route === "ferry") return true;
43920 return graph.parentRelations(way).some(function(parentRelation) {
43921 if (parentRelation.tags.type === "route" && parentRelation.tags.route === "ferry") return true;
43922 if (parentRelation.isMultipolygon() && isTaggedAsHighway(parentRelation) && (!ignoreInnerWays || parentRelation.memberById(way.id).role !== "inner")) return true;
43926 function makeContinueDrawingFixIfAllowed(textDirection, vertexID, whichEnd) {
43927 var vertex = graph.hasEntity(vertexID);
43928 if (!vertex || vertex.tags.noexit === "yes") return null;
43929 var useLeftContinue = whichEnd === "start" && textDirection === "ltr" || whichEnd === "end" && textDirection === "rtl";
43930 return new validationIssueFix({
43931 icon: "iD-operation-continue" + (useLeftContinue ? "-left" : ""),
43932 title: _t.append("issues.fix.continue_from_" + whichEnd + ".title"),
43933 entityIds: [vertexID],
43934 onClick: function(context) {
43935 var wayId = this.issue.entityIds[0];
43936 var way = context.hasEntity(wayId);
43937 var vertexId = this.entityIds[0];
43938 var vertex2 = context.hasEntity(vertexId);
43939 if (!way || !vertex2) return;
43940 var map2 = context.map();
43941 if (!context.editable() || !map2.trimmedExtent().contains(vertex2.loc)) {
43942 map2.zoomToEase(vertex2);
43945 modeDrawLine(context, wayId, context.graph(), "line", way.affix(vertexId), true)
43951 validation.type = type2;
43954 var init_disconnected_way = __esm({
43955 "modules/validations/disconnected_way.js"() {
43960 init_utilDisplayLabel();
43967 // modules/validations/invalid_format.js
43968 var invalid_format_exports = {};
43969 __export(invalid_format_exports, {
43970 validationFormatting: () => validationFormatting
43972 function validationFormatting() {
43973 var type2 = "invalid_format";
43974 var validation = function(entity) {
43976 function isValidEmail(email) {
43977 var valid_email = /^[^\(\)\\,":;<>@\[\]]+@[^\(\)\\,":;<>@\[\]\.]+(?:\.[a-z0-9-]+)*$/i;
43978 return !email || valid_email.test(email);
43980 function showReferenceEmail(selection2) {
43981 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.invalid_format.email.reference"));
43983 if (entity.tags.email) {
43984 var emails = entity.tags.email.split(";").map(function(s2) {
43986 }).filter(function(x2) {
43987 return !isValidEmail(x2);
43989 if (emails.length) {
43990 issues.push(new validationIssue({
43993 severity: "warning",
43994 message: function(context) {
43995 var entity2 = context.hasEntity(this.entityIds[0]);
43996 return entity2 ? _t.append(
43997 "issues.invalid_format.email.message" + this.data,
43998 { feature: utilDisplayLabel(entity2, context.graph()), email: emails.join(", ") }
44001 reference: showReferenceEmail,
44002 entityIds: [entity.id],
44003 hash: emails.join(),
44004 data: emails.length > 1 ? "_multi" : ""
44010 validation.type = type2;
44013 var init_invalid_format = __esm({
44014 "modules/validations/invalid_format.js"() {
44017 init_utilDisplayLabel();
44022 // modules/validations/help_request.js
44023 var help_request_exports = {};
44024 __export(help_request_exports, {
44025 validationHelpRequest: () => validationHelpRequest
44027 function validationHelpRequest(context) {
44028 var type2 = "help_request";
44029 var validation = function checkFixmeTag(entity) {
44030 if (!entity.tags.fixme) return [];
44031 if (entity.version === void 0) return [];
44032 if (entity.v !== void 0) {
44033 var baseEntity = context.history().base().hasEntity(entity.id);
44034 if (!baseEntity || !baseEntity.tags.fixme) return [];
44036 return [new validationIssue({
44038 subtype: "fixme_tag",
44039 severity: "warning",
44040 message: function(context2) {
44041 var entity2 = context2.hasEntity(this.entityIds[0]);
44042 return entity2 ? _t.append("issues.fixme_tag.message", {
44043 feature: utilDisplayLabel(
44051 dynamicFixes: function() {
44053 new validationIssueFix({
44054 title: _t.append("issues.fix.address_the_concern.title")
44058 reference: showReference,
44059 entityIds: [entity.id]
44061 function showReference(selection2) {
44062 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.fixme_tag.reference"));
44065 validation.type = type2;
44068 var init_help_request = __esm({
44069 "modules/validations/help_request.js"() {
44072 init_utilDisplayLabel();
44077 // modules/validations/impossible_oneway.js
44078 var impossible_oneway_exports = {};
44079 __export(impossible_oneway_exports, {
44080 validationImpossibleOneway: () => validationImpossibleOneway
44082 function validationImpossibleOneway() {
44083 const type2 = "impossible_oneway";
44084 const validation = function checkImpossibleOneway(entity, graph) {
44085 if (entity.type !== "way" || entity.geometry(graph) !== "line") return [];
44086 if (entity.isClosed()) return [];
44087 if (!typeForWay(entity)) return [];
44088 if (!entity.isOneWay()) return [];
44090 ...issuesForNode(entity, entity.first()),
44091 ...issuesForNode(entity, entity.last())
44093 function typeForWay(way) {
44094 if (way.geometry(graph) !== "line") return null;
44095 if (osmRoutableHighwayTagValues[way.tags.highway]) return "highway";
44096 if (osmFlowingWaterwayTagValues[way.tags.waterway]) return "waterway";
44099 function nodeOccursMoreThanOnce(way, nodeID) {
44100 let occurrences = 0;
44101 for (const index in way.nodes) {
44102 if (way.nodes[index] === nodeID) {
44104 if (occurrences > 1) return true;
44109 function isConnectedViaOtherTypes(way, node) {
44110 var wayType = typeForWay(way);
44111 if (wayType === "highway") {
44112 if (node.tags.entrance && node.tags.entrance !== "no") return true;
44113 if (node.tags.amenity === "parking_entrance") return true;
44114 } else if (wayType === "waterway") {
44115 if (node.id === way.first()) {
44116 if (node.tags.natural === "spring") return true;
44118 if (node.tags.manhole === "drain") return true;
44121 return graph.parentWays(node).some(function(parentWay) {
44122 if (parentWay.id === way.id) return false;
44123 if (wayType === "highway") {
44124 if (parentWay.geometry(graph) === "area" && osmRoutableHighwayTagValues[parentWay.tags.highway]) return true;
44125 if (parentWay.tags.route === "ferry") return true;
44126 return graph.parentRelations(parentWay).some(function(parentRelation) {
44127 if (parentRelation.tags.type === "route" && parentRelation.tags.route === "ferry") return true;
44128 return parentRelation.isMultipolygon() && osmRoutableHighwayTagValues[parentRelation.tags.highway];
44130 } else if (wayType === "waterway") {
44131 if (parentWay.tags.natural === "water" || parentWay.tags.natural === "coastline") return true;
44136 function issuesForNode(way, nodeID) {
44137 const isFirst = nodeID === way.first() ^ way.isOneWayBackwards();
44138 const wayType = typeForWay(way);
44139 if (nodeOccursMoreThanOnce(way, nodeID)) return [];
44140 const osm = services.osm;
44141 if (!osm) return [];
44142 const node = graph.hasEntity(nodeID);
44143 if (!node || !osm.isDataLoaded(node.loc)) return [];
44144 if (isConnectedViaOtherTypes(way, node)) return [];
44145 const attachedWaysOfSameType = graph.parentWays(node).filter((parentWay) => {
44146 if (parentWay.id === way.id) return false;
44147 return typeForWay(parentWay) === wayType;
44149 if (wayType === "waterway" && attachedWaysOfSameType.length === 0) return [];
44150 const attachedOneways = attachedWaysOfSameType.filter((attachedWay) => attachedWay.isOneWay());
44151 if (attachedOneways.length < attachedWaysOfSameType.length) return [];
44152 if (attachedOneways.length) {
44153 const connectedEndpointsOkay = attachedOneways.some((attachedOneway) => {
44154 const isAttachedBackwards = attachedOneway.isOneWayBackwards();
44155 if ((isFirst ^ isAttachedBackwards ? attachedOneway.first() : attachedOneway.last()) !== nodeID) {
44158 if (nodeOccursMoreThanOnce(attachedOneway, nodeID)) return true;
44161 if (connectedEndpointsOkay) return [];
44163 const placement = isFirst ? "start" : "end";
44164 let messageID = wayType + ".";
44165 let referenceID = wayType + ".";
44166 if (wayType === "waterway") {
44167 messageID += "connected." + placement;
44168 referenceID += "connected";
44170 messageID += placement;
44171 referenceID += placement;
44173 return [new validationIssue({
44176 severity: "warning",
44177 message: function(context) {
44178 var entity2 = context.hasEntity(this.entityIds[0]);
44179 return entity2 ? _t.append("issues.impossible_oneway." + messageID + ".message", {
44180 feature: utilDisplayLabel(entity2, context.graph())
44183 reference: getReference(referenceID),
44184 entityIds: [way.id, node.id],
44185 dynamicFixes: function() {
44187 if (attachedOneways.length) {
44188 fixes.push(new validationIssueFix({
44189 icon: "iD-operation-reverse",
44190 title: _t.append("issues.fix.reverse_feature.title"),
44191 entityIds: [way.id],
44192 onClick: function(context) {
44193 var id2 = this.issue.entityIds[0];
44194 context.perform(actionReverse(id2), _t("operations.reverse.annotation.line", { n: 1 }));
44198 if (node.tags.noexit !== "yes") {
44199 var textDirection = _mainLocalizer.textDirection();
44200 var useLeftContinue = isFirst && textDirection === "ltr" || !isFirst && textDirection === "rtl";
44201 fixes.push(new validationIssueFix({
44202 icon: "iD-operation-continue" + (useLeftContinue ? "-left" : ""),
44203 title: _t.append("issues.fix.continue_from_" + (isFirst ? "start" : "end") + ".title"),
44204 onClick: function(context) {
44205 var entityID = this.issue.entityIds[0];
44206 var vertexID = this.issue.entityIds[1];
44207 var way2 = context.entity(entityID);
44208 var vertex = context.entity(vertexID);
44209 continueDrawing(way2, vertex, context);
44217 function getReference(referenceID2) {
44218 return function showReference(selection2) {
44219 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.impossible_oneway." + referenceID2 + ".reference"));
44224 function continueDrawing(way, vertex, context) {
44225 var map2 = context.map();
44226 if (!context.editable() || !map2.trimmedExtent().contains(vertex.loc)) {
44227 map2.zoomToEase(vertex);
44230 modeDrawLine(context, way.id, context.graph(), "line", way.affix(vertex.id), true)
44233 validation.type = type2;
44236 var init_impossible_oneway = __esm({
44237 "modules/validations/impossible_oneway.js"() {
44242 init_utilDisplayLabel();
44249 // modules/validations/incompatible_source.js
44250 var incompatible_source_exports = {};
44251 __export(incompatible_source_exports, {
44252 validationIncompatibleSource: () => validationIncompatibleSource
44254 function validationIncompatibleSource() {
44255 const type2 = "incompatible_source";
44256 const incompatibleRules = [
44259 regex: /(^amap$|^amap\.com|autonavi|mapabc|高德)/i
44263 regex: /(baidu|mapbar|百度)/i
44268 exceptRegex: /((books|drive)\.google|google\s?(books|drive|plus))|(esri\/Google_Africa_Buildings)/i
44271 const validation = function checkIncompatibleSource(entity) {
44272 const entitySources = entity.tags && entity.tags.source && entity.tags.source.split(";");
44273 if (!entitySources) return [];
44274 const entityID = entity.id;
44275 return entitySources.map((source) => {
44276 const matchRule = incompatibleRules.find((rule) => {
44277 if (!rule.regex.test(source)) return false;
44278 if (rule.exceptRegex && rule.exceptRegex.test(source)) return false;
44281 if (!matchRule) return null;
44282 return new validationIssue({
44284 severity: "warning",
44285 message: (context) => {
44286 const entity2 = context.hasEntity(entityID);
44287 return entity2 ? _t.append("issues.incompatible_source.feature.message", {
44288 feature: utilDisplayLabel(
44297 reference: getReference(matchRule.id),
44298 entityIds: [entityID],
44300 dynamicFixes: () => {
44302 new validationIssueFix({ title: _t.append("issues.fix.remove_proprietary_data.title") })
44306 }).filter(Boolean);
44307 function getReference(id2) {
44308 return function showReference(selection2) {
44309 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append(`issues.incompatible_source.reference.${id2}`));
44313 validation.type = type2;
44316 var init_incompatible_source = __esm({
44317 "modules/validations/incompatible_source.js"() {
44320 init_utilDisplayLabel();
44325 // modules/validations/maprules.js
44326 var maprules_exports2 = {};
44327 __export(maprules_exports2, {
44328 validationMaprules: () => validationMaprules
44330 function validationMaprules() {
44331 var type2 = "maprules";
44332 var validation = function checkMaprules(entity, graph) {
44333 if (!services.maprules) return [];
44334 var rules = services.maprules.validationRules();
44336 for (var i3 = 0; i3 < rules.length; i3++) {
44337 var rule = rules[i3];
44338 rule.findIssues(entity, graph, issues);
44342 validation.type = type2;
44345 var init_maprules2 = __esm({
44346 "modules/validations/maprules.js"() {
44352 // modules/validations/mismatched_geometry.js
44353 var mismatched_geometry_exports = {};
44354 __export(mismatched_geometry_exports, {
44355 validationMismatchedGeometry: () => validationMismatchedGeometry
44357 function validationMismatchedGeometry() {
44358 var type2 = "mismatched_geometry";
44359 function tagSuggestingLineIsArea(entity) {
44360 if (entity.type !== "way" || entity.isClosed()) return null;
44361 var tagSuggestingArea = entity.tagSuggestingArea();
44362 if (!tagSuggestingArea) {
44365 var asLine = _mainPresetIndex.matchTags(tagSuggestingArea, "line");
44366 var asArea = _mainPresetIndex.matchTags(tagSuggestingArea, "area");
44367 if (asLine && asArea && (0, import_fast_deep_equal5.default)(asLine.tags, asArea.tags)) {
44370 if (asLine.isFallback() && asArea.isFallback() && !(0, import_fast_deep_equal5.default)(tagSuggestingArea, { area: "yes" })) {
44373 return tagSuggestingArea;
44375 function makeConnectEndpointsFixOnClick(way, graph) {
44376 if (way.nodes.length < 3) return null;
44377 var nodes = graph.childNodes(way), testNodes;
44378 var firstToLastDistanceMeters = geoSphericalDistance(nodes[0].loc, nodes[nodes.length - 1].loc);
44379 if (firstToLastDistanceMeters < 0.75) {
44380 testNodes = nodes.slice();
44382 testNodes.push(testNodes[0]);
44383 if (!geoHasSelfIntersections(testNodes, testNodes[0].id)) {
44384 return function(context) {
44385 var way2 = context.entity(this.issue.entityIds[0]);
44387 actionMergeNodes([way2.nodes[0], way2.nodes[way2.nodes.length - 1]], nodes[0].loc),
44388 _t("issues.fix.connect_endpoints.annotation")
44393 testNodes = nodes.slice();
44394 testNodes.push(testNodes[0]);
44395 if (!geoHasSelfIntersections(testNodes, testNodes[0].id)) {
44396 return function(context) {
44397 var wayId = this.issue.entityIds[0];
44398 var way2 = context.entity(wayId);
44399 var nodeId = way2.nodes[0];
44400 var index = way2.nodes.length;
44402 actionAddVertex(wayId, nodeId, index),
44403 _t("issues.fix.connect_endpoints.annotation")
44408 function lineTaggedAsAreaIssue(entity) {
44409 var tagSuggestingArea = tagSuggestingLineIsArea(entity);
44410 if (!tagSuggestingArea) return null;
44411 var validAsLine = false;
44412 var presetAsLine = _mainPresetIndex.matchTags(entity.tags, "line");
44413 if (presetAsLine) {
44414 validAsLine = true;
44415 var key = Object.keys(tagSuggestingArea)[0];
44416 if (presetAsLine.tags[key] && presetAsLine.tags[key] === "*") {
44417 validAsLine = false;
44419 if (Object.keys(presetAsLine.tags).length === 0) {
44420 validAsLine = false;
44423 return new validationIssue({
44425 subtype: "area_as_line",
44426 severity: "warning",
44427 message: function(context) {
44428 var entity2 = context.hasEntity(this.entityIds[0]);
44429 return entity2 ? _t.append("issues.tag_suggests_area.message", {
44430 feature: utilDisplayLabel(
44436 tag: utilTagText({ tags: tagSuggestingArea })
44439 reference: showReference,
44440 entityIds: [entity.id],
44441 hash: JSON.stringify(tagSuggestingArea),
44442 dynamicFixes: function(context) {
44444 var entity2 = context.entity(this.entityIds[0]);
44445 var connectEndsOnClick = makeConnectEndpointsFixOnClick(entity2, context.graph());
44446 if (!validAsLine) {
44447 fixes.push(new validationIssueFix({
44448 title: _t.append("issues.fix.connect_endpoints.title"),
44449 onClick: connectEndsOnClick
44452 fixes.push(new validationIssueFix({
44453 icon: "iD-operation-delete",
44454 title: _t.append("issues.fix.remove_tag.title"),
44455 onClick: function(context2) {
44456 var entityId = this.issue.entityIds[0];
44457 var entity3 = context2.entity(entityId);
44458 var tags = Object.assign({}, entity3.tags);
44459 for (var key2 in tagSuggestingArea) {
44463 actionChangeTags(entityId, tags),
44464 _t("issues.fix.remove_tag.annotation")
44471 function showReference(selection2) {
44472 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.tag_suggests_area.reference"));
44475 function vertexPointIssue(entity, graph) {
44476 if (entity.type !== "node") return null;
44477 if (Object.keys(entity.tags).length === 0) return null;
44478 if (entity.isOnAddressLine(graph)) return null;
44479 var geometry = entity.geometry(graph);
44480 var allowedGeometries = osmNodeGeometriesForTags(entity.tags);
44481 if (geometry === "point" && !allowedGeometries.point && allowedGeometries.vertex) {
44482 return new validationIssue({
44484 subtype: "vertex_as_point",
44485 severity: "warning",
44486 message: function(context) {
44487 var entity2 = context.hasEntity(this.entityIds[0]);
44488 return entity2 ? _t.append("issues.vertex_as_point.message", {
44489 feature: utilDisplayLabel(
44497 reference: function showReference(selection2) {
44498 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.vertex_as_point.reference"));
44500 entityIds: [entity.id]
44502 } else if (geometry === "vertex" && !allowedGeometries.vertex && allowedGeometries.point) {
44503 return new validationIssue({
44505 subtype: "point_as_vertex",
44506 severity: "warning",
44507 message: function(context) {
44508 var entity2 = context.hasEntity(this.entityIds[0]);
44509 return entity2 ? _t.append("issues.point_as_vertex.message", {
44510 feature: utilDisplayLabel(
44518 reference: function showReference(selection2) {
44519 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.point_as_vertex.reference"));
44521 entityIds: [entity.id],
44522 dynamicFixes: extractPointDynamicFixes
44527 function otherMismatchIssue(entity, graph) {
44528 if (!entity.hasInterestingTags()) return null;
44529 if (entity.type !== "node" && entity.type !== "way") return null;
44530 if (entity.type === "node" && entity.isOnAddressLine(graph)) return null;
44531 var sourceGeom = entity.geometry(graph);
44532 var targetGeoms = entity.type === "way" ? ["point", "vertex"] : ["line", "area"];
44533 if (sourceGeom === "area") targetGeoms.unshift("line");
44534 var asSource = _mainPresetIndex.match(entity, graph);
44535 var targetGeom = targetGeoms.find((nodeGeom) => {
44536 const asTarget = _mainPresetIndex.matchTags(
44539 entity.extent(graph).center()
44541 if (!asSource || !asTarget || asSource === asTarget || // sometimes there are two presets with the same tags for different geometries
44542 (0, import_fast_deep_equal5.default)(asSource.tags, asTarget.tags)) return false;
44543 if (asTarget.isFallback()) return false;
44544 var primaryKey = Object.keys(asTarget.tags)[0];
44545 if (primaryKey === "building") return false;
44546 if (asTarget.tags[primaryKey] === "*") return false;
44547 return asSource.isFallback() || asSource.tags[primaryKey] === "*";
44549 if (!targetGeom) return null;
44550 var subtype = targetGeom + "_as_" + sourceGeom;
44551 if (targetGeom === "vertex") targetGeom = "point";
44552 if (sourceGeom === "vertex") sourceGeom = "point";
44553 var referenceId = targetGeom + "_as_" + sourceGeom;
44555 if (targetGeom === "point") {
44556 dynamicFixes = extractPointDynamicFixes;
44557 } else if (sourceGeom === "area" && targetGeom === "line") {
44558 dynamicFixes = lineToAreaDynamicFixes;
44560 return new validationIssue({
44563 severity: "warning",
44564 message: function(context) {
44565 var entity2 = context.hasEntity(this.entityIds[0]);
44566 return entity2 ? _t.append("issues." + referenceId + ".message", {
44567 feature: utilDisplayLabel(
44575 reference: function showReference(selection2) {
44576 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.mismatched_geometry.reference"));
44578 entityIds: [entity.id],
44582 function lineToAreaDynamicFixes(context) {
44583 var convertOnClick;
44584 var entityId = this.entityIds[0];
44585 var entity = context.entity(entityId);
44586 var tags = Object.assign({}, entity.tags);
44588 if (!osmTagSuggestingArea(tags)) {
44589 convertOnClick = function(context2) {
44590 var entityId2 = this.issue.entityIds[0];
44591 var entity2 = context2.entity(entityId2);
44592 var tags2 = Object.assign({}, entity2.tags);
44597 actionChangeTags(entityId2, tags2),
44598 _t("issues.fix.convert_to_line.annotation")
44603 new validationIssueFix({
44604 icon: "iD-icon-line",
44605 title: _t.append("issues.fix.convert_to_line.title"),
44606 onClick: convertOnClick
44610 function extractPointDynamicFixes(context) {
44611 var entityId = this.entityIds[0];
44612 var extractOnClick = null;
44613 if (!context.hasHiddenConnections(entityId)) {
44614 extractOnClick = function(context2) {
44615 var entityId2 = this.issue.entityIds[0];
44616 var action = actionExtract(entityId2, context2.projection);
44619 _t("operations.extract.annotation", { n: 1 })
44621 context2.enter(modeSelect(context2, [action.getExtractedNodeID()]));
44625 new validationIssueFix({
44626 icon: "iD-operation-extract",
44627 title: _t.append("issues.fix.extract_point.title"),
44628 onClick: extractOnClick
44632 function unclosedMultipolygonPartIssues(entity, graph) {
44633 if (entity.type !== "relation" || !entity.isMultipolygon() || entity.isDegenerate() || // cannot determine issues for incompletely-downloaded relations
44634 !entity.isComplete(graph)) return [];
44635 var sequences = osmJoinWays(entity.members, graph);
44637 for (var i3 in sequences) {
44638 var sequence = sequences[i3];
44639 if (!sequence.nodes) continue;
44640 var firstNode = sequence.nodes[0];
44641 var lastNode = sequence.nodes[sequence.nodes.length - 1];
44642 if (firstNode === lastNode) continue;
44643 var issue = new validationIssue({
44645 subtype: "unclosed_multipolygon_part",
44646 severity: "warning",
44647 message: function(context) {
44648 var entity2 = context.hasEntity(this.entityIds[0]);
44649 return entity2 ? _t.append("issues.unclosed_multipolygon_part.message", {
44650 feature: utilDisplayLabel(
44658 reference: showReference,
44659 loc: sequence.nodes[0].loc,
44660 entityIds: [entity.id],
44661 hash: sequence.map(function(way) {
44665 issues.push(issue);
44668 function showReference(selection2) {
44669 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.unclosed_multipolygon_part.reference"));
44672 var validation = function checkMismatchedGeometry(entity, graph) {
44673 var vertexPoint = vertexPointIssue(entity, graph);
44674 if (vertexPoint) return [vertexPoint];
44675 var lineAsArea = lineTaggedAsAreaIssue(entity);
44676 if (lineAsArea) return [lineAsArea];
44677 var mismatch = otherMismatchIssue(entity, graph);
44678 if (mismatch) return [mismatch];
44679 return unclosedMultipolygonPartIssues(entity, graph);
44681 validation.type = type2;
44684 var import_fast_deep_equal5;
44685 var init_mismatched_geometry = __esm({
44686 "modules/validations/mismatched_geometry.js"() {
44688 import_fast_deep_equal5 = __toESM(require_fast_deep_equal(), 1);
44690 init_change_tags();
44691 init_merge_nodes();
44694 init_multipolygon();
44700 init_utilDisplayLabel();
44705 // modules/validations/missing_role.js
44706 var missing_role_exports = {};
44707 __export(missing_role_exports, {
44708 validationMissingRole: () => validationMissingRole
44710 function validationMissingRole() {
44711 var type2 = "missing_role";
44712 var validation = function checkMissingRole(entity, graph) {
44714 if (entity.type === "way") {
44715 graph.parentRelations(entity).forEach(function(relation) {
44716 if (!relation.isMultipolygon()) return;
44717 var member = relation.memberById(entity.id);
44718 if (member && isMissingRole(member)) {
44719 issues.push(makeIssue(entity, relation, member));
44722 } else if (entity.type === "relation" && entity.isMultipolygon()) {
44723 entity.indexedMembers().forEach(function(member) {
44724 var way = graph.hasEntity(member.id);
44725 if (way && isMissingRole(member)) {
44726 issues.push(makeIssue(way, entity, member));
44732 function isMissingRole(member) {
44733 return !member.role || !member.role.trim().length;
44735 function makeIssue(way, relation, member) {
44736 return new validationIssue({
44738 severity: "warning",
44739 message: function(context) {
44740 const member2 = context.hasEntity(this.entityIds[0]), relation2 = context.hasEntity(this.entityIds[1]);
44741 return member2 && relation2 ? _t.append("issues.missing_role.message", {
44742 member: utilDisplayLabel(member2, context.graph()),
44743 relation: utilDisplayLabel(relation2, context.graph())
44746 reference: showReference,
44747 entityIds: [way.id, relation.id],
44748 extent: function(graph) {
44749 return graph.entity(this.entityIds[0]).extent(graph);
44754 hash: member.index.toString(),
44755 dynamicFixes: function() {
44757 makeAddRoleFix("inner"),
44758 makeAddRoleFix("outer"),
44759 new validationIssueFix({
44760 icon: "iD-operation-delete",
44761 title: _t.append("issues.fix.remove_from_relation.title"),
44762 onClick: function(context) {
44764 actionDeleteMember(this.issue.entityIds[1], this.issue.data.member.index),
44765 _t("operations.delete_member.annotation", {
44774 function showReference(selection2) {
44775 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.missing_role.multipolygon.reference"));
44778 function makeAddRoleFix(role) {
44779 return new validationIssueFix({
44780 title: _t.append("issues.fix.set_as_" + role + ".title"),
44781 onClick: function(context) {
44782 var oldMember = this.issue.data.member;
44783 var member = { id: this.issue.entityIds[0], type: oldMember.type, role };
44785 actionChangeMember(this.issue.entityIds[1], member, oldMember.index),
44786 _t("operations.change_role.annotation", {
44793 validation.type = type2;
44796 var init_missing_role = __esm({
44797 "modules/validations/missing_role.js"() {
44799 init_change_member();
44800 init_delete_member();
44802 init_utilDisplayLabel();
44807 // modules/validations/missing_tag.js
44808 var missing_tag_exports = {};
44809 __export(missing_tag_exports, {
44810 validationMissingTag: () => validationMissingTag
44812 function validationMissingTag(context) {
44813 var type2 = "missing_tag";
44814 function hasDescriptiveTags(entity) {
44815 var onlyAttributeKeys = ["description", "name", "note", "start_date", "oneway"];
44816 var entityDescriptiveKeys = Object.keys(entity.tags).filter(function(k2) {
44817 if (k2 === "area" || !osmIsInterestingTag(k2)) return false;
44818 return !onlyAttributeKeys.some(function(attributeKey) {
44819 return k2 === attributeKey || k2.indexOf(attributeKey + ":") === 0;
44822 if (entity.type === "relation" && entityDescriptiveKeys.length === 1 && entity.tags.type === "multipolygon") {
44825 return entityDescriptiveKeys.length > 0;
44827 function isUnknownRoad(entity) {
44828 return entity.type === "way" && entity.tags.highway === "road";
44830 function isUntypedRelation(entity) {
44831 return entity.type === "relation" && !entity.tags.type;
44833 var validation = function checkMissingTag(entity, graph) {
44835 var osm = context.connection();
44836 var isUnloadedNode = entity.type === "node" && osm && !osm.isDataLoaded(entity.loc);
44837 if (!isUnloadedNode && // allow untagged nodes that are part of ways
44838 entity.geometry(graph) !== "vertex" && // allow untagged entities that are part of relations
44839 !entity.hasParentRelations(graph)) {
44840 if (Object.keys(entity.tags).length === 0) {
44842 } else if (!hasDescriptiveTags(entity)) {
44843 subtype = "descriptive";
44844 } else if (isUntypedRelation(entity)) {
44845 subtype = "relation_type";
44848 if (!subtype && isUnknownRoad(entity)) {
44849 subtype = "highway_classification";
44851 if (!subtype) return [];
44852 var messageID = subtype === "highway_classification" ? "unknown_road" : "missing_tag." + subtype;
44853 var referenceID = subtype === "highway_classification" ? "unknown_road" : "missing_tag";
44854 var canDelete = entity.version === void 0 || entity.v !== void 0;
44855 var severity = canDelete && subtype !== "highway_classification" ? "error" : "warning";
44856 return [new validationIssue({
44860 message: function(context2) {
44861 var entity2 = context2.hasEntity(this.entityIds[0]);
44862 return entity2 ? _t.append("issues." + messageID + ".message", {
44863 feature: utilDisplayLabel(entity2, context2.graph())
44866 reference: showReference,
44867 entityIds: [entity.id],
44868 dynamicFixes: function(context2) {
44870 var selectFixType = subtype === "highway_classification" ? "select_road_type" : "select_preset";
44871 fixes.push(new validationIssueFix({
44872 icon: "iD-icon-search",
44873 title: _t.append("issues.fix." + selectFixType + ".title"),
44874 onClick: function(context3) {
44875 context3.ui().sidebar.showPresetList();
44879 var id2 = this.entityIds[0];
44880 var operation2 = operationDelete(context2, [id2]);
44881 var disabledReasonID = operation2.disabled();
44882 if (!disabledReasonID) {
44883 deleteOnClick = function(context3) {
44884 var id3 = this.issue.entityIds[0];
44885 var operation3 = operationDelete(context3, [id3]);
44886 if (!operation3.disabled()) {
44892 new validationIssueFix({
44893 icon: "iD-operation-delete",
44894 title: _t.append("issues.fix.delete_feature.title"),
44895 disabledReason: disabledReasonID ? _t("operations.delete." + disabledReasonID + ".single") : void 0,
44896 onClick: deleteOnClick
44902 function showReference(selection2) {
44903 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues." + referenceID + ".reference"));
44906 validation.type = type2;
44909 var init_missing_tag = __esm({
44910 "modules/validations/missing_tag.js"() {
44915 init_utilDisplayLabel();
44920 // modules/validations/mutually_exclusive_tags.js
44921 var mutually_exclusive_tags_exports = {};
44922 __export(mutually_exclusive_tags_exports, {
44923 validationMutuallyExclusiveTags: () => validationMutuallyExclusiveTags
44925 function validationMutuallyExclusiveTags() {
44926 const type2 = "mutually_exclusive_tags";
44927 const tagKeyPairs = osmMutuallyExclusiveTagPairs;
44928 const validation = function checkMutuallyExclusiveTags(entity) {
44929 let pairsFounds = tagKeyPairs.filter((pair3) => {
44930 return pair3[0] in entity.tags && pair3[1] in entity.tags;
44931 }).filter((pair3) => {
44932 return !(pair3[0].match(/^(addr:)?no[a-z]/) && entity.tags[pair3[0]] === "no" || pair3[1].match(/^(addr:)?no[a-z]/) && entity.tags[pair3[1]] === "no");
44934 Object.keys(entity.tags).forEach((key) => {
44935 let negative_key = "not:" + key;
44936 if (negative_key in entity.tags && entity.tags[negative_key].split(";").includes(entity.tags[key])) {
44937 pairsFounds.push([negative_key, key, "same_value"]);
44939 if (key.match(/^name:[a-z]+/)) {
44940 negative_key = "not:name";
44941 if (negative_key in entity.tags && entity.tags[negative_key].split(";").includes(entity.tags[key])) {
44942 pairsFounds.push([negative_key, key, "same_value"]);
44946 let issues = pairsFounds.map((pair3) => {
44947 const subtype = pair3[2] || "default";
44948 return new validationIssue({
44951 severity: "warning",
44952 message: function(context) {
44953 let entity2 = context.hasEntity(this.entityIds[0]);
44954 return entity2 ? _t.append(`issues.${type2}.${subtype}.message`, {
44955 feature: utilDisplayLabel(entity2, context.graph()),
44960 reference: (selection2) => showReference(selection2, pair3, subtype),
44961 entityIds: [entity.id],
44962 dynamicFixes: () => pair3.slice(0, 2).map((tagToRemove) => createIssueFix(tagToRemove))
44965 function createIssueFix(tagToRemove) {
44966 return new validationIssueFix({
44967 icon: "iD-operation-delete",
44968 title: _t.append("issues.fix.remove_named_tag.title", { tag: tagToRemove }),
44969 onClick: function(context) {
44970 const entityId = this.issue.entityIds[0];
44971 const entity2 = context.entity(entityId);
44972 let tags = Object.assign({}, entity2.tags);
44973 delete tags[tagToRemove];
44975 actionChangeTags(entityId, tags),
44976 _t("issues.fix.remove_named_tag.annotation", { tag: tagToRemove })
44981 function showReference(selection2, pair3, subtype) {
44982 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append(`issues.${type2}.${subtype}.reference`, { tag1: pair3[0], tag2: pair3[1] }));
44986 validation.type = type2;
44989 var init_mutually_exclusive_tags = __esm({
44990 "modules/validations/mutually_exclusive_tags.js"() {
44992 init_change_tags();
44994 init_utilDisplayLabel();
45000 // modules/operations/split.js
45001 var split_exports2 = {};
45002 __export(split_exports2, {
45003 operationSplit: () => operationSplit
45005 function operationSplit(context, selectedIDs) {
45006 var _vertexIds = selectedIDs.filter(function(id2) {
45007 return context.graph().geometry(id2) === "vertex";
45009 var _selectedWayIds = selectedIDs.filter(function(id2) {
45010 var entity = context.graph().hasEntity(id2);
45011 return entity && entity.type === "way";
45013 var _isAvailable = _vertexIds.length > 0 && _vertexIds.length + _selectedWayIds.length === selectedIDs.length;
45014 var _action = actionSplit(_vertexIds);
45016 var _geometry = "feature";
45017 var _waysAmount = "single";
45018 var _nodesAmount = _vertexIds.length === 1 ? "single" : "multiple";
45019 if (_isAvailable) {
45020 if (_selectedWayIds.length) _action.limitWays(_selectedWayIds);
45021 _ways = _action.ways(context.graph());
45022 var geometries = {};
45023 _ways.forEach(function(way) {
45024 geometries[way.geometry(context.graph())] = true;
45026 if (Object.keys(geometries).length === 1) {
45027 _geometry = Object.keys(geometries)[0];
45029 _waysAmount = _ways.length === 1 ? "single" : "multiple";
45031 var operation2 = function() {
45032 var difference2 = context.perform(_action, operation2.annotation());
45033 var idsToSelect = _vertexIds.concat(difference2.extantIDs().filter(function(id2) {
45034 return context.entity(id2).type === "way";
45036 context.enter(modeSelect(context, idsToSelect));
45038 operation2.relatedEntityIds = function() {
45039 return _selectedWayIds.length ? [] : _ways.map((way) => way.id);
45041 operation2.available = function() {
45042 return _isAvailable;
45044 operation2.disabled = function() {
45045 var reason = _action.disabled(context.graph());
45048 } else if (selectedIDs.some(context.hasHiddenConnections)) {
45049 return "connected_to_hidden";
45053 operation2.tooltip = function() {
45054 var disable = operation2.disabled();
45055 return disable ? _t.append("operations.split." + disable) : _t.append("operations.split.description." + _geometry + "." + _waysAmount + "." + _nodesAmount + "_node");
45057 operation2.annotation = function() {
45058 return _t("operations.split.annotation." + _geometry, { n: _ways.length });
45060 operation2.icon = function() {
45061 if (_waysAmount === "multiple") {
45062 return "#iD-operation-split-multiple";
45064 return "#iD-operation-split";
45067 operation2.id = "split";
45068 operation2.keys = [_t("operations.split.key")];
45069 operation2.title = _t.append("operations.split.title");
45070 operation2.behavior = behaviorOperation(context).which(operation2);
45073 var init_split2 = __esm({
45074 "modules/operations/split.js"() {
45083 // modules/validations/osm_api_limits.js
45084 var osm_api_limits_exports = {};
45085 __export(osm_api_limits_exports, {
45086 validationOsmApiLimits: () => validationOsmApiLimits
45088 function validationOsmApiLimits(context) {
45089 const type2 = "osm_api_limits";
45090 const validation = function checkOsmApiLimits(entity) {
45092 const osm = context.connection();
45093 if (!osm) return issues;
45094 const maxWayNodes = osm.maxWayNodes();
45095 if (entity.type === "way") {
45096 if (entity.nodes.length > maxWayNodes) {
45097 issues.push(new validationIssue({
45099 subtype: "exceededMaxWayNodes",
45101 message: function() {
45102 return _t.html("issues.osm_api_limits.max_way_nodes.message");
45104 reference: function(selection2) {
45105 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").html(_t.html("issues.osm_api_limits.max_way_nodes.reference", { maxWayNodes }));
45107 entityIds: [entity.id],
45108 dynamicFixes: splitWayIntoSmallChunks
45114 function splitWayIntoSmallChunks() {
45115 const fix = new validationIssueFix({
45116 icon: "iD-operation-split",
45117 title: _t.html("issues.fix.split_way.title"),
45118 entityIds: this.entityIds,
45119 onClick: function(context2) {
45120 const maxWayNodes = context2.connection().maxWayNodes();
45121 const g3 = context2.graph();
45122 const entityId = this.entityIds[0];
45123 const entity = context2.graph().entities[entityId];
45124 const numberOfParts = Math.ceil(entity.nodes.length / maxWayNodes);
45126 if (numberOfParts === 2) {
45127 const splitIntersections = entity.nodes.map((nid) => g3.entity(nid)).filter((n3) => g3.parentWays(n3).length > 1).map((n3) => n3.id).filter((nid) => {
45128 const splitIndex = entity.nodes.indexOf(nid);
45129 return splitIndex < maxWayNodes && entity.nodes.length - splitIndex < maxWayNodes;
45131 if (splitIntersections.length > 0) {
45133 splitIntersections[Math.floor(splitIntersections.length / 2)]
45137 if (splitVertices === void 0) {
45138 splitVertices = [...Array(numberOfParts - 1)].map((_3, i3) => entity.nodes[Math.floor(entity.nodes.length * (i3 + 1) / numberOfParts)]);
45140 if (entity.isClosed()) {
45141 splitVertices.push(entity.nodes[0]);
45143 const operation2 = operationSplit(context2, splitVertices.concat(entityId));
45144 if (!operation2.disabled()) {
45151 validation.type = type2;
45154 var init_osm_api_limits = __esm({
45155 "modules/validations/osm_api_limits.js"() {
45163 // modules/osm/deprecated.js
45164 var deprecated_exports = {};
45165 __export(deprecated_exports, {
45166 deprecatedTagValuesByKey: () => deprecatedTagValuesByKey,
45167 getDeprecatedTags: () => getDeprecatedTags
45169 function getDeprecatedTags(tags, dataDeprecated) {
45170 if (Object.keys(tags).length === 0) return [];
45171 var deprecated = [];
45172 dataDeprecated.forEach((d4) => {
45173 var oldKeys = Object.keys(d4.old);
45175 var hasExistingValues = Object.keys(d4.replace).some((replaceKey) => {
45176 if (!tags[replaceKey] || d4.old[replaceKey]) return false;
45177 var replaceValue = d4.replace[replaceKey];
45178 if (replaceValue === "*") return false;
45179 if (replaceValue === tags[replaceKey]) return false;
45182 if (hasExistingValues) return;
45184 var matchesDeprecatedTags = oldKeys.every((oldKey) => {
45185 if (!tags[oldKey]) return false;
45186 if (d4.old[oldKey] === "*") return true;
45187 if (d4.old[oldKey] === tags[oldKey]) return true;
45188 var vals = tags[oldKey].split(";").filter(Boolean);
45189 if (vals.length === 0) {
45191 } else if (vals.length > 1) {
45192 return vals.indexOf(d4.old[oldKey]) !== -1;
45194 if (tags[oldKey] === d4.old[oldKey]) {
45195 if (d4.replace && d4.old[oldKey] === d4.replace[oldKey]) {
45196 var replaceKeys = Object.keys(d4.replace);
45197 return !replaceKeys.every((replaceKey) => {
45198 return tags[replaceKey] === d4.replace[replaceKey];
45207 if (matchesDeprecatedTags) {
45208 deprecated.push(d4);
45213 function deprecatedTagValuesByKey(dataDeprecated) {
45214 if (!_deprecatedTagValuesByKey) {
45215 _deprecatedTagValuesByKey = {};
45216 dataDeprecated.forEach((d4) => {
45217 var oldKeys = Object.keys(d4.old);
45218 if (oldKeys.length === 1) {
45219 var oldKey = oldKeys[0];
45220 var oldValue = d4.old[oldKey];
45221 if (oldValue !== "*") {
45222 if (!_deprecatedTagValuesByKey[oldKey]) {
45223 _deprecatedTagValuesByKey[oldKey] = [oldValue];
45225 _deprecatedTagValuesByKey[oldKey].push(oldValue);
45231 return _deprecatedTagValuesByKey;
45233 var _deprecatedTagValuesByKey;
45234 var init_deprecated = __esm({
45235 "modules/osm/deprecated.js"() {
45240 // modules/validations/outdated_tags.js
45241 var outdated_tags_exports = {};
45242 __export(outdated_tags_exports, {
45243 validationOutdatedTags: () => validationOutdatedTags
45245 function validationOutdatedTags() {
45246 const type2 = "outdated_tags";
45247 let _waitingForDeprecated = true;
45248 let _dataDeprecated;
45249 _mainFileFetcher.get("deprecated").then((d4) => _dataDeprecated = d4).catch(() => {
45250 }).finally(() => _waitingForDeprecated = false);
45251 function oldTagIssues(entity, graph) {
45252 if (!entity.hasInterestingTags()) return [];
45253 let preset = _mainPresetIndex.match(entity, graph);
45254 if (!preset) return [];
45255 const oldTags = Object.assign({}, entity.tags);
45256 if (preset.replacement) {
45257 const newPreset = _mainPresetIndex.item(preset.replacement);
45258 graph = actionChangePreset(
45263 /* skip field defaults */
45265 entity = graph.entity(entity.id);
45266 preset = newPreset;
45268 const nsi = services.nsi;
45269 let waitingForNsi = false;
45272 waitingForNsi = nsi.status() === "loading";
45273 if (!waitingForNsi) {
45274 const loc = entity.extent(graph).center();
45275 nsiResult = nsi.upgradeTags(oldTags, loc);
45278 const nsiDiff = nsiResult ? utilTagDiff(oldTags, nsiResult.newTags) : [];
45279 let deprecatedTags;
45280 if (_dataDeprecated) {
45281 deprecatedTags = getDeprecatedTags(entity.tags, _dataDeprecated);
45282 if (entity.type === "way" && entity.isClosed() && entity.tags.traffic_calming === "island" && !entity.tags.highway) {
45283 deprecatedTags.push({
45284 old: { traffic_calming: "island" },
45285 replace: { "area:highway": "traffic_island" }
45288 if (deprecatedTags.length) {
45289 deprecatedTags.forEach((tag) => {
45290 graph = actionUpgradeTags(entity.id, tag.old, tag.replace)(graph);
45292 entity = graph.entity(entity.id);
45295 let newTags = Object.assign({}, entity.tags);
45296 if (preset.tags !== preset.addTags) {
45297 Object.keys(preset.addTags).filter((k2) => {
45298 return !(nsiResult == null ? void 0 : nsiResult.newTags[k2]);
45299 }).forEach((k2) => {
45300 if (!newTags[k2]) {
45301 if (preset.addTags[k2] === "*") {
45302 newTags[k2] = "yes";
45303 } else if (preset.addTags[k2]) {
45304 newTags[k2] = preset.addTags[k2];
45309 const deprecationDiff = utilTagDiff(oldTags, newTags);
45310 const deprecationDiffContext = Object.keys(oldTags).filter((key) => deprecatedTags == null ? void 0 : deprecatedTags.some((deprecated) => {
45312 return ((_a4 = deprecated.replace) == null ? void 0 : _a4[key]) !== void 0;
45313 })).filter((key) => newTags[key] === oldTags[key]).map((key) => ({
45316 oldVal: oldTags[key],
45317 newVal: newTags[key],
45318 display: " " + key + "=" + oldTags[key]
45321 issues.provisional = _waitingForDeprecated || waitingForNsi;
45322 if (deprecationDiff.length) {
45323 const isOnlyAddingTags = !deprecationDiff.some((d4) => d4.type === "-");
45324 const prefix = isOnlyAddingTags ? "incomplete." : "";
45325 issues.push(new validationIssue({
45327 subtype: isOnlyAddingTags ? "incomplete_tags" : "deprecated_tags",
45328 severity: "warning",
45329 message: (context) => {
45330 const currEntity = context.hasEntity(entity.id);
45331 if (!currEntity) return "";
45332 const feature3 = utilDisplayLabel(
45338 return _t.append(`issues.outdated_tags.${prefix}message`, { feature: feature3 });
45340 reference: (selection2) => showReference(
45342 _t.append(`issues.outdated_tags.${prefix}reference`),
45343 [...deprecationDiff, ...deprecationDiffContext]
45345 entityIds: [entity.id],
45346 hash: utilHashcode(JSON.stringify(deprecationDiff)),
45347 dynamicFixes: () => {
45349 new validationIssueFix({
45350 title: _t.append("issues.fix.upgrade_tags.title"),
45351 onClick: (context) => {
45352 context.perform((graph2) => doUpgrade(graph2, deprecationDiff), _t("issues.fix.upgrade_tags.annotation"));
45360 if (nsiDiff.length) {
45361 const isOnlyAddingTags = nsiDiff.every((d4) => d4.type === "+");
45362 issues.push(new validationIssue({
45364 subtype: "noncanonical_brand",
45365 severity: "warning",
45366 message: (context) => {
45367 const currEntity = context.hasEntity(entity.id);
45368 if (!currEntity) return "";
45369 const feature3 = utilDisplayLabel(
45375 return isOnlyAddingTags ? _t.append("issues.outdated_tags.noncanonical_brand.message_incomplete", { feature: feature3 }) : _t.append("issues.outdated_tags.noncanonical_brand.message", { feature: feature3 });
45377 reference: (selection2) => showReference(
45379 _t.append("issues.outdated_tags.noncanonical_brand.reference"),
45382 entityIds: [entity.id],
45383 hash: utilHashcode(JSON.stringify(nsiDiff)),
45384 dynamicFixes: () => {
45386 new validationIssueFix({
45387 title: _t.append("issues.fix.upgrade_tags.title"),
45388 onClick: (context) => {
45389 context.perform((graph2) => doUpgrade(graph2, nsiDiff), _t("issues.fix.upgrade_tags.annotation"));
45392 new validationIssueFix({
45393 title: _t.append("issues.fix.tag_as_not.title", { name: nsiResult.matched.displayName }),
45394 onClick: (context) => {
45395 context.perform(addNotTag, _t("issues.fix.tag_as_not.annotation"));
45404 function doUpgrade(graph2, diff) {
45405 const currEntity = graph2.hasEntity(entity.id);
45406 if (!currEntity) return graph2;
45407 let newTags2 = Object.assign({}, currEntity.tags);
45408 diff.forEach((diff2) => {
45409 if (diff2.type === "-") {
45410 delete newTags2[diff2.key];
45411 } else if (diff2.type === "+") {
45412 newTags2[diff2.key] = diff2.newVal;
45415 return actionChangeTags(currEntity.id, newTags2)(graph2);
45417 function addNotTag(graph2) {
45418 const currEntity = graph2.hasEntity(entity.id);
45419 if (!currEntity) return graph2;
45420 const item = nsiResult && nsiResult.matched;
45421 if (!item) return graph2;
45422 let newTags2 = Object.assign({}, currEntity.tags);
45423 const wd = item.mainTag;
45424 const notwd = `not:${wd}`;
45425 const qid = item.tags[wd];
45426 newTags2[notwd] = qid;
45427 if (newTags2[wd] === qid) {
45428 const wp = item.mainTag.replace("wikidata", "wikipedia");
45429 delete newTags2[wd];
45430 delete newTags2[wp];
45432 return actionChangeTags(currEntity.id, newTags2)(graph2);
45434 function showReference(selection2, reference, tagDiff) {
45435 let enter = selection2.selectAll(".issue-reference").data([0]).enter();
45436 enter.append("div").attr("class", "issue-reference").call(reference);
45437 enter.append("strong").call(_t.append("issues.suggested"));
45438 enter.append("table").attr("class", "tagDiff-table").selectAll(".tagDiff-row").data(tagDiff).enter().append("tr").attr("class", "tagDiff-row").append("td").attr("class", (d4) => {
45439 const klass = "tagDiff-cell";
45442 return `${klass} tagDiff-cell-add`;
45444 return `${klass} tagDiff-cell-remove`;
45446 return `${klass} tagDiff-cell-unchanged`;
45448 }).html((d4) => d4.display);
45451 let validation = oldTagIssues;
45452 validation.type = type2;
45455 var init_outdated_tags = __esm({
45456 "modules/validations/outdated_tags.js"() {
45459 init_change_preset();
45460 init_change_tags();
45461 init_upgrade_tags();
45466 init_utilDisplayLabel();
45472 // modules/validations/private_data.js
45473 var private_data_exports = {};
45474 __export(private_data_exports, {
45475 validationPrivateData: () => validationPrivateData
45477 function validationPrivateData() {
45478 var type2 = "private_data";
45479 var privateBuildingValues = {
45485 semidetached_house: true,
45486 static_caravan: true
45497 var personalTags = {
45498 "contact:email": true,
45499 "contact:fax": true,
45500 "contact:phone": true,
45505 var validation = function checkPrivateData(entity) {
45506 var tags = entity.tags;
45507 if (!tags.building || !privateBuildingValues[tags.building]) return [];
45509 for (var k2 in tags) {
45510 if (publicKeys[k2]) return [];
45511 if (!personalTags[k2]) {
45512 keepTags[k2] = tags[k2];
45515 var tagDiff = utilTagDiff(tags, keepTags);
45516 if (!tagDiff.length) return [];
45517 var fixID = tagDiff.length === 1 ? "remove_tag" : "remove_tags";
45518 return [new validationIssue({
45520 severity: "warning",
45521 message: showMessage,
45522 reference: showReference,
45523 entityIds: [entity.id],
45524 dynamicFixes: function() {
45526 new validationIssueFix({
45527 icon: "iD-operation-delete",
45528 title: _t.append("issues.fix." + fixID + ".title"),
45529 onClick: function(context) {
45530 context.perform(doUpgrade, _t("issues.fix.remove_tag.annotation"));
45536 function doUpgrade(graph) {
45537 var currEntity = graph.hasEntity(entity.id);
45538 if (!currEntity) return graph;
45539 var newTags = Object.assign({}, currEntity.tags);
45540 tagDiff.forEach(function(diff) {
45541 if (diff.type === "-") {
45542 delete newTags[diff.key];
45543 } else if (diff.type === "+") {
45544 newTags[diff.key] = diff.newVal;
45547 return actionChangeTags(currEntity.id, newTags)(graph);
45549 function showMessage(context) {
45550 var currEntity = context.hasEntity(this.entityIds[0]);
45551 if (!currEntity) return "";
45553 "issues.private_data.contact.message",
45554 { feature: utilDisplayLabel(currEntity, context.graph()) }
45557 function showReference(selection2) {
45558 var enter = selection2.selectAll(".issue-reference").data([0]).enter();
45559 enter.append("div").attr("class", "issue-reference").call(_t.append("issues.private_data.reference"));
45560 enter.append("strong").call(_t.append("issues.suggested"));
45561 enter.append("table").attr("class", "tagDiff-table").selectAll(".tagDiff-row").data(tagDiff).enter().append("tr").attr("class", "tagDiff-row").append("td").attr("class", function(d4) {
45562 var klass = d4.type === "+" ? "add" : "remove";
45563 return "tagDiff-cell tagDiff-cell-" + klass;
45564 }).html(function(d4) {
45569 validation.type = type2;
45572 var init_private_data = __esm({
45573 "modules/validations/private_data.js"() {
45575 init_change_tags();
45578 init_utilDisplayLabel();
45583 // modules/validations/suspicious_name.js
45584 var suspicious_name_exports = {};
45585 __export(suspicious_name_exports, {
45586 validationSuspiciousName: () => validationSuspiciousName
45588 function validationSuspiciousName(context) {
45589 const type2 = "suspicious_name";
45590 const keysToTestForGenericValues = [
45605 const ignoredPresets = /* @__PURE__ */ new Set([
45606 "amenity/place_of_worship/christian/jehovahs_witness",
45607 "__test__ignored_preset"
45610 let _waitingForNsi = false;
45611 function isGenericMatchInNsi(tags) {
45612 const nsi = services.nsi;
45614 _waitingForNsi = nsi.status() === "loading";
45615 if (!_waitingForNsi) {
45616 return nsi.isGenericName(tags);
45621 function nameMatchesRawTag(lowercaseName, tags) {
45622 for (let i3 = 0; i3 < keysToTestForGenericValues.length; i3++) {
45623 let key = keysToTestForGenericValues[i3];
45624 let val = tags[key];
45626 val = val.toLowerCase();
45627 if (key === lowercaseName || val === lowercaseName || key.replace(/\_/g, " ") === lowercaseName || val.replace(/\_/g, " ") === lowercaseName) {
45634 function nameMatchesPresetName(name, preset) {
45635 if (!preset) return false;
45636 if (ignoredPresets.has(preset.id)) return false;
45637 name = name.toLowerCase();
45638 return name === preset.name().toLowerCase() || preset.aliases().some((alias) => name === alias.toLowerCase());
45640 function isGenericName(name, tags, preset) {
45641 name = name.toLowerCase();
45642 return nameMatchesRawTag(name, tags) || nameMatchesPresetName(name, preset) || isGenericMatchInNsi(tags);
45644 function makeGenericNameIssue(entityId, nameKey, genericName, langCode) {
45645 return new validationIssue({
45647 subtype: "generic_name",
45648 severity: "warning",
45649 message: function(context2) {
45650 let entity = context2.hasEntity(this.entityIds[0]);
45651 if (!entity) return "";
45652 let preset = _mainPresetIndex.match(entity, context2.graph());
45653 let langName = langCode && _mainLocalizer.languageName(langCode);
45655 "issues.generic_name.message" + (langName ? "_language" : ""),
45656 { feature: preset.name(), name: genericName, language: langName }
45659 reference: showReference,
45660 entityIds: [entityId],
45661 hash: `${nameKey}=${genericName}`,
45662 dynamicFixes: function() {
45664 new validationIssueFix({
45665 icon: "iD-operation-delete",
45666 title: _t.append("issues.fix.remove_the_name.title"),
45667 onClick: function(context2) {
45668 let entityId2 = this.issue.entityIds[0];
45669 let entity = context2.entity(entityId2);
45670 let tags = Object.assign({}, entity.tags);
45671 delete tags[nameKey];
45673 actionChangeTags(entityId2, tags),
45674 _t("issues.fix.remove_generic_name.annotation")
45681 function showReference(selection2) {
45682 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.generic_name.reference"));
45685 let validation = function checkGenericName(entity) {
45686 const tags = entity.tags;
45687 const hasWikidata = !!tags.wikidata || !!tags["brand:wikidata"] || !!tags["operator:wikidata"];
45688 if (hasWikidata) return [];
45690 const preset = _mainPresetIndex.match(entity, context.graph());
45691 for (let key in tags) {
45692 const m3 = key.match(/^name(?:(?::)([a-zA-Z_-]+))?$/);
45694 const langCode = m3.length >= 2 ? m3[1] : null;
45695 const value = tags[key];
45696 if (isGenericName(value, tags, preset)) {
45697 issues.provisional = _waitingForNsi;
45698 issues.push(makeGenericNameIssue(entity.id, key, value, langCode));
45703 validation.type = type2;
45706 var init_suspicious_name = __esm({
45707 "modules/validations/suspicious_name.js"() {
45709 init_change_tags();
45717 // modules/validations/unsquare_way.js
45718 var unsquare_way_exports = {};
45719 __export(unsquare_way_exports, {
45720 validationUnsquareWay: () => validationUnsquareWay
45722 function validationUnsquareWay(context) {
45723 var type2 = "unsquare_way";
45724 var DEFAULT_DEG_THRESHOLD = 5;
45725 var epsilon3 = 0.05;
45726 var nodeThreshold = 10;
45727 function isBuilding(entity, graph) {
45728 if (entity.type !== "way" || entity.geometry(graph) !== "area") return false;
45729 return entity.tags.building && entity.tags.building !== "no";
45731 var validation = function checkUnsquareWay(entity, graph) {
45732 if (!isBuilding(entity, graph)) return [];
45733 if (entity.tags.nonsquare === "yes") return [];
45734 var isClosed = entity.isClosed();
45735 if (!isClosed) return [];
45736 var nodes = graph.childNodes(entity).slice();
45737 if (nodes.length > nodeThreshold + 1) return [];
45738 var osm = services.osm;
45739 if (!osm || nodes.some(function(node) {
45740 return !osm.isDataLoaded(node.loc);
45742 var hasConnectedSquarableWays = nodes.some(function(node) {
45743 return graph.parentWays(node).some(function(way) {
45744 if (way.id === entity.id) return false;
45745 if (isBuilding(way, graph)) return true;
45746 return graph.parentRelations(way).some(function(parentRelation) {
45747 return parentRelation.isMultipolygon() && parentRelation.tags.building && parentRelation.tags.building !== "no";
45751 if (hasConnectedSquarableWays) return [];
45752 var storedDegreeThreshold = corePreferences("validate-square-degrees");
45753 var degreeThreshold = isFinite(storedDegreeThreshold) ? Number(storedDegreeThreshold) : DEFAULT_DEG_THRESHOLD;
45754 var points = nodes.map(function(node) {
45755 return context.projection(node.loc);
45757 if (!geoOrthoCanOrthogonalize(points, isClosed, epsilon3, degreeThreshold, true)) return [];
45759 if (!entity.tags.wikidata) {
45760 var autoAction = actionOrthogonalize(entity.id, context.projection, void 0, degreeThreshold);
45761 autoAction.transitionable = false;
45762 autoArgs = [autoAction, _t("operations.orthogonalize.annotation.feature", { n: 1 })];
45764 return [new validationIssue({
45766 subtype: "building",
45767 severity: "suggestion",
45768 message: function(context2) {
45769 var entity2 = context2.hasEntity(this.entityIds[0]);
45770 return entity2 ? _t.append("issues.unsquare_way.message", {
45771 feature: utilDisplayLabel(entity2, context2.graph())
45774 reference: showReference,
45775 entityIds: [entity.id],
45776 hash: degreeThreshold,
45777 dynamicFixes: function() {
45779 new validationIssueFix({
45780 icon: "iD-operation-orthogonalize",
45781 title: _t.append("issues.fix.square_feature.title"),
45783 onClick: function(context2, completionHandler) {
45784 var entityId = this.issue.entityIds[0];
45786 actionOrthogonalize(entityId, context2.projection, void 0, degreeThreshold),
45787 _t("operations.orthogonalize.annotation.feature", { n: 1 })
45789 window.setTimeout(function() {
45790 completionHandler();
45795 new validationIssueFix({
45796 title: t.append('issues.fix.tag_as_unsquare.title'),
45797 onClick: function(context) {
45798 var entityId = this.issue.entityIds[0];
45799 var entity = context.entity(entityId);
45800 var tags = Object.assign({}, entity.tags); // shallow copy
45801 tags.nonsquare = 'yes';
45803 actionChangeTags(entityId, tags),
45804 t('issues.fix.tag_as_unsquare.annotation')
45812 function showReference(selection2) {
45813 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.unsquare_way.buildings.reference"));
45816 validation.type = type2;
45819 var init_unsquare_way = __esm({
45820 "modules/validations/unsquare_way.js"() {
45822 init_preferences();
45824 init_orthogonalize();
45826 init_utilDisplayLabel();
45832 // modules/validations/index.js
45833 var validations_exports = {};
45834 __export(validations_exports, {
45835 validationAlmostJunction: () => validationAlmostJunction,
45836 validationCloseNodes: () => validationCloseNodes,
45837 validationCrossingWays: () => validationCrossingWays,
45838 validationDisconnectedWay: () => validationDisconnectedWay,
45839 validationFormatting: () => validationFormatting,
45840 validationHelpRequest: () => validationHelpRequest,
45841 validationImpossibleOneway: () => validationImpossibleOneway,
45842 validationIncompatibleSource: () => validationIncompatibleSource,
45843 validationMaprules: () => validationMaprules,
45844 validationMismatchedGeometry: () => validationMismatchedGeometry,
45845 validationMissingRole: () => validationMissingRole,
45846 validationMissingTag: () => validationMissingTag,
45847 validationMutuallyExclusiveTags: () => validationMutuallyExclusiveTags,
45848 validationOsmApiLimits: () => validationOsmApiLimits,
45849 validationOutdatedTags: () => validationOutdatedTags,
45850 validationPrivateData: () => validationPrivateData,
45851 validationSuspiciousName: () => validationSuspiciousName,
45852 validationUnsquareWay: () => validationUnsquareWay
45854 var init_validations = __esm({
45855 "modules/validations/index.js"() {
45857 init_almost_junction();
45858 init_close_nodes();
45859 init_crossing_ways();
45860 init_disconnected_way();
45861 init_invalid_format();
45862 init_help_request();
45863 init_impossible_oneway();
45864 init_incompatible_source();
45866 init_mismatched_geometry();
45867 init_missing_role();
45868 init_missing_tag();
45869 init_mutually_exclusive_tags();
45870 init_osm_api_limits();
45871 init_outdated_tags();
45872 init_private_data();
45873 init_suspicious_name();
45874 init_unsquare_way();
45878 // modules/core/validator.js
45879 var validator_exports = {};
45880 __export(validator_exports, {
45881 coreValidator: () => coreValidator
45883 function coreValidator(context) {
45884 let dispatch14 = dispatch_default("validated", "focusedIssue");
45885 const validator = {};
45887 let _disabledRules = {};
45888 let _ignoredIssueIDs = /* @__PURE__ */ new Set();
45889 let _resolvedIssueIDs = /* @__PURE__ */ new Set();
45890 let _baseCache = validationCache("base");
45891 let _headCache = validationCache("head");
45892 let _completeDiff = {};
45893 let _headIsCurrent = false;
45894 let _deferredRIC = {};
45895 let _deferredST = /* @__PURE__ */ new Set();
45898 const _errorOverrides = parseHashParam(context.initialHashParams.validationError);
45899 const _warningOverrides = parseHashParam(context.initialHashParams.validationWarning);
45900 const _suggestionOverrides = parseHashParam(context.initialHashParams.validationSuggestion);
45901 const _disableOverrides = parseHashParam(context.initialHashParams.validationDisable);
45902 function parseHashParam(param) {
45904 let rules = (param || "").split(",");
45905 rules.forEach((rule) => {
45906 rule = rule.trim();
45907 const parts = rule.split("/", 2);
45908 const type2 = parts[0];
45909 const subtype = parts[1] || "*";
45910 if (!type2 || !subtype) return;
45911 result.push({ type: makeRegExp(type2), subtype: makeRegExp(subtype) });
45914 function makeRegExp(str) {
45915 const escaped = str.replace(/[-\/\\^$+?.()|[\]{}]/g, "\\$&").replace(/\*/g, ".*");
45916 return new RegExp("^" + escaped + "$");
45919 validator.init = () => {
45920 Object.values(validations_exports).forEach((validation) => {
45921 if (typeof validation !== "function") return;
45922 const fn = validation(context);
45923 const key = fn.type;
45926 let disabledRules = corePreferences("validate-disabledRules");
45927 if (disabledRules) {
45928 disabledRules.split(",").forEach((k2) => _disabledRules[k2] = true);
45931 function reset(resetIgnored) {
45932 _baseCache.queue = [];
45933 _headCache.queue = [];
45934 Object.keys(_deferredRIC).forEach((key) => {
45935 window.cancelIdleCallback(key);
45936 _deferredRIC[key]();
45939 _deferredST.forEach(window.clearTimeout);
45940 _deferredST.clear();
45941 if (resetIgnored) _ignoredIssueIDs.clear();
45942 _resolvedIssueIDs.clear();
45943 _baseCache = validationCache("base");
45944 _headCache = validationCache("head");
45945 _completeDiff = {};
45946 _headIsCurrent = false;
45948 validator.reset = () => {
45951 validator.resetIgnoredIssues = () => {
45952 _ignoredIssueIDs.clear();
45953 dispatch14.call("validated");
45955 validator.revalidateUnsquare = () => {
45956 revalidateUnsquare(_headCache);
45957 revalidateUnsquare(_baseCache);
45958 dispatch14.call("validated");
45960 function revalidateUnsquare(cache) {
45961 const checkUnsquareWay = _rules.unsquare_way;
45962 if (!cache.graph || typeof checkUnsquareWay !== "function") return;
45963 cache.uncacheIssuesOfType("unsquare_way");
45964 const buildings = context.history().tree().intersects(geoExtent([-180, -90], [180, 90]), cache.graph).filter((entity) => entity.type === "way" && entity.tags.building && entity.tags.building !== "no");
45965 buildings.forEach((entity) => {
45966 const detected = checkUnsquareWay(entity, cache.graph);
45967 if (!detected.length) return;
45968 cache.cacheIssues(detected);
45971 validator.getIssues = (options) => {
45972 const opts = Object.assign({ what: "all", where: "all", includeIgnored: false, includeDisabledRules: false }, options);
45973 const view = context.map().extent();
45974 let seen = /* @__PURE__ */ new Set();
45976 if (_headCache.graph && _headCache.graph !== _baseCache.graph) {
45977 Object.values(_headCache.issuesByIssueID).forEach((issue) => {
45978 const userModified = (issue.entityIds || []).some((id2) => _completeDiff.hasOwnProperty(id2));
45979 if (opts.what === "edited" && !userModified) return;
45980 if (!filter2(issue)) return;
45981 seen.add(issue.id);
45982 results.push(issue);
45985 if (opts.what === "all") {
45986 Object.values(_baseCache.issuesByIssueID).forEach((issue) => {
45987 if (!filter2(issue)) return;
45988 seen.add(issue.id);
45989 results.push(issue);
45993 function filter2(issue) {
45994 if (!issue) return false;
45995 if (seen.has(issue.id)) return false;
45996 if (_resolvedIssueIDs.has(issue.id)) return false;
45997 if (opts.includeDisabledRules === "only" && !_disabledRules[issue.type]) return false;
45998 if (!opts.includeDisabledRules && _disabledRules[issue.type]) return false;
45999 if (opts.includeIgnored === "only" && !_ignoredIssueIDs.has(issue.id)) return false;
46000 if (!opts.includeIgnored && _ignoredIssueIDs.has(issue.id)) return false;
46001 if ((issue.entityIds || []).some((id2) => !context.hasEntity(id2))) return false;
46002 if (opts.where === "visible") {
46003 const extent = issue.extent(context.graph());
46004 if (!view.intersects(extent)) return false;
46009 validator.getResolvedIssues = () => {
46010 return Array.from(_resolvedIssueIDs).map((issueID) => _baseCache.issuesByIssueID[issueID]).filter(Boolean);
46012 validator.focusIssue = (issue) => {
46013 const graph = context.graph();
46015 let issueExtent = issue.extent(graph);
46016 if (issue.entityIds && issue.entityIds.length) {
46017 selectID = issue.entityIds[0];
46018 if (selectID && selectID.charAt(0) === "r") {
46019 const ids = utilEntityAndDeepMemberIDs([selectID], graph);
46020 let nodeID = ids.find((id2) => id2.charAt(0) === "n" && graph.hasEntity(id2));
46022 const wayID = ids.find((id2) => id2.charAt(0) === "w" && graph.hasEntity(id2));
46024 nodeID = graph.entity(wayID).first();
46028 issueExtent = graph.entity(nodeID).extent(graph);
46032 context.map().zoomToEase(issueExtent);
46034 window.setTimeout(() => {
46035 context.enter(modeSelect(context, [selectID]));
46036 dispatch14.call("focusedIssue", this, issue);
46040 validator.getIssuesBySeverity = (options) => {
46041 let groups = utilArrayGroupBy(validator.getIssues(options), "severity");
46042 groups.error = groups.error || [];
46043 groups.warning = groups.warning || [];
46044 groups.suggestion = groups.suggestion || [];
46047 validator.getSharedEntityIssues = (entityIDs, options) => {
46048 const orderedIssueTypes = [
46049 // Show some issue types in a particular order:
46052 // - missing data first
46054 "mismatched_geometry",
46055 // - identity issues
46058 // - geometry issues where fixing them might solve connectivity issues
46059 "disconnected_way",
46060 "impossible_oneway"
46061 // - finally connectivity issues
46063 const allIssues = validator.getIssues(options);
46064 const forEntityIDs = new Set(entityIDs);
46065 return allIssues.filter((issue) => (issue.entityIds || []).some((entityID) => forEntityIDs.has(entityID))).sort((issue1, issue2) => {
46066 if (issue1.type === issue2.type) {
46067 return issue1.id < issue2.id ? -1 : 1;
46069 const index1 = orderedIssueTypes.indexOf(issue1.type);
46070 const index2 = orderedIssueTypes.indexOf(issue2.type);
46071 if (index1 !== -1 && index2 !== -1) {
46072 return index1 - index2;
46073 } else if (index1 === -1 && index2 === -1) {
46074 return issue1.type < issue2.type ? -1 : 1;
46076 return index1 !== -1 ? -1 : 1;
46080 validator.getEntityIssues = (entityID, options) => {
46081 return validator.getSharedEntityIssues([entityID], options);
46083 validator.getRuleKeys = () => {
46084 return Object.keys(_rules);
46086 validator.isRuleEnabled = (key) => {
46087 return !_disabledRules[key];
46089 validator.toggleRule = (key) => {
46090 if (_disabledRules[key]) {
46091 delete _disabledRules[key];
46093 _disabledRules[key] = true;
46095 corePreferences("validate-disabledRules", Object.keys(_disabledRules).join(","));
46096 validator.validate();
46098 validator.disableRules = (keys2) => {
46099 _disabledRules = {};
46100 keys2.forEach((k2) => _disabledRules[k2] = true);
46101 corePreferences("validate-disabledRules", Object.keys(_disabledRules).join(","));
46102 validator.validate();
46104 validator.ignoreIssue = (issueID) => {
46105 _ignoredIssueIDs.add(issueID);
46107 validator.validate = () => {
46108 const baseGraph = context.history().base();
46109 if (!_headCache.graph) _headCache.graph = baseGraph;
46110 if (!_baseCache.graph) _baseCache.graph = baseGraph;
46111 const prevGraph = _headCache.graph;
46112 const currGraph = context.graph();
46113 if (currGraph === prevGraph) {
46114 _headIsCurrent = true;
46115 dispatch14.call("validated");
46116 return Promise.resolve();
46118 if (_headPromise) {
46119 _headIsCurrent = false;
46120 return _headPromise;
46122 _headCache.graph = currGraph;
46123 _completeDiff = context.history().difference().complete();
46124 const incrementalDiff = coreDifference(prevGraph, currGraph);
46125 const diff = Object.keys(incrementalDiff.complete());
46126 const entityIDs = _headCache.withAllRelatedEntities(diff);
46127 if (!entityIDs.size) {
46128 dispatch14.call("validated");
46129 return Promise.resolve();
46131 const addConnectedWays = (graph) => diff.filter((entityID) => graph.hasEntity(entityID)).map((entityID) => graph.entity(entityID)).flatMap((entity) => graph.childNodes(entity)).flatMap((vertex) => graph.parentWays(vertex)).forEach((way) => entityIDs.add(way.id));
46132 addConnectedWays(currGraph);
46133 addConnectedWays(prevGraph);
46134 Object.values({ ...incrementalDiff.created(), ...incrementalDiff.deleted() }).filter((e3) => e3.type === "relation").flatMap((r2) => r2.members).forEach((m3) => entityIDs.add(m3.id));
46135 Object.values(incrementalDiff.modified()).filter((e3) => e3.type === "relation").map((r2) => ({ baseEntity: prevGraph.entity(r2.id), headEntity: r2 })).forEach(({ baseEntity, headEntity }) => {
46136 const bm = baseEntity.members.map((m3) => m3.id);
46137 const hm = headEntity.members.map((m3) => m3.id);
46138 const symDiff = utilArrayDifference(utilArrayUnion(bm, hm), utilArrayIntersection(bm, hm));
46139 symDiff.forEach((id2) => entityIDs.add(id2));
46141 _headPromise = validateEntitiesAsync(entityIDs, _headCache).then(() => updateResolvedIssues(entityIDs)).then(() => dispatch14.call("validated")).catch(() => {
46143 _headPromise = null;
46144 if (!_headIsCurrent) {
46145 validator.validate();
46148 return _headPromise;
46150 context.history().on("restore.validator", validator.validate).on("undone.validator", validator.validate).on("redone.validator", validator.validate).on("reset.validator", () => {
46152 validator.validate();
46154 context.on("exit.validator", validator.validate);
46155 context.history().on("merge.validator", (entities) => {
46156 if (!entities) return;
46157 const baseGraph = context.history().base();
46158 if (!_headCache.graph) _headCache.graph = baseGraph;
46159 if (!_baseCache.graph) _baseCache.graph = baseGraph;
46160 let entityIDs = entities.map((entity) => entity.id);
46161 entityIDs = _baseCache.withAllRelatedEntities(entityIDs);
46162 validateEntitiesAsync(entityIDs, _baseCache);
46164 function validateEntity(entity, graph) {
46165 let result = { issues: [], provisional: false };
46166 Object.keys(_rules).forEach(runValidation);
46168 function runValidation(key) {
46169 const fn = _rules[key];
46170 if (typeof fn !== "function") {
46171 console.error("no such validation rule = " + key);
46174 let detected = fn(entity, graph);
46175 if (detected.provisional) {
46176 result.provisional = true;
46178 detected = detected.filter(applySeverityOverrides);
46179 result.issues = result.issues.concat(detected);
46180 function applySeverityOverrides(issue) {
46181 const type2 = issue.type;
46182 const subtype = issue.subtype || "";
46184 for (i3 = 0; i3 < _errorOverrides.length; i3++) {
46185 if (_errorOverrides[i3].type.test(type2) && _errorOverrides[i3].subtype.test(subtype)) {
46186 issue.severity = "error";
46190 for (i3 = 0; i3 < _warningOverrides.length; i3++) {
46191 if (_warningOverrides[i3].type.test(type2) && _warningOverrides[i3].subtype.test(subtype)) {
46192 issue.severity = "warning";
46196 for (i3 = 0; i3 < _suggestionOverrides.length; i3++) {
46197 if (_suggestionOverrides[i3].type.test(type2) && _suggestionOverrides[i3].subtype.test(subtype)) {
46198 issue.severity = "suggestion";
46202 for (i3 = 0; i3 < _disableOverrides.length; i3++) {
46203 if (_disableOverrides[i3].type.test(type2) && _disableOverrides[i3].subtype.test(subtype)) {
46211 function updateResolvedIssues(entityIDs) {
46212 entityIDs.forEach((entityID) => {
46213 const baseIssues = _baseCache.issuesByEntityID[entityID];
46214 if (!baseIssues) return;
46215 baseIssues.forEach((issueID) => {
46216 const issue = _baseCache.issuesByIssueID[issueID];
46217 const userModified = (issue.entityIds || []).some((id2) => _completeDiff.hasOwnProperty(id2));
46218 if (userModified && !_headCache.issuesByIssueID[issueID]) {
46219 _resolvedIssueIDs.add(issueID);
46221 _resolvedIssueIDs.delete(issueID);
46226 function validateEntitiesAsync(entityIDs, cache) {
46227 const jobs = Array.from(entityIDs).map((entityID) => {
46228 if (cache.queuedEntityIDs.has(entityID)) return null;
46229 cache.queuedEntityIDs.add(entityID);
46230 cache.uncacheEntityID(entityID);
46232 cache.queuedEntityIDs.delete(entityID);
46233 const graph = cache.graph;
46234 if (!graph) return;
46235 const entity = graph.hasEntity(entityID);
46236 if (!entity) return;
46237 const result = validateEntity(entity, graph);
46238 if (result.provisional) {
46239 cache.provisionalEntityIDs.add(entityID);
46241 cache.cacheIssues(result.issues);
46243 }).filter(Boolean);
46244 cache.queue = cache.queue.concat(utilArrayChunk(jobs, 100));
46245 if (cache.queuePromise) return cache.queuePromise;
46246 cache.queuePromise = processQueue(cache).then(() => revalidateProvisionalEntities(cache)).catch(() => {
46247 }).finally(() => cache.queuePromise = null);
46248 return cache.queuePromise;
46250 function revalidateProvisionalEntities(cache) {
46251 if (!cache.provisionalEntityIDs.size) return;
46252 const handle = window.setTimeout(() => {
46253 _deferredST.delete(handle);
46254 if (!cache.provisionalEntityIDs.size) return;
46255 validateEntitiesAsync(Array.from(cache.provisionalEntityIDs), cache);
46257 _deferredST.add(handle);
46259 function processQueue(cache) {
46260 if (!cache.queue.length) return Promise.resolve();
46261 const chunk = cache.queue.pop();
46262 return new Promise((resolvePromise, rejectPromise) => {
46263 const handle = window.requestIdleCallback(() => {
46264 delete _deferredRIC[handle];
46265 chunk.forEach((job) => job());
46268 _deferredRIC[handle] = rejectPromise;
46270 if (cache.queue.length % 25 === 0) dispatch14.call("validated");
46271 }).then(() => processQueue(cache));
46273 return utilRebind(validator, dispatch14, "on");
46275 function validationCache(which) {
46280 queuePromise: null,
46281 queuedEntityIDs: /* @__PURE__ */ new Set(),
46282 provisionalEntityIDs: /* @__PURE__ */ new Set(),
46283 issuesByIssueID: {},
46284 // issue.id -> issue
46285 issuesByEntityID: {}
46286 // entity.id -> Set(issue.id)
46288 cache.cacheIssue = (issue) => {
46289 (issue.entityIds || []).forEach((entityID) => {
46290 if (!cache.issuesByEntityID[entityID]) {
46291 cache.issuesByEntityID[entityID] = /* @__PURE__ */ new Set();
46293 cache.issuesByEntityID[entityID].add(issue.id);
46295 cache.issuesByIssueID[issue.id] = issue;
46297 cache.uncacheIssue = (issue) => {
46298 (issue.entityIds || []).forEach((entityID) => {
46299 if (cache.issuesByEntityID[entityID]) {
46300 cache.issuesByEntityID[entityID].delete(issue.id);
46303 delete cache.issuesByIssueID[issue.id];
46305 cache.cacheIssues = (issues) => {
46306 issues.forEach(cache.cacheIssue);
46308 cache.uncacheIssues = (issues) => {
46309 issues.forEach(cache.uncacheIssue);
46311 cache.uncacheIssuesOfType = (type2) => {
46312 const issuesOfType = Object.values(cache.issuesByIssueID).filter((issue) => issue.type === type2);
46313 cache.uncacheIssues(issuesOfType);
46315 cache.uncacheEntityID = (entityID) => {
46316 const entityIssueIDs = cache.issuesByEntityID[entityID];
46317 if (entityIssueIDs) {
46318 entityIssueIDs.forEach((issueID) => {
46319 const issue = cache.issuesByIssueID[issueID];
46321 cache.uncacheIssue(issue);
46323 delete cache.issuesByIssueID[issueID];
46327 delete cache.issuesByEntityID[entityID];
46328 cache.provisionalEntityIDs.delete(entityID);
46330 cache.withAllRelatedEntities = (entityIDs) => {
46331 let result = /* @__PURE__ */ new Set();
46332 (entityIDs || []).forEach((entityID) => {
46333 result.add(entityID);
46334 const entityIssueIDs = cache.issuesByEntityID[entityID];
46335 if (entityIssueIDs) {
46336 entityIssueIDs.forEach((issueID) => {
46337 const issue = cache.issuesByIssueID[issueID];
46339 (issue.entityIds || []).forEach((relatedID) => result.add(relatedID));
46341 delete cache.issuesByIssueID[issueID];
46350 var init_validator = __esm({
46351 "modules/core/validator.js"() {
46354 init_preferences();
46359 init_validations();
46363 // modules/core/uploader.js
46364 var uploader_exports = {};
46365 __export(uploader_exports, {
46366 coreUploader: () => coreUploader
46368 function coreUploader(context) {
46369 var dispatch14 = dispatch_default(
46370 // Start and end events are dispatched exactly once each per legitimate outside call to `save`
46372 // dispatched as soon as a call to `save` has been deemed legitimate
46374 // dispatched after the result event has been dispatched
46375 "willAttemptUpload",
46376 // dispatched before the actual upload call occurs, if it will
46378 // Each save results in one of these outcomes:
46380 // upload wasn't attempted since there were no edits
46382 // upload failed due to errors
46384 // upload failed due to data conflicts
46386 // upload completed without errors
46388 var _isSaving = false;
46389 let _anyConflictsAutomaticallyResolved = false;
46390 var _conflicts = [];
46393 var _discardTags = {};
46394 _mainFileFetcher.get("discarded").then(function(d4) {
46396 }).catch(function() {
46398 const uploader = {};
46399 uploader.isSaving = function() {
46402 uploader.save = function(changeset, tryAgain, checkConflicts) {
46403 if (_isSaving && !tryAgain) {
46406 var osm = context.connection();
46408 if (!osm.authenticated()) {
46409 osm.authenticate(function(err) {
46411 uploader.save(changeset, tryAgain, checkConflicts);
46418 dispatch14.call("saveStarted", this);
46420 var history = context.history();
46421 _anyConflictsAutomaticallyResolved = false;
46424 _origChanges = history.changes(actionDiscardTags(history.difference(), _discardTags));
46426 history.perform(actionNoop());
46428 if (!checkConflicts) {
46431 performFullConflictCheck(changeset);
46434 function performFullConflictCheck(changeset) {
46435 var osm = context.connection();
46437 var history = context.history();
46438 var localGraph = context.graph();
46439 var remoteGraph = coreGraph(history.base(), true);
46440 var summary = history.difference().summary();
46442 for (var i3 = 0; i3 < summary.length; i3++) {
46443 var item = summary[i3];
46444 if (item.changeType === "modified") {
46445 _toCheck.push(item.entity.id);
46448 var _toLoad = withChildNodes(_toCheck, localGraph);
46450 var _toLoadCount = 0;
46451 var _toLoadTotal = _toLoad.length;
46452 if (_toCheck.length) {
46453 dispatch14.call("progressChanged", this, _toLoadCount, _toLoadTotal);
46454 _toLoad.forEach(function(id2) {
46455 _loaded[id2] = false;
46457 osm.loadMultiple(_toLoad, loaded);
46462 function withChildNodes(ids, graph) {
46463 var s2 = new Set(ids);
46464 ids.forEach(function(id2) {
46465 var entity = graph.entity(id2);
46466 if (entity.type !== "way") return;
46467 graph.childNodes(entity).forEach(function(child) {
46468 if (child.version !== void 0) {
46473 return Array.from(s2);
46475 function loaded(err, result) {
46476 if (_errors.length) return;
46479 msg: err.message || err.responseText,
46480 details: [_t("save.status_code", { code: err.status })]
46482 didResultInErrors();
46485 result.data.forEach(function(entity) {
46486 remoteGraph.replace(entity);
46487 _loaded[entity.id] = true;
46488 _toLoad = _toLoad.filter(function(val) {
46489 return val !== entity.id;
46491 if (!entity.visible) return;
46493 if (entity.type === "way") {
46494 for (i4 = 0; i4 < entity.nodes.length; i4++) {
46495 id2 = entity.nodes[i4];
46496 if (_loaded[id2] === void 0) {
46497 _loaded[id2] = false;
46498 loadMore.push(id2);
46501 } else if (entity.type === "relation" && entity.isMultipolygon()) {
46502 for (i4 = 0; i4 < entity.members.length; i4++) {
46503 id2 = entity.members[i4].id;
46504 if (_loaded[id2] === void 0) {
46505 _loaded[id2] = false;
46506 loadMore.push(id2);
46511 _toLoadCount += result.data.length;
46512 _toLoadTotal += loadMore.length;
46513 dispatch14.call("progressChanged", this, _toLoadCount, _toLoadTotal);
46514 if (loadMore.length) {
46515 _toLoad.push.apply(_toLoad, loadMore);
46516 osm.loadMultiple(loadMore, loaded);
46518 if (!_toLoad.length) {
46524 function detectConflicts() {
46525 function choice(id2, text, action) {
46529 action: function() {
46530 history.replace(action);
46534 function formatUser(d4) {
46535 return '<a href="' + osm.userURL(d4) + '" target="_blank">' + escape_default(d4) + "</a>";
46537 function entityName(entity) {
46538 return utilDisplayName(entity) || utilDisplayType(entity.id) + " " + entity.id;
46540 function sameVersions(local, remote) {
46541 if (local.version !== remote.version) return false;
46542 if (local.type === "way") {
46543 var children2 = utilArrayUnion(local.nodes, remote.nodes);
46544 for (var i4 = 0; i4 < children2.length; i4++) {
46545 var a2 = localGraph.hasEntity(children2[i4]);
46546 var b3 = remoteGraph.hasEntity(children2[i4]);
46547 if (a2 && b3 && a2.version !== b3.version) return false;
46552 _toCheck.forEach(function(id2) {
46553 var local = localGraph.entity(id2);
46554 var remote = remoteGraph.entity(id2);
46555 if (sameVersions(local, remote)) return;
46556 var merge3 = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags, formatUser);
46557 history.replace(merge3);
46558 var mergeConflicts = merge3.conflicts();
46559 if (!mergeConflicts.length) {
46560 _anyConflictsAutomaticallyResolved = true;
46563 var forceLocal = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags).withOption("force_local");
46564 var forceRemote = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags).withOption("force_remote");
46565 var keepMine = _t("save.conflict." + (remote.visible ? "keep_local" : "restore"));
46566 var keepTheirs = _t("save.conflict." + (remote.visible ? "keep_remote" : "delete"));
46569 name: entityName(local),
46570 details: mergeConflicts,
46573 choice(id2, keepMine, forceLocal),
46574 choice(id2, keepTheirs, forceRemote)
46580 async function upload(changeset) {
46581 var osm = context.connection();
46583 _errors.push({ msg: "No OSM Service" });
46585 if (_conflicts.length) {
46586 didResultInConflicts(changeset);
46587 } else if (_errors.length) {
46588 didResultInErrors();
46590 if (_anyConflictsAutomaticallyResolved) {
46591 changeset.tags.merge_conflict_resolved = "automatically";
46592 await osm.updateChangesetTags(changeset);
46594 var history = context.history();
46595 var changes = history.changes(actionDiscardTags(history.difference(), _discardTags));
46596 if (changes.modified.length || changes.created.length || changes.deleted.length) {
46597 dispatch14.call("willAttemptUpload", this);
46598 osm.putChangeset(changeset, changes, uploadCallback);
46600 didResultInNoChanges();
46604 function uploadCallback(err, changeset) {
46606 if (err.status === 409) {
46607 uploader.save(changeset, true, true);
46610 msg: err.message || err.responseText,
46611 details: [_t("save.status_code", { code: err.status })]
46613 didResultInErrors();
46616 didResultInSuccess(changeset);
46619 function didResultInNoChanges() {
46620 dispatch14.call("resultNoChanges", this);
46624 function didResultInErrors() {
46625 context.history().pop();
46626 dispatch14.call("resultErrors", this, _errors);
46629 function didResultInConflicts(changeset) {
46630 changeset.tags.merge_conflict_resolved = "manually";
46631 context.connection().updateChangesetTags(changeset);
46632 _conflicts.sort(function(a2, b3) {
46633 return b3.id.localeCompare(a2.id);
46635 dispatch14.call("resultConflicts", this, changeset, _conflicts, _origChanges);
46638 function didResultInSuccess(changeset) {
46639 context.history().clearSaved();
46640 dispatch14.call("resultSuccess", this, changeset);
46641 window.setTimeout(function() {
46646 function endSave() {
46648 dispatch14.call("saveEnded", this);
46650 uploader.cancelConflictResolution = function() {
46651 context.history().pop();
46653 uploader.processResolvedConflicts = function(changeset) {
46654 var history = context.history();
46655 for (var i3 = 0; i3 < _conflicts.length; i3++) {
46656 if (_conflicts[i3].chosen === 1) {
46657 var entity = context.hasEntity(_conflicts[i3].id);
46658 if (entity && entity.type === "way") {
46659 var children2 = utilArrayUniq(entity.nodes);
46660 for (var j3 = 0; j3 < children2.length; j3++) {
46661 history.replace(actionRevert(children2[j3]));
46664 history.replace(actionRevert(_conflicts[i3].id));
46667 uploader.save(changeset, true, false);
46669 uploader.reset = function() {
46671 return utilRebind(uploader, dispatch14, "on");
46673 var init_uploader = __esm({
46674 "modules/core/uploader.js"() {
46678 init_file_fetcher();
46679 init_discard_tags();
46680 init_merge_remote_changes();
46689 // modules/modes/draw_area.js
46690 var draw_area_exports = {};
46691 __export(draw_area_exports, {
46692 modeDrawArea: () => modeDrawArea
46694 function modeDrawArea(context, wayID, startGraph, button) {
46699 var behavior = behaviorDrawWay(context, wayID, mode, startGraph).on("rejectedSelfIntersection.modeDrawArea", function() {
46700 context.ui().flash.iconName("#iD-icon-no").label(_t.append("self_intersection.error.areas"))();
46702 mode.wayID = wayID;
46703 mode.enter = function() {
46704 context.install(behavior);
46706 mode.exit = function() {
46707 context.uninstall(behavior);
46709 mode.selectedIDs = function() {
46712 mode.activeID = function() {
46713 return behavior && behavior.activeID() || [];
46717 var init_draw_area = __esm({
46718 "modules/modes/draw_area.js"() {
46725 // modules/modes/add_area.js
46726 var add_area_exports = {};
46727 __export(add_area_exports, {
46728 modeAddArea: () => modeAddArea
46730 function modeAddArea(context, mode) {
46731 mode.id = "add-area";
46732 var behavior = behaviorAddWay(context).on("start", start2).on("startFromWay", startFromWay).on("startFromNode", startFromNode);
46733 function defaultTags(loc) {
46734 var defaultTags2 = { area: "yes" };
46735 if (mode.preset) defaultTags2 = mode.preset.setTags(defaultTags2, "area", false, loc);
46736 return defaultTags2;
46738 function actionClose(wayId) {
46739 return function(graph) {
46740 return graph.replace(graph.entity(wayId).close());
46743 function start2(loc) {
46744 var startGraph = context.graph();
46745 var node = osmNode({ loc });
46746 var way = osmWay({ tags: defaultTags(loc) });
46748 actionAddEntity(node),
46749 actionAddEntity(way),
46750 actionAddVertex(way.id, node.id),
46751 actionClose(way.id)
46753 context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
46755 function startFromWay(loc, edge) {
46756 var startGraph = context.graph();
46757 var node = osmNode({ loc });
46758 var way = osmWay({ tags: defaultTags(loc) });
46760 actionAddEntity(node),
46761 actionAddEntity(way),
46762 actionAddVertex(way.id, node.id),
46763 actionClose(way.id),
46764 actionAddMidpoint({ loc, edge }, node)
46766 context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
46768 function startFromNode(node) {
46769 var startGraph = context.graph();
46770 var way = osmWay({ tags: defaultTags(node.loc) });
46772 actionAddEntity(way),
46773 actionAddVertex(way.id, node.id),
46774 actionClose(way.id)
46776 context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
46778 mode.enter = function() {
46779 context.install(behavior);
46781 mode.exit = function() {
46782 context.uninstall(behavior);
46786 var init_add_area = __esm({
46787 "modules/modes/add_area.js"() {
46790 init_add_midpoint();
46798 // modules/modes/add_line.js
46799 var add_line_exports = {};
46800 __export(add_line_exports, {
46801 modeAddLine: () => modeAddLine
46803 function modeAddLine(context, mode) {
46804 mode.id = "add-line";
46805 var behavior = behaviorAddWay(context).on("start", start2).on("startFromWay", startFromWay).on("startFromNode", startFromNode);
46806 function defaultTags(loc) {
46807 var defaultTags2 = {};
46808 if (mode.preset) defaultTags2 = mode.preset.setTags(defaultTags2, "line", false, loc);
46809 return defaultTags2;
46811 function start2(loc) {
46812 var startGraph = context.graph();
46813 var node = osmNode({ loc });
46814 var way = osmWay({ tags: defaultTags(loc) });
46816 actionAddEntity(node),
46817 actionAddEntity(way),
46818 actionAddVertex(way.id, node.id)
46820 context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
46822 function startFromWay(loc, edge) {
46823 var startGraph = context.graph();
46824 var node = osmNode({ loc });
46825 var way = osmWay({ tags: defaultTags(loc) });
46827 actionAddEntity(node),
46828 actionAddEntity(way),
46829 actionAddVertex(way.id, node.id),
46830 actionAddMidpoint({ loc, edge }, node)
46832 context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
46834 function startFromNode(node) {
46835 var startGraph = context.graph();
46836 var way = osmWay({ tags: defaultTags(node.loc) });
46838 actionAddEntity(way),
46839 actionAddVertex(way.id, node.id)
46841 context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
46843 mode.enter = function() {
46844 context.install(behavior);
46846 mode.exit = function() {
46847 context.uninstall(behavior);
46851 var init_add_line = __esm({
46852 "modules/modes/add_line.js"() {
46855 init_add_midpoint();
46863 // modules/modes/add_point.js
46864 var add_point_exports = {};
46865 __export(add_point_exports, {
46866 modeAddPoint: () => modeAddPoint
46868 function modeAddPoint(context, mode) {
46869 mode.id = "add-point";
46870 var behavior = behaviorDraw(context).on("click", add).on("clickWay", addWay).on("clickNode", addNode).on("cancel", cancel).on("finish", cancel);
46871 function defaultTags(loc) {
46872 var defaultTags2 = {};
46873 if (mode.preset) defaultTags2 = mode.preset.setTags(defaultTags2, "point", false, loc);
46874 return defaultTags2;
46876 function add(loc) {
46877 var node = osmNode({ loc, tags: defaultTags(loc) });
46879 actionAddEntity(node),
46880 _t("operations.add.annotation.point")
46882 enterSelectMode(node);
46884 function addWay(loc, edge) {
46885 var node = osmNode({ tags: defaultTags(loc) });
46887 actionAddMidpoint({ loc, edge }, node),
46888 _t("operations.add.annotation.vertex")
46890 enterSelectMode(node);
46892 function enterSelectMode(node) {
46894 modeSelect(context, [node.id]).newFeature(true)
46897 function addNode(node) {
46898 const _defaultTags = defaultTags(node.loc);
46899 if (Object.keys(_defaultTags).length === 0) {
46900 enterSelectMode(node);
46903 var tags = Object.assign({}, node.tags);
46904 for (var key in _defaultTags) {
46905 tags[key] = _defaultTags[key];
46908 actionChangeTags(node.id, tags),
46909 _t("operations.add.annotation.point")
46911 enterSelectMode(node);
46913 function cancel() {
46914 context.enter(modeBrowse(context));
46916 mode.enter = function() {
46917 context.install(behavior);
46919 mode.exit = function() {
46920 context.uninstall(behavior);
46924 var init_add_point = __esm({
46925 "modules/modes/add_point.js"() {
46933 init_change_tags();
46934 init_add_midpoint();
46938 // modules/behavior/drag.js
46939 var drag_exports = {};
46940 __export(drag_exports, {
46941 behaviorDrag: () => behaviorDrag
46943 function behaviorDrag() {
46944 var dispatch14 = dispatch_default("start", "move", "end");
46945 var _tolerancePx = 1;
46946 var _penTolerancePx = 4;
46947 var _origin = null;
46948 var _selector = "";
46953 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
46954 var d3_event_userSelectProperty = utilPrefixCSSProperty("UserSelect");
46955 var d3_event_userSelectSuppress = function() {
46956 var selection2 = selection_default();
46957 var select = selection2.style(d3_event_userSelectProperty);
46958 selection2.style(d3_event_userSelectProperty, "none");
46959 return function() {
46960 selection2.style(d3_event_userSelectProperty, select);
46963 function pointerdown(d3_event) {
46964 if (_pointerId) return;
46965 _pointerId = d3_event.pointerId || "mouse";
46966 _targetNode = this;
46967 var pointerLocGetter = utilFastMouse(_surface || _targetNode.parentNode);
46969 var startOrigin = pointerLocGetter(d3_event);
46970 var started = false;
46971 var selectEnable = d3_event_userSelectSuppress();
46972 select_default2(window).on(_pointerPrefix + "move.drag", pointermove).on(_pointerPrefix + "up.drag pointercancel.drag", pointerup, true);
46974 offset = _origin.call(_targetNode, _targetEntity);
46975 offset = [offset[0] - startOrigin[0], offset[1] - startOrigin[1]];
46979 d3_event.stopPropagation();
46980 function pointermove(d3_event2) {
46981 if (_pointerId !== (d3_event2.pointerId || "mouse")) return;
46982 var p2 = pointerLocGetter(d3_event2);
46984 var dist = geoVecLength(startOrigin, p2);
46985 var tolerance = d3_event2.pointerType === "pen" ? _penTolerancePx : _tolerancePx;
46986 if (dist < tolerance) return;
46988 dispatch14.call("start", this, d3_event2, _targetEntity);
46991 d3_event2.stopPropagation();
46992 d3_event2.preventDefault();
46993 var dx = p2[0] - startOrigin[0];
46994 var dy = p2[1] - startOrigin[1];
46995 dispatch14.call("move", this, d3_event2, _targetEntity, [p2[0] + offset[0], p2[1] + offset[1]], [dx, dy]);
46998 function pointerup(d3_event2) {
46999 if (_pointerId !== (d3_event2.pointerId || "mouse")) return;
47002 dispatch14.call("end", this, d3_event2, _targetEntity);
47003 d3_event2.preventDefault();
47005 select_default2(window).on(_pointerPrefix + "move.drag", null).on(_pointerPrefix + "up.drag pointercancel.drag", null);
47009 function behavior(selection2) {
47010 var matchesSelector = utilPrefixDOMProperty("matchesSelector");
47011 var delegate = pointerdown;
47013 delegate = function(d3_event) {
47015 var target = d3_event.target;
47016 for (; target && target !== root3; target = target.parentNode) {
47017 var datum2 = target.__data__;
47018 _targetEntity = datum2 instanceof osmNote ? datum2 : datum2 && datum2.properties && datum2.properties.entity;
47019 if (_targetEntity && target[matchesSelector](_selector)) {
47020 return pointerdown.call(target, d3_event);
47025 selection2.on(_pointerPrefix + "down.drag" + _selector, delegate);
47027 behavior.off = function(selection2) {
47028 selection2.on(_pointerPrefix + "down.drag" + _selector, null);
47030 behavior.selector = function(_3) {
47031 if (!arguments.length) return _selector;
47035 behavior.origin = function(_3) {
47036 if (!arguments.length) return _origin;
47040 behavior.cancel = function() {
47041 select_default2(window).on(_pointerPrefix + "move.drag", null).on(_pointerPrefix + "up.drag pointercancel.drag", null);
47044 behavior.targetNode = function(_3) {
47045 if (!arguments.length) return _targetNode;
47049 behavior.targetEntity = function(_3) {
47050 if (!arguments.length) return _targetEntity;
47051 _targetEntity = _3;
47054 behavior.surface = function(_3) {
47055 if (!arguments.length) return _surface;
47059 return utilRebind(behavior, dispatch14, "on");
47061 var init_drag2 = __esm({
47062 "modules/behavior/drag.js"() {
47073 // modules/modes/drag_node.js
47074 var drag_node_exports = {};
47075 __export(drag_node_exports, {
47076 modeDragNode: () => modeDragNode
47078 function modeDragNode(context) {
47083 var hover = behaviorHover(context).altDisables(true).on("hover", context.ui().sidebar.hover);
47084 var edit = behaviorEdit(context);
47085 var _nudgeInterval;
47086 var _restoreSelectedIDs = [];
47087 var _wasMidpoint = false;
47088 var _isCancelled = false;
47092 function startNudge(d3_event, entity, nudge) {
47093 if (_nudgeInterval) window.clearInterval(_nudgeInterval);
47094 _nudgeInterval = window.setInterval(function() {
47095 context.map().pan(nudge);
47096 doMove(d3_event, entity, nudge);
47099 function stopNudge() {
47100 if (_nudgeInterval) {
47101 window.clearInterval(_nudgeInterval);
47102 _nudgeInterval = null;
47105 function moveAnnotation(entity) {
47106 return _t("operations.move.annotation." + entity.geometry(context.graph()));
47108 function connectAnnotation(nodeEntity, targetEntity) {
47109 var nodeGeometry = nodeEntity.geometry(context.graph());
47110 var targetGeometry = targetEntity.geometry(context.graph());
47111 if (nodeGeometry === "vertex" && targetGeometry === "vertex") {
47112 var nodeParentWayIDs = context.graph().parentWays(nodeEntity);
47113 var targetParentWayIDs = context.graph().parentWays(targetEntity);
47114 var sharedParentWays = utilArrayIntersection(nodeParentWayIDs, targetParentWayIDs);
47115 if (sharedParentWays.length !== 0) {
47116 if (sharedParentWays[0].areAdjacent(nodeEntity.id, targetEntity.id)) {
47117 return _t("operations.connect.annotation.from_vertex.to_adjacent_vertex");
47119 return _t("operations.connect.annotation.from_vertex.to_sibling_vertex");
47122 return _t("operations.connect.annotation.from_" + nodeGeometry + ".to_" + targetGeometry);
47124 function shouldSnapToNode(target) {
47125 if (!_activeEntity) return false;
47126 return _activeEntity.geometry(context.graph()) !== "vertex" || (target.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(target, context.graph()));
47128 function origin(entity) {
47129 return context.projection(entity.loc);
47131 function keydown(d3_event) {
47132 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
47133 if (context.surface().classed("nope")) {
47134 context.surface().classed("nope-suppressed", true);
47136 context.surface().classed("nope", false).classed("nope-disabled", true);
47139 function keyup(d3_event) {
47140 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
47141 if (context.surface().classed("nope-suppressed")) {
47142 context.surface().classed("nope", true);
47144 context.surface().classed("nope-suppressed", false).classed("nope-disabled", false);
47147 function start2(d3_event, entity) {
47148 _wasMidpoint = entity.type === "midpoint";
47149 var hasHidden = context.features().hasHiddenConnections(entity, context.graph());
47150 _isCancelled = !context.editable() || d3_event.shiftKey || hasHidden;
47151 if (_isCancelled) {
47153 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("modes.drag_node.connected_to_hidden"))();
47155 return drag.cancel();
47157 if (_wasMidpoint) {
47158 var midpoint = entity;
47159 entity = osmNode();
47160 context.perform(actionAddMidpoint(midpoint, entity));
47161 entity = context.entity(entity.id);
47162 var vertex = context.surface().selectAll("." + entity.id);
47163 drag.targetNode(vertex.node()).targetEntity(entity);
47165 context.perform(actionNoop());
47167 _activeEntity = entity;
47168 _startLoc = entity.loc;
47169 hover.ignoreVertex(entity.geometry(context.graph()) === "vertex");
47170 context.surface().selectAll("." + _activeEntity.id).classed("active", true);
47171 context.enter(mode);
47173 function datum2(d3_event) {
47174 if (!d3_event || d3_event.altKey) {
47177 var d4 = d3_event.target.__data__;
47178 return d4 && d4.properties && d4.properties.target ? d4 : {};
47181 function doMove(d3_event, entity, nudge) {
47182 nudge = nudge || [0, 0];
47183 var currPoint = d3_event && d3_event.point || context.projection(_lastLoc);
47184 var currMouse = geoVecSubtract(currPoint, nudge);
47185 var loc = context.projection.invert(currMouse);
47187 if (!_nudgeInterval) {
47188 var d4 = datum2(d3_event);
47189 target = d4 && d4.properties && d4.properties.entity;
47190 var targetLoc = target && target.loc;
47191 var targetNodes = d4 && d4.properties && d4.properties.nodes;
47193 if (shouldSnapToNode(target)) {
47196 } else if (targetNodes) {
47197 edge = geoChooseEdge(targetNodes, context.map().mouse(), context.projection, end.id);
47204 actionMoveNode(entity.id, loc)
47206 var isInvalid = false;
47208 isInvalid = hasRelationConflict(entity, target, edge, context.graph());
47211 isInvalid = hasInvalidGeometry(entity, context.graph());
47213 var nope = context.surface().classed("nope");
47214 if (isInvalid === "relation" || isInvalid === "restriction") {
47216 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append(
47217 "operations.connect." + isInvalid,
47218 { relation: _mainPresetIndex.item("type/restriction").name() }
47221 } else if (isInvalid) {
47222 var errorID = isInvalid === "line" ? "lines" : "areas";
47223 context.ui().flash.duration(3e3).iconName("#iD-icon-no").label(_t.append("self_intersection.error." + errorID))();
47226 context.ui().flash.duration(1).label("")();
47229 var nopeDisabled = context.surface().classed("nope-disabled");
47230 if (nopeDisabled) {
47231 context.surface().classed("nope", false).classed("nope-suppressed", isInvalid);
47233 context.surface().classed("nope", isInvalid).classed("nope-suppressed", false);
47237 function hasRelationConflict(entity, target, edge, graph) {
47238 var testGraph = graph.update();
47240 var midpoint = osmNode();
47241 var action = actionAddMidpoint({
47243 edge: [target.nodes[edge.index - 1], target.nodes[edge.index]]
47245 testGraph = action(testGraph);
47248 var ids = [entity.id, target.id];
47249 return actionConnect(ids).disabled(testGraph);
47251 function hasInvalidGeometry(entity, graph) {
47252 var parents = graph.parentWays(entity);
47254 for (i3 = 0; i3 < parents.length; i3++) {
47255 var parent2 = parents[i3];
47257 var activeIndex = null;
47258 var relations = graph.parentRelations(parent2);
47259 for (j3 = 0; j3 < relations.length; j3++) {
47260 if (!relations[j3].isMultipolygon()) continue;
47261 var rings = osmJoinWays(relations[j3].members, graph);
47262 for (k2 = 0; k2 < rings.length; k2++) {
47263 nodes = rings[k2].nodes;
47264 if (nodes.find(function(n3) {
47265 return n3.id === entity.id;
47268 if (geoHasSelfIntersections(nodes, entity.id)) {
47269 return "multipolygonMember";
47272 rings[k2].coords = nodes.map(function(n3) {
47276 for (k2 = 0; k2 < rings.length; k2++) {
47277 if (k2 === activeIndex) continue;
47278 if (geoHasLineIntersections(rings[activeIndex].nodes, rings[k2].nodes, entity.id)) {
47279 return "multipolygonRing";
47283 if (activeIndex === null) {
47284 nodes = parent2.nodes.map(function(nodeID) {
47285 return graph.entity(nodeID);
47287 if (nodes.length && geoHasSelfIntersections(nodes, entity.id)) {
47288 return parent2.geometry(graph);
47294 function move(d3_event, entity, point) {
47295 if (_isCancelled) return;
47296 d3_event.stopPropagation();
47297 context.surface().classed("nope-disabled", d3_event.altKey);
47298 _lastLoc = context.projection.invert(point);
47299 doMove(d3_event, entity);
47300 var nudge = geoViewportEdge(point, context.map().dimensions());
47302 startNudge(d3_event, entity, nudge);
47307 function end(d3_event, entity) {
47308 if (_isCancelled) return;
47309 var wasPoint = entity.geometry(context.graph()) === "point";
47310 var d4 = datum2(d3_event);
47311 var nope = d4 && d4.properties && d4.properties.nope || context.surface().classed("nope");
47312 var target = d4 && d4.properties && d4.properties.entity;
47315 _actionBounceBack(entity.id, _startLoc)
47317 } else if (target && target.type === "way") {
47318 var choice = geoChooseEdge(context.graph().childNodes(target), context.map().mouse(), context.projection, entity.id);
47320 actionAddMidpoint({
47322 edge: [target.nodes[choice.index - 1], target.nodes[choice.index]]
47324 connectAnnotation(entity, target)
47326 } else if (target && target.type === "node" && shouldSnapToNode(target)) {
47328 actionConnect([target.id, entity.id]),
47329 connectAnnotation(entity, target)
47331 } else if (_wasMidpoint) {
47334 _t("operations.add.annotation.vertex")
47339 moveAnnotation(entity)
47343 context.enter(modeSelect(context, [entity.id]));
47345 var reselection = _restoreSelectedIDs.filter(function(id2) {
47346 return context.graph().hasEntity(id2);
47348 if (reselection.length) {
47349 context.enter(modeSelect(context, reselection));
47351 context.enter(modeBrowse(context));
47355 function _actionBounceBack(nodeID, toLoc) {
47356 var moveNode = actionMoveNode(nodeID, toLoc);
47357 var action = function(graph, t2) {
47358 if (t2 === 1) context.pop();
47359 return moveNode(graph, t2);
47361 action.transitionable = true;
47364 function cancel() {
47366 context.enter(modeBrowse(context));
47368 var drag = behaviorDrag().selector(".layer-touch.points .target").surface(context.container().select(".main-map").node()).origin(origin).on("start", start2).on("move", move).on("end", end);
47369 mode.enter = function() {
47370 context.install(hover);
47371 context.install(edit);
47372 select_default2(window).on("keydown.dragNode", keydown).on("keyup.dragNode", keyup);
47373 context.history().on("undone.drag-node", cancel);
47375 mode.exit = function() {
47376 context.ui().sidebar.hover.cancel();
47377 context.uninstall(hover);
47378 context.uninstall(edit);
47379 select_default2(window).on("keydown.dragNode", null).on("keyup.dragNode", null);
47380 context.history().on("undone.drag-node", null);
47381 _activeEntity = null;
47382 context.surface().classed("nope", false).classed("nope-suppressed", false).classed("nope-disabled", false).selectAll(".active").classed("active", false);
47385 mode.selectedIDs = function() {
47386 if (!arguments.length) return _activeEntity ? [_activeEntity.id] : [];
47389 mode.activeID = function() {
47390 if (!arguments.length) return _activeEntity && _activeEntity.id;
47393 mode.restoreSelectedIDs = function(_3) {
47394 if (!arguments.length) return _restoreSelectedIDs;
47395 _restoreSelectedIDs = _3;
47398 mode.behavior = drag;
47401 var init_drag_node = __esm({
47402 "modules/modes/drag_node.js"() {
47407 init_add_midpoint();
47422 // modules/modes/drag_note.js
47423 var drag_note_exports = {};
47424 __export(drag_note_exports, {
47425 modeDragNote: () => modeDragNote
47427 function modeDragNote(context) {
47432 var edit = behaviorEdit(context);
47433 var _nudgeInterval;
47436 function startNudge(d3_event, nudge) {
47437 if (_nudgeInterval) window.clearInterval(_nudgeInterval);
47438 _nudgeInterval = window.setInterval(function() {
47439 context.map().pan(nudge);
47440 doMove(d3_event, nudge);
47443 function stopNudge() {
47444 if (_nudgeInterval) {
47445 window.clearInterval(_nudgeInterval);
47446 _nudgeInterval = null;
47449 function origin(note) {
47450 return context.projection(note.loc);
47452 function start2(d3_event, note) {
47454 var osm = services.osm;
47456 _note = osm.getNote(_note.id);
47458 context.surface().selectAll(".note-" + _note.id).classed("active", true);
47459 context.perform(actionNoop());
47460 context.enter(mode);
47461 context.selectedNoteID(_note.id);
47463 function move(d3_event, entity, point) {
47464 d3_event.stopPropagation();
47465 _lastLoc = context.projection.invert(point);
47467 var nudge = geoViewportEdge(point, context.map().dimensions());
47469 startNudge(d3_event, nudge);
47474 function doMove(d3_event, nudge) {
47475 nudge = nudge || [0, 0];
47476 var currPoint = d3_event && d3_event.point || context.projection(_lastLoc);
47477 var currMouse = geoVecSubtract(currPoint, nudge);
47478 var loc = context.projection.invert(currMouse);
47479 _note = _note.move(loc);
47480 var osm = services.osm;
47482 osm.replaceNote(_note);
47484 context.replace(actionNoop());
47487 context.replace(actionNoop());
47488 context.selectedNoteID(_note.id).enter(modeSelectNote(context, _note.id));
47490 var drag = behaviorDrag().selector(".layer-touch.markers .target.note.new").surface(context.container().select(".main-map").node()).origin(origin).on("start", start2).on("move", move).on("end", end);
47491 mode.enter = function() {
47492 context.install(edit);
47494 mode.exit = function() {
47495 context.ui().sidebar.hover.cancel();
47496 context.uninstall(edit);
47497 context.surface().selectAll(".active").classed("active", false);
47500 mode.behavior = drag;
47503 var init_drag_note = __esm({
47504 "modules/modes/drag_note.js"() {
47511 init_select_note();
47515 // modules/ui/data_header.js
47516 var data_header_exports = {};
47517 __export(data_header_exports, {
47518 uiDataHeader: () => uiDataHeader
47520 function uiDataHeader() {
47522 function dataHeader(selection2) {
47523 var header = selection2.selectAll(".data-header").data(
47524 _datum ? [_datum] : [],
47526 return d4.__featurehash__;
47529 header.exit().remove();
47530 var headerEnter = header.enter().append("div").attr("class", "data-header");
47531 var iconEnter = headerEnter.append("div").attr("class", "data-header-icon");
47532 iconEnter.append("div").attr("class", "preset-icon-28").call(svgIcon("#iD-icon-data", "note-fill"));
47533 headerEnter.append("div").attr("class", "data-header-label").call(_t.append("map_data.layers.custom.title"));
47535 dataHeader.datum = function(val) {
47536 if (!arguments.length) return _datum;
47542 var init_data_header = __esm({
47543 "modules/ui/data_header.js"() {
47550 // modules/ui/combobox.js
47551 var combobox_exports = {};
47552 __export(combobox_exports, {
47553 uiCombobox: () => uiCombobox
47555 function uiCombobox(context, klass) {
47556 var dispatch14 = dispatch_default("accept", "cancel", "update");
47557 var container = context.container();
47558 var _suggestions = [];
47561 var _selected = null;
47562 var _canAutocomplete = true;
47563 var _caseSensitive = false;
47564 var _cancelFetch = false;
47567 var _mouseEnterHandler, _mouseLeaveHandler;
47568 var _fetcher = function(val, cb) {
47569 cb(_data.filter(function(d4) {
47570 var terms = d4.terms || [];
47571 terms.push(d4.value);
47573 terms.push(d4.key);
47575 return terms.some(function(term) {
47576 return term.toString().toLowerCase().indexOf(val.toLowerCase()) !== -1;
47580 var combobox = function(input, attachTo) {
47581 if (!input || input.empty()) return;
47582 input.classed("combobox-input", true).on("focus.combo-input", focus).on("blur.combo-input", blur).on("keydown.combo-input", keydown).on("keyup.combo-input", keyup).on("input.combo-input", change).on("mousedown.combo-input", mousedown).each(function() {
47583 var parent2 = this.parentNode;
47584 var sibling = this.nextSibling;
47585 select_default2(parent2).selectAll(".combobox-caret").filter(function(d4) {
47586 return d4 === input.node();
47587 }).data([input.node()]).enter().insert("div", function() {
47589 }).attr("class", "combobox-caret").on("mousedown.combo-caret", function(d3_event) {
47590 d3_event.preventDefault();
47591 input.node().focus();
47592 mousedown(d3_event);
47593 }).on("mouseup.combo-caret", function(d3_event) {
47594 d3_event.preventDefault();
47598 function mousedown(d3_event) {
47599 if (d3_event.button !== 0) return;
47600 if (input.classed("disabled")) return;
47601 _tDown = +/* @__PURE__ */ new Date();
47602 d3_event.stopPropagation();
47603 var start2 = input.property("selectionStart");
47604 var end = input.property("selectionEnd");
47605 if (start2 !== end) {
47606 var val = utilGetSetValue(input);
47607 input.node().setSelectionRange(val.length, val.length);
47610 input.on("mouseup.combo-input", mouseup);
47612 function mouseup(d3_event) {
47613 input.on("mouseup.combo-input", null);
47614 if (d3_event.button !== 0) return;
47615 if (input.classed("disabled")) return;
47616 if (input.node() !== document.activeElement) return;
47617 var start2 = input.property("selectionStart");
47618 var end = input.property("selectionEnd");
47619 if (start2 !== end) return;
47620 var combo = container.selectAll(".combobox");
47621 if (combo.empty() || combo.datum() !== input.node()) {
47622 var tOrig = _tDown;
47623 window.setTimeout(function() {
47624 if (tOrig !== _tDown) return;
47625 fetchComboData("", function() {
47635 fetchComboData("");
47638 _comboHideTimerID = window.setTimeout(hide, 75);
47642 container.insert("div", ":first-child").datum(input.node()).attr("class", "combobox" + (klass ? " combobox-" + klass : "")).style("position", "absolute").style("display", "block").style("left", "0px").on("mousedown.combo-container", function(d3_event) {
47643 d3_event.preventDefault();
47645 container.on("scroll.combo-scroll", render, true);
47650 function keydown(d3_event) {
47651 var shown = !container.selectAll(".combobox").empty();
47652 var tagName = input.node() ? input.node().tagName.toLowerCase() : "";
47653 switch (d3_event.keyCode) {
47657 d3_event.stopPropagation();
47660 input.on("input.combo-input", function() {
47661 var start2 = input.property("selectionStart");
47662 input.node().setSelectionRange(start2, start2);
47663 input.on("input.combo-input", change);
47671 d3_event.preventDefault();
47672 d3_event.stopPropagation();
47676 if (tagName === "textarea" && !shown) return;
47677 d3_event.preventDefault();
47678 if (tagName === "input" && !shown) {
47684 if (tagName === "textarea" && !shown) return;
47685 d3_event.preventDefault();
47686 if (tagName === "input" && !shown) {
47693 function keyup(d3_event) {
47694 switch (d3_event.keyCode) {
47700 function change(doAutoComplete) {
47701 if (doAutoComplete === void 0) doAutoComplete = true;
47702 fetchComboData(value(), function(skipAutosuggest) {
47704 var val = input.property("value");
47705 if (_suggestions.length) {
47706 if (doAutoComplete && !skipAutosuggest && input.property("selectionEnd") === val.length) {
47707 _selected = tryAutocomplete();
47714 var combo = container.selectAll(".combobox");
47715 if (combo.empty()) {
47724 function nav(dir) {
47725 if (_suggestions.length) {
47727 for (var i3 = 0; i3 < _suggestions.length; i3++) {
47728 if (_selected && _suggestions[i3].value === _selected) {
47733 index = Math.max(Math.min(index + dir, _suggestions.length - 1), 0);
47734 _selected = _suggestions[index].value;
47735 utilGetSetValue(input, _selected);
47736 dispatch14.call("update");
47741 function ensureVisible() {
47743 var combo = container.selectAll(".combobox");
47744 if (combo.empty()) return;
47745 var containerRect = container.node().getBoundingClientRect();
47746 var comboRect = combo.node().getBoundingClientRect();
47747 if (comboRect.bottom > containerRect.bottom) {
47748 var node = attachTo ? attachTo.node() : input.node();
47749 node.scrollIntoView({ behavior: "instant", block: "center" });
47752 var selected = combo.selectAll(".combobox-option.selected").node();
47754 (_a4 = selected.scrollIntoView) == null ? void 0 : _a4.call(selected, { behavior: "smooth", block: "nearest" });
47758 var value2 = input.property("value");
47759 var start2 = input.property("selectionStart");
47760 var end = input.property("selectionEnd");
47761 if (start2 && end) {
47762 value2 = value2.substring(0, start2);
47766 function fetchComboData(v3, cb) {
47767 _cancelFetch = false;
47768 _fetcher.call(input, v3, function(results, skipAutosuggest) {
47769 if (_cancelFetch) return;
47770 _suggestions = results;
47771 results.forEach(function(d4) {
47772 _fetched[d4.value] = d4;
47775 cb(skipAutosuggest);
47779 function tryAutocomplete() {
47780 if (!_canAutocomplete) return;
47781 var val = _caseSensitive ? value() : value().toLowerCase();
47783 if (isFinite(val)) return;
47784 const suggestionValues = [];
47785 _suggestions.forEach((s2) => {
47786 suggestionValues.push(s2.value);
47787 if (s2.key && s2.key !== s2.value) {
47788 suggestionValues.push(s2.key);
47791 var bestIndex = -1;
47792 for (var i3 = 0; i3 < suggestionValues.length; i3++) {
47793 var suggestion = suggestionValues[i3];
47794 var compare2 = _caseSensitive ? suggestion : suggestion.toLowerCase();
47795 if (compare2 === val) {
47798 } else if (bestIndex === -1 && compare2.indexOf(val) === 0) {
47802 if (bestIndex !== -1) {
47803 var bestVal = suggestionValues[bestIndex];
47804 input.property("value", bestVal);
47805 input.node().setSelectionRange(val.length, bestVal.length);
47806 dispatch14.call("update");
47810 function render() {
47811 if (_suggestions.length < _minItems || document.activeElement !== input.node()) {
47815 var shown = !container.selectAll(".combobox").empty();
47816 if (!shown) return;
47817 var combo = container.selectAll(".combobox");
47818 var options = combo.selectAll(".combobox-option").data(_suggestions, function(d4) {
47821 options.exit().remove();
47822 options.enter().append("a").attr("class", function(d4) {
47823 return "combobox-option " + (d4.klass || "");
47824 }).attr("title", function(d4) {
47826 }).each(function(d4) {
47828 d4.display(select_default2(this));
47830 select_default2(this).text(d4.value);
47832 }).on("mouseenter", _mouseEnterHandler).on("mouseleave", _mouseLeaveHandler).merge(options).classed("selected", function(d4) {
47833 return d4.value === _selected || d4.key === _selected;
47834 }).on("click.combo-option", accept).order();
47835 var node = attachTo ? attachTo.node() : input.node();
47836 var containerRect = container.node().getBoundingClientRect();
47837 var rect = node.getBoundingClientRect();
47838 combo.style("left", rect.left + 5 - containerRect.left + "px").style("width", rect.width - 10 + "px").style("top", rect.height + rect.top - containerRect.top + "px");
47840 function accept(d3_event, d4) {
47841 _cancelFetch = true;
47842 var thiz = input.node();
47844 utilGetSetValue(input, d4.value);
47845 utilTriggerEvent(input, "change");
47847 var val = utilGetSetValue(input);
47848 thiz.setSelectionRange(val.length, val.length);
47850 d4 = _fetched[val];
47852 dispatch14.call("accept", thiz, d4, val);
47855 function cancel() {
47856 _cancelFetch = true;
47857 var thiz = input.node();
47858 var val = utilGetSetValue(input);
47859 var start2 = input.property("selectionStart");
47860 var end = input.property("selectionEnd");
47861 val = val.slice(0, start2) + val.slice(end);
47862 utilGetSetValue(input, val);
47863 thiz.setSelectionRange(val.length, val.length);
47864 dispatch14.call("cancel", thiz);
47868 combobox.canAutocomplete = function(val) {
47869 if (!arguments.length) return _canAutocomplete;
47870 _canAutocomplete = val;
47873 combobox.caseSensitive = function(val) {
47874 if (!arguments.length) return _caseSensitive;
47875 _caseSensitive = val;
47878 combobox.data = function(val) {
47879 if (!arguments.length) return _data;
47883 combobox.fetcher = function(val) {
47884 if (!arguments.length) return _fetcher;
47888 combobox.minItems = function(val) {
47889 if (!arguments.length) return _minItems;
47893 combobox.itemsMouseEnter = function(val) {
47894 if (!arguments.length) return _mouseEnterHandler;
47895 _mouseEnterHandler = val;
47898 combobox.itemsMouseLeave = function(val) {
47899 if (!arguments.length) return _mouseLeaveHandler;
47900 _mouseLeaveHandler = val;
47903 return utilRebind(combobox, dispatch14, "on");
47905 function _hide(container) {
47906 if (_comboHideTimerID) {
47907 window.clearTimeout(_comboHideTimerID);
47908 _comboHideTimerID = void 0;
47910 container.selectAll(".combobox").remove();
47911 container.on("scroll.combo-scroll", null);
47913 var _comboHideTimerID;
47914 var init_combobox = __esm({
47915 "modules/ui/combobox.js"() {
47920 uiCombobox.off = function(input, context) {
47921 _hide(context.container());
47922 input.on("focus.combo-input", null).on("blur.combo-input", null).on("keydown.combo-input", null).on("keyup.combo-input", null).on("input.combo-input", null).on("mousedown.combo-input", null).on("mouseup.combo-input", null);
47923 context.container().on("scroll.combo-scroll", null);
47928 // modules/ui/toggle.js
47929 var toggle_exports = {};
47930 __export(toggle_exports, {
47931 uiToggle: () => uiToggle
47933 function uiToggle(show, callback) {
47934 return function(selection2) {
47935 selection2.style("opacity", show ? 0 : 1).classed("hide", false).transition().style("opacity", show ? 1 : 0).on("end", function() {
47936 select_default2(this).classed("hide", !show).style("opacity", null);
47937 if (callback) callback.apply(this);
47941 var init_toggle = __esm({
47942 "modules/ui/toggle.js"() {
47948 // modules/ui/disclosure.js
47949 var disclosure_exports = {};
47950 __export(disclosure_exports, {
47951 uiDisclosure: () => uiDisclosure
47953 function uiDisclosure(context, key, expandedDefault) {
47954 var dispatch14 = dispatch_default("toggled");
47956 var _label = utilFunctor("");
47957 var _updatePreference = true;
47958 var _content = function() {
47960 var disclosure = function(selection2) {
47961 if (_expanded === void 0 || _expanded === null) {
47962 var preference = corePreferences("disclosure." + key + ".expanded");
47963 _expanded = preference === null ? !!expandedDefault : preference === "true";
47965 var hideToggle = selection2.selectAll(".hide-toggle-" + key).data([0]);
47966 var hideToggleEnter = hideToggle.enter().append("h3").append("a").attr("role", "button").attr("href", "#").attr("class", "hide-toggle hide-toggle-" + key).call(svgIcon("", "pre-text", "hide-toggle-icon"));
47967 hideToggleEnter.append("span").attr("class", "hide-toggle-text");
47968 hideToggle = hideToggleEnter.merge(hideToggle);
47969 hideToggle.on("click", toggle).attr("title", _t(`icons.${_expanded ? "collapse" : "expand"}`)).attr("aria-expanded", _expanded).classed("expanded", _expanded);
47970 const label = _label();
47971 const labelSelection = hideToggle.selectAll(".hide-toggle-text");
47972 if (typeof label !== "function") {
47973 labelSelection.text(_label());
47975 labelSelection.text("").call(label);
47977 hideToggle.selectAll(".hide-toggle-icon").attr(
47979 _expanded ? "#iD-icon-down" : _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward"
47981 var wrap2 = selection2.selectAll(".disclosure-wrap").data([0]);
47982 wrap2 = wrap2.enter().append("div").attr("class", "disclosure-wrap disclosure-wrap-" + key).merge(wrap2).classed("hide", !_expanded);
47984 wrap2.call(_content);
47986 function toggle(d3_event) {
47987 d3_event.preventDefault();
47988 _expanded = !_expanded;
47989 if (_updatePreference) {
47990 corePreferences("disclosure." + key + ".expanded", _expanded);
47992 hideToggle.classed("expanded", _expanded).attr("aria-expanded", _expanded).attr("title", _t(`icons.${_expanded ? "collapse" : "expand"}`));
47993 hideToggle.selectAll(".hide-toggle-icon").attr(
47995 _expanded ? "#iD-icon-down" : _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward"
47997 wrap2.call(uiToggle(_expanded));
47999 wrap2.call(_content);
48001 dispatch14.call("toggled", this, _expanded);
48004 disclosure.label = function(val) {
48005 if (!arguments.length) return _label;
48006 _label = utilFunctor(val);
48009 disclosure.expanded = function(val) {
48010 if (!arguments.length) return _expanded;
48014 disclosure.updatePreference = function(val) {
48015 if (!arguments.length) return _updatePreference;
48016 _updatePreference = val;
48019 disclosure.content = function(val) {
48020 if (!arguments.length) return _content;
48024 return utilRebind(disclosure, dispatch14, "on");
48026 var init_disclosure = __esm({
48027 "modules/ui/disclosure.js"() {
48030 init_preferences();
48039 // modules/ui/section.js
48040 var section_exports = {};
48041 __export(section_exports, {
48042 uiSection: () => uiSection
48044 function uiSection(id2, context) {
48045 var _classes = utilFunctor("");
48046 var _shouldDisplay;
48050 var _expandedByDefault = utilFunctor(true);
48051 var _disclosureContent;
48052 var _disclosureExpanded;
48053 var _containerSelection = select_default2(null);
48057 section.classes = function(val) {
48058 if (!arguments.length) return _classes;
48059 _classes = utilFunctor(val);
48062 section.label = function(val) {
48063 if (!arguments.length) return _label;
48064 _label = utilFunctor(val);
48067 section.expandedByDefault = function(val) {
48068 if (!arguments.length) return _expandedByDefault;
48069 _expandedByDefault = utilFunctor(val);
48072 section.shouldDisplay = function(val) {
48073 if (!arguments.length) return _shouldDisplay;
48074 _shouldDisplay = utilFunctor(val);
48077 section.content = function(val) {
48078 if (!arguments.length) return _content;
48082 section.disclosureContent = function(val) {
48083 if (!arguments.length) return _disclosureContent;
48084 _disclosureContent = val;
48087 section.disclosureExpanded = function(val) {
48088 if (!arguments.length) return _disclosureExpanded;
48089 _disclosureExpanded = val;
48092 section.render = function(selection2) {
48093 _containerSelection = selection2.selectAll(".section-" + id2).data([0]);
48094 var sectionEnter = _containerSelection.enter().append("div").attr("class", "section section-" + id2 + " " + (_classes && _classes() || ""));
48095 _containerSelection = sectionEnter.merge(_containerSelection);
48096 _containerSelection.call(renderContent);
48098 section.reRender = function() {
48099 _containerSelection.call(renderContent);
48101 section.selection = function() {
48102 return _containerSelection;
48104 section.disclosure = function() {
48105 return _disclosure;
48107 function renderContent(selection2) {
48108 if (_shouldDisplay) {
48109 var shouldDisplay = _shouldDisplay();
48110 selection2.classed("hide", !shouldDisplay);
48111 if (!shouldDisplay) {
48112 selection2.html("");
48116 if (_disclosureContent) {
48117 if (!_disclosure) {
48118 _disclosure = uiDisclosure(context, id2.replace(/-/g, "_"), _expandedByDefault()).label(_label || "").content(_disclosureContent);
48120 if (_disclosureExpanded !== void 0) {
48121 _disclosure.expanded(_disclosureExpanded);
48122 _disclosureExpanded = void 0;
48124 selection2.call(_disclosure);
48128 selection2.call(_content);
48133 var init_section = __esm({
48134 "modules/ui/section.js"() {
48142 // modules/ui/tag_reference.js
48143 var tag_reference_exports = {};
48144 __export(tag_reference_exports, {
48145 uiTagReference: () => uiTagReference
48147 function uiTagReference(what) {
48148 var wikibase = what.qid ? services.wikidata : services.osmWikibase;
48149 var tagReference = {};
48150 var _button = select_default2(null);
48151 var _body = select_default2(null);
48155 if (!wikibase) return;
48156 _button.classed("tag-reference-loading", true);
48157 wikibase.getDocs(what, gotDocs);
48159 function gotDocs(err, docs) {
48161 if (!docs || !docs.title) {
48162 _body.append("p").attr("class", "tag-reference-description").call(_t.append("inspector.no_documentation_key"));
48166 if (docs.imageURL) {
48167 _body.append("img").attr("class", "tag-reference-wiki-image").attr("alt", docs.title).attr("src", docs.imageURL).on("load", function() {
48169 }).on("error", function() {
48170 select_default2(this).remove();
48176 var tagReferenceDescription = _body.append("p").attr("class", "tag-reference-description").append("span");
48177 if (docs.description) {
48178 tagReferenceDescription = tagReferenceDescription.attr("class", "localized-text").attr("lang", docs.descriptionLocaleCode || "und").call(docs.description);
48180 tagReferenceDescription = tagReferenceDescription.call(_t.append("inspector.no_documentation_key"));
48182 tagReferenceDescription.append("a").attr("class", "tag-reference-edit").attr("target", "_blank").attr("title", _t("inspector.edit_reference")).attr("href", docs.editURL).call(svgIcon("#iD-icon-edit", "inline"));
48184 _body.append("a").attr("class", "tag-reference-link").attr("target", "_blank").attr("href", docs.wiki.url).call(svgIcon("#iD-icon-out-link", "inline")).append("span").call(_t.append(docs.wiki.text));
48186 if (what.key === "comment") {
48187 _body.append("a").attr("class", "tag-reference-comment-link").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).attr("href", _t("commit.about_changeset_comments_link")).append("span").call(_t.append("commit.about_changeset_comments"));
48192 _button.classed("tag-reference-loading", false);
48193 _body.classed("expanded", true).transition().duration(200).style("max-height", "200px").style("opacity", "1");
48195 _button.selectAll("svg.icon use").each(function() {
48196 var iconUse = select_default2(this);
48197 if (iconUse.attr("href") === "#iD-icon-info") {
48198 iconUse.attr("href", "#iD-icon-info-filled");
48203 _body.transition().duration(200).style("max-height", "0px").style("opacity", "0").on("end", function() {
48204 _body.classed("expanded", false);
48207 _button.selectAll("svg.icon use").each(function() {
48208 var iconUse = select_default2(this);
48209 if (iconUse.attr("href") === "#iD-icon-info-filled") {
48210 iconUse.attr("href", "#iD-icon-info");
48214 tagReference.button = function(selection2, klass, iconName) {
48215 _button = selection2.selectAll(".tag-reference-button").data([0]);
48216 _button = _button.enter().append("button").attr("class", "tag-reference-button " + (klass || "")).attr("title", _t("icons.information")).call(svgIcon("#iD-icon-" + (iconName || "inspect"))).merge(_button);
48217 _button.on("click", function(d3_event) {
48218 d3_event.stopPropagation();
48219 d3_event.preventDefault();
48223 } else if (_loaded) {
48230 tagReference.body = function(selection2) {
48231 var itemID = what.qid || what.key + "-" + (what.value || "");
48232 _body = selection2.selectAll(".tag-reference-body").data([itemID], function(d4) {
48235 _body.exit().remove();
48236 _body = _body.enter().append("div").attr("class", "tag-reference-body").style("max-height", "0").style("opacity", "0").merge(_body);
48237 if (_showing === false) {
48241 tagReference.showing = function(val) {
48242 if (!arguments.length) return _showing;
48244 return tagReference;
48246 return tagReference;
48248 var init_tag_reference = __esm({
48249 "modules/ui/tag_reference.js"() {
48258 // modules/ui/sections/raw_tag_editor.js
48259 var raw_tag_editor_exports = {};
48260 __export(raw_tag_editor_exports, {
48261 uiSectionRawTagEditor: () => uiSectionRawTagEditor
48263 function uiSectionRawTagEditor(id2, context) {
48264 var section = uiSection(id2, context).classes("raw-tag-editor").label(function() {
48265 var count = Object.keys(_tags).filter(function(d4) {
48268 return _t.append("inspector.title_count", { title: _t("inspector.tags"), count });
48269 }).expandedByDefault(false).disclosureContent(renderDisclosureContent);
48270 var taginfo = services.taginfo;
48271 var dispatch14 = dispatch_default("change");
48272 var availableViews = [
48273 { id: "list", icon: "#fas-th-list" },
48274 { id: "text", icon: "#fas-i-cursor" }
48276 let _discardTags = {};
48277 _mainFileFetcher.get("discarded").then((d4) => {
48281 var _tagView = corePreferences("raw-tag-editor-view") || "list";
48282 var _readOnlyTags = [];
48283 var _orderedKeys = [];
48284 var _pendingChange = null;
48289 var _didInteract = false;
48290 function interacted() {
48291 _didInteract = true;
48293 function renderDisclosureContent(wrap2) {
48294 _orderedKeys = _orderedKeys.filter(function(key) {
48295 return _tags[key] !== void 0;
48297 var all = Object.keys(_tags).sort();
48298 var missingKeys = utilArrayDifference(all, _orderedKeys);
48299 for (var i3 in missingKeys) {
48300 _orderedKeys.push(missingKeys[i3]);
48302 var rowData = _orderedKeys.map(function(key, i4) {
48303 return { index: i4, key, value: _tags[key] };
48305 rowData.push({ index: rowData.length, key: "", value: "" });
48306 var options = wrap2.selectAll(".raw-tag-options").data([0]);
48307 options.exit().remove();
48308 var optionsEnter = options.enter().insert("div", ":first-child").attr("class", "raw-tag-options").attr("role", "tablist");
48309 var optionEnter = optionsEnter.selectAll(".raw-tag-option").data(availableViews, function(d4) {
48312 optionEnter.append("button").attr("class", function(d4) {
48313 return "raw-tag-option raw-tag-option-" + d4.id + (_tagView === d4.id ? " selected" : "");
48314 }).attr("aria-selected", function(d4) {
48315 return _tagView === d4.id;
48316 }).attr("role", "tab").attr("title", function(d4) {
48317 return _t("icons." + d4.id);
48318 }).on("click", function(d3_event, d4) {
48320 corePreferences("raw-tag-editor-view", d4.id);
48321 wrap2.selectAll(".raw-tag-option").classed("selected", function(datum2) {
48322 return datum2 === d4;
48323 }).attr("aria-selected", function(datum2) {
48324 return datum2 === d4;
48326 wrap2.selectAll(".tag-text").classed("hide", d4.id !== "text").each(setTextareaHeight);
48327 wrap2.selectAll(".tag-list, .add-row").classed("hide", d4.id !== "list");
48328 }).each(function(d4) {
48329 select_default2(this).call(svgIcon(d4.icon));
48331 var textData = rowsToText(rowData);
48332 var textarea = wrap2.selectAll(".tag-text").data([0]);
48333 textarea = textarea.enter().append("textarea").attr("class", "tag-text" + (_tagView !== "text" ? " hide" : "")).call(utilNoAuto).attr("placeholder", _t("inspector.key_value")).attr("spellcheck", "false").style("direction", "ltr").merge(textarea);
48334 textarea.call(utilGetSetValue, textData).each(setTextareaHeight).on("input", setTextareaHeight).on("focus", interacted).on("blur", textChanged).on("change", textChanged);
48335 var list = wrap2.selectAll(".tag-list").data([0]);
48336 list = list.enter().append("ul").attr("class", "tag-list" + (_tagView !== "list" ? " hide" : "")).merge(list);
48337 var items = list.selectAll(".tag-row").data(rowData, (d4) => d4.key);
48338 items.exit().each(unbind).remove();
48339 var itemsEnter = items.enter().append("li").attr("class", "tag-row").classed("readonly", isReadOnly);
48340 var innerWrap = itemsEnter.append("div").attr("class", "inner-wrap");
48341 innerWrap.append("div").attr("class", "key-wrap").append("input").property("type", "text").attr("class", "key").call(utilNoAuto).on("focus", interacted).on("blur", keyChange).on("change", keyChange);
48342 innerWrap.append("div").attr("class", "value-wrap").append("input").property("type", "text").attr("dir", "auto").attr("class", "value").call(utilNoAuto).on("focus", interacted).on("blur", valueChange).on("change", valueChange);
48343 innerWrap.append("button").attr("tabindex", -1).attr("class", "form-field-button remove").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
48344 items = items.merge(itemsEnter).sort(function(a2, b3) {
48345 return a2.index - b3.index;
48347 items.classed("add-tag", (d4) => d4.key === "").each(function(d4) {
48348 var row = select_default2(this);
48349 var key = row.select("input.key");
48350 var value = row.select("input.value");
48351 if (_entityIDs && taginfo && _state !== "hover") {
48352 bindTypeahead(key, value);
48354 var referenceOptions = { key: d4.key };
48355 if (typeof d4.value === "string") {
48356 referenceOptions.value = d4.value;
48358 var reference = uiTagReference(referenceOptions, context);
48359 if (_state === "hover") {
48360 reference.showing(false);
48362 row.select(".inner-wrap").call(reference.button).select(".tag-reference-button").attr("tabindex", -1).classed("disabled", (d5) => d5.key === "").attr("disabled", (d5) => d5.key === "" ? "disabled" : null);
48363 row.call(reference.body);
48364 row.select("button.remove");
48366 items.selectAll("input.key").attr("title", function(d4) {
48368 }).attr("placeholder", function(d4) {
48369 return d4.key === "" ? _t("inspector.add_tag") : null;
48370 }).attr("readonly", function(d4) {
48371 return isReadOnly(d4) || null;
48375 (_3, newKey) => _pendingChange === null || isEmpty_default(_pendingChange) || _pendingChange[newKey]
48376 // if there are pending changes: skip untouched tags
48378 items.selectAll("input.value").attr("title", function(d4) {
48379 return Array.isArray(d4.value) ? d4.value.filter(Boolean).join("\n") : d4.value;
48380 }).classed("mixed", function(d4) {
48381 return Array.isArray(d4.value);
48382 }).attr("placeholder", function(d4) {
48383 return Array.isArray(d4.value) ? _t("inspector.multiple_values") : null;
48384 }).attr("readonly", function(d4) {
48385 return isReadOnly(d4) || null;
48386 }).call(utilGetSetValue, (d4) => {
48387 if (_pendingChange !== null && !isEmpty_default(_pendingChange) && !_pendingChange[d4.key]) {
48390 return Array.isArray(d4.value) ? "" : d4.value;
48392 items.selectAll("button.remove").classed("disabled", (d4) => d4.key === "").on(
48393 ("PointerEvent" in window ? "pointer" : "mouse") + "down",
48394 // 'click' fires too late - #5878
48395 (d3_event, d4) => {
48396 if (d3_event.button !== 0) return;
48397 removeTag(d3_event, d4);
48401 function isReadOnly(d4) {
48402 for (var i3 = 0; i3 < _readOnlyTags.length; i3++) {
48403 if (d4.key.match(_readOnlyTags[i3]) !== null) {
48409 function setTextareaHeight() {
48410 if (_tagView !== "text") return;
48411 var selection2 = select_default2(this);
48412 var matches = selection2.node().value.match(/\n/g);
48413 var lineCount = 2 + Number(matches && matches.length);
48414 var lineHeight = 20;
48415 selection2.style("height", lineCount * lineHeight + "px");
48417 function stringify3(s2) {
48418 const stringified = JSON.stringify(s2).slice(1, -1);
48419 if (stringified !== s2) {
48420 return `"${stringified}"`;
48425 function unstringify(s2) {
48426 const isQuoted = s2.length > 1 && s2.charAt(0) === '"' && s2.charAt(s2.length - 1) === '"';
48429 return JSON.parse(s2);
48437 function rowsToText(rows) {
48438 var str = rows.filter(function(row) {
48439 return row.key && row.key.trim() !== "";
48440 }).map(function(row) {
48441 var rawVal = row.value;
48442 if (Array.isArray(rawVal)) rawVal = "*";
48443 var val = rawVal ? stringify3(rawVal) : "";
48444 return stringify3(row.key) + "=" + val;
48446 if (_state !== "hover" && str.length) {
48451 function textChanged() {
48452 var newText = this.value.trim();
48454 newText.split("\n").forEach(function(row) {
48455 var m3 = row.match(/^\s*([^=]+)=(.*)$/);
48457 var k2 = context.cleanTagKey(unstringify(m3[1].trim()));
48458 var v3 = context.cleanTagValue(unstringify(m3[2].trim()));
48462 var tagDiff = utilTagDiff(_tags, newTags);
48463 _pendingChange = _pendingChange || {};
48464 tagDiff.forEach(function(change) {
48465 if (isReadOnly({ key: change.key })) return;
48466 if (change.newVal === "*" && Array.isArray(change.oldVal)) return;
48467 if (change.type === "-") {
48468 _pendingChange[change.key] = void 0;
48469 } else if (change.type === "+") {
48470 _pendingChange[change.key] = change.newVal || "";
48473 if (isEmpty_default(_pendingChange)) {
48474 _pendingChange = null;
48475 section.reRender();
48480 function bindTypeahead(key, value) {
48481 if (isReadOnly(key.datum())) return;
48482 if (Array.isArray(value.datum().value)) {
48483 value.call(uiCombobox(context, "tag-value").minItems(1).fetcher(function(value2, callback) {
48484 var keyString = utilGetSetValue(key);
48485 if (!_tags[keyString]) return;
48486 var data = _tags[keyString].map(function(tagValue) {
48490 title: _t("inspector.empty"),
48491 display: (selection2) => selection2.text("").classed("virtual-option", true).call(_t.append("inspector.empty"))
48503 var geometry = context.graph().geometry(_entityIDs[0]);
48504 key.call(uiCombobox(context, "tag-key").fetcher(function(value2, callback) {
48509 }, function(err, data) {
48511 const filtered = data.filter((d4) => _tags[d4.value] === void 0).filter((d4) => !(d4.value in _discardTags)).filter((d4) => !/_\d$/.test(d4)).filter((d4) => d4.value.toLowerCase().includes(value2.toLowerCase()));
48512 callback(sort(value2, filtered));
48516 value.call(uiCombobox(context, "tag-value").fetcher(function(value2, callback) {
48519 key: utilGetSetValue(key),
48522 }, function(err, data) {
48524 const filtered = data.filter((d4) => d4.value.toLowerCase().includes(value2.toLowerCase()));
48525 callback(sort(value2, filtered));
48528 }).caseSensitive(allowUpperCaseTagValues.test(utilGetSetValue(key))));
48529 function sort(value2, data) {
48530 var sameletter = [];
48532 for (var i3 = 0; i3 < data.length; i3++) {
48533 if (data[i3].value.substring(0, value2.length) === value2) {
48534 sameletter.push(data[i3]);
48536 other.push(data[i3]);
48539 return sameletter.concat(other);
48542 function unbind() {
48543 var row = select_default2(this);
48544 row.selectAll("input.key").call(uiCombobox.off, context);
48545 row.selectAll("input.value").call(uiCombobox.off, context);
48547 function keyChange(d3_event, d4) {
48548 const input = select_default2(this);
48549 if (input.attr("readonly")) return;
48551 if (_pendingChange && _pendingChange.hasOwnProperty(kOld) && _pendingChange[kOld] === void 0) return;
48552 var kNew = context.cleanTagKey(this.value.trim());
48553 if (isReadOnly({ key: kNew })) {
48557 if (kNew !== this.value) {
48558 utilGetSetValue(input, kNew);
48560 if (kNew && kNew !== kOld && _tags[kNew] !== void 0) {
48562 section.selection().selectAll(".tag-list input.value").each(function(d5) {
48563 if (d5.key === kNew) {
48564 var input2 = select_default2(this).node();
48571 _pendingChange = _pendingChange || {};
48573 if (kOld === kNew) return;
48574 _pendingChange[kNew] = _pendingChange[kOld] || { oldKey: kOld };
48575 _pendingChange[kOld] = void 0;
48577 let row = this.parentNode.parentNode;
48578 let inputVal = select_default2(row).selectAll("input.value");
48579 let vNew = context.cleanTagValue(utilGetSetValue(inputVal));
48580 _pendingChange[kNew] = vNew;
48581 utilGetSetValue(inputVal, vNew);
48583 var existingKeyIndex = _orderedKeys.indexOf(kOld);
48584 if (existingKeyIndex !== -1) _orderedKeys[existingKeyIndex] = kNew;
48589 function valueChange(d3_event, d4) {
48590 if (isReadOnly(d4)) return;
48591 if (Array.isArray(d4.value) && !this.value) return;
48592 if (_pendingChange && _pendingChange.hasOwnProperty(d4.key) && _pendingChange[d4.key] === void 0) return;
48593 _pendingChange = _pendingChange || {};
48594 const vNew = context.cleanTagValue(this.value);
48595 if (vNew !== this.value) {
48596 utilGetSetValue(select_default2(this), vNew);
48598 _pendingChange[d4.key] = vNew;
48601 function removeTag(d3_event, d4) {
48602 if (isReadOnly(d4)) return;
48603 _orderedKeys = _orderedKeys.filter(function(key) {
48604 return key !== d4.key;
48606 _pendingChange = _pendingChange || {};
48607 _pendingChange[d4.key] = void 0;
48610 function scheduleChange() {
48611 if (!_pendingChange) return;
48612 for (const key in _pendingChange) {
48613 _tags[key] = _pendingChange[key];
48615 dispatch14.call("change", this, _entityIDs, _pendingChange);
48616 _pendingChange = null;
48618 section.state = function(val) {
48619 if (!arguments.length) return _state;
48620 if (_state !== val) {
48626 section.presets = function(val) {
48627 if (!arguments.length) return _presets;
48629 if (_presets && _presets.length && _presets[0].isFallback()) {
48630 section.disclosureExpanded(true);
48631 } else if (!_didInteract) {
48632 section.disclosureExpanded(null);
48636 section.tags = function(val) {
48637 if (!arguments.length) return _tags;
48641 section.entityIDs = function(val) {
48642 if (!arguments.length) return _entityIDs;
48643 if (!_entityIDs || !val || !utilArrayIdentical(_entityIDs, val)) {
48649 section.readOnlyTags = function(val) {
48650 if (!arguments.length) return _readOnlyTags;
48651 _readOnlyTags = val;
48654 return utilRebind(section, dispatch14, "on");
48656 var init_raw_tag_editor = __esm({
48657 "modules/ui/sections/raw_tag_editor.js"() {
48666 init_tag_reference();
48667 init_preferences();
48676 // modules/ui/data_editor.js
48677 var data_editor_exports = {};
48678 __export(data_editor_exports, {
48679 uiDataEditor: () => uiDataEditor
48681 function uiDataEditor(context) {
48682 var dataHeader = uiDataHeader();
48683 var rawTagEditor = uiSectionRawTagEditor("custom-data-tag-editor", context).expandedByDefault(true).readOnlyTags([/./]);
48685 function dataEditor(selection2) {
48686 var header = selection2.selectAll(".header").data([0]);
48687 var headerEnter = header.enter().append("div").attr("class", "header fillL");
48688 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
48689 context.enter(modeBrowse(context));
48690 }).call(svgIcon("#iD-icon-close"));
48691 headerEnter.append("h2").call(_t.append("map_data.title"));
48692 var body = selection2.selectAll(".body").data([0]);
48693 body = body.enter().append("div").attr("class", "body").merge(body);
48694 var editor = body.selectAll(".data-editor").data([0]);
48695 editor.enter().append("div").attr("class", "modal-section data-editor").merge(editor).call(dataHeader.datum(_datum));
48696 var rte = body.selectAll(".raw-tag-editor").data([0]);
48697 rte.enter().append("div").attr("class", "raw-tag-editor data-editor").merge(rte).call(
48698 rawTagEditor.tags(_datum && _datum.properties || {}).state("hover").render
48699 ).selectAll("textarea.tag-text").attr("readonly", true).classed("readonly", true);
48701 dataEditor.datum = function(val) {
48702 if (!arguments.length) return _datum;
48708 var init_data_editor = __esm({
48709 "modules/ui/data_editor.js"() {
48714 init_data_header();
48715 init_raw_tag_editor();
48719 // modules/modes/select_data.js
48720 var select_data_exports = {};
48721 __export(select_data_exports, {
48722 modeSelectData: () => modeSelectData
48724 function modeSelectData(context, selectedDatum) {
48729 var keybinding = utilKeybinding("select-data");
48730 var dataEditor = uiDataEditor(context);
48732 behaviorBreathe(context),
48733 behaviorHover(context),
48734 behaviorSelect(context),
48735 behaviorLasso(context),
48736 modeDragNode(context).behavior,
48737 modeDragNote(context).behavior
48739 function selectData(d3_event, drawn) {
48740 var selection2 = context.surface().selectAll(".layer-mapdata .data" + selectedDatum.__featurehash__);
48741 if (selection2.empty()) {
48742 var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
48743 if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
48744 context.enter(modeBrowse(context));
48747 selection2.classed("selected", true);
48751 if (context.container().select(".combobox").size()) return;
48752 context.enter(modeBrowse(context));
48754 mode.zoomToSelected = function() {
48755 var extent = geoExtent(bounds_default(selectedDatum));
48756 context.map().centerZoomEase(extent.center(), context.map().trimmedExtentZoom(extent));
48758 mode.enter = function() {
48759 behaviors.forEach(context.install);
48760 keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
48761 select_default2(document).call(keybinding);
48763 var sidebar = context.ui().sidebar;
48764 sidebar.show(dataEditor.datum(selectedDatum));
48765 var extent = geoExtent(bounds_default(selectedDatum));
48766 sidebar.expand(sidebar.intersects(extent));
48767 context.map().on("drawn.select-data", selectData);
48769 mode.exit = function() {
48770 behaviors.forEach(context.uninstall);
48771 select_default2(document).call(keybinding.unbind);
48772 context.surface().selectAll(".layer-mapdata .selected").classed("selected hover", false);
48773 context.map().on("drawn.select-data", null);
48774 context.ui().sidebar.hide();
48778 var init_select_data = __esm({
48779 "modules/modes/select_data.js"() {
48792 init_data_editor();
48797 // modules/ui/keepRight_details.js
48798 var keepRight_details_exports = {};
48799 __export(keepRight_details_exports, {
48800 uiKeepRightDetails: () => uiKeepRightDetails
48802 function uiKeepRightDetails(context) {
48804 function issueDetail(d4) {
48805 const { itemType, parentIssueType } = d4;
48806 const unknown = { html: _t.html("inspector.unknown") };
48807 let replacements = d4.replacements || {};
48808 replacements.default = unknown;
48809 if (_mainLocalizer.hasTextForStringId(`QA.keepRight.errorTypes.${itemType}.title`)) {
48810 return _t.html(`QA.keepRight.errorTypes.${itemType}.description`, replacements);
48812 return _t.html(`QA.keepRight.errorTypes.${parentIssueType}.description`, replacements);
48815 function keepRightDetails(selection2) {
48816 const details = selection2.selectAll(".error-details").data(
48817 _qaItem ? [_qaItem] : [],
48818 (d4) => `${d4.id}-${d4.status || 0}`
48820 details.exit().remove();
48821 const detailsEnter = details.enter().append("div").attr("class", "error-details qa-details-container");
48822 const descriptionEnter = detailsEnter.append("div").attr("class", "qa-details-subsection");
48823 descriptionEnter.append("h4").call(_t.append("QA.keepRight.detail_description"));
48824 descriptionEnter.append("div").attr("class", "qa-details-description-text").html(issueDetail);
48825 let relatedEntities = [];
48826 descriptionEnter.selectAll(".error_entity_link, .error_object_link").attr("href", "#").each(function() {
48827 const link2 = select_default2(this);
48828 const isObjectLink = link2.classed("error_object_link");
48829 const entityID = isObjectLink ? utilEntityRoot(_qaItem.objectType) + _qaItem.objectId : this.textContent;
48830 const entity = context.hasEntity(entityID);
48831 relatedEntities.push(entityID);
48832 link2.on("mouseenter", () => {
48833 utilHighlightEntities([entityID], true, context);
48834 }).on("mouseleave", () => {
48835 utilHighlightEntities([entityID], false, context);
48836 }).on("click", (d3_event) => {
48837 d3_event.preventDefault();
48838 utilHighlightEntities([entityID], false, context);
48839 const osmlayer = context.layers().layer("osm");
48840 if (!osmlayer.enabled()) {
48841 osmlayer.enabled(true);
48843 context.map().centerZoomEase(_qaItem.loc, 20);
48845 context.enter(modeSelect(context, [entityID]));
48847 context.loadEntity(entityID, (err, result) => {
48849 const entity2 = result.data.find((e3) => e3.id === entityID);
48850 if (entity2) context.enter(modeSelect(context, [entityID]));
48855 let name = utilDisplayName(entity);
48856 if (!name && !isObjectLink) {
48857 const preset = _mainPresetIndex.match(entity, context.graph());
48858 name = preset && !preset.isFallback() && preset.name();
48861 this.innerText = name;
48865 context.features().forceVisible(relatedEntities);
48866 context.map().pan([0, 0]);
48868 keepRightDetails.issue = function(val) {
48869 if (!arguments.length) return _qaItem;
48871 return keepRightDetails;
48873 return keepRightDetails;
48875 var init_keepRight_details = __esm({
48876 "modules/ui/keepRight_details.js"() {
48886 // modules/ui/keepRight_header.js
48887 var keepRight_header_exports = {};
48888 __export(keepRight_header_exports, {
48889 uiKeepRightHeader: () => uiKeepRightHeader
48891 function uiKeepRightHeader() {
48893 function issueTitle(d4) {
48894 const { itemType, parentIssueType } = d4;
48895 const unknown = _t.html("inspector.unknown");
48896 let replacements = d4.replacements || {};
48897 replacements.default = { html: unknown };
48898 if (_mainLocalizer.hasTextForStringId(`QA.keepRight.errorTypes.${itemType}.title`)) {
48899 return _t.html(`QA.keepRight.errorTypes.${itemType}.title`, replacements);
48901 return _t.html(`QA.keepRight.errorTypes.${parentIssueType}.title`, replacements);
48904 function keepRightHeader(selection2) {
48905 const header = selection2.selectAll(".qa-header").data(
48906 _qaItem ? [_qaItem] : [],
48907 (d4) => `${d4.id}-${d4.status || 0}`
48909 header.exit().remove();
48910 const headerEnter = header.enter().append("div").attr("class", "qa-header");
48911 const iconEnter = headerEnter.append("div").attr("class", "qa-header-icon").classed("new", (d4) => d4.id < 0);
48912 iconEnter.append("div").attr("class", (d4) => `preset-icon-28 qaItem ${d4.service} itemId-${d4.id} itemType-${d4.parentIssueType}`).call(svgIcon("#iD-icon-bolt", "qaItem-fill"));
48913 headerEnter.append("div").attr("class", "qa-header-label").html(issueTitle);
48915 keepRightHeader.issue = function(val) {
48916 if (!arguments.length) return _qaItem;
48918 return keepRightHeader;
48920 return keepRightHeader;
48922 var init_keepRight_header = __esm({
48923 "modules/ui/keepRight_header.js"() {
48930 // modules/ui/view_on_keepRight.js
48931 var view_on_keepRight_exports = {};
48932 __export(view_on_keepRight_exports, {
48933 uiViewOnKeepRight: () => uiViewOnKeepRight
48935 function uiViewOnKeepRight() {
48937 function viewOnKeepRight(selection2) {
48939 if (services.keepRight && _qaItem instanceof QAItem) {
48940 url = services.keepRight.issueURL(_qaItem);
48942 const link2 = selection2.selectAll(".view-on-keepRight").data(url ? [url] : []);
48943 link2.exit().remove();
48944 const linkEnter = link2.enter().append("a").attr("class", "view-on-keepRight").attr("target", "_blank").attr("rel", "noopener").attr("href", (d4) => d4).call(svgIcon("#iD-icon-out-link", "inline"));
48945 linkEnter.append("span").call(_t.append("inspector.view_on_keepRight"));
48947 viewOnKeepRight.what = function(val) {
48948 if (!arguments.length) return _qaItem;
48950 return viewOnKeepRight;
48952 return viewOnKeepRight;
48954 var init_view_on_keepRight = __esm({
48955 "modules/ui/view_on_keepRight.js"() {
48964 // modules/ui/keepRight_editor.js
48965 var keepRight_editor_exports = {};
48966 __export(keepRight_editor_exports, {
48967 uiKeepRightEditor: () => uiKeepRightEditor
48969 function uiKeepRightEditor(context) {
48970 const dispatch14 = dispatch_default("change");
48971 const qaDetails = uiKeepRightDetails(context);
48972 const qaHeader = uiKeepRightHeader(context);
48974 function keepRightEditor(selection2) {
48975 const headerEnter = selection2.selectAll(".header").data([0]).enter().append("div").attr("class", "header fillL");
48976 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => context.enter(modeBrowse(context))).call(svgIcon("#iD-icon-close"));
48977 headerEnter.append("h2").call(_t.append("QA.keepRight.title"));
48978 let body = selection2.selectAll(".body").data([0]);
48979 body = body.enter().append("div").attr("class", "body").merge(body);
48980 const editor = body.selectAll(".qa-editor").data([0]);
48981 editor.enter().append("div").attr("class", "modal-section qa-editor").merge(editor).call(qaHeader.issue(_qaItem)).call(qaDetails.issue(_qaItem)).call(keepRightSaveSection);
48982 const footer = selection2.selectAll(".footer").data([0]);
48983 footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnKeepRight(context).what(_qaItem));
48985 function keepRightSaveSection(selection2) {
48986 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
48987 const isShown = _qaItem && (isSelected || _qaItem.newComment || _qaItem.comment);
48988 let saveSection = selection2.selectAll(".qa-save").data(
48989 isShown ? [_qaItem] : [],
48990 (d4) => `${d4.id}-${d4.status || 0}`
48992 saveSection.exit().remove();
48993 const saveSectionEnter = saveSection.enter().append("div").attr("class", "qa-save save-section cf");
48994 saveSectionEnter.append("h4").attr("class", ".qa-save-header").call(_t.append("QA.keepRight.comment"));
48995 saveSectionEnter.append("textarea").attr("class", "new-comment-input").attr("placeholder", _t("QA.keepRight.comment_placeholder")).attr("maxlength", 1e3).property("value", (d4) => d4.newComment || d4.comment).call(utilNoAuto).on("input", changeInput).on("blur", changeInput);
48996 saveSection = saveSectionEnter.merge(saveSection).call(qaSaveButtons);
48997 function changeInput() {
48998 const input = select_default2(this);
48999 let val = input.property("value").trim();
49000 if (val === _qaItem.comment) {
49003 _qaItem = _qaItem.update({ newComment: val });
49004 const qaService = services.keepRight;
49006 qaService.replaceItem(_qaItem);
49008 saveSection.call(qaSaveButtons);
49011 function qaSaveButtons(selection2) {
49012 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
49013 let buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_qaItem] : [], (d4) => d4.status + d4.id);
49014 buttonSection.exit().remove();
49015 const buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
49016 buttonEnter.append("button").attr("class", "button comment-button action").call(_t.append("QA.keepRight.save_comment"));
49017 buttonEnter.append("button").attr("class", "button close-button action");
49018 buttonEnter.append("button").attr("class", "button ignore-button action");
49019 buttonSection = buttonSection.merge(buttonEnter);
49020 buttonSection.select(".comment-button").attr("disabled", (d4) => d4.newComment ? null : true).on("click.comment", function(d3_event, d4) {
49022 const qaService = services.keepRight;
49024 qaService.postUpdate(d4, (err, item) => dispatch14.call("change", item));
49027 buttonSection.select(".close-button").html((d4) => {
49028 const andComment = d4.newComment ? "_comment" : "";
49029 return _t.html(`QA.keepRight.close${andComment}`);
49030 }).on("click.close", function(d3_event, d4) {
49032 const qaService = services.keepRight;
49034 d4.newStatus = "ignore_t";
49035 qaService.postUpdate(d4, (err, item) => dispatch14.call("change", item));
49038 buttonSection.select(".ignore-button").html((d4) => {
49039 const andComment = d4.newComment ? "_comment" : "";
49040 return _t.html(`QA.keepRight.ignore${andComment}`);
49041 }).on("click.ignore", function(d3_event, d4) {
49043 const qaService = services.keepRight;
49045 d4.newStatus = "ignore";
49046 qaService.postUpdate(d4, (err, item) => dispatch14.call("change", item));
49050 keepRightEditor.error = function(val) {
49051 if (!arguments.length) return _qaItem;
49053 return keepRightEditor;
49055 return utilRebind(keepRightEditor, dispatch14, "on");
49057 var init_keepRight_editor = __esm({
49058 "modules/ui/keepRight_editor.js"() {
49066 init_keepRight_details();
49067 init_keepRight_header();
49068 init_view_on_keepRight();
49073 // modules/ui/osmose_details.js
49074 var osmose_details_exports = {};
49075 __export(osmose_details_exports, {
49076 uiOsmoseDetails: () => uiOsmoseDetails
49078 function uiOsmoseDetails(context) {
49080 function issueString(d4, type2) {
49081 if (!d4) return "";
49082 const s2 = services.osmose.getStrings(d4.itemType);
49083 return type2 in s2 ? s2[type2] : "";
49085 function osmoseDetails(selection2) {
49086 const details = selection2.selectAll(".error-details").data(
49087 _qaItem ? [_qaItem] : [],
49088 (d4) => `${d4.id}-${d4.status || 0}`
49090 details.exit().remove();
49091 const detailsEnter = details.enter().append("div").attr("class", "error-details qa-details-container");
49092 if (issueString(_qaItem, "detail")) {
49093 const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
49094 div.append("h4").call(_t.append("QA.keepRight.detail_description"));
49095 div.append("p").attr("class", "qa-details-description-text").html((d4) => issueString(d4, "detail")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
49097 const detailsDiv = detailsEnter.append("div").attr("class", "qa-details-subsection");
49098 const elemsDiv = detailsEnter.append("div").attr("class", "qa-details-subsection");
49099 if (issueString(_qaItem, "fix")) {
49100 const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
49101 div.append("h4").call(_t.append("QA.osmose.fix_title"));
49102 div.append("p").html((d4) => issueString(d4, "fix")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
49104 if (issueString(_qaItem, "trap")) {
49105 const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
49106 div.append("h4").call(_t.append("QA.osmose.trap_title"));
49107 div.append("p").html((d4) => issueString(d4, "trap")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
49109 const thisItem = _qaItem;
49110 services.osmose.loadIssueDetail(_qaItem).then((d4) => {
49111 if (!d4.elems || d4.elems.length === 0) return;
49112 if (context.selectedErrorID() !== thisItem.id && context.container().selectAll(`.qaItem.osmose.hover.itemId-${thisItem.id}`).empty()) return;
49114 detailsDiv.append("h4").call(_t.append("QA.osmose.detail_title"));
49115 detailsDiv.append("p").html((d5) => d5.detail).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
49117 elemsDiv.append("h4").call(_t.append("QA.osmose.elems_title"));
49118 elemsDiv.append("ul").selectAll("li").data(d4.elems).enter().append("li").append("a").attr("href", "#").attr("class", "error_entity_link").text((d5) => d5).each(function() {
49119 const link2 = select_default2(this);
49120 const entityID = this.textContent;
49121 const entity = context.hasEntity(entityID);
49122 link2.on("mouseenter", () => {
49123 utilHighlightEntities([entityID], true, context);
49124 }).on("mouseleave", () => {
49125 utilHighlightEntities([entityID], false, context);
49126 }).on("click", (d3_event) => {
49127 d3_event.preventDefault();
49128 utilHighlightEntities([entityID], false, context);
49129 const osmlayer = context.layers().layer("osm");
49130 if (!osmlayer.enabled()) {
49131 osmlayer.enabled(true);
49133 context.map().centerZoom(d4.loc, 20);
49135 context.enter(modeSelect(context, [entityID]));
49137 context.loadEntity(entityID, (err, result) => {
49139 const entity2 = result.data.find((e3) => e3.id === entityID);
49140 if (entity2) context.enter(modeSelect(context, [entityID]));
49145 let name = utilDisplayName(entity);
49147 const preset = _mainPresetIndex.match(entity, context.graph());
49148 name = preset && !preset.isFallback() && preset.name();
49151 this.innerText = name;
49155 context.features().forceVisible(d4.elems);
49156 context.map().pan([0, 0]);
49157 }).catch((err) => {
49161 osmoseDetails.issue = function(val) {
49162 if (!arguments.length) return _qaItem;
49164 return osmoseDetails;
49166 return osmoseDetails;
49168 var init_osmose_details = __esm({
49169 "modules/ui/osmose_details.js"() {
49180 // modules/ui/osmose_header.js
49181 var osmose_header_exports = {};
49182 __export(osmose_header_exports, {
49183 uiOsmoseHeader: () => uiOsmoseHeader
49185 function uiOsmoseHeader() {
49187 function issueTitle(d4) {
49188 const unknown = _t("inspector.unknown");
49189 if (!d4) return unknown;
49190 const s2 = services.osmose.getStrings(d4.itemType);
49191 return "title" in s2 ? s2.title : unknown;
49193 function osmoseHeader(selection2) {
49194 const header = selection2.selectAll(".qa-header").data(
49195 _qaItem ? [_qaItem] : [],
49196 (d4) => `${d4.id}-${d4.status || 0}`
49198 header.exit().remove();
49199 const headerEnter = header.enter().append("div").attr("class", "qa-header");
49200 const svgEnter = headerEnter.append("div").attr("class", "qa-header-icon").classed("new", (d4) => d4.id < 0).append("svg").attr("width", "20px").attr("height", "30px").attr("viewbox", "0 0 20 30").attr("class", (d4) => `preset-icon-28 qaItem ${d4.service} itemId-${d4.id} itemType-${d4.itemType}`);
49201 svgEnter.append("polygon").attr("fill", (d4) => services.osmose.getColor(d4.item)).attr("class", "qaItem-fill").attr("points", "16,3 4,3 1,6 1,17 4,20 7,20 10,27 13,20 16,20 19,17.033 19,6");
49202 svgEnter.append("use").attr("class", "icon-annotation").attr("width", "12px").attr("height", "12px").attr("transform", "translate(4, 5.5)").attr("xlink:href", (d4) => d4.icon ? "#" + d4.icon : "");
49203 headerEnter.append("div").attr("class", "qa-header-label").text(issueTitle);
49205 osmoseHeader.issue = function(val) {
49206 if (!arguments.length) return _qaItem;
49208 return osmoseHeader;
49210 return osmoseHeader;
49212 var init_osmose_header = __esm({
49213 "modules/ui/osmose_header.js"() {
49220 // modules/ui/view_on_osmose.js
49221 var view_on_osmose_exports = {};
49222 __export(view_on_osmose_exports, {
49223 uiViewOnOsmose: () => uiViewOnOsmose
49225 function uiViewOnOsmose() {
49227 function viewOnOsmose(selection2) {
49229 if (services.osmose && _qaItem instanceof QAItem) {
49230 url = services.osmose.itemURL(_qaItem);
49232 const link2 = selection2.selectAll(".view-on-osmose").data(url ? [url] : []);
49233 link2.exit().remove();
49234 const linkEnter = link2.enter().append("a").attr("class", "view-on-osmose").attr("target", "_blank").attr("rel", "noopener").attr("href", (d4) => d4).call(svgIcon("#iD-icon-out-link", "inline"));
49235 linkEnter.append("span").call(_t.append("inspector.view_on_osmose"));
49237 viewOnOsmose.what = function(val) {
49238 if (!arguments.length) return _qaItem;
49240 return viewOnOsmose;
49242 return viewOnOsmose;
49244 var init_view_on_osmose = __esm({
49245 "modules/ui/view_on_osmose.js"() {
49254 // modules/ui/osmose_editor.js
49255 var osmose_editor_exports = {};
49256 __export(osmose_editor_exports, {
49257 uiOsmoseEditor: () => uiOsmoseEditor
49259 function uiOsmoseEditor(context) {
49260 const dispatch14 = dispatch_default("change");
49261 const qaDetails = uiOsmoseDetails(context);
49262 const qaHeader = uiOsmoseHeader(context);
49264 function osmoseEditor(selection2) {
49265 const header = selection2.selectAll(".header").data([0]);
49266 const headerEnter = header.enter().append("div").attr("class", "header fillL");
49267 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => context.enter(modeBrowse(context))).call(svgIcon("#iD-icon-close"));
49268 headerEnter.append("h2").call(_t.append("QA.osmose.title"));
49269 let body = selection2.selectAll(".body").data([0]);
49270 body = body.enter().append("div").attr("class", "body").merge(body);
49271 let editor = body.selectAll(".qa-editor").data([0]);
49272 editor.enter().append("div").attr("class", "modal-section qa-editor").merge(editor).call(qaHeader.issue(_qaItem)).call(qaDetails.issue(_qaItem)).call(osmoseSaveSection);
49273 const footer = selection2.selectAll(".footer").data([0]);
49274 footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnOsmose(context).what(_qaItem));
49276 function osmoseSaveSection(selection2) {
49277 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
49278 const isShown = _qaItem && isSelected;
49279 let saveSection = selection2.selectAll(".qa-save").data(
49280 isShown ? [_qaItem] : [],
49281 (d4) => `${d4.id}-${d4.status || 0}`
49283 saveSection.exit().remove();
49284 const saveSectionEnter = saveSection.enter().append("div").attr("class", "qa-save save-section cf");
49285 saveSection = saveSectionEnter.merge(saveSection).call(qaSaveButtons);
49287 function qaSaveButtons(selection2) {
49288 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
49289 let buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_qaItem] : [], (d4) => d4.status + d4.id);
49290 buttonSection.exit().remove();
49291 const buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
49292 buttonEnter.append("button").attr("class", "button close-button action");
49293 buttonEnter.append("button").attr("class", "button ignore-button action");
49294 buttonSection = buttonSection.merge(buttonEnter);
49295 buttonSection.select(".close-button").call(_t.append("QA.keepRight.close")).on("click.close", function(d3_event, d4) {
49297 const qaService = services.osmose;
49299 d4.newStatus = "done";
49300 qaService.postUpdate(d4, (err, item) => dispatch14.call("change", item));
49303 buttonSection.select(".ignore-button").call(_t.append("QA.keepRight.ignore")).on("click.ignore", function(d3_event, d4) {
49305 const qaService = services.osmose;
49307 d4.newStatus = "false";
49308 qaService.postUpdate(d4, (err, item) => dispatch14.call("change", item));
49312 osmoseEditor.error = function(val) {
49313 if (!arguments.length) return _qaItem;
49315 return osmoseEditor;
49317 return utilRebind(osmoseEditor, dispatch14, "on");
49319 var init_osmose_editor = __esm({
49320 "modules/ui/osmose_editor.js"() {
49327 init_osmose_details();
49328 init_osmose_header();
49329 init_view_on_osmose();
49334 // modules/modes/select_error.js
49335 var select_error_exports = {};
49336 __export(select_error_exports, {
49337 modeSelectError: () => modeSelectError
49339 function modeSelectError(context, selectedErrorID, selectedErrorService) {
49341 id: "select-error",
49344 var keybinding = utilKeybinding("select-error");
49345 var errorService = services[selectedErrorService];
49347 switch (selectedErrorService) {
49349 errorEditor = uiKeepRightEditor(context).on("change", function() {
49350 context.map().pan([0, 0]);
49351 var error = checkSelectedID();
49352 if (!error) return;
49353 context.ui().sidebar.show(errorEditor.error(error));
49357 errorEditor = uiOsmoseEditor(context).on("change", function() {
49358 context.map().pan([0, 0]);
49359 var error = checkSelectedID();
49360 if (!error) return;
49361 context.ui().sidebar.show(errorEditor.error(error));
49366 behaviorBreathe(context),
49367 behaviorHover(context),
49368 behaviorSelect(context),
49369 behaviorLasso(context),
49370 modeDragNode(context).behavior,
49371 modeDragNote(context).behavior
49373 function checkSelectedID() {
49374 if (!errorService) return;
49375 var error = errorService.getError(selectedErrorID);
49377 context.enter(modeBrowse(context));
49381 mode.zoomToSelected = function() {
49382 if (!errorService) return;
49383 var error = errorService.getError(selectedErrorID);
49385 context.map().centerZoomEase(error.loc, 20);
49388 mode.enter = function() {
49389 var error = checkSelectedID();
49390 if (!error) return;
49391 behaviors.forEach(context.install);
49392 keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
49393 select_default2(document).call(keybinding);
49395 var sidebar = context.ui().sidebar;
49396 sidebar.show(errorEditor.error(error));
49397 context.map().on("drawn.select-error", selectError);
49398 function selectError(d3_event, drawn) {
49399 if (!checkSelectedID()) return;
49400 var selection2 = context.surface().selectAll(".itemId-" + selectedErrorID + "." + selectedErrorService);
49401 if (selection2.empty()) {
49402 var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
49403 if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
49404 context.enter(modeBrowse(context));
49407 selection2.classed("selected", true);
49408 context.selectedErrorID(selectedErrorID);
49412 if (context.container().select(".combobox").size()) return;
49413 context.enter(modeBrowse(context));
49416 mode.exit = function() {
49417 behaviors.forEach(context.uninstall);
49418 select_default2(document).call(keybinding.unbind);
49419 context.surface().selectAll(".qaItem.selected").classed("selected hover", false);
49420 context.map().on("drawn.select-error", null);
49421 context.ui().sidebar.hide();
49422 context.selectedErrorID(null);
49423 context.features().forceVisible([]);
49427 var init_select_error = __esm({
49428 "modules/modes/select_error.js"() {
49440 init_keepRight_editor();
49441 init_osmose_editor();
49446 // modules/behavior/select.js
49447 var select_exports = {};
49448 __export(select_exports, {
49449 behaviorSelect: () => behaviorSelect
49451 function behaviorSelect(context) {
49452 var _tolerancePx = 4;
49453 var _lastMouseEvent = null;
49454 var _showMenu = false;
49455 var _downPointers = {};
49456 var _longPressTimeout = null;
49457 var _lastInteractionType = null;
49458 var _multiselectionPointerId = null;
49459 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
49460 function keydown(d3_event) {
49461 if (d3_event.keyCode === 32) {
49462 var activeNode = document.activeElement;
49463 if (activeNode && (/* @__PURE__ */ new Set(["INPUT", "TEXTAREA"])).has(activeNode.nodeName)) return;
49465 if (d3_event.keyCode === 93 || // context menu key
49466 d3_event.keyCode === 32) {
49467 d3_event.preventDefault();
49469 if (d3_event.repeat) return;
49471 if (d3_event.shiftKey) {
49472 context.surface().classed("behavior-multiselect", true);
49474 if (d3_event.keyCode === 32) {
49475 if (!_downPointers.spacebar && _lastMouseEvent) {
49477 _longPressTimeout = window.setTimeout(didLongPress, 500, "spacebar", "spacebar");
49478 _downPointers.spacebar = {
49479 firstEvent: _lastMouseEvent,
49480 lastEvent: _lastMouseEvent
49485 function keyup(d3_event) {
49487 if (!d3_event.shiftKey) {
49488 context.surface().classed("behavior-multiselect", false);
49490 if (d3_event.keyCode === 93) {
49491 d3_event.preventDefault();
49492 _lastInteractionType = "menukey";
49493 contextmenu(d3_event);
49494 } else if (d3_event.keyCode === 32) {
49495 var pointer = _downPointers.spacebar;
49497 delete _downPointers.spacebar;
49498 if (pointer.done) return;
49499 d3_event.preventDefault();
49500 _lastInteractionType = "spacebar";
49501 click(pointer.firstEvent, pointer.lastEvent, "spacebar");
49505 function pointerdown(d3_event) {
49506 var id2 = (d3_event.pointerId || "mouse").toString();
49508 if (d3_event.buttons && d3_event.buttons !== 1) return;
49509 context.ui().closeEditMenu();
49510 if (d3_event.pointerType !== "mouse") {
49511 _longPressTimeout = window.setTimeout(didLongPress, 500, id2, "longdown-" + (d3_event.pointerType || "mouse"));
49513 _downPointers[id2] = {
49514 firstEvent: d3_event,
49515 lastEvent: d3_event
49518 function didLongPress(id2, interactionType) {
49519 var pointer = _downPointers[id2];
49520 if (!pointer) return;
49521 for (var i3 in _downPointers) {
49522 _downPointers[i3].done = true;
49524 _longPressTimeout = null;
49525 _lastInteractionType = interactionType;
49527 click(pointer.firstEvent, pointer.lastEvent, id2);
49529 function pointermove(d3_event) {
49530 var id2 = (d3_event.pointerId || "mouse").toString();
49531 if (_downPointers[id2]) {
49532 _downPointers[id2].lastEvent = d3_event;
49534 if (!d3_event.pointerType || d3_event.pointerType === "mouse") {
49535 _lastMouseEvent = d3_event;
49536 if (_downPointers.spacebar) {
49537 _downPointers.spacebar.lastEvent = d3_event;
49541 function pointerup(d3_event) {
49542 var id2 = (d3_event.pointerId || "mouse").toString();
49543 var pointer = _downPointers[id2];
49544 if (!pointer) return;
49545 delete _downPointers[id2];
49546 if (_multiselectionPointerId === id2) {
49547 _multiselectionPointerId = null;
49549 if (pointer.done) return;
49550 click(pointer.firstEvent, d3_event, id2);
49552 function pointercancel(d3_event) {
49553 var id2 = (d3_event.pointerId || "mouse").toString();
49554 if (!_downPointers[id2]) return;
49555 delete _downPointers[id2];
49556 if (_multiselectionPointerId === id2) {
49557 _multiselectionPointerId = null;
49560 function contextmenu(d3_event) {
49561 d3_event.preventDefault();
49562 if (!+d3_event.clientX && !+d3_event.clientY) {
49563 if (_lastMouseEvent) {
49564 d3_event = _lastMouseEvent;
49569 _lastMouseEvent = d3_event;
49570 if (d3_event.pointerType === "touch" || d3_event.pointerType === "pen" || d3_event.mozInputSource && // firefox doesn't give a pointerType on contextmenu events
49571 (d3_event.mozInputSource === MouseEvent.MOZ_SOURCE_TOUCH || d3_event.mozInputSource === MouseEvent.MOZ_SOURCE_PEN)) {
49572 _lastInteractionType = "touch";
49574 _lastInteractionType = "rightclick";
49578 click(d3_event, d3_event);
49580 function click(firstEvent, lastEvent, pointerId) {
49582 var mapNode = context.container().select(".main-map").node();
49583 var pointGetter = utilFastMouse(mapNode);
49584 var p1 = pointGetter(firstEvent);
49585 var p2 = pointGetter(lastEvent);
49586 var dist = geoVecLength(p1, p2);
49587 if (dist > _tolerancePx || !mapContains(lastEvent)) {
49591 var targetDatum = lastEvent.target.__data__;
49592 if (targetDatum === 0 && lastEvent.target.parentNode.__data__) {
49593 targetDatum = lastEvent.target.parentNode.__data__;
49595 var multiselectEntityId;
49596 if (!_multiselectionPointerId) {
49597 var selectPointerInfo = pointerDownOnSelection(pointerId);
49598 if (selectPointerInfo) {
49599 _multiselectionPointerId = selectPointerInfo.pointerId;
49600 multiselectEntityId = !selectPointerInfo.selected && selectPointerInfo.entityId;
49601 _downPointers[selectPointerInfo.pointerId].done = true;
49604 var isMultiselect = context.mode().id === "select" && // and shift key is down
49605 (lastEvent && lastEvent.shiftKey || // or we're lasso-selecting
49606 context.surface().select(".lasso").node() || // or a pointer is down over a selected feature
49607 _multiselectionPointerId && !multiselectEntityId);
49608 processClick(targetDatum, isMultiselect, p2, multiselectEntityId);
49609 function mapContains(event) {
49610 var rect = mapNode.getBoundingClientRect();
49611 return event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
49613 function pointerDownOnSelection(skipPointerId) {
49614 var mode = context.mode();
49615 var selectedIDs = mode.id === "select" ? mode.selectedIDs() : [];
49616 for (var pointerId2 in _downPointers) {
49617 if (pointerId2 === "spacebar" || pointerId2 === skipPointerId) continue;
49618 var pointerInfo = _downPointers[pointerId2];
49619 var p12 = pointGetter(pointerInfo.firstEvent);
49620 var p22 = pointGetter(pointerInfo.lastEvent);
49621 if (geoVecLength(p12, p22) > _tolerancePx) continue;
49622 var datum2 = pointerInfo.firstEvent.target.__data__;
49623 var entity = datum2 && datum2.properties && datum2.properties.entity || datum2;
49624 if (context.graph().hasEntity(entity.id)) {
49626 pointerId: pointerId2,
49627 entityId: entity.id,
49628 selected: selectedIDs.indexOf(entity.id) !== -1
49635 function processClick(datum2, isMultiselect, point, alsoSelectId) {
49636 var mode = context.mode();
49637 var showMenu = _showMenu;
49638 var interactionType = _lastInteractionType;
49639 var entity = datum2 && datum2.properties && datum2.properties.entity;
49640 if (entity) datum2 = entity;
49641 if (datum2 && datum2.type === "midpoint") {
49642 datum2 = datum2.parents[0];
49645 if (datum2 instanceof osmEntity) {
49646 var selectedIDs = context.selectedIDs();
49647 context.selectedNoteID(null);
49648 context.selectedErrorID(null);
49649 if (!isMultiselect) {
49650 if (!showMenu || selectedIDs.length <= 1 || selectedIDs.indexOf(datum2.id) === -1) {
49651 if (alsoSelectId === datum2.id) alsoSelectId = null;
49652 selectedIDs = (alsoSelectId ? [alsoSelectId] : []).concat([datum2.id]);
49653 newMode = mode.id === "select" ? mode.selectedIDs(selectedIDs) : modeSelect(context, selectedIDs).selectBehavior(behavior);
49654 context.enter(newMode);
49657 if (selectedIDs.indexOf(datum2.id) !== -1) {
49659 selectedIDs = selectedIDs.filter(function(id2) {
49660 return id2 !== datum2.id;
49662 newMode = selectedIDs.length ? mode.selectedIDs(selectedIDs) : modeBrowse(context).selectBehavior(behavior);
49663 context.enter(newMode);
49666 selectedIDs = selectedIDs.concat([datum2.id]);
49667 newMode = mode.selectedIDs(selectedIDs);
49668 context.enter(newMode);
49671 } else if (datum2 && datum2.__featurehash__ && !isMultiselect) {
49672 context.selectedNoteID(null).enter(modeSelectData(context, datum2));
49673 } else if (datum2 instanceof osmNote && !isMultiselect) {
49674 context.selectedNoteID(datum2.id).enter(modeSelectNote(context, datum2.id));
49675 } else if (datum2 instanceof QAItem && !isMultiselect) {
49676 context.selectedErrorID(datum2.id).enter(modeSelectError(context, datum2.id, datum2.service));
49677 } else if (datum2.service === "photo") {
49679 context.selectedNoteID(null);
49680 context.selectedErrorID(null);
49681 if (!isMultiselect && mode.id !== "browse") {
49682 context.enter(modeBrowse(context));
49685 context.ui().closeEditMenu();
49686 if (showMenu) context.ui().showEditMenu(point, interactionType);
49689 function cancelLongPress() {
49690 if (_longPressTimeout) window.clearTimeout(_longPressTimeout);
49691 _longPressTimeout = null;
49693 function resetProperties() {
49696 _lastInteractionType = null;
49698 function behavior(selection2) {
49700 _lastMouseEvent = context.map().lastPointerEvent();
49701 select_default2(window).on("keydown.select", keydown).on("keyup.select", keyup).on(_pointerPrefix + "move.select", pointermove, true).on(_pointerPrefix + "up.select", pointerup, true).on("pointercancel.select", pointercancel, true).on("contextmenu.select-window", function(d3_event) {
49703 if (+e3.clientX === 0 && +e3.clientY === 0) {
49704 d3_event.preventDefault();
49707 selection2.on(_pointerPrefix + "down.select", pointerdown).on("contextmenu.select", contextmenu);
49709 behavior.off = function(selection2) {
49711 select_default2(window).on("keydown.select", null).on("keyup.select", null).on("contextmenu.select-window", null).on(_pointerPrefix + "move.select", null, true).on(_pointerPrefix + "up.select", null, true).on("pointercancel.select", null, true);
49712 selection2.on(_pointerPrefix + "down.select", null).on("contextmenu.select", null);
49713 context.surface().classed("behavior-multiselect", false);
49717 var init_select4 = __esm({
49718 "modules/behavior/select.js"() {
49724 init_select_data();
49725 init_select_note();
49726 init_select_error();
49732 // modules/ui/note_comments.js
49733 var note_comments_exports = {};
49734 __export(note_comments_exports, {
49735 uiNoteComments: () => uiNoteComments
49737 function uiNoteComments() {
49739 function noteComments(selection2) {
49740 if (_note.isNew()) return;
49741 var comments = selection2.selectAll(".comments-container").data([0]);
49742 comments = comments.enter().append("div").attr("class", "comments-container").merge(comments);
49743 var commentEnter = comments.selectAll(".comment").data(_note.comments).enter().append("div").attr("class", "comment");
49744 commentEnter.append("div").attr("class", function(d4) {
49745 return "comment-avatar user-" + d4.uid;
49746 }).call(svgIcon("#iD-icon-avatar", "comment-avatar-icon"));
49747 var mainEnter = commentEnter.append("div").attr("class", "comment-main");
49748 var metadataEnter = mainEnter.append("div").attr("class", "comment-metadata");
49749 metadataEnter.append("div").attr("class", "comment-author").each(function(d4) {
49750 var selection3 = select_default2(this);
49751 var osm = services.osm;
49752 if (osm && d4.user) {
49753 selection3 = selection3.append("a").attr("class", "comment-author-link").attr("href", osm.userURL(d4.user)).attr("target", "_blank");
49756 selection3.text(d4.user);
49758 selection3.call(_t.append("note.anonymous"));
49761 metadataEnter.append("div").attr("class", "comment-date").html(function(d4) {
49762 return _t.html("note.status." + d4.action, { when: localeDateString2(d4.date) });
49764 mainEnter.append("div").attr("class", "comment-text").html(function(d4) {
49766 }).selectAll("a").attr("rel", "noopener nofollow").attr("target", "_blank");
49767 comments.call(replaceAvatars);
49769 function replaceAvatars(selection2) {
49770 var showThirdPartyIcons = corePreferences("preferences.privacy.thirdpartyicons") || "true";
49771 var osm = services.osm;
49772 if (showThirdPartyIcons !== "true" || !osm) return;
49774 _note.comments.forEach(function(d4) {
49775 if (d4.uid) uids[d4.uid] = true;
49777 Object.keys(uids).forEach(function(uid) {
49778 osm.loadUser(uid, function(err, user) {
49779 if (!user || !user.image_url) return;
49780 selection2.selectAll(".comment-avatar.user-" + uid).html("").append("img").attr("class", "icon comment-avatar-icon").attr("src", user.image_url).attr("alt", user.display_name);
49784 function localeDateString2(s2) {
49785 if (!s2) return null;
49786 var options = { day: "numeric", month: "short", year: "numeric" };
49787 s2 = s2.replace(/-/g, "/");
49788 var d4 = new Date(s2);
49789 if (isNaN(d4.getTime())) return null;
49790 return d4.toLocaleDateString(_mainLocalizer.localeCode(), options);
49792 noteComments.note = function(val) {
49793 if (!arguments.length) return _note;
49795 return noteComments;
49797 return noteComments;
49799 var init_note_comments = __esm({
49800 "modules/ui/note_comments.js"() {
49803 init_preferences();
49810 // modules/ui/note_header.js
49811 var note_header_exports = {};
49812 __export(note_header_exports, {
49813 uiNoteHeader: () => uiNoteHeader
49815 function uiNoteHeader() {
49817 function noteHeader(selection2) {
49818 var header = selection2.selectAll(".note-header").data(
49819 _note ? [_note] : [],
49821 return d4.status + d4.id;
49824 header.exit().remove();
49825 var headerEnter = header.enter().append("div").attr("class", "note-header");
49826 var iconEnter = headerEnter.append("div").attr("class", function(d4) {
49827 return "note-header-icon " + d4.status;
49828 }).classed("new", function(d4) {
49831 iconEnter.append("div").attr("class", "preset-icon-28").call(svgIcon("#iD-icon-note", "note-fill"));
49832 iconEnter.each(function(d4) {
49835 statusIcon = "#iD-icon-plus";
49836 } else if (d4.status === "open") {
49837 statusIcon = "#iD-icon-close";
49839 statusIcon = "#iD-icon-apply";
49841 iconEnter.append("div").attr("class", "note-icon-annotation").attr("title", _t("icons.close")).call(svgIcon(statusIcon, "icon-annotation"));
49843 headerEnter.append("div").attr("class", "note-header-label").html(function(d4) {
49844 if (_note.isNew()) {
49845 return _t.html("note.new");
49847 return _t.html("note.note") + " " + d4.id + " " + (d4.status === "closed" ? _t.html("note.closed") : "");
49850 noteHeader.note = function(val) {
49851 if (!arguments.length) return _note;
49857 var init_note_header = __esm({
49858 "modules/ui/note_header.js"() {
49865 // modules/ui/note_report.js
49866 var note_report_exports = {};
49867 __export(note_report_exports, {
49868 uiNoteReport: () => uiNoteReport
49870 function uiNoteReport() {
49872 function noteReport(selection2) {
49874 if (services.osm && _note instanceof osmNote && !_note.isNew()) {
49875 url = services.osm.noteReportURL(_note);
49877 var link2 = selection2.selectAll(".note-report").data(url ? [url] : []);
49878 link2.exit().remove();
49879 var linkEnter = link2.enter().append("a").attr("class", "note-report").attr("target", "_blank").attr("href", function(d4) {
49881 }).call(svgIcon("#iD-icon-out-link", "inline"));
49882 linkEnter.append("span").call(_t.append("note.report"));
49884 noteReport.note = function(val) {
49885 if (!arguments.length) return _note;
49891 var init_note_report = __esm({
49892 "modules/ui/note_report.js"() {
49901 // modules/util/date.ts
49902 var date_exports = {};
49903 __export(date_exports, {
49904 getRelativeDate: () => getRelativeDate
49906 function timeSince(date) {
49907 const seconds = Math.floor((+/* @__PURE__ */ new Date() - +date) / 1e3);
49908 const s2 = (n3) => Math.floor(seconds / n3);
49909 if (s2(60 * 60 * 24 * 365) > 1) return [s2(60 * 60 * 24 * 365), "years"];
49910 if (s2(60 * 60 * 24 * 30) > 1) return [s2(60 * 60 * 24 * 30), "months"];
49911 if (s2(60 * 60 * 24) > 1) return [s2(60 * 60 * 24), "days"];
49912 if (s2(60 * 60) > 1) return [s2(60 * 60), "hours"];
49913 if (s2(60) > 1) return [s2(60), "minutes"];
49914 return [s2(1), "seconds"];
49916 function getRelativeDate(date) {
49917 if (typeof Intl === "undefined" || typeof Intl.RelativeTimeFormat === "undefined") {
49918 return `on ${date.toLocaleDateString(preferredLanguage)}`;
49920 const [number3, units] = timeSince(date);
49921 if (!Number.isFinite(number3)) return "-";
49922 return new Intl.RelativeTimeFormat(preferredLanguage).format(-number3, units);
49924 var preferredLanguage;
49925 var init_date2 = __esm({
49926 "modules/util/date.ts"() {
49929 preferredLanguage = utilDetect().browserLocales[0];
49933 // modules/ui/view_on_osm.js
49934 var view_on_osm_exports = {};
49935 __export(view_on_osm_exports, {
49936 uiViewOnOSM: () => uiViewOnOSM
49938 function uiViewOnOSM(context) {
49940 function viewOnOSM(selection2) {
49942 if (_what instanceof osmEntity) {
49943 url = context.connection().entityURL(_what);
49944 } else if (_what instanceof osmNote) {
49945 url = context.connection().noteURL(_what);
49947 var data = !_what || _what.isNew() ? [] : [_what];
49948 var link2 = selection2.selectAll(".view-on-osm").data(data, function(d4) {
49951 link2.exit().remove();
49952 var linkEnter = link2.enter().append("a").attr("class", "view-on-osm").attr("target", "_blank").attr("href", url).call(svgIcon("#iD-icon-out-link", "inline"));
49953 if (_what && !(_what instanceof osmNote)) {
49954 const { user, timestamp } = uiViewOnOSM.findLastModifiedChild(context.history().base(), _what);
49955 linkEnter.append("span").text(_t("inspector.last_modified", {
49956 timeago: getRelativeDate(new Date(timestamp)),
49958 })).attr("title", _t("inspector.view_on_osm"));
49960 linkEnter.append("span").call(_t.append("inspector.view_on_osm"));
49963 viewOnOSM.what = function(_3) {
49964 if (!arguments.length) return _what;
49970 var init_view_on_osm = __esm({
49971 "modules/ui/view_on_osm.js"() {
49977 uiViewOnOSM.findLastModifiedChild = (graph, feature3) => {
49978 let latest = feature3;
49979 function recurseChilds(obj) {
49980 if (obj.timestamp > latest.timestamp) {
49983 if (obj instanceof osmWay) {
49984 obj.nodes.map((id2) => graph.hasEntity(id2)).filter(Boolean).forEach(recurseChilds);
49985 } else if (obj instanceof osmRelation) {
49986 obj.members.map((m3) => graph.hasEntity(m3.id)).filter((e3) => e3 instanceof osmWay || e3 instanceof osmRelation).forEach(recurseChilds);
49989 recurseChilds(feature3);
49995 // modules/ui/note_editor.js
49996 var note_editor_exports = {};
49997 __export(note_editor_exports, {
49998 uiNoteEditor: () => uiNoteEditor
50000 function uiNoteEditor(context) {
50001 var dispatch14 = dispatch_default("change");
50002 var noteComments = uiNoteComments(context);
50003 var noteHeader = uiNoteHeader();
50006 function noteEditor(selection2) {
50007 var header = selection2.selectAll(".header").data([0]);
50008 var headerEnter = header.enter().append("div").attr("class", "header fillL");
50009 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
50010 context.enter(modeBrowse(context));
50011 }).call(svgIcon("#iD-icon-close"));
50012 headerEnter.append("h2").call(_t.append("note.title"));
50013 var body = selection2.selectAll(".body").data([0]);
50014 body = body.enter().append("div").attr("class", "body").merge(body);
50015 var editor = body.selectAll(".note-editor").data([0]);
50016 editor.enter().append("div").attr("class", "modal-section note-editor").merge(editor).call(noteHeader.note(_note)).call(noteComments.note(_note)).call(noteSaveSection);
50017 var footer = selection2.selectAll(".footer").data([0]);
50018 footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnOSM(context).what(_note)).call(uiNoteReport(context).note(_note));
50019 var osm = services.osm;
50021 osm.on("change.note-save", function() {
50022 selection2.call(noteEditor);
50026 function noteSaveSection(selection2) {
50027 var isSelected = _note && _note.id === context.selectedNoteID();
50028 var noteSave = selection2.selectAll(".note-save").data(isSelected ? [_note] : [], function(d4) {
50029 return d4.status + d4.id;
50031 noteSave.exit().remove();
50032 var noteSaveEnter = noteSave.enter().append("div").attr("class", "note-save save-section cf");
50033 noteSaveEnter.append("h4").attr("class", ".note-save-header").text("").each(function() {
50034 if (_note.isNew()) {
50035 _t.append("note.newDescription")(select_default2(this));
50037 _t.append("note.newComment")(select_default2(this));
50040 var commentTextarea = noteSaveEnter.append("textarea").attr("class", "new-comment-input").attr("placeholder", _t("note.inputPlaceholder")).attr("maxlength", 1e3).property("value", function(d4) {
50041 return d4.newComment;
50042 }).call(utilNoAuto).on("keydown.note-input", keydown).on("input.note-input", changeInput).on("blur.note-input", changeInput);
50043 if (!commentTextarea.empty() && _newNote) {
50044 commentTextarea.node().focus();
50046 noteSave = noteSaveEnter.merge(noteSave).call(userDetails).call(noteSaveButtons);
50047 function keydown(d3_event) {
50048 if (!(d3_event.keyCode === 13 && // ↩ Return
50049 d3_event.metaKey)) return;
50050 var osm = services.osm;
50052 var hasAuth = osm.authenticated();
50053 if (!hasAuth) return;
50054 if (!_note.newComment) return;
50055 d3_event.preventDefault();
50056 select_default2(this).on("keydown.note-input", null);
50057 window.setTimeout(function() {
50058 if (_note.isNew()) {
50059 noteSave.selectAll(".save-button").node().focus();
50062 noteSave.selectAll(".comment-button").node().focus();
50063 clickComment(_note);
50067 function changeInput() {
50068 var input = select_default2(this);
50069 var val = input.property("value").trim() || void 0;
50070 _note = _note.update({ newComment: val });
50071 var osm = services.osm;
50073 osm.replaceNote(_note);
50075 noteSave.call(noteSaveButtons);
50078 function userDetails(selection2) {
50079 var detailSection = selection2.selectAll(".detail-section").data([0]);
50080 detailSection = detailSection.enter().append("div").attr("class", "detail-section").merge(detailSection);
50081 var osm = services.osm;
50083 var hasAuth = osm.authenticated();
50084 var authWarning = detailSection.selectAll(".auth-warning").data(hasAuth ? [] : [0]);
50085 authWarning.exit().transition().duration(200).style("opacity", 0).remove();
50086 var authEnter = authWarning.enter().insert("div", ".tag-reference-body").attr("class", "field-warning auth-warning").style("opacity", 0);
50087 authEnter.call(svgIcon("#iD-icon-alert", "inline"));
50088 authEnter.append("span").call(_t.append("note.login"));
50089 authEnter.append("a").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).append("span").call(_t.append("login")).on("click.note-login", function(d3_event) {
50090 d3_event.preventDefault();
50091 osm.authenticate();
50093 authEnter.transition().duration(200).style("opacity", 1);
50094 var prose = detailSection.selectAll(".note-save-prose").data(hasAuth ? [0] : []);
50095 prose.exit().remove();
50096 prose = prose.enter().append("p").attr("class", "note-save-prose").call(_t.append("note.upload_explanation")).merge(prose);
50097 osm.userDetails(function(err, user) {
50099 var userLink = select_default2(document.createElement("div"));
50100 if (user.image_url) {
50101 userLink.append("img").attr("src", user.image_url).attr("class", "icon pre-text user-icon");
50103 userLink.append("a").attr("class", "user-info").text(user.display_name).attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
50104 prose.html(_t.html("note.upload_explanation_with_user", { user: { html: userLink.html() } }));
50107 function noteSaveButtons(selection2) {
50108 var osm = services.osm;
50109 var hasAuth = osm && osm.authenticated();
50110 var isSelected = _note && _note.id === context.selectedNoteID();
50111 var buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_note] : [], function(d4) {
50112 return d4.status + d4.id;
50114 buttonSection.exit().remove();
50115 var buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
50116 if (_note.isNew()) {
50117 buttonEnter.append("button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
50118 buttonEnter.append("button").attr("class", "button save-button action").call(_t.append("note.save"));
50120 buttonEnter.append("button").attr("class", "button status-button action");
50121 buttonEnter.append("button").attr("class", "button comment-button action").call(_t.append("note.comment"));
50123 buttonSection = buttonSection.merge(buttonEnter);
50124 buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
50125 buttonSection.select(".save-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
50126 buttonSection.select(".status-button").attr("disabled", hasAuth ? null : true).each(function(d4) {
50127 var action = d4.status === "open" ? "close" : "open";
50128 var andComment = d4.newComment ? "_comment" : "";
50129 _t.addOrUpdate("note." + action + andComment)(select_default2(this));
50130 }).on("click.status", clickStatus);
50131 buttonSection.select(".comment-button").attr("disabled", isSaveDisabled).on("click.comment", clickComment);
50132 function isSaveDisabled(d4) {
50133 return hasAuth && d4.status === "open" && d4.newComment ? null : true;
50136 function clickCancel(d3_event, d4) {
50138 var osm = services.osm;
50140 osm.removeNote(d4);
50142 context.enter(modeBrowse(context));
50143 dispatch14.call("change");
50145 function clickSave(d3_event, d4) {
50147 var osm = services.osm;
50149 osm.postNoteCreate(d4, function(err, note) {
50150 dispatch14.call("change", note);
50154 function clickStatus(d3_event, d4) {
50156 var osm = services.osm;
50158 var setStatus = d4.status === "open" ? "closed" : "open";
50159 osm.postNoteUpdate(d4, setStatus, function(err, note) {
50160 dispatch14.call("change", note);
50164 function clickComment(d3_event, d4) {
50166 var osm = services.osm;
50168 osm.postNoteUpdate(d4, d4.status, function(err, note) {
50169 dispatch14.call("change", note);
50173 noteEditor.note = function(val) {
50174 if (!arguments.length) return _note;
50178 noteEditor.newNote = function(val) {
50179 if (!arguments.length) return _newNote;
50183 return utilRebind(noteEditor, dispatch14, "on");
50185 var init_note_editor = __esm({
50186 "modules/ui/note_editor.js"() {
50194 init_note_comments();
50195 init_note_header();
50196 init_note_report();
50197 init_view_on_osm();
50202 // modules/modes/select_note.js
50203 var select_note_exports = {};
50204 __export(select_note_exports, {
50205 modeSelectNote: () => modeSelectNote
50207 function modeSelectNote(context, selectedNoteID) {
50212 var _keybinding = utilKeybinding("select-note");
50213 var _noteEditor = uiNoteEditor(context).on("change", function() {
50214 context.map().pan([0, 0]);
50215 var note = checkSelectedID();
50217 context.ui().sidebar.show(_noteEditor.note(note));
50220 behaviorBreathe(context),
50221 behaviorHover(context),
50222 behaviorSelect(context),
50223 behaviorLasso(context),
50224 modeDragNode(context).behavior,
50225 modeDragNote(context).behavior
50227 var _newFeature = false;
50228 function checkSelectedID() {
50229 if (!services.osm) return;
50230 var note = services.osm.getNote(selectedNoteID);
50232 context.enter(modeBrowse(context));
50236 function selectNote(d3_event, drawn) {
50237 if (!checkSelectedID()) return;
50238 var selection2 = context.surface().selectAll(".layer-notes .note-" + selectedNoteID);
50239 if (selection2.empty()) {
50240 var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
50241 if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
50242 context.enter(modeBrowse(context));
50245 selection2.classed("selected", true);
50246 context.selectedNoteID(selectedNoteID);
50250 if (context.container().select(".combobox").size()) return;
50251 context.enter(modeBrowse(context));
50253 mode.zoomToSelected = function() {
50254 if (!services.osm) return;
50255 var note = services.osm.getNote(selectedNoteID);
50257 context.map().centerZoomEase(note.loc, 20);
50260 mode.newFeature = function(val) {
50261 if (!arguments.length) return _newFeature;
50265 mode.enter = function() {
50266 var note = checkSelectedID();
50268 _behaviors.forEach(context.install);
50269 _keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
50270 select_default2(document).call(_keybinding);
50272 var sidebar = context.ui().sidebar;
50273 sidebar.show(_noteEditor.note(note).newNote(_newFeature));
50274 sidebar.expand(sidebar.intersects(note.extent()));
50275 context.map().on("drawn.select", selectNote);
50277 mode.exit = function() {
50278 _behaviors.forEach(context.uninstall);
50279 select_default2(document).call(_keybinding.unbind);
50280 context.surface().selectAll(".layer-notes .selected").classed("selected hover", false);
50281 context.map().on("drawn.select", null);
50282 context.ui().sidebar.hide();
50283 context.selectedNoteID(null);
50287 var init_select_note = __esm({
50288 "modules/modes/select_note.js"() {
50300 init_note_editor();
50305 // modules/modes/add_note.js
50306 var add_note_exports = {};
50307 __export(add_note_exports, {
50308 modeAddNote: () => modeAddNote
50310 function modeAddNote(context) {
50314 description: _t.append("modes.add_note.description"),
50315 key: _t("modes.add_note.key")
50317 var behavior = behaviorDraw(context).on("click", add).on("cancel", cancel).on("finish", cancel);
50318 function add(loc) {
50319 var osm = services.osm;
50321 var note = osmNote({ loc, status: "open", comments: [] });
50322 osm.replaceNote(note);
50323 context.map().pan([0, 0]);
50324 context.selectedNoteID(note.id).enter(modeSelectNote(context, note.id).newFeature(true));
50326 function cancel() {
50327 context.enter(modeBrowse(context));
50329 mode.enter = function() {
50330 context.install(behavior);
50332 mode.exit = function() {
50333 context.uninstall(behavior);
50337 var init_add_note = __esm({
50338 "modules/modes/add_note.js"() {
50343 init_select_note();
50349 // modules/operations/move.js
50350 var move_exports2 = {};
50351 __export(move_exports2, {
50352 operationMove: () => operationMove
50354 function operationMove(context, selectedIDs) {
50355 var multi = selectedIDs.length === 1 ? "single" : "multiple";
50356 var nodes = utilGetAllNodes(selectedIDs, context.graph());
50357 var coords = nodes.map(function(n3) {
50360 var extent = utilTotalExtent(selectedIDs, context.graph());
50361 var operation2 = function() {
50362 context.enter(modeMove(context, selectedIDs));
50364 operation2.available = function() {
50365 return selectedIDs.length > 0;
50367 operation2.disabled = function() {
50368 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
50369 return "too_large";
50370 } else if (someMissing()) {
50371 return "not_downloaded";
50372 } else if (selectedIDs.some(context.hasHiddenConnections)) {
50373 return "connected_to_hidden";
50374 } else if (selectedIDs.some(incompleteRelation)) {
50375 return "incomplete_relation";
50378 function someMissing() {
50379 if (context.inIntro()) return false;
50380 var osm = context.connection();
50382 var missing = coords.filter(function(loc) {
50383 return !osm.isDataLoaded(loc);
50385 if (missing.length) {
50386 missing.forEach(function(loc) {
50387 context.loadTileAtLoc(loc);
50394 function incompleteRelation(id2) {
50395 var entity = context.entity(id2);
50396 return entity.type === "relation" && !entity.isComplete(context.graph());
50399 operation2.tooltip = function() {
50400 var disable = operation2.disabled();
50401 return disable ? _t.append("operations.move." + disable + "." + multi) : _t.append("operations.move.description." + multi);
50403 operation2.annotation = function() {
50404 return selectedIDs.length === 1 ? _t("operations.move.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.move.annotation.feature", { n: selectedIDs.length });
50406 operation2.id = "move";
50407 operation2.keys = [_t("operations.move.key")];
50408 operation2.title = _t.append("operations.move.title");
50409 operation2.behavior = behaviorOperation(context).which(operation2);
50410 operation2.mouseOnly = true;
50413 var init_move2 = __esm({
50414 "modules/operations/move.js"() {
50423 // modules/operations/orthogonalize.js
50424 var orthogonalize_exports2 = {};
50425 __export(orthogonalize_exports2, {
50426 operationOrthogonalize: () => operationOrthogonalize
50428 function operationOrthogonalize(context, selectedIDs) {
50431 var _actions = selectedIDs.map(chooseAction).filter(Boolean);
50432 var _amount = _actions.length === 1 ? "single" : "multiple";
50433 var _coords = utilGetAllNodes(selectedIDs, context.graph()).map(function(n3) {
50436 function chooseAction(entityID) {
50437 var entity = context.entity(entityID);
50438 var geometry = entity.geometry(context.graph());
50440 _extent = entity.extent(context.graph());
50442 _extent = _extent.extend(entity.extent(context.graph()));
50444 if (entity.type === "way" && new Set(entity.nodes).size > 2) {
50445 if (_type && _type !== "feature") return null;
50447 return actionOrthogonalize(entityID, context.projection);
50448 } else if (geometry === "vertex") {
50449 if (_type && _type !== "corner") return null;
50451 var graph = context.graph();
50452 var parents = graph.parentWays(entity);
50453 if (parents.length === 1) {
50454 var way = parents[0];
50455 if (way.nodes.indexOf(entityID) !== -1) {
50456 return actionOrthogonalize(way.id, context.projection, entityID);
50462 var operation2 = function() {
50463 if (!_actions.length) return;
50464 var combinedAction = function(graph, t2) {
50465 _actions.forEach(function(action) {
50466 if (!action.disabled(graph)) {
50467 graph = action(graph, t2);
50472 combinedAction.transitionable = true;
50473 context.perform(combinedAction, operation2.annotation());
50474 window.setTimeout(function() {
50475 context.validator().validate();
50478 operation2.available = function() {
50479 return _actions.length && selectedIDs.length === _actions.length;
50481 operation2.disabled = function() {
50482 if (!_actions.length) return "";
50483 var actionDisableds = _actions.map(function(action) {
50484 return action.disabled(context.graph());
50485 }).filter(Boolean);
50486 if (actionDisableds.length === _actions.length) {
50487 if (new Set(actionDisableds).size > 1) {
50488 return "multiple_blockers";
50490 return actionDisableds[0];
50491 } else if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
50492 return "too_large";
50493 } else if (someMissing()) {
50494 return "not_downloaded";
50495 } else if (selectedIDs.some(context.hasHiddenConnections)) {
50496 return "connected_to_hidden";
50499 function someMissing() {
50500 if (context.inIntro()) return false;
50501 var osm = context.connection();
50503 var missing = _coords.filter(function(loc) {
50504 return !osm.isDataLoaded(loc);
50506 if (missing.length) {
50507 missing.forEach(function(loc) {
50508 context.loadTileAtLoc(loc);
50516 operation2.tooltip = function() {
50517 var disable = operation2.disabled();
50518 return disable ? _t.append("operations.orthogonalize." + disable + "." + _amount) : _t.append("operations.orthogonalize.description." + _type + "." + _amount);
50520 operation2.annotation = function() {
50521 return _t("operations.orthogonalize.annotation." + _type, { n: _actions.length });
50523 operation2.id = "orthogonalize";
50524 operation2.keys = [_t("operations.orthogonalize.key")];
50525 operation2.title = _t.append("operations.orthogonalize.title");
50526 operation2.behavior = behaviorOperation(context).which(operation2);
50529 var init_orthogonalize2 = __esm({
50530 "modules/operations/orthogonalize.js"() {
50533 init_orthogonalize();
50539 // modules/operations/reflect.js
50540 var reflect_exports2 = {};
50541 __export(reflect_exports2, {
50542 operationReflect: () => operationReflect,
50543 operationReflectLong: () => operationReflectLong,
50544 operationReflectShort: () => operationReflectShort
50546 function operationReflectShort(context, selectedIDs) {
50547 return operationReflect(context, selectedIDs, "short");
50549 function operationReflectLong(context, selectedIDs) {
50550 return operationReflect(context, selectedIDs, "long");
50552 function operationReflect(context, selectedIDs, axis) {
50553 axis = axis || "long";
50554 var multi = selectedIDs.length === 1 ? "single" : "multiple";
50555 var nodes = utilGetAllNodes(selectedIDs, context.graph());
50556 var coords = nodes.map(function(n3) {
50559 var extent = utilTotalExtent(selectedIDs, context.graph());
50560 var operation2 = function() {
50561 var action = actionReflect(selectedIDs, context.projection).useLongAxis(Boolean(axis === "long"));
50562 context.perform(action, operation2.annotation());
50563 window.setTimeout(function() {
50564 context.validator().validate();
50567 operation2.available = function() {
50568 return nodes.length >= 3;
50570 operation2.disabled = function() {
50571 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
50572 return "too_large";
50573 } else if (someMissing()) {
50574 return "not_downloaded";
50575 } else if (selectedIDs.some(context.hasHiddenConnections)) {
50576 return "connected_to_hidden";
50577 } else if (selectedIDs.some(incompleteRelation)) {
50578 return "incomplete_relation";
50581 function someMissing() {
50582 if (context.inIntro()) return false;
50583 var osm = context.connection();
50585 var missing = coords.filter(function(loc) {
50586 return !osm.isDataLoaded(loc);
50588 if (missing.length) {
50589 missing.forEach(function(loc) {
50590 context.loadTileAtLoc(loc);
50597 function incompleteRelation(id2) {
50598 var entity = context.entity(id2);
50599 return entity.type === "relation" && !entity.isComplete(context.graph());
50602 operation2.tooltip = function() {
50603 var disable = operation2.disabled();
50604 return disable ? _t.append("operations.reflect." + disable + "." + multi) : _t.append("operations.reflect.description." + axis + "." + multi);
50606 operation2.annotation = function() {
50607 return _t("operations.reflect.annotation." + axis + ".feature", { n: selectedIDs.length });
50609 operation2.id = "reflect-" + axis;
50610 operation2.keys = [_t("operations.reflect.key." + axis)];
50611 operation2.title = _t.append("operations.reflect.title." + axis);
50612 operation2.behavior = behaviorOperation(context).which(operation2);
50615 var init_reflect2 = __esm({
50616 "modules/operations/reflect.js"() {
50625 // modules/modes/rotate.js
50626 var rotate_exports2 = {};
50627 __export(rotate_exports2, {
50628 modeRotate: () => modeRotate
50630 function modeRotate(context, entityIDs) {
50631 var _tolerancePx = 4;
50636 var keybinding = utilKeybinding("rotate");
50638 behaviorEdit(context),
50639 operationCircularize(context, entityIDs).behavior,
50640 operationDelete(context, entityIDs).behavior,
50641 operationMove(context, entityIDs).behavior,
50642 operationOrthogonalize(context, entityIDs).behavior,
50643 operationReflectLong(context, entityIDs).behavior,
50644 operationReflectShort(context, entityIDs).behavior
50646 var annotation = entityIDs.length === 1 ? _t("operations.rotate.annotation." + context.graph().geometry(entityIDs[0])) : _t("operations.rotate.annotation.feature", { n: entityIDs.length });
50649 var _prevTransform;
50651 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
50652 function doRotate(d3_event) {
50654 if (context.graph() !== _prevGraph) {
50655 fn = context.perform;
50657 fn = context.replace;
50659 var projection2 = context.projection;
50660 var currTransform = projection2.transform();
50661 if (!_prevTransform || currTransform.k !== _prevTransform.k || currTransform.x !== _prevTransform.x || currTransform.y !== _prevTransform.y) {
50662 var nodes = utilGetAllNodes(entityIDs, context.graph());
50663 var points = nodes.map(function(n3) {
50664 return projection2(n3.loc);
50666 _pivot = getPivot(points);
50667 _prevAngle = void 0;
50669 var currMouse = context.map().mouse(d3_event);
50670 var currAngle = Math.atan2(currMouse[1] - _pivot[1], currMouse[0] - _pivot[0]);
50671 if (typeof _prevAngle === "undefined") _prevAngle = currAngle;
50672 var delta = currAngle - _prevAngle;
50673 fn(actionRotate(entityIDs, _pivot, delta, projection2));
50674 _prevTransform = currTransform;
50675 _prevAngle = currAngle;
50676 _prevGraph = context.graph();
50678 function getPivot(points) {
50680 if (points.length === 1) {
50681 _pivot2 = points[0];
50682 } else if (points.length === 2) {
50683 _pivot2 = geoVecInterp(points[0], points[1], 0.5);
50685 var polygonHull = hull_default(points);
50686 if (polygonHull.length === 2) {
50687 _pivot2 = geoVecInterp(points[0], points[1], 0.5);
50689 _pivot2 = centroid_default(hull_default(points));
50694 function finish(d3_event) {
50695 d3_event.stopPropagation();
50696 context.replace(actionNoop(), annotation);
50697 context.enter(modeSelect(context, entityIDs));
50699 function cancel() {
50700 if (_prevGraph) context.pop();
50701 context.enter(modeSelect(context, entityIDs));
50703 function undone() {
50704 context.enter(modeBrowse(context));
50706 mode.enter = function() {
50708 context.features().forceVisible(entityIDs);
50709 behaviors.forEach(context.install);
50711 context.surface().on(_pointerPrefix + "down.modeRotate", function(d3_event) {
50712 downEvent = d3_event;
50714 select_default2(window).on(_pointerPrefix + "move.modeRotate", doRotate, true).on(_pointerPrefix + "up.modeRotate", function(d3_event) {
50715 if (!downEvent) return;
50716 var mapNode = context.container().select(".main-map").node();
50717 var pointGetter = utilFastMouse(mapNode);
50718 var p1 = pointGetter(downEvent);
50719 var p2 = pointGetter(d3_event);
50720 var dist = geoVecLength(p1, p2);
50721 if (dist <= _tolerancePx) finish(d3_event);
50724 context.history().on("undone.modeRotate", undone);
50725 keybinding.on("\u238B", cancel).on("\u21A9", finish);
50726 select_default2(document).call(keybinding);
50728 mode.exit = function() {
50729 behaviors.forEach(context.uninstall);
50730 context.surface().on(_pointerPrefix + "down.modeRotate", null);
50731 select_default2(window).on(_pointerPrefix + "move.modeRotate", null, true).on(_pointerPrefix + "up.modeRotate", null, true);
50732 context.history().on("undone.modeRotate", null);
50733 select_default2(document).call(keybinding.unbind);
50734 context.features().forceVisible([]);
50736 mode.selectedIDs = function() {
50737 if (!arguments.length) return entityIDs;
50742 var init_rotate2 = __esm({
50743 "modules/modes/rotate.js"() {
50754 init_circularize2();
50757 init_orthogonalize2();
50764 // modules/ui/conflicts.js
50765 var conflicts_exports = {};
50766 __export(conflicts_exports, {
50767 uiConflicts: () => uiConflicts
50769 function uiConflicts(context) {
50770 var dispatch14 = dispatch_default("cancel", "save");
50771 var keybinding = utilKeybinding("conflicts");
50774 var _shownConflictIndex;
50775 function keybindingOn() {
50776 select_default2(document).call(keybinding.on("\u238B", cancel, true));
50778 function keybindingOff() {
50779 select_default2(document).call(keybinding.unbind);
50781 function tryAgain() {
50783 dispatch14.call("save");
50785 function cancel() {
50787 dispatch14.call("cancel");
50789 function conflicts(selection2) {
50791 var headerEnter = selection2.selectAll(".header").data([0]).enter().append("div").attr("class", "header fillL");
50792 headerEnter.append("button").attr("class", "fr").attr("title", _t("icons.close")).on("click", cancel).call(svgIcon("#iD-icon-close"));
50793 headerEnter.append("h2").call(_t.append("save.conflict.header"));
50794 var bodyEnter = selection2.selectAll(".body").data([0]).enter().append("div").attr("class", "body fillL");
50795 var conflictsHelpEnter = bodyEnter.append("div").attr("class", "conflicts-help").call(_t.append("save.conflict.help"));
50796 var changeset = new osmChangeset();
50797 delete changeset.id;
50798 var data = JXON.stringify(changeset.osmChangeJXON(_origChanges));
50799 var blob = new Blob([data], { type: "text/xml;charset=utf-8;" });
50800 var fileName = "changes.osc";
50801 var linkEnter = conflictsHelpEnter.selectAll(".download-changes").append("a").attr("class", "download-changes");
50802 linkEnter.attr("href", window.URL.createObjectURL(blob)).attr("download", fileName);
50803 linkEnter.call(svgIcon("#iD-icon-load", "inline")).append("span").call(_t.append("save.conflict.download_changes"));
50804 bodyEnter.append("div").attr("class", "conflict-container fillL3").call(showConflict, 0);
50805 bodyEnter.append("div").attr("class", "conflicts-done").attr("opacity", 0).style("display", "none").call(_t.append("save.conflict.done"));
50806 var buttonsEnter = bodyEnter.append("div").attr("class", "buttons col12 joined conflicts-buttons");
50807 buttonsEnter.append("button").attr("disabled", _conflictList.length > 1).attr("class", "action conflicts-button col6").call(_t.append("save.title")).on("click.try_again", tryAgain);
50808 buttonsEnter.append("button").attr("class", "secondary-action conflicts-button col6").call(_t.append("confirm.cancel")).on("click.cancel", cancel);
50810 function showConflict(selection2, index) {
50811 index = utilWrap(index, _conflictList.length);
50812 _shownConflictIndex = index;
50813 var parent2 = select_default2(selection2.node().parentNode);
50814 if (index === _conflictList.length - 1) {
50815 window.setTimeout(function() {
50816 parent2.select(".conflicts-button").attr("disabled", null);
50817 parent2.select(".conflicts-done").transition().attr("opacity", 1).style("display", "block");
50820 var conflict = selection2.selectAll(".conflict").data([_conflictList[index]]);
50821 conflict.exit().remove();
50822 var conflictEnter = conflict.enter().append("div").attr("class", "conflict");
50823 conflictEnter.append("h4").attr("class", "conflict-count").call(_t.append("save.conflict.count", { num: index + 1, total: _conflictList.length }));
50824 conflictEnter.append("a").attr("class", "conflict-description").attr("href", "#").text(function(d4) {
50826 }).on("click", function(d3_event, d4) {
50827 d3_event.preventDefault();
50828 zoomToEntity(d4.id);
50830 var details = conflictEnter.append("div").attr("class", "conflict-detail-container");
50831 details.append("ul").attr("class", "conflict-detail-list").selectAll("li").data(function(d4) {
50832 return d4.details || [];
50833 }).enter().append("li").attr("class", "conflict-detail-item").html(function(d4) {
50836 details.append("div").attr("class", "conflict-choices").call(addChoices);
50837 details.append("div").attr("class", "conflict-nav-buttons joined cf").selectAll("button").data(["previous", "next"]).enter().append("button").attr("class", "conflict-nav-button action col6").attr("disabled", function(d4, i3) {
50838 return i3 === 0 && index === 0 || i3 === 1 && index === _conflictList.length - 1 || null;
50839 }).on("click", function(d3_event, d4) {
50840 d3_event.preventDefault();
50841 var container = parent2.selectAll(".conflict-container");
50842 var sign2 = d4 === "previous" ? -1 : 1;
50843 container.selectAll(".conflict").remove();
50844 container.call(showConflict, index + sign2);
50845 }).each(function(d4) {
50846 _t.append("save.conflict." + d4)(select_default2(this));
50849 function addChoices(selection2) {
50850 var choices = selection2.append("ul").attr("class", "layer-list").selectAll("li").data(function(d4) {
50851 return d4.choices || [];
50853 var choicesEnter = choices.enter().append("li").attr("class", "layer");
50854 var labelEnter = choicesEnter.append("label");
50855 labelEnter.append("input").attr("type", "radio").attr("name", function(d4) {
50857 }).on("change", function(d3_event, d4) {
50858 var ul = this.parentNode.parentNode.parentNode;
50859 ul.__data__.chosen = d4.id;
50860 choose(d3_event, ul, d4);
50862 labelEnter.append("span").text(function(d4) {
50865 choicesEnter.merge(choices).each(function(d4) {
50866 var ul = this.parentNode;
50867 if (ul.__data__.chosen === d4.id) {
50868 choose(null, ul, d4);
50872 function choose(d3_event, ul, datum2) {
50873 if (d3_event) d3_event.preventDefault();
50874 select_default2(ul).selectAll("li").classed("active", function(d4) {
50875 return d4 === datum2;
50876 }).selectAll("input").property("checked", function(d4) {
50877 return d4 === datum2;
50879 var extent = geoExtent();
50881 entity = context.graph().hasEntity(datum2.id);
50882 if (entity) extent._extend(entity.extent(context.graph()));
50884 entity = context.graph().hasEntity(datum2.id);
50885 if (entity) extent._extend(entity.extent(context.graph()));
50886 zoomToEntity(datum2.id, extent);
50888 function zoomToEntity(id2, extent) {
50889 context.surface().selectAll(".hover").classed("hover", false);
50890 var entity = context.graph().hasEntity(id2);
50893 context.map().trimmedExtent(extent);
50895 context.map().zoomToEase(entity);
50897 context.surface().selectAll(utilEntityOrMemberSelector([entity.id], context.graph())).classed("hover", true);
50900 conflicts.conflictList = function(_3) {
50901 if (!arguments.length) return _conflictList;
50902 _conflictList = _3;
50905 conflicts.origChanges = function(_3) {
50906 if (!arguments.length) return _origChanges;
50910 conflicts.shownEntityIds = function() {
50911 if (_conflictList && typeof _shownConflictIndex === "number") {
50912 return [_conflictList[_shownConflictIndex].id];
50916 return utilRebind(conflicts, dispatch14, "on");
50918 var init_conflicts = __esm({
50919 "modules/ui/conflicts.js"() {
50932 // modules/ui/confirm.js
50933 var confirm_exports = {};
50934 __export(confirm_exports, {
50935 uiConfirm: () => uiConfirm
50937 function uiConfirm(selection2) {
50938 var modalSelection = uiModal(selection2);
50939 modalSelection.select(".modal").classed("modal-alert", true);
50940 var section = modalSelection.select(".content");
50941 section.append("div").attr("class", "modal-section header");
50942 section.append("div").attr("class", "modal-section message-text");
50943 var buttons = section.append("div").attr("class", "modal-section buttons cf");
50944 modalSelection.okButton = function() {
50945 buttons.append("button").attr("class", "button ok-button action").on("click.confirm", function() {
50946 modalSelection.remove();
50947 }).call(_t.append("confirm.okay")).node().focus();
50948 return modalSelection;
50950 return modalSelection;
50952 var init_confirm = __esm({
50953 "modules/ui/confirm.js"() {
50960 // modules/ui/popover.js
50961 var popover_exports = {};
50962 __export(popover_exports, {
50963 uiPopover: () => uiPopover
50965 function uiPopover(klass) {
50966 var _id = _popoverID++;
50967 var _anchorSelection = select_default2(null);
50968 var popover = function(selection2) {
50969 _anchorSelection = selection2;
50970 selection2.each(setup);
50972 var _animation = utilFunctor(false);
50973 var _placement = utilFunctor("top");
50974 var _alignment = utilFunctor("center");
50975 var _scrollContainer = utilFunctor(select_default2(null));
50977 var _displayType = utilFunctor("");
50978 var _hasArrow = utilFunctor(true);
50979 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
50980 popover.displayType = function(val) {
50981 if (arguments.length) {
50982 _displayType = utilFunctor(val);
50985 return _displayType;
50988 popover.hasArrow = function(val) {
50989 if (arguments.length) {
50990 _hasArrow = utilFunctor(val);
50996 popover.placement = function(val) {
50997 if (arguments.length) {
50998 _placement = utilFunctor(val);
51004 popover.alignment = function(val) {
51005 if (arguments.length) {
51006 _alignment = utilFunctor(val);
51012 popover.scrollContainer = function(val) {
51013 if (arguments.length) {
51014 _scrollContainer = utilFunctor(val);
51017 return _scrollContainer;
51020 popover.content = function(val) {
51021 if (arguments.length) {
51028 popover.isShown = function() {
51029 var popoverSelection = _anchorSelection.select(".popover-" + _id);
51030 return !popoverSelection.empty() && popoverSelection.classed("in");
51032 popover.show = function() {
51033 _anchorSelection.each(show);
51035 popover.updateContent = function() {
51036 _anchorSelection.each(updateContent);
51038 popover.hide = function() {
51039 _anchorSelection.each(hide);
51041 popover.toggle = function() {
51042 _anchorSelection.each(toggle);
51044 popover.destroy = function(selection2, selector) {
51045 selector = selector || ".popover-" + _id;
51046 selection2.on(_pointerPrefix + "enter.popover", null).on(_pointerPrefix + "leave.popover", null).on(_pointerPrefix + "up.popover", null).on(_pointerPrefix + "down.popover", null).on("focus.popover", null).on("blur.popover", null).on("click.popover", null).attr("title", function() {
51047 return this.getAttribute("data-original-title") || this.getAttribute("title");
51048 }).attr("data-original-title", null).selectAll(selector).remove();
51050 popover.destroyAny = function(selection2) {
51051 selection2.call(popover.destroy, ".popover");
51054 var anchor = select_default2(this);
51055 var animate = _animation.apply(this, arguments);
51056 var popoverSelection = anchor.selectAll(".popover-" + _id).data([0]);
51057 var enter = popoverSelection.enter().append("div").attr("class", "popover popover-" + _id + " " + (klass ? klass : "")).classed("arrowed", _hasArrow.apply(this, arguments));
51058 enter.append("div").attr("class", "popover-arrow");
51059 enter.append("div").attr("class", "popover-inner");
51060 popoverSelection = enter.merge(popoverSelection);
51062 popoverSelection.classed("fade", true);
51064 var display = _displayType.apply(this, arguments);
51065 if (display === "hover") {
51066 var _lastNonMouseEnterTime;
51067 anchor.on(_pointerPrefix + "enter.popover", function(d3_event) {
51068 if (d3_event.pointerType) {
51069 if (d3_event.pointerType !== "mouse") {
51070 _lastNonMouseEnterTime = d3_event.timeStamp;
51072 } else if (_lastNonMouseEnterTime && d3_event.timeStamp - _lastNonMouseEnterTime < 1500) {
51076 if (d3_event.buttons !== 0) return;
51077 show.apply(this, arguments);
51078 }).on(_pointerPrefix + "leave.popover", function() {
51079 hide.apply(this, arguments);
51080 }).on("focus.popover", function() {
51081 show.apply(this, arguments);
51082 }).on("blur.popover", function() {
51083 hide.apply(this, arguments);
51085 } else if (display === "clickFocus") {
51086 anchor.on(_pointerPrefix + "down.popover", function(d3_event) {
51087 d3_event.preventDefault();
51088 d3_event.stopPropagation();
51089 }).on(_pointerPrefix + "up.popover", function(d3_event) {
51090 d3_event.preventDefault();
51091 d3_event.stopPropagation();
51092 }).on("click.popover", toggle);
51093 popoverSelection.attr("tabindex", 0).on("blur.popover", function() {
51094 anchor.each(function() {
51095 hide.apply(this, arguments);
51101 var anchor = select_default2(this);
51102 var popoverSelection = anchor.selectAll(".popover-" + _id);
51103 if (popoverSelection.empty()) {
51104 anchor.call(popover.destroy);
51105 anchor.each(setup);
51106 popoverSelection = anchor.selectAll(".popover-" + _id);
51108 popoverSelection.classed("in", true);
51109 var displayType = _displayType.apply(this, arguments);
51110 if (displayType === "clickFocus") {
51111 anchor.classed("active", true);
51112 popoverSelection.node().focus();
51114 anchor.each(updateContent);
51116 function updateContent() {
51117 var anchor = select_default2(this);
51119 anchor.selectAll(".popover-" + _id + " > .popover-inner").call(_content.apply(this, arguments));
51121 updatePosition.apply(this, arguments);
51122 updatePosition.apply(this, arguments);
51123 updatePosition.apply(this, arguments);
51125 function updatePosition() {
51126 var anchor = select_default2(this);
51127 var popoverSelection = anchor.selectAll(".popover-" + _id);
51128 var scrollContainer = _scrollContainer && _scrollContainer.apply(this, arguments);
51129 var scrollNode = scrollContainer && !scrollContainer.empty() && scrollContainer.node();
51130 var scrollLeft = scrollNode ? scrollNode.scrollLeft : 0;
51131 var scrollTop = scrollNode ? scrollNode.scrollTop : 0;
51132 var placement = _placement.apply(this, arguments);
51133 popoverSelection.classed("left", false).classed("right", false).classed("top", false).classed("bottom", false).classed(placement, true);
51134 var alignment = _alignment.apply(this, arguments);
51135 var alignFactor = 0.5;
51136 if (alignment === "leading") {
51138 } else if (alignment === "trailing") {
51141 var anchorFrame = getFrame(anchor.node());
51142 var popoverFrame = getFrame(popoverSelection.node());
51144 switch (placement) {
51147 x: anchorFrame.x + (anchorFrame.w - popoverFrame.w) * alignFactor,
51148 y: anchorFrame.y - popoverFrame.h
51153 x: anchorFrame.x + (anchorFrame.w - popoverFrame.w) * alignFactor,
51154 y: anchorFrame.y + anchorFrame.h
51159 x: anchorFrame.x - popoverFrame.w,
51160 y: anchorFrame.y + (anchorFrame.h - popoverFrame.h) * alignFactor
51165 x: anchorFrame.x + anchorFrame.w,
51166 y: anchorFrame.y + (anchorFrame.h - popoverFrame.h) * alignFactor
51171 if (scrollNode && (placement === "top" || placement === "bottom")) {
51172 var initialPosX = position.x;
51173 if (position.x + popoverFrame.w > scrollNode.offsetWidth - 10) {
51174 position.x = scrollNode.offsetWidth - 10 - popoverFrame.w;
51175 } else if (position.x < 10) {
51178 var arrow = anchor.selectAll(".popover-" + _id + " > .popover-arrow");
51179 var arrowPosX = Math.min(Math.max(popoverFrame.w / 2 - (position.x - initialPosX), 10), popoverFrame.w - 10);
51180 arrow.style("left", ~~arrowPosX + "px");
51182 popoverSelection.style("left", ~~position.x + "px").style("top", ~~position.y + "px");
51184 popoverSelection.style("left", null).style("top", null);
51186 function getFrame(node) {
51187 var positionStyle = select_default2(node).style("position");
51188 if (positionStyle === "absolute" || positionStyle === "static") {
51190 x: node.offsetLeft - scrollLeft,
51191 y: node.offsetTop - scrollTop,
51192 w: node.offsetWidth,
51193 h: node.offsetHeight
51199 w: node.offsetWidth,
51200 h: node.offsetHeight
51206 var anchor = select_default2(this);
51207 if (_displayType.apply(this, arguments) === "clickFocus") {
51208 anchor.classed("active", false);
51210 anchor.selectAll(".popover-" + _id).classed("in", false);
51212 function toggle() {
51213 if (select_default2(this).select(".popover-" + _id).classed("in")) {
51214 hide.apply(this, arguments);
51216 show.apply(this, arguments);
51222 var init_popover = __esm({
51223 "modules/ui/popover.js"() {
51231 // modules/ui/tooltip.js
51232 var tooltip_exports = {};
51233 __export(tooltip_exports, {
51234 uiTooltip: () => uiTooltip
51236 function uiTooltip(klass) {
51237 var tooltip = uiPopover((klass || "") + " tooltip").displayType("hover");
51238 var _title = function() {
51239 var title = this.getAttribute("data-original-title");
51243 title = this.getAttribute("title");
51244 this.removeAttribute("title");
51245 this.setAttribute("data-original-title", title);
51249 var _heading = utilFunctor(null);
51250 var _keys = utilFunctor(null);
51251 tooltip.title = function(val) {
51252 if (!arguments.length) return _title;
51253 _title = utilFunctor(val);
51256 tooltip.heading = function(val) {
51257 if (!arguments.length) return _heading;
51258 _heading = utilFunctor(val);
51261 tooltip.keys = function(val) {
51262 if (!arguments.length) return _keys;
51263 _keys = utilFunctor(val);
51266 tooltip.content(function() {
51267 var heading = _heading.apply(this, arguments);
51268 var text = _title.apply(this, arguments);
51269 var keys2 = _keys.apply(this, arguments);
51270 var headingCallback = typeof heading === "function" ? heading : (s2) => s2.text(heading);
51271 var textCallback = typeof text === "function" ? text : (s2) => s2.text(text);
51272 return function(selection2) {
51273 var headingSelect = selection2.selectAll(".tooltip-heading").data(heading ? [heading] : []);
51274 headingSelect.exit().remove();
51275 headingSelect.enter().append("div").attr("class", "tooltip-heading").merge(headingSelect).text("").call(headingCallback);
51276 var textSelect = selection2.selectAll(".tooltip-text").data(text ? [text] : []);
51277 textSelect.exit().remove();
51278 textSelect.enter().append("div").attr("class", "tooltip-text").merge(textSelect).text("").call(textCallback);
51279 var keyhintWrap = selection2.selectAll(".keyhint-wrap").data(keys2 && keys2.length ? [0] : []);
51280 keyhintWrap.exit().remove();
51281 var keyhintWrapEnter = keyhintWrap.enter().append("div").attr("class", "keyhint-wrap");
51282 keyhintWrapEnter.append("span").call(_t.append("tooltip_keyhint"));
51283 keyhintWrap = keyhintWrapEnter.merge(keyhintWrap);
51284 keyhintWrap.selectAll("kbd.shortcut").data(keys2 && keys2.length ? keys2 : []).enter().append("kbd").attr("class", "shortcut").text(function(d4) {
51291 var init_tooltip = __esm({
51292 "modules/ui/tooltip.js"() {
51300 // node_modules/bignumber.js/bignumber.mjs
51301 function clone(configObject) {
51302 var div, convertBase, parseNumeric2, P3 = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
51305 secondaryGroupSize: 0,
51306 groupSeparator: ",",
51307 decimalSeparator: ".",
51308 fractionGroupSize: 0,
51309 fractionGroupSeparator: "\xA0",
51310 // non-breaking space
51312 }, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
51313 function BigNumber2(v3, b3) {
51314 var alphabet, c2, caseChanged, e3, i3, isNum, len, str, x2 = this;
51315 if (!(x2 instanceof BigNumber2)) return new BigNumber2(v3, b3);
51317 if (v3 && v3._isBigNumber === true) {
51319 if (!v3.c || v3.e > MAX_EXP) {
51320 x2.c = x2.e = null;
51321 } else if (v3.e < MIN_EXP) {
51325 x2.c = v3.c.slice();
51329 if ((isNum = typeof v3 == "number") && v3 * 0 == 0) {
51330 x2.s = 1 / v3 < 0 ? (v3 = -v3, -1) : 1;
51332 for (e3 = 0, i3 = v3; i3 >= 10; i3 /= 10, e3++) ;
51333 if (e3 > MAX_EXP) {
51334 x2.c = x2.e = null;
51343 if (!isNumeric.test(str = String(v3))) return parseNumeric2(x2, str, isNum);
51344 x2.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
51346 if ((e3 = str.indexOf(".")) > -1) str = str.replace(".", "");
51347 if ((i3 = str.search(/e/i)) > 0) {
51348 if (e3 < 0) e3 = i3;
51349 e3 += +str.slice(i3 + 1);
51350 str = str.substring(0, i3);
51351 } else if (e3 < 0) {
51355 intCheck(b3, 2, ALPHABET.length, "Base");
51356 if (b3 == 10 && alphabetHasNormalDecimalDigits) {
51357 x2 = new BigNumber2(v3);
51358 return round(x2, DECIMAL_PLACES + x2.e + 1, ROUNDING_MODE);
51361 if (isNum = typeof v3 == "number") {
51362 if (v3 * 0 != 0) return parseNumeric2(x2, str, isNum, b3);
51363 x2.s = 1 / v3 < 0 ? (str = str.slice(1), -1) : 1;
51364 if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
51365 throw Error(tooManyDigits + v3);
51368 x2.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
51370 alphabet = ALPHABET.slice(0, b3);
51372 for (len = str.length; i3 < len; i3++) {
51373 if (alphabet.indexOf(c2 = str.charAt(i3)) < 0) {
51379 } else if (!caseChanged) {
51380 if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
51381 caseChanged = true;
51387 return parseNumeric2(x2, String(v3), isNum, b3);
51391 str = convertBase(str, b3, 10, x2.s);
51392 if ((e3 = str.indexOf(".")) > -1) str = str.replace(".", "");
51393 else e3 = str.length;
51395 for (i3 = 0; str.charCodeAt(i3) === 48; i3++) ;
51396 for (len = str.length; str.charCodeAt(--len) === 48; ) ;
51397 if (str = str.slice(i3, ++len)) {
51399 if (isNum && BigNumber2.DEBUG && len > 15 && (v3 > MAX_SAFE_INTEGER3 || v3 !== mathfloor(v3))) {
51400 throw Error(tooManyDigits + x2.s * v3);
51402 if ((e3 = e3 - i3 - 1) > MAX_EXP) {
51403 x2.c = x2.e = null;
51404 } else if (e3 < MIN_EXP) {
51409 i3 = (e3 + 1) % LOG_BASE;
51410 if (e3 < 0) i3 += LOG_BASE;
51412 if (i3) x2.c.push(+str.slice(0, i3));
51413 for (len -= LOG_BASE; i3 < len; ) {
51414 x2.c.push(+str.slice(i3, i3 += LOG_BASE));
51416 i3 = LOG_BASE - (str = str.slice(i3)).length;
51420 for (; i3--; str += "0") ;
51427 BigNumber2.clone = clone;
51428 BigNumber2.ROUND_UP = 0;
51429 BigNumber2.ROUND_DOWN = 1;
51430 BigNumber2.ROUND_CEIL = 2;
51431 BigNumber2.ROUND_FLOOR = 3;
51432 BigNumber2.ROUND_HALF_UP = 4;
51433 BigNumber2.ROUND_HALF_DOWN = 5;
51434 BigNumber2.ROUND_HALF_EVEN = 6;
51435 BigNumber2.ROUND_HALF_CEIL = 7;
51436 BigNumber2.ROUND_HALF_FLOOR = 8;
51437 BigNumber2.EUCLID = 9;
51438 BigNumber2.config = BigNumber2.set = function(obj) {
51441 if (typeof obj == "object") {
51442 if (obj.hasOwnProperty(p2 = "DECIMAL_PLACES")) {
51444 intCheck(v3, 0, MAX, p2);
51445 DECIMAL_PLACES = v3;
51447 if (obj.hasOwnProperty(p2 = "ROUNDING_MODE")) {
51449 intCheck(v3, 0, 8, p2);
51450 ROUNDING_MODE = v3;
51452 if (obj.hasOwnProperty(p2 = "EXPONENTIAL_AT")) {
51454 if (v3 && v3.pop) {
51455 intCheck(v3[0], -MAX, 0, p2);
51456 intCheck(v3[1], 0, MAX, p2);
51457 TO_EXP_NEG = v3[0];
51458 TO_EXP_POS = v3[1];
51460 intCheck(v3, -MAX, MAX, p2);
51461 TO_EXP_NEG = -(TO_EXP_POS = v3 < 0 ? -v3 : v3);
51464 if (obj.hasOwnProperty(p2 = "RANGE")) {
51466 if (v3 && v3.pop) {
51467 intCheck(v3[0], -MAX, -1, p2);
51468 intCheck(v3[1], 1, MAX, p2);
51472 intCheck(v3, -MAX, MAX, p2);
51474 MIN_EXP = -(MAX_EXP = v3 < 0 ? -v3 : v3);
51476 throw Error(bignumberError + p2 + " cannot be zero: " + v3);
51480 if (obj.hasOwnProperty(p2 = "CRYPTO")) {
51484 if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
51488 throw Error(bignumberError + "crypto unavailable");
51494 throw Error(bignumberError + p2 + " not true or false: " + v3);
51497 if (obj.hasOwnProperty(p2 = "MODULO_MODE")) {
51499 intCheck(v3, 0, 9, p2);
51502 if (obj.hasOwnProperty(p2 = "POW_PRECISION")) {
51504 intCheck(v3, 0, MAX, p2);
51505 POW_PRECISION = v3;
51507 if (obj.hasOwnProperty(p2 = "FORMAT")) {
51509 if (typeof v3 == "object") FORMAT = v3;
51510 else throw Error(bignumberError + p2 + " not an object: " + v3);
51512 if (obj.hasOwnProperty(p2 = "ALPHABET")) {
51514 if (typeof v3 == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v3)) {
51515 alphabetHasNormalDecimalDigits = v3.slice(0, 10) == "0123456789";
51518 throw Error(bignumberError + p2 + " invalid: " + v3);
51522 throw Error(bignumberError + "Object expected: " + obj);
51528 EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
51529 RANGE: [MIN_EXP, MAX_EXP],
51537 BigNumber2.isBigNumber = function(v3) {
51538 if (!v3 || v3._isBigNumber !== true) return false;
51539 if (!BigNumber2.DEBUG) return true;
51540 var i3, n3, c2 = v3.c, e3 = v3.e, s2 = v3.s;
51541 out: if ({}.toString.call(c2) == "[object Array]") {
51542 if ((s2 === 1 || s2 === -1) && e3 >= -MAX && e3 <= MAX && e3 === mathfloor(e3)) {
51544 if (e3 === 0 && c2.length === 1) return true;
51547 i3 = (e3 + 1) % LOG_BASE;
51548 if (i3 < 1) i3 += LOG_BASE;
51549 if (String(c2[0]).length == i3) {
51550 for (i3 = 0; i3 < c2.length; i3++) {
51552 if (n3 < 0 || n3 >= BASE || n3 !== mathfloor(n3)) break out;
51554 if (n3 !== 0) return true;
51557 } else if (c2 === null && e3 === null && (s2 === null || s2 === 1 || s2 === -1)) {
51560 throw Error(bignumberError + "Invalid BigNumber: " + v3);
51562 BigNumber2.maximum = BigNumber2.max = function() {
51563 return maxOrMin(arguments, -1);
51565 BigNumber2.minimum = BigNumber2.min = function() {
51566 return maxOrMin(arguments, 1);
51568 BigNumber2.random = (function() {
51569 var pow2_53 = 9007199254740992;
51570 var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
51571 return mathfloor(Math.random() * pow2_53);
51573 return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
51575 return function(dp) {
51576 var a2, b3, e3, k2, v3, i3 = 0, c2 = [], rand = new BigNumber2(ONE);
51577 if (dp == null) dp = DECIMAL_PLACES;
51578 else intCheck(dp, 0, MAX);
51579 k2 = mathceil(dp / LOG_BASE);
51581 if (crypto.getRandomValues) {
51582 a2 = crypto.getRandomValues(new Uint32Array(k2 *= 2));
51583 for (; i3 < k2; ) {
51584 v3 = a2[i3] * 131072 + (a2[i3 + 1] >>> 11);
51586 b3 = crypto.getRandomValues(new Uint32Array(2));
51588 a2[i3 + 1] = b3[1];
51590 c2.push(v3 % 1e14);
51595 } else if (crypto.randomBytes) {
51596 a2 = crypto.randomBytes(k2 *= 7);
51597 for (; i3 < k2; ) {
51598 v3 = (a2[i3] & 31) * 281474976710656 + a2[i3 + 1] * 1099511627776 + a2[i3 + 2] * 4294967296 + a2[i3 + 3] * 16777216 + (a2[i3 + 4] << 16) + (a2[i3 + 5] << 8) + a2[i3 + 6];
51600 crypto.randomBytes(7).copy(a2, i3);
51602 c2.push(v3 % 1e14);
51609 throw Error(bignumberError + "crypto unavailable");
51613 for (; i3 < k2; ) {
51614 v3 = random53bitInt();
51615 if (v3 < 9e15) c2[i3++] = v3 % 1e14;
51621 v3 = POWS_TEN[LOG_BASE - dp];
51622 c2[i3] = mathfloor(k2 / v3) * v3;
51624 for (; c2[i3] === 0; c2.pop(), i3--) ;
51628 for (e3 = -1; c2[0] === 0; c2.splice(0, 1), e3 -= LOG_BASE) ;
51629 for (i3 = 1, v3 = c2[0]; v3 >= 10; v3 /= 10, i3++) ;
51630 if (i3 < LOG_BASE) e3 -= LOG_BASE - i3;
51637 BigNumber2.sum = function() {
51638 var i3 = 1, args = arguments, sum = new BigNumber2(args[0]);
51639 for (; i3 < args.length; ) sum = sum.plus(args[i3++]);
51642 convertBase = /* @__PURE__ */ (function() {
51643 var decimal = "0123456789";
51644 function toBaseOut(str, baseIn, baseOut, alphabet) {
51645 var j3, arr = [0], arrL, i3 = 0, len = str.length;
51646 for (; i3 < len; ) {
51647 for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
51648 arr[0] += alphabet.indexOf(str.charAt(i3++));
51649 for (j3 = 0; j3 < arr.length; j3++) {
51650 if (arr[j3] > baseOut - 1) {
51651 if (arr[j3 + 1] == null) arr[j3 + 1] = 0;
51652 arr[j3 + 1] += arr[j3] / baseOut | 0;
51653 arr[j3] %= baseOut;
51657 return arr.reverse();
51659 return function(str, baseIn, baseOut, sign2, callerIsToString) {
51660 var alphabet, d4, e3, k2, r2, x2, xc, y3, i3 = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
51662 k2 = POW_PRECISION;
51664 str = str.replace(".", "");
51665 y3 = new BigNumber2(baseIn);
51666 x2 = y3.pow(str.length - i3);
51667 POW_PRECISION = k2;
51669 toFixedPoint(coeffToString(x2.c), x2.e, "0"),
51674 y3.e = y3.c.length;
51676 xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
51677 e3 = k2 = xc.length;
51678 for (; xc[--k2] == 0; xc.pop()) ;
51679 if (!xc[0]) return alphabet.charAt(0);
51686 x2 = div(x2, y3, dp, rm, baseOut);
51694 r2 = r2 || d4 < 0 || xc[d4 + 1] != null;
51695 r2 = rm < 4 ? (i3 != null || r2) && (rm == 0 || rm == (x2.s < 0 ? 3 : 2)) : i3 > k2 || i3 == k2 && (rm == 4 || r2 || rm == 6 && xc[d4 - 1] & 1 || rm == (x2.s < 0 ? 8 : 7));
51696 if (d4 < 1 || !xc[0]) {
51697 str = r2 ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
51701 for (--baseOut; ++xc[--d4] > baseOut; ) {
51705 xc = [1].concat(xc);
51709 for (k2 = xc.length; !xc[--k2]; ) ;
51710 for (i3 = 0, str = ""; i3 <= k2; str += alphabet.charAt(xc[i3++])) ;
51711 str = toFixedPoint(str, e3, alphabet.charAt(0));
51716 div = /* @__PURE__ */ (function() {
51717 function multiply(x2, k2, base) {
51718 var m3, temp, xlo, xhi, carry = 0, i3 = x2.length, klo = k2 % SQRT_BASE, khi = k2 / SQRT_BASE | 0;
51719 for (x2 = x2.slice(); i3--; ) {
51720 xlo = x2[i3] % SQRT_BASE;
51721 xhi = x2[i3] / SQRT_BASE | 0;
51722 m3 = khi * xlo + xhi * klo;
51723 temp = klo * xlo + m3 % SQRT_BASE * SQRT_BASE + carry;
51724 carry = (temp / base | 0) + (m3 / SQRT_BASE | 0) + khi * xhi;
51725 x2[i3] = temp % base;
51727 if (carry) x2 = [carry].concat(x2);
51730 function compare2(a2, b3, aL, bL) {
51733 cmp = aL > bL ? 1 : -1;
51735 for (i3 = cmp = 0; i3 < aL; i3++) {
51736 if (a2[i3] != b3[i3]) {
51737 cmp = a2[i3] > b3[i3] ? 1 : -1;
51744 function subtract(a2, b3, aL, base) {
51748 i3 = a2[aL] < b3[aL] ? 1 : 0;
51749 a2[aL] = i3 * base + a2[aL] - b3[aL];
51751 for (; !a2[0] && a2.length > 1; a2.splice(0, 1)) ;
51753 return function(x2, y3, dp, rm, base) {
51754 var cmp, e3, i3, more, n3, prod, prodL, q3, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s2 = x2.s == y3.s ? 1 : -1, xc = x2.c, yc = y3.c;
51755 if (!xc || !xc[0] || !yc || !yc[0]) {
51756 return new BigNumber2(
51757 // Return NaN if either NaN, or both Infinity or 0.
51758 !x2.s || !y3.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
51759 // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
51760 xc && xc[0] == 0 || !yc ? s2 * 0 : s2 / 0
51764 q3 = new BigNumber2(s2);
51770 e3 = bitFloor(x2.e / LOG_BASE) - bitFloor(y3.e / LOG_BASE);
51771 s2 = s2 / LOG_BASE | 0;
51773 for (i3 = 0; yc[i3] == (xc[i3] || 0); i3++) ;
51774 if (yc[i3] > (xc[i3] || 0)) e3--;
51783 n3 = mathfloor(base / (yc[0] + 1));
51785 yc = multiply(yc, n3, base);
51786 xc = multiply(xc, n3, base);
51791 rem = xc.slice(0, yL);
51793 for (; remL < yL; rem[remL++] = 0) ;
51795 yz = [0].concat(yz);
51797 if (yc[1] >= base / 2) yc0++;
51800 cmp = compare2(yc, rem, yL, remL);
51803 if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
51804 n3 = mathfloor(rem0 / yc0);
51806 if (n3 >= base) n3 = base - 1;
51807 prod = multiply(yc, n3, base);
51808 prodL = prod.length;
51810 while (compare2(prod, rem, prodL, remL) == 1) {
51812 subtract(prod, yL < prodL ? yz : yc, prodL, base);
51813 prodL = prod.length;
51821 prodL = prod.length;
51823 if (prodL < remL) prod = [0].concat(prod);
51824 subtract(rem, prod, remL, base);
51827 while (compare2(yc, rem, yL, remL) < 1) {
51829 subtract(rem, yL < remL ? yz : yc, remL, base);
51833 } else if (cmp === 0) {
51839 rem[remL++] = xc[xi] || 0;
51844 } while ((xi++ < xL || rem[0] != null) && s2--);
51845 more = rem[0] != null;
51846 if (!qc[0]) qc.splice(0, 1);
51848 if (base == BASE) {
51849 for (i3 = 1, s2 = qc[0]; s2 >= 10; s2 /= 10, i3++) ;
51850 round(q3, dp + (q3.e = i3 + e3 * LOG_BASE - 1) + 1, rm, more);
51858 function format2(n3, i3, rm, id2) {
51859 var c0, e3, ne2, len, str;
51860 if (rm == null) rm = ROUNDING_MODE;
51861 else intCheck(rm, 0, 8);
51862 if (!n3.c) return n3.toString();
51866 str = coeffToString(n3.c);
51867 str = id2 == 1 || id2 == 2 && (ne2 <= TO_EXP_NEG || ne2 >= TO_EXP_POS) ? toExponential(str, ne2) : toFixedPoint(str, ne2, "0");
51869 n3 = round(new BigNumber2(n3), i3, rm);
51871 str = coeffToString(n3.c);
51873 if (id2 == 1 || id2 == 2 && (i3 <= e3 || e3 <= TO_EXP_NEG)) {
51874 for (; len < i3; str += "0", len++) ;
51875 str = toExponential(str, e3);
51878 str = toFixedPoint(str, e3, "0");
51879 if (e3 + 1 > len) {
51880 if (--i3 > 0) for (str += "."; i3--; str += "0") ;
51884 if (e3 + 1 == len) str += ".";
51885 for (; i3--; str += "0") ;
51890 return n3.s < 0 && c0 ? "-" + str : str;
51892 function maxOrMin(args, n3) {
51893 var k2, y3, i3 = 1, x2 = new BigNumber2(args[0]);
51894 for (; i3 < args.length; i3++) {
51895 y3 = new BigNumber2(args[i3]);
51896 if (!y3.s || (k2 = compare(x2, y3)) === n3 || k2 === 0 && x2.s === n3) {
51902 function normalise(n3, c2, e3) {
51903 var i3 = 1, j3 = c2.length;
51904 for (; !c2[--j3]; c2.pop()) ;
51905 for (j3 = c2[0]; j3 >= 10; j3 /= 10, i3++) ;
51906 if ((e3 = i3 + e3 * LOG_BASE - 1) > MAX_EXP) {
51907 n3.c = n3.e = null;
51908 } else if (e3 < MIN_EXP) {
51916 parseNumeric2 = /* @__PURE__ */ (function() {
51917 var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
51918 return function(x2, str, isNum, b3) {
51919 var base, s2 = isNum ? str : str.replace(whitespaceOrPlus, "");
51920 if (isInfinityOrNaN.test(s2)) {
51921 x2.s = isNaN(s2) ? null : s2 < 0 ? -1 : 1;
51924 s2 = s2.replace(basePrefix, function(m3, p1, p2) {
51925 base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
51926 return !b3 || b3 == base ? p1 : m3;
51930 s2 = s2.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
51932 if (str != s2) return new BigNumber2(s2, base);
51934 if (BigNumber2.DEBUG) {
51935 throw Error(bignumberError + "Not a" + (b3 ? " base " + b3 : "") + " number: " + str);
51939 x2.c = x2.e = null;
51942 function round(x2, sd, rm, r2) {
51943 var d4, i3, j3, k2, n3, ni, rd, xc = x2.c, pows10 = POWS_TEN;
51946 for (d4 = 1, k2 = xc[0]; k2 >= 10; k2 /= 10, d4++) ;
51952 rd = mathfloor(n3 / pows10[d4 - j3 - 1] % 10);
51954 ni = mathceil((i3 + 1) / LOG_BASE);
51955 if (ni >= xc.length) {
51957 for (; xc.length <= ni; xc.push(0)) ;
51961 j3 = i3 - LOG_BASE + 1;
51967 for (d4 = 1; k2 >= 10; k2 /= 10, d4++) ;
51969 j3 = i3 - LOG_BASE + d4;
51970 rd = j3 < 0 ? 0 : mathfloor(n3 / pows10[d4 - j3 - 1] % 10);
51973 r2 = r2 || sd < 0 || // Are there any non-zero digits after the rounding digit?
51974 // The expression n % pows10[d - j - 1] returns all digits of n to the right
51975 // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
51976 xc[ni + 1] != null || (j3 < 0 ? n3 : n3 % pows10[d4 - j3 - 1]);
51977 r2 = rm < 4 ? (rd || r2) && (rm == 0 || rm == (x2.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r2 || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.
51978 (i3 > 0 ? j3 > 0 ? n3 / pows10[d4 - j3] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x2.s < 0 ? 8 : 7));
51979 if (sd < 1 || !xc[0]) {
51983 xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
51995 xc.length = ni + 1;
51996 k2 = pows10[LOG_BASE - i3];
51997 xc[ni] = j3 > 0 ? mathfloor(n3 / pows10[d4 - j3] % pows10[j3]) * k2 : 0;
52002 for (i3 = 1, j3 = xc[0]; j3 >= 10; j3 /= 10, i3++) ;
52004 for (k2 = 1; j3 >= 10; j3 /= 10, k2++) ;
52007 if (xc[0] == BASE) xc[0] = 1;
52012 if (xc[ni] != BASE) break;
52018 for (i3 = xc.length; xc[--i3] === 0; xc.pop()) ;
52020 if (x2.e > MAX_EXP) {
52021 x2.c = x2.e = null;
52022 } else if (x2.e < MIN_EXP) {
52028 function valueOf(n3) {
52029 var str, e3 = n3.e;
52030 if (e3 === null) return n3.toString();
52031 str = coeffToString(n3.c);
52032 str = e3 <= TO_EXP_NEG || e3 >= TO_EXP_POS ? toExponential(str, e3) : toFixedPoint(str, e3, "0");
52033 return n3.s < 0 ? "-" + str : str;
52035 P3.absoluteValue = P3.abs = function() {
52036 var x2 = new BigNumber2(this);
52037 if (x2.s < 0) x2.s = 1;
52040 P3.comparedTo = function(y3, b3) {
52041 return compare(this, new BigNumber2(y3, b3));
52043 P3.decimalPlaces = P3.dp = function(dp, rm) {
52044 var c2, n3, v3, x2 = this;
52046 intCheck(dp, 0, MAX);
52047 if (rm == null) rm = ROUNDING_MODE;
52048 else intCheck(rm, 0, 8);
52049 return round(new BigNumber2(x2), dp + x2.e + 1, rm);
52051 if (!(c2 = x2.c)) return null;
52052 n3 = ((v3 = c2.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
52053 if (v3 = c2[v3]) for (; v3 % 10 == 0; v3 /= 10, n3--) ;
52054 if (n3 < 0) n3 = 0;
52057 P3.dividedBy = P3.div = function(y3, b3) {
52058 return div(this, new BigNumber2(y3, b3), DECIMAL_PLACES, ROUNDING_MODE);
52060 P3.dividedToIntegerBy = P3.idiv = function(y3, b3) {
52061 return div(this, new BigNumber2(y3, b3), 0, 1);
52063 P3.exponentiatedBy = P3.pow = function(n3, m3) {
52064 var half, isModExp, i3, k2, more, nIsBig, nIsNeg, nIsOdd, y3, x2 = this;
52065 n3 = new BigNumber2(n3);
52066 if (n3.c && !n3.isInteger()) {
52067 throw Error(bignumberError + "Exponent not an integer: " + valueOf(n3));
52069 if (m3 != null) m3 = new BigNumber2(m3);
52070 nIsBig = n3.e > 14;
52071 if (!x2.c || !x2.c[0] || x2.c[0] == 1 && !x2.e && x2.c.length == 1 || !n3.c || !n3.c[0]) {
52072 y3 = new BigNumber2(Math.pow(+valueOf(x2), nIsBig ? n3.s * (2 - isOdd(n3)) : +valueOf(n3)));
52073 return m3 ? y3.mod(m3) : y3;
52077 if (m3.c ? !m3.c[0] : !m3.s) return new BigNumber2(NaN);
52078 isModExp = !nIsNeg && x2.isInteger() && m3.isInteger();
52079 if (isModExp) x2 = x2.mod(m3);
52080 } else if (n3.e > 9 && (x2.e > 0 || x2.e < -1 || (x2.e == 0 ? x2.c[0] > 1 || nIsBig && x2.c[1] >= 24e7 : x2.c[0] < 8e13 || nIsBig && x2.c[0] <= 9999975e7))) {
52081 k2 = x2.s < 0 && isOdd(n3) ? -0 : 0;
52082 if (x2.e > -1) k2 = 1 / k2;
52083 return new BigNumber2(nIsNeg ? 1 / k2 : k2);
52084 } else if (POW_PRECISION) {
52085 k2 = mathceil(POW_PRECISION / LOG_BASE + 2);
52088 half = new BigNumber2(0.5);
52089 if (nIsNeg) n3.s = 1;
52090 nIsOdd = isOdd(n3);
52092 i3 = Math.abs(+valueOf(n3));
52095 y3 = new BigNumber2(ONE);
52101 if (y3.c.length > k2) y3.c.length = k2;
52102 } else if (isModExp) {
52107 i3 = mathfloor(i3 / 2);
52108 if (i3 === 0) break;
52111 n3 = n3.times(half);
52112 round(n3, n3.e + 1, 1);
52114 nIsOdd = isOdd(n3);
52117 if (i3 === 0) break;
52123 if (x2.c && x2.c.length > k2) x2.c.length = k2;
52124 } else if (isModExp) {
52128 if (isModExp) return y3;
52129 if (nIsNeg) y3 = ONE.div(y3);
52130 return m3 ? y3.mod(m3) : k2 ? round(y3, POW_PRECISION, ROUNDING_MODE, more) : y3;
52132 P3.integerValue = function(rm) {
52133 var n3 = new BigNumber2(this);
52134 if (rm == null) rm = ROUNDING_MODE;
52135 else intCheck(rm, 0, 8);
52136 return round(n3, n3.e + 1, rm);
52138 P3.isEqualTo = P3.eq = function(y3, b3) {
52139 return compare(this, new BigNumber2(y3, b3)) === 0;
52141 P3.isFinite = function() {
52144 P3.isGreaterThan = P3.gt = function(y3, b3) {
52145 return compare(this, new BigNumber2(y3, b3)) > 0;
52147 P3.isGreaterThanOrEqualTo = P3.gte = function(y3, b3) {
52148 return (b3 = compare(this, new BigNumber2(y3, b3))) === 1 || b3 === 0;
52150 P3.isInteger = function() {
52151 return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
52153 P3.isLessThan = P3.lt = function(y3, b3) {
52154 return compare(this, new BigNumber2(y3, b3)) < 0;
52156 P3.isLessThanOrEqualTo = P3.lte = function(y3, b3) {
52157 return (b3 = compare(this, new BigNumber2(y3, b3))) === -1 || b3 === 0;
52159 P3.isNaN = function() {
52162 P3.isNegative = function() {
52165 P3.isPositive = function() {
52168 P3.isZero = function() {
52169 return !!this.c && this.c[0] == 0;
52171 P3.minus = function(y3, b3) {
52172 var i3, j3, t2, xLTy, x2 = this, a2 = x2.s;
52173 y3 = new BigNumber2(y3, b3);
52175 if (!a2 || !b3) return new BigNumber2(NaN);
52178 return x2.plus(y3);
52180 var xe3 = x2.e / LOG_BASE, ye3 = y3.e / LOG_BASE, xc = x2.c, yc = y3.c;
52181 if (!xe3 || !ye3) {
52182 if (!xc || !yc) return xc ? (y3.s = -b3, y3) : new BigNumber2(yc ? x2 : NaN);
52183 if (!xc[0] || !yc[0]) {
52184 return yc[0] ? (y3.s = -b3, y3) : new BigNumber2(xc[0] ? x2 : (
52185 // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
52186 ROUNDING_MODE == 3 ? -0 : 0
52190 xe3 = bitFloor(xe3);
52191 ye3 = bitFloor(ye3);
52193 if (a2 = xe3 - ye3) {
52194 if (xLTy = a2 < 0) {
52202 for (b3 = a2; b3--; t2.push(0)) ;
52205 j3 = (xLTy = (a2 = xc.length) < (b3 = yc.length)) ? a2 : b3;
52206 for (a2 = b3 = 0; b3 < j3; b3++) {
52207 if (xc[b3] != yc[b3]) {
52208 xLTy = xc[b3] < yc[b3];
52219 b3 = (j3 = yc.length) - (i3 = xc.length);
52220 if (b3 > 0) for (; b3--; xc[i3++] = 0) ;
52222 for (; j3 > a2; ) {
52223 if (xc[--j3] < yc[j3]) {
52224 for (i3 = j3; i3 && !xc[--i3]; xc[i3] = b3) ;
52230 for (; xc[0] == 0; xc.splice(0, 1), --ye3) ;
52232 y3.s = ROUNDING_MODE == 3 ? -1 : 1;
52236 return normalise(y3, xc, ye3);
52238 P3.modulo = P3.mod = function(y3, b3) {
52239 var q3, s2, x2 = this;
52240 y3 = new BigNumber2(y3, b3);
52241 if (!x2.c || !y3.s || y3.c && !y3.c[0]) {
52242 return new BigNumber2(NaN);
52243 } else if (!y3.c || x2.c && !x2.c[0]) {
52244 return new BigNumber2(x2);
52246 if (MODULO_MODE == 9) {
52249 q3 = div(x2, y3, 0, 3);
52253 q3 = div(x2, y3, 0, MODULO_MODE);
52255 y3 = x2.minus(q3.times(y3));
52256 if (!y3.c[0] && MODULO_MODE == 1) y3.s = x2.s;
52259 P3.multipliedBy = P3.times = function(y3, b3) {
52260 var c2, e3, i3, j3, k2, m3, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x2 = this, xc = x2.c, yc = (y3 = new BigNumber2(y3, b3)).c;
52261 if (!xc || !yc || !xc[0] || !yc[0]) {
52262 if (!x2.s || !y3.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
52263 y3.c = y3.e = y3.s = null;
52267 y3.c = y3.e = null;
52275 e3 = bitFloor(x2.e / LOG_BASE) + bitFloor(y3.e / LOG_BASE);
52287 for (i3 = xcL + ycL, zc = []; i3--; zc.push(0)) ;
52289 sqrtBase = SQRT_BASE;
52290 for (i3 = ycL; --i3 >= 0; ) {
52292 ylo = yc[i3] % sqrtBase;
52293 yhi = yc[i3] / sqrtBase | 0;
52294 for (k2 = xcL, j3 = i3 + k2; j3 > i3; ) {
52295 xlo = xc[--k2] % sqrtBase;
52296 xhi = xc[k2] / sqrtBase | 0;
52297 m3 = yhi * xlo + xhi * ylo;
52298 xlo = ylo * xlo + m3 % sqrtBase * sqrtBase + zc[j3] + c2;
52299 c2 = (xlo / base | 0) + (m3 / sqrtBase | 0) + yhi * xhi;
52300 zc[j3--] = xlo % base;
52309 return normalise(y3, zc, e3);
52311 P3.negated = function() {
52312 var x2 = new BigNumber2(this);
52313 x2.s = -x2.s || null;
52316 P3.plus = function(y3, b3) {
52317 var t2, x2 = this, a2 = x2.s;
52318 y3 = new BigNumber2(y3, b3);
52320 if (!a2 || !b3) return new BigNumber2(NaN);
52323 return x2.minus(y3);
52325 var xe3 = x2.e / LOG_BASE, ye3 = y3.e / LOG_BASE, xc = x2.c, yc = y3.c;
52326 if (!xe3 || !ye3) {
52327 if (!xc || !yc) return new BigNumber2(a2 / 0);
52328 if (!xc[0] || !yc[0]) return yc[0] ? y3 : new BigNumber2(xc[0] ? x2 : a2 * 0);
52330 xe3 = bitFloor(xe3);
52331 ye3 = bitFloor(ye3);
52333 if (a2 = xe3 - ye3) {
52342 for (; a2--; t2.push(0)) ;
52353 for (a2 = 0; b3; ) {
52354 a2 = (xc[--b3] = xc[b3] + yc[b3] + a2) / BASE | 0;
52355 xc[b3] = BASE === xc[b3] ? 0 : xc[b3] % BASE;
52358 xc = [a2].concat(xc);
52361 return normalise(y3, xc, ye3);
52363 P3.precision = P3.sd = function(sd, rm) {
52364 var c2, n3, v3, x2 = this;
52365 if (sd != null && sd !== !!sd) {
52366 intCheck(sd, 1, MAX);
52367 if (rm == null) rm = ROUNDING_MODE;
52368 else intCheck(rm, 0, 8);
52369 return round(new BigNumber2(x2), sd, rm);
52371 if (!(c2 = x2.c)) return null;
52372 v3 = c2.length - 1;
52373 n3 = v3 * LOG_BASE + 1;
52375 for (; v3 % 10 == 0; v3 /= 10, n3--) ;
52376 for (v3 = c2[0]; v3 >= 10; v3 /= 10, n3++) ;
52378 if (sd && x2.e + 1 > n3) n3 = x2.e + 1;
52381 P3.shiftedBy = function(k2) {
52382 intCheck(k2, -MAX_SAFE_INTEGER3, MAX_SAFE_INTEGER3);
52383 return this.times("1e" + k2);
52385 P3.squareRoot = P3.sqrt = function() {
52386 var m3, n3, r2, rep, t2, x2 = this, c2 = x2.c, s2 = x2.s, e3 = x2.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5");
52387 if (s2 !== 1 || !c2 || !c2[0]) {
52388 return new BigNumber2(!s2 || s2 < 0 && (!c2 || c2[0]) ? NaN : c2 ? x2 : 1 / 0);
52390 s2 = Math.sqrt(+valueOf(x2));
52391 if (s2 == 0 || s2 == 1 / 0) {
52392 n3 = coeffToString(c2);
52393 if ((n3.length + e3) % 2 == 0) n3 += "0";
52394 s2 = Math.sqrt(+n3);
52395 e3 = bitFloor((e3 + 1) / 2) - (e3 < 0 || e3 % 2);
52399 n3 = s2.toExponential();
52400 n3 = n3.slice(0, n3.indexOf("e") + 1) + e3;
52402 r2 = new BigNumber2(n3);
52404 r2 = new BigNumber2(s2 + "");
52409 if (s2 < 3) s2 = 0;
52412 r2 = half.times(t2.plus(div(x2, t2, dp, 1)));
52413 if (coeffToString(t2.c).slice(0, s2) === (n3 = coeffToString(r2.c)).slice(0, s2)) {
52414 if (r2.e < e3) --s2;
52415 n3 = n3.slice(s2 - 3, s2 + 1);
52416 if (n3 == "9999" || !rep && n3 == "4999") {
52418 round(t2, t2.e + DECIMAL_PLACES + 2, 0);
52419 if (t2.times(t2).eq(x2)) {
52428 if (!+n3 || !+n3.slice(1) && n3.charAt(0) == "5") {
52429 round(r2, r2.e + DECIMAL_PLACES + 2, 1);
52430 m3 = !r2.times(r2).eq(x2);
52437 return round(r2, r2.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m3);
52439 P3.toExponential = function(dp, rm) {
52441 intCheck(dp, 0, MAX);
52444 return format2(this, dp, rm, 1);
52446 P3.toFixed = function(dp, rm) {
52448 intCheck(dp, 0, MAX);
52449 dp = dp + this.e + 1;
52451 return format2(this, dp, rm);
52453 P3.toFormat = function(dp, rm, format3) {
52454 var str, x2 = this;
52455 if (format3 == null) {
52456 if (dp != null && rm && typeof rm == "object") {
52459 } else if (dp && typeof dp == "object") {
52465 } else if (typeof format3 != "object") {
52466 throw Error(bignumberError + "Argument not an object: " + format3);
52468 str = x2.toFixed(dp, rm);
52470 var i3, arr = str.split("."), g1 = +format3.groupSize, g22 = +format3.secondaryGroupSize, groupSeparator = format3.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x2.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
52477 if (g1 > 0 && len > 0) {
52478 i3 = len % g1 || g1;
52479 intPart = intDigits.substr(0, i3);
52480 for (; i3 < len; i3 += g1) intPart += groupSeparator + intDigits.substr(i3, g1);
52481 if (g22 > 0) intPart += groupSeparator + intDigits.slice(i3);
52482 if (isNeg) intPart = "-" + intPart;
52484 str = fractionPart ? intPart + (format3.decimalSeparator || "") + ((g22 = +format3.fractionGroupSize) ? fractionPart.replace(
52485 new RegExp("\\d{" + g22 + "}\\B", "g"),
52486 "$&" + (format3.fractionGroupSeparator || "")
52487 ) : fractionPart) : intPart;
52489 return (format3.prefix || "") + str + (format3.suffix || "");
52491 P3.toFraction = function(md) {
52492 var d4, d0, d1, d22, e3, exp2, n3, n0, n1, q3, r2, s2, x2 = this, xc = x2.c;
52494 n3 = new BigNumber2(md);
52495 if (!n3.isInteger() && (n3.c || n3.s !== 1) || n3.lt(ONE)) {
52496 throw Error(bignumberError + "Argument " + (n3.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n3));
52499 if (!xc) return new BigNumber2(x2);
52500 d4 = new BigNumber2(ONE);
52501 n1 = d0 = new BigNumber2(ONE);
52502 d1 = n0 = new BigNumber2(ONE);
52503 s2 = coeffToString(xc);
52504 e3 = d4.e = s2.length - x2.e - 1;
52505 d4.c[0] = POWS_TEN[(exp2 = e3 % LOG_BASE) < 0 ? LOG_BASE + exp2 : exp2];
52506 md = !md || n3.comparedTo(d4) > 0 ? e3 > 0 ? d4 : n1 : n3;
52509 n3 = new BigNumber2(s2);
52512 q3 = div(n3, d4, 0, 1);
52513 d22 = d0.plus(q3.times(d1));
52514 if (d22.comparedTo(md) == 1) break;
52517 n1 = n0.plus(q3.times(d22 = n1));
52519 d4 = n3.minus(q3.times(d22 = d4));
52522 d22 = div(md.minus(d0), d1, 0, 1);
52523 n0 = n0.plus(d22.times(n1));
52524 d0 = d0.plus(d22.times(d1));
52525 n0.s = n1.s = x2.s;
52527 r2 = div(n1, d1, e3, ROUNDING_MODE).minus(x2).abs().comparedTo(
52528 div(n0, d0, e3, ROUNDING_MODE).minus(x2).abs()
52529 ) < 1 ? [n1, d1] : [n0, d0];
52533 P3.toNumber = function() {
52534 return +valueOf(this);
52536 P3.toPrecision = function(sd, rm) {
52537 if (sd != null) intCheck(sd, 1, MAX);
52538 return format2(this, sd, rm, 2);
52540 P3.toString = function(b3) {
52541 var str, n3 = this, s2 = n3.s, e3 = n3.e;
52545 if (s2 < 0) str = "-" + str;
52551 str = e3 <= TO_EXP_NEG || e3 >= TO_EXP_POS ? toExponential(coeffToString(n3.c), e3) : toFixedPoint(coeffToString(n3.c), e3, "0");
52552 } else if (b3 === 10 && alphabetHasNormalDecimalDigits) {
52553 n3 = round(new BigNumber2(n3), DECIMAL_PLACES + e3 + 1, ROUNDING_MODE);
52554 str = toFixedPoint(coeffToString(n3.c), n3.e, "0");
52556 intCheck(b3, 2, ALPHABET.length, "Base");
52557 str = convertBase(toFixedPoint(coeffToString(n3.c), e3, "0"), 10, b3, s2, true);
52559 if (s2 < 0 && n3.c[0]) str = "-" + str;
52563 P3.valueOf = P3.toJSON = function() {
52564 return valueOf(this);
52566 P3._isBigNumber = true;
52567 P3[Symbol.toStringTag] = "BigNumber";
52568 P3[Symbol.for("nodejs.util.inspect.custom")] = P3.valueOf;
52569 if (configObject != null) BigNumber2.set(configObject);
52572 function bitFloor(n3) {
52574 return n3 > 0 || n3 === i3 ? i3 : i3 - 1;
52576 function coeffToString(a2) {
52577 var s2, z3, i3 = 1, j3 = a2.length, r2 = a2[0] + "";
52578 for (; i3 < j3; ) {
52579 s2 = a2[i3++] + "";
52580 z3 = LOG_BASE - s2.length;
52581 for (; z3--; s2 = "0" + s2) ;
52584 for (j3 = r2.length; r2.charCodeAt(--j3) === 48; ) ;
52585 return r2.slice(0, j3 + 1 || 1);
52587 function compare(x2, y3) {
52588 var a2, b3, xc = x2.c, yc = y3.c, i3 = x2.s, j3 = y3.s, k2 = x2.e, l4 = y3.e;
52589 if (!i3 || !j3) return null;
52592 if (a2 || b3) return a2 ? b3 ? 0 : -j3 : i3;
52593 if (i3 != j3) return i3;
52596 if (!xc || !yc) return b3 ? 0 : !xc ^ a2 ? 1 : -1;
52597 if (!b3) return k2 > l4 ^ a2 ? 1 : -1;
52598 j3 = (k2 = xc.length) < (l4 = yc.length) ? k2 : l4;
52599 for (i3 = 0; i3 < j3; i3++) if (xc[i3] != yc[i3]) return xc[i3] > yc[i3] ^ a2 ? 1 : -1;
52600 return k2 == l4 ? 0 : k2 > l4 ^ a2 ? 1 : -1;
52602 function intCheck(n3, min3, max3, name) {
52603 if (n3 < min3 || n3 > max3 || n3 !== mathfloor(n3)) {
52604 throw Error(bignumberError + (name || "Argument") + (typeof n3 == "number" ? n3 < min3 || n3 > max3 ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n3));
52607 function isOdd(n3) {
52608 var k2 = n3.c.length - 1;
52609 return bitFloor(n3.e / LOG_BASE) == k2 && n3.c[k2] % 2 != 0;
52611 function toExponential(str, e3) {
52612 return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e3 < 0 ? "e" : "e+") + e3;
52614 function toFixedPoint(str, e3, z3) {
52617 for (zs = z3 + "."; ++e3; zs += z3) ;
52622 for (zs = z3, e3 -= len; --e3; zs += z3) ;
52624 } else if (e3 < len) {
52625 str = str.slice(0, e3) + "." + str.slice(e3);
52630 var isNumeric, mathceil, mathfloor, bignumberError, tooManyDigits, BASE, LOG_BASE, MAX_SAFE_INTEGER3, POWS_TEN, SQRT_BASE, MAX, BigNumber, bignumber_default;
52631 var init_bignumber = __esm({
52632 "node_modules/bignumber.js/bignumber.mjs"() {
52633 isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
52634 mathceil = Math.ceil;
52635 mathfloor = Math.floor;
52636 bignumberError = "[BigNumber Error] ";
52637 tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ";
52640 MAX_SAFE_INTEGER3 = 9007199254740991;
52641 POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13];
52644 BigNumber = clone();
52645 bignumber_default = BigNumber;
52649 // node_modules/splaytree-ts/dist/esm/index.js
52650 var SplayTreeNode, SplayTreeSetNode, SplayTree, _a2, _b, SplayTreeSet, SplayTreeIterableIterator, SplayTreeKeyIterableIterator, SplayTreeSetEntryIterableIterator;
52651 var init_esm4 = __esm({
52652 "node_modules/splaytree-ts/dist/esm/index.js"() {
52653 SplayTreeNode = class {
52655 __publicField(this, "key");
52656 __publicField(this, "left", null);
52657 __publicField(this, "right", null);
52661 SplayTreeSetNode = class extends SplayTreeNode {
52666 SplayTree = class {
52668 __publicField(this, "size", 0);
52669 __publicField(this, "modificationCount", 0);
52670 __publicField(this, "splayCount", 0);
52673 const root3 = this.root;
52674 if (root3 == null) {
52675 this.compare(key, key);
52679 let newTreeRight = null;
52681 let newTreeLeft = null;
52682 let current = root3;
52683 const compare2 = this.compare;
52686 comp = compare2(current.key, key);
52688 let currentLeft = current.left;
52689 if (currentLeft == null) break;
52690 comp = compare2(currentLeft.key, key);
52692 current.left = currentLeft.right;
52693 currentLeft.right = current;
52694 current = currentLeft;
52695 currentLeft = current.left;
52696 if (currentLeft == null) break;
52698 if (right == null) {
52699 newTreeRight = current;
52701 right.left = current;
52704 current = currentLeft;
52705 } else if (comp < 0) {
52706 let currentRight = current.right;
52707 if (currentRight == null) break;
52708 comp = compare2(currentRight.key, key);
52710 current.right = currentRight.left;
52711 currentRight.left = current;
52712 current = currentRight;
52713 currentRight = current.right;
52714 if (currentRight == null) break;
52716 if (left == null) {
52717 newTreeLeft = current;
52719 left.right = current;
52722 current = currentRight;
52727 if (left != null) {
52728 left.right = current.left;
52729 current.left = newTreeLeft;
52731 if (right != null) {
52732 right.left = current.right;
52733 current.right = newTreeRight;
52735 if (this.root !== current) {
52736 this.root = current;
52742 let current = node;
52743 let nextLeft = current.left;
52744 while (nextLeft != null) {
52745 const left = nextLeft;
52746 current.left = left.right;
52747 left.right = current;
52749 nextLeft = current.left;
52754 let current = node;
52755 let nextRight = current.right;
52756 while (nextRight != null) {
52757 const right = nextRight;
52758 current.right = right.left;
52759 right.left = current;
52761 nextRight = current.right;
52766 if (this.root == null) return null;
52767 const comp = this.splay(key);
52768 if (comp != 0) return null;
52769 let root3 = this.root;
52770 const result = root3;
52771 const left = root3.left;
52773 if (left == null) {
52774 this.root = root3.right;
52776 const right = root3.right;
52777 root3 = this.splayMax(left);
52778 root3.right = right;
52781 this.modificationCount++;
52784 addNewRoot(node, comp) {
52786 this.modificationCount++;
52787 const root3 = this.root;
52788 if (root3 == null) {
52794 node.right = root3.right;
52795 root3.right = null;
52797 node.right = root3;
52798 node.left = root3.left;
52804 const root3 = this.root;
52805 if (root3 == null) return null;
52806 this.root = this.splayMin(root3);
52810 const root3 = this.root;
52811 if (root3 == null) return null;
52812 this.root = this.splayMax(root3);
52818 this.modificationCount++;
52821 return this.validKey(key) && this.splay(key) == 0;
52824 return (a2, b3) => a2 < b3 ? -1 : a2 > b3 ? 1 : 0;
52831 setRoot: (root3) => {
52837 getModificationCount: () => {
52838 return this.modificationCount;
52840 getSplayCount: () => {
52841 return this.splayCount;
52843 setSplayCount: (count) => {
52844 this.splayCount = count;
52847 return this.splay(key);
52850 return this.has(key);
52855 SplayTreeSet = class _SplayTreeSet extends SplayTree {
52856 constructor(compare2, isValidKey) {
52858 __publicField(this, "root", null);
52859 __publicField(this, "compare");
52860 __publicField(this, "validKey");
52861 __publicField(this, _a2, "[object Set]");
52862 this.compare = compare2 != null ? compare2 : this.defaultCompare();
52863 this.validKey = isValidKey != null ? isValidKey : ((v3) => v3 != null && v3 != void 0);
52866 if (!this.validKey(element)) return false;
52867 return this._delete(element) != null;
52869 deleteAll(elements) {
52870 for (const element of elements) {
52871 this.delete(element);
52875 const nodes = this[Symbol.iterator]();
52877 while (result = nodes.next(), !result.done) {
52878 f2(result.value, result.value, this);
52882 const compare2 = this.splay(element);
52883 if (compare2 != 0) this.addNewRoot(new SplayTreeSetNode(element), compare2);
52886 addAndReturn(element) {
52887 const compare2 = this.splay(element);
52888 if (compare2 != 0) this.addNewRoot(new SplayTreeSetNode(element), compare2);
52889 return this.root.key;
52892 for (const element of elements) {
52897 return this.root == null;
52900 return this.root != null;
52903 if (this.size == 0) throw "Bad state: No element";
52904 if (this.size > 1) throw "Bad state: Too many element";
52905 return this.root.key;
52908 if (this.size == 0) throw "Bad state: No element";
52909 return this._first().key;
52912 if (this.size == 0) throw "Bad state: No element";
52913 return this._last().key;
52915 lastBefore(element) {
52916 if (element == null) throw "Invalid arguments(s)";
52917 if (this.root == null) return null;
52918 const comp = this.splay(element);
52919 if (comp < 0) return this.root.key;
52920 let node = this.root.left;
52921 if (node == null) return null;
52922 let nodeRight = node.right;
52923 while (nodeRight != null) {
52925 nodeRight = node.right;
52929 firstAfter(element) {
52930 if (element == null) throw "Invalid arguments(s)";
52931 if (this.root == null) return null;
52932 const comp = this.splay(element);
52933 if (comp > 0) return this.root.key;
52934 let node = this.root.right;
52935 if (node == null) return null;
52936 let nodeLeft = node.left;
52937 while (nodeLeft != null) {
52939 nodeLeft = node.left;
52943 retainAll(elements) {
52944 const retainSet = new _SplayTreeSet(this.compare, this.validKey);
52945 const modificationCount = this.modificationCount;
52946 for (const object of elements) {
52947 if (modificationCount != this.modificationCount) {
52948 throw "Concurrent modification during iteration.";
52950 if (this.validKey(object) && this.splay(object) == 0) {
52951 retainSet.add(this.root.key);
52954 if (retainSet.size != this.size) {
52955 this.root = retainSet.root;
52956 this.size = retainSet.size;
52957 this.modificationCount++;
52961 if (!this.validKey(object)) return null;
52962 const comp = this.splay(object);
52963 if (comp != 0) return null;
52964 return this.root.key;
52966 intersection(other) {
52967 const result = new _SplayTreeSet(this.compare, this.validKey);
52968 for (const element of this) {
52969 if (other.has(element)) result.add(element);
52973 difference(other) {
52974 const result = new _SplayTreeSet(this.compare, this.validKey);
52975 for (const element of this) {
52976 if (!other.has(element)) result.add(element);
52981 const u2 = this.clone();
52986 const set4 = new _SplayTreeSet(this.compare, this.validKey);
52987 set4.size = this.size;
52988 set4.root = this.copyNode(this.root);
52992 if (node == null) return null;
52993 function copyChildren(node2, dest) {
52998 right = node2.right;
52999 if (left != null) {
53000 const newLeft = new SplayTreeSetNode(left.key);
53001 dest.left = newLeft;
53002 copyChildren(left, newLeft);
53004 if (right != null) {
53005 const newRight = new SplayTreeSetNode(right.key);
53006 dest.right = newRight;
53010 } while (right != null);
53012 const result = new SplayTreeSetNode(node.key);
53013 copyChildren(node, result);
53017 return this.clone();
53020 return new SplayTreeSetEntryIterableIterator(this.wrap());
53023 return this[Symbol.iterator]();
53026 return this[Symbol.iterator]();
53028 [(_b = Symbol.iterator, _a2 = Symbol.toStringTag, _b)]() {
53029 return new SplayTreeKeyIterableIterator(this.wrap());
53032 SplayTreeIterableIterator = class {
53033 constructor(tree) {
53034 __publicField(this, "tree");
53035 __publicField(this, "path", new Array());
53036 __publicField(this, "modificationCount", null);
53037 __publicField(this, "splayCount");
53039 this.splayCount = tree.getSplayCount();
53041 [Symbol.iterator]() {
53045 if (this.moveNext()) return { done: false, value: this.current() };
53046 return { done: true, value: null };
53049 if (!this.path.length) return null;
53050 const node = this.path[this.path.length - 1];
53051 return this.getValue(node);
53054 this.path.splice(0, this.path.length);
53055 this.tree.splay(key);
53056 this.path.push(this.tree.getRoot());
53057 this.splayCount = this.tree.getSplayCount();
53059 findLeftMostDescendent(node) {
53060 while (node != null) {
53061 this.path.push(node);
53066 if (this.modificationCount != this.tree.getModificationCount()) {
53067 if (this.modificationCount == null) {
53068 this.modificationCount = this.tree.getModificationCount();
53069 let node2 = this.tree.getRoot();
53070 while (node2 != null) {
53071 this.path.push(node2);
53072 node2 = node2.left;
53074 return this.path.length > 0;
53076 throw "Concurrent modification during iteration.";
53078 if (!this.path.length) return false;
53079 if (this.splayCount != this.tree.getSplayCount()) {
53080 this.rebuildPath(this.path[this.path.length - 1].key);
53082 let node = this.path[this.path.length - 1];
53083 let next = node.right;
53084 if (next != null) {
53085 while (next != null) {
53086 this.path.push(next);
53092 while (this.path.length && this.path[this.path.length - 1].right === node) {
53093 node = this.path.pop();
53095 return this.path.length > 0;
53098 SplayTreeKeyIterableIterator = class extends SplayTreeIterableIterator {
53103 SplayTreeSetEntryIterableIterator = class extends SplayTreeIterableIterator {
53105 return [node.key, node.key];
53111 // node_modules/polyclip-ts/dist/esm/index.js
53112 function orient_default(eps) {
53113 const almostCollinear = eps ? (area2, ax, ay, cx, cy) => area2.exponentiatedBy(2).isLessThanOrEqualTo(
53114 cx.minus(ax).exponentiatedBy(2).plus(cy.minus(ay).exponentiatedBy(2)).times(eps)
53115 ) : constant_default6(false);
53116 return (a2, b3, c2) => {
53117 const ax = a2.x, ay = a2.y, cx = c2.x, cy = c2.y;
53118 const area2 = ay.minus(cy).times(b3.x.minus(cx)).minus(ax.minus(cx).times(b3.y.minus(cy)));
53119 if (almostCollinear(area2, ax, ay, cx, cy)) return 0;
53120 return area2.comparedTo(0);
53123 var constant_default6, compare_default, identity_default5, snap_default, set3, precision, isInBbox, getBboxOverlap, crossProduct, dotProduct, length, sineOfAngle, cosineOfAngle, horizontalIntersection, verticalIntersection, intersection, SweepEvent, RingOut, PolyOut, MultiPolyOut, SweepLine, Operation, operation, operation_default, segmentId, Segment, RingIn, PolyIn, MultiPolyIn, union, difference, setPrecision;
53124 var init_esm5 = __esm({
53125 "node_modules/polyclip-ts/dist/esm/index.js"() {
53131 constant_default6 = (x2) => {
53136 compare_default = (eps) => {
53137 const almostEqual = eps ? (a2, b3) => b3.minus(a2).abs().isLessThanOrEqualTo(eps) : constant_default6(false);
53138 return (a2, b3) => {
53139 if (almostEqual(a2, b3)) return 0;
53140 return a2.comparedTo(b3);
53143 identity_default5 = (x2) => {
53146 snap_default = (eps) => {
53148 const xTree = new SplayTreeSet(compare_default(eps));
53149 const yTree = new SplayTreeSet(compare_default(eps));
53150 const snapCoord = (coord2, tree) => {
53151 return tree.addAndReturn(coord2);
53153 const snap = (v3) => {
53155 x: snapCoord(v3.x, xTree),
53156 y: snapCoord(v3.y, yTree)
53159 snap({ x: new bignumber_default(0), y: new bignumber_default(0) });
53162 return identity_default5;
53167 precision = set3(eps2);
53169 reset: () => set3(eps),
53170 compare: compare_default(eps),
53171 snap: snap_default(eps),
53172 orient: orient_default(eps)
53175 precision = set3();
53176 isInBbox = (bbox2, point) => {
53177 return bbox2.ll.x.isLessThanOrEqualTo(point.x) && point.x.isLessThanOrEqualTo(bbox2.ur.x) && bbox2.ll.y.isLessThanOrEqualTo(point.y) && point.y.isLessThanOrEqualTo(bbox2.ur.y);
53179 getBboxOverlap = (b1, b22) => {
53180 if (b22.ur.x.isLessThan(b1.ll.x) || b1.ur.x.isLessThan(b22.ll.x) || b22.ur.y.isLessThan(b1.ll.y) || b1.ur.y.isLessThan(b22.ll.y))
53182 const lowerX = b1.ll.x.isLessThan(b22.ll.x) ? b22.ll.x : b1.ll.x;
53183 const upperX = b1.ur.x.isLessThan(b22.ur.x) ? b1.ur.x : b22.ur.x;
53184 const lowerY = b1.ll.y.isLessThan(b22.ll.y) ? b22.ll.y : b1.ll.y;
53185 const upperY = b1.ur.y.isLessThan(b22.ur.y) ? b1.ur.y : b22.ur.y;
53186 return { ll: { x: lowerX, y: lowerY }, ur: { x: upperX, y: upperY } };
53188 crossProduct = (a2, b3) => a2.x.times(b3.y).minus(a2.y.times(b3.x));
53189 dotProduct = (a2, b3) => a2.x.times(b3.x).plus(a2.y.times(b3.y));
53190 length = (v3) => dotProduct(v3, v3).sqrt();
53191 sineOfAngle = (pShared, pBase, pAngle) => {
53192 const vBase = { x: pBase.x.minus(pShared.x), y: pBase.y.minus(pShared.y) };
53193 const vAngle = { x: pAngle.x.minus(pShared.x), y: pAngle.y.minus(pShared.y) };
53194 return crossProduct(vAngle, vBase).div(length(vAngle)).div(length(vBase));
53196 cosineOfAngle = (pShared, pBase, pAngle) => {
53197 const vBase = { x: pBase.x.minus(pShared.x), y: pBase.y.minus(pShared.y) };
53198 const vAngle = { x: pAngle.x.minus(pShared.x), y: pAngle.y.minus(pShared.y) };
53199 return dotProduct(vAngle, vBase).div(length(vAngle)).div(length(vBase));
53201 horizontalIntersection = (pt2, v3, y3) => {
53202 if (v3.y.isZero()) return null;
53203 return { x: pt2.x.plus(v3.x.div(v3.y).times(y3.minus(pt2.y))), y: y3 };
53205 verticalIntersection = (pt2, v3, x2) => {
53206 if (v3.x.isZero()) return null;
53207 return { x: x2, y: pt2.y.plus(v3.y.div(v3.x).times(x2.minus(pt2.x))) };
53209 intersection = (pt1, v1, pt2, v22) => {
53210 if (v1.x.isZero()) return verticalIntersection(pt2, v22, pt1.x);
53211 if (v22.x.isZero()) return verticalIntersection(pt1, v1, pt2.x);
53212 if (v1.y.isZero()) return horizontalIntersection(pt2, v22, pt1.y);
53213 if (v22.y.isZero()) return horizontalIntersection(pt1, v1, pt2.y);
53214 const kross = crossProduct(v1, v22);
53215 if (kross.isZero()) return null;
53216 const ve3 = { x: pt2.x.minus(pt1.x), y: pt2.y.minus(pt1.y) };
53217 const d1 = crossProduct(ve3, v1).div(kross);
53218 const d22 = crossProduct(ve3, v22).div(kross);
53219 const x12 = pt1.x.plus(d22.times(v1.x)), x2 = pt2.x.plus(d1.times(v22.x));
53220 const y12 = pt1.y.plus(d22.times(v1.y)), y22 = pt2.y.plus(d1.times(v22.y));
53221 const x3 = x12.plus(x2).div(2);
53222 const y3 = y12.plus(y22).div(2);
53223 return { x: x3, y: y3 };
53225 SweepEvent = class _SweepEvent {
53226 // Warning: 'point' input will be modified and re-used (for performance)
53227 constructor(point, isLeft) {
53228 __publicField(this, "point");
53229 __publicField(this, "isLeft");
53230 __publicField(this, "segment");
53231 __publicField(this, "otherSE");
53232 __publicField(this, "consumedBy");
53233 if (point.events === void 0) point.events = [this];
53234 else point.events.push(this);
53235 this.point = point;
53236 this.isLeft = isLeft;
53238 // for ordering sweep events in the sweep event queue
53239 static compare(a2, b3) {
53240 const ptCmp = _SweepEvent.comparePoints(a2.point, b3.point);
53241 if (ptCmp !== 0) return ptCmp;
53242 if (a2.point !== b3.point) a2.link(b3);
53243 if (a2.isLeft !== b3.isLeft) return a2.isLeft ? 1 : -1;
53244 return Segment.compare(a2.segment, b3.segment);
53246 // for ordering points in sweep line order
53247 static comparePoints(aPt, bPt) {
53248 if (aPt.x.isLessThan(bPt.x)) return -1;
53249 if (aPt.x.isGreaterThan(bPt.x)) return 1;
53250 if (aPt.y.isLessThan(bPt.y)) return -1;
53251 if (aPt.y.isGreaterThan(bPt.y)) return 1;
53255 if (other.point === this.point) {
53256 throw new Error("Tried to link already linked events");
53258 const otherEvents = other.point.events;
53259 for (let i3 = 0, iMax = otherEvents.length; i3 < iMax; i3++) {
53260 const evt = otherEvents[i3];
53261 this.point.events.push(evt);
53262 evt.point = this.point;
53264 this.checkForConsuming();
53266 /* Do a pass over our linked events and check to see if any pair
53267 * of segments match, and should be consumed. */
53268 checkForConsuming() {
53269 const numEvents = this.point.events.length;
53270 for (let i3 = 0; i3 < numEvents; i3++) {
53271 const evt1 = this.point.events[i3];
53272 if (evt1.segment.consumedBy !== void 0) continue;
53273 for (let j3 = i3 + 1; j3 < numEvents; j3++) {
53274 const evt2 = this.point.events[j3];
53275 if (evt2.consumedBy !== void 0) continue;
53276 if (evt1.otherSE.point.events !== evt2.otherSE.point.events) continue;
53277 evt1.segment.consume(evt2.segment);
53281 getAvailableLinkedEvents() {
53283 for (let i3 = 0, iMax = this.point.events.length; i3 < iMax; i3++) {
53284 const evt = this.point.events[i3];
53285 if (evt !== this && !evt.segment.ringOut && evt.segment.isInResult()) {
53292 * Returns a comparator function for sorting linked events that will
53293 * favor the event that will give us the smallest left-side angle.
53294 * All ring construction starts as low as possible heading to the right,
53295 * so by always turning left as sharp as possible we'll get polygons
53296 * without uncessary loops & holes.
53298 * The comparator function has a compute cache such that it avoids
53299 * re-computing already-computed values.
53301 getLeftmostComparator(baseEvent) {
53302 const cache = /* @__PURE__ */ new Map();
53303 const fillCache = (linkedEvent) => {
53304 const nextEvent = linkedEvent.otherSE;
53305 cache.set(linkedEvent, {
53306 sine: sineOfAngle(this.point, baseEvent.point, nextEvent.point),
53307 cosine: cosineOfAngle(this.point, baseEvent.point, nextEvent.point)
53310 return (a2, b3) => {
53311 if (!cache.has(a2)) fillCache(a2);
53312 if (!cache.has(b3)) fillCache(b3);
53313 const { sine: asine, cosine: acosine } = cache.get(a2);
53314 const { sine: bsine, cosine: bcosine } = cache.get(b3);
53315 if (asine.isGreaterThanOrEqualTo(0) && bsine.isGreaterThanOrEqualTo(0)) {
53316 if (acosine.isLessThan(bcosine)) return 1;
53317 if (acosine.isGreaterThan(bcosine)) return -1;
53320 if (asine.isLessThan(0) && bsine.isLessThan(0)) {
53321 if (acosine.isLessThan(bcosine)) return -1;
53322 if (acosine.isGreaterThan(bcosine)) return 1;
53325 if (bsine.isLessThan(asine)) return -1;
53326 if (bsine.isGreaterThan(asine)) return 1;
53331 RingOut = class _RingOut {
53332 constructor(events) {
53333 __publicField(this, "events");
53334 __publicField(this, "poly");
53335 __publicField(this, "_isExteriorRing");
53336 __publicField(this, "_enclosingRing");
53337 this.events = events;
53338 for (let i3 = 0, iMax = events.length; i3 < iMax; i3++) {
53339 events[i3].segment.ringOut = this;
53343 /* Given the segments from the sweep line pass, compute & return a series
53344 * of closed rings from all the segments marked to be part of the result */
53345 static factory(allSegments) {
53346 const ringsOut = [];
53347 for (let i3 = 0, iMax = allSegments.length; i3 < iMax; i3++) {
53348 const segment = allSegments[i3];
53349 if (!segment.isInResult() || segment.ringOut) continue;
53350 let prevEvent = null;
53351 let event = segment.leftSE;
53352 let nextEvent = segment.rightSE;
53353 const events = [event];
53354 const startingPoint = event.point;
53355 const intersectionLEs = [];
53359 events.push(event);
53360 if (event.point === startingPoint) break;
53362 const availableLEs = event.getAvailableLinkedEvents();
53363 if (availableLEs.length === 0) {
53364 const firstPt = events[0].point;
53365 const lastPt = events[events.length - 1].point;
53367 `Unable to complete output ring starting at [${firstPt.x}, ${firstPt.y}]. Last matching segment found ends at [${lastPt.x}, ${lastPt.y}].`
53370 if (availableLEs.length === 1) {
53371 nextEvent = availableLEs[0].otherSE;
53374 let indexLE = null;
53375 for (let j3 = 0, jMax = intersectionLEs.length; j3 < jMax; j3++) {
53376 if (intersectionLEs[j3].point === event.point) {
53381 if (indexLE !== null) {
53382 const intersectionLE = intersectionLEs.splice(indexLE)[0];
53383 const ringEvents = events.splice(intersectionLE.index);
53384 ringEvents.unshift(ringEvents[0].otherSE);
53385 ringsOut.push(new _RingOut(ringEvents.reverse()));
53388 intersectionLEs.push({
53389 index: events.length,
53392 const comparator = event.getLeftmostComparator(prevEvent);
53393 nextEvent = availableLEs.sort(comparator)[0].otherSE;
53397 ringsOut.push(new _RingOut(events));
53402 let prevPt = this.events[0].point;
53403 const points = [prevPt];
53404 for (let i3 = 1, iMax = this.events.length - 1; i3 < iMax; i3++) {
53405 const pt22 = this.events[i3].point;
53406 const nextPt2 = this.events[i3 + 1].point;
53407 if (precision.orient(pt22, prevPt, nextPt2) === 0) continue;
53411 if (points.length === 1) return null;
53412 const pt2 = points[0];
53413 const nextPt = points[1];
53414 if (precision.orient(pt2, prevPt, nextPt) === 0) points.shift();
53415 points.push(points[0]);
53416 const step = this.isExteriorRing() ? 1 : -1;
53417 const iStart = this.isExteriorRing() ? 0 : points.length - 1;
53418 const iEnd = this.isExteriorRing() ? points.length : -1;
53419 const orderedPoints = [];
53420 for (let i3 = iStart; i3 != iEnd; i3 += step)
53421 orderedPoints.push([points[i3].x.toNumber(), points[i3].y.toNumber()]);
53422 return orderedPoints;
53425 if (this._isExteriorRing === void 0) {
53426 const enclosing = this.enclosingRing();
53427 this._isExteriorRing = enclosing ? !enclosing.isExteriorRing() : true;
53429 return this._isExteriorRing;
53432 if (this._enclosingRing === void 0) {
53433 this._enclosingRing = this._calcEnclosingRing();
53435 return this._enclosingRing;
53437 /* Returns the ring that encloses this one, if any */
53438 _calcEnclosingRing() {
53440 let leftMostEvt = this.events[0];
53441 for (let i3 = 1, iMax = this.events.length; i3 < iMax; i3++) {
53442 const evt = this.events[i3];
53443 if (SweepEvent.compare(leftMostEvt, evt) > 0) leftMostEvt = evt;
53445 let prevSeg = leftMostEvt.segment.prevInResult();
53446 let prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
53448 if (!prevSeg) return null;
53449 if (!prevPrevSeg) return prevSeg.ringOut;
53450 if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
53451 if (((_a4 = prevPrevSeg.ringOut) == null ? void 0 : _a4.enclosingRing()) !== prevSeg.ringOut) {
53452 return prevSeg.ringOut;
53453 } else return (_b2 = prevSeg.ringOut) == null ? void 0 : _b2.enclosingRing();
53455 prevSeg = prevPrevSeg.prevInResult();
53456 prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
53461 constructor(exteriorRing) {
53462 __publicField(this, "exteriorRing");
53463 __publicField(this, "interiorRings");
53464 this.exteriorRing = exteriorRing;
53465 exteriorRing.poly = this;
53466 this.interiorRings = [];
53468 addInterior(ring) {
53469 this.interiorRings.push(ring);
53473 const geom0 = this.exteriorRing.getGeom();
53474 if (geom0 === null) return null;
53475 const geom = [geom0];
53476 for (let i3 = 0, iMax = this.interiorRings.length; i3 < iMax; i3++) {
53477 const ringGeom = this.interiorRings[i3].getGeom();
53478 if (ringGeom === null) continue;
53479 geom.push(ringGeom);
53484 MultiPolyOut = class {
53485 constructor(rings) {
53486 __publicField(this, "rings");
53487 __publicField(this, "polys");
53488 this.rings = rings;
53489 this.polys = this._composePolys(rings);
53493 for (let i3 = 0, iMax = this.polys.length; i3 < iMax; i3++) {
53494 const polyGeom = this.polys[i3].getGeom();
53495 if (polyGeom === null) continue;
53496 geom.push(polyGeom);
53500 _composePolys(rings) {
53503 for (let i3 = 0, iMax = rings.length; i3 < iMax; i3++) {
53504 const ring = rings[i3];
53505 if (ring.poly) continue;
53506 if (ring.isExteriorRing()) polys.push(new PolyOut(ring));
53508 const enclosingRing = ring.enclosingRing();
53509 if (!(enclosingRing == null ? void 0 : enclosingRing.poly)) polys.push(new PolyOut(enclosingRing));
53510 (_a4 = enclosingRing == null ? void 0 : enclosingRing.poly) == null ? void 0 : _a4.addInterior(ring);
53516 SweepLine = class {
53517 constructor(queue, comparator = Segment.compare) {
53518 __publicField(this, "queue");
53519 __publicField(this, "tree");
53520 __publicField(this, "segments");
53521 this.queue = queue;
53522 this.tree = new SplayTreeSet(comparator);
53523 this.segments = [];
53526 const segment = event.segment;
53527 const newEvents = [];
53528 if (event.consumedBy) {
53529 if (event.isLeft) this.queue.delete(event.otherSE);
53530 else this.tree.delete(segment);
53533 if (event.isLeft) this.tree.add(segment);
53534 let prevSeg = segment;
53535 let nextSeg = segment;
53537 prevSeg = this.tree.lastBefore(prevSeg);
53538 } while (prevSeg != null && prevSeg.consumedBy != void 0);
53540 nextSeg = this.tree.firstAfter(nextSeg);
53541 } while (nextSeg != null && nextSeg.consumedBy != void 0);
53542 if (event.isLeft) {
53543 let prevMySplitter = null;
53545 const prevInter = prevSeg.getIntersection(segment);
53546 if (prevInter !== null) {
53547 if (!segment.isAnEndpoint(prevInter)) prevMySplitter = prevInter;
53548 if (!prevSeg.isAnEndpoint(prevInter)) {
53549 const newEventsFromSplit = this._splitSafely(prevSeg, prevInter);
53550 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
53551 newEvents.push(newEventsFromSplit[i3]);
53556 let nextMySplitter = null;
53558 const nextInter = nextSeg.getIntersection(segment);
53559 if (nextInter !== null) {
53560 if (!segment.isAnEndpoint(nextInter)) nextMySplitter = nextInter;
53561 if (!nextSeg.isAnEndpoint(nextInter)) {
53562 const newEventsFromSplit = this._splitSafely(nextSeg, nextInter);
53563 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
53564 newEvents.push(newEventsFromSplit[i3]);
53569 if (prevMySplitter !== null || nextMySplitter !== null) {
53570 let mySplitter = null;
53571 if (prevMySplitter === null) mySplitter = nextMySplitter;
53572 else if (nextMySplitter === null) mySplitter = prevMySplitter;
53574 const cmpSplitters = SweepEvent.comparePoints(
53578 mySplitter = cmpSplitters <= 0 ? prevMySplitter : nextMySplitter;
53580 this.queue.delete(segment.rightSE);
53581 newEvents.push(segment.rightSE);
53582 const newEventsFromSplit = segment.split(mySplitter);
53583 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
53584 newEvents.push(newEventsFromSplit[i3]);
53587 if (newEvents.length > 0) {
53588 this.tree.delete(segment);
53589 newEvents.push(event);
53591 this.segments.push(segment);
53592 segment.prev = prevSeg;
53595 if (prevSeg && nextSeg) {
53596 const inter = prevSeg.getIntersection(nextSeg);
53597 if (inter !== null) {
53598 if (!prevSeg.isAnEndpoint(inter)) {
53599 const newEventsFromSplit = this._splitSafely(prevSeg, inter);
53600 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
53601 newEvents.push(newEventsFromSplit[i3]);
53604 if (!nextSeg.isAnEndpoint(inter)) {
53605 const newEventsFromSplit = this._splitSafely(nextSeg, inter);
53606 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
53607 newEvents.push(newEventsFromSplit[i3]);
53612 this.tree.delete(segment);
53616 /* Safely split a segment that is currently in the datastructures
53617 * IE - a segment other than the one that is currently being processed. */
53618 _splitSafely(seg, pt2) {
53619 this.tree.delete(seg);
53620 const rightSE = seg.rightSE;
53621 this.queue.delete(rightSE);
53622 const newEvents = seg.split(pt2);
53623 newEvents.push(rightSE);
53624 if (seg.consumedBy === void 0) this.tree.add(seg);
53628 Operation = class {
53630 __publicField(this, "type");
53631 __publicField(this, "numMultiPolys");
53633 run(type2, geom, moreGeoms) {
53634 operation.type = type2;
53635 const multipolys = [new MultiPolyIn(geom, true)];
53636 for (let i3 = 0, iMax = moreGeoms.length; i3 < iMax; i3++) {
53637 multipolys.push(new MultiPolyIn(moreGeoms[i3], false));
53639 operation.numMultiPolys = multipolys.length;
53640 if (operation.type === "difference") {
53641 const subject = multipolys[0];
53643 while (i3 < multipolys.length) {
53644 if (getBboxOverlap(multipolys[i3].bbox, subject.bbox) !== null) i3++;
53645 else multipolys.splice(i3, 1);
53648 if (operation.type === "intersection") {
53649 for (let i3 = 0, iMax = multipolys.length; i3 < iMax; i3++) {
53650 const mpA = multipolys[i3];
53651 for (let j3 = i3 + 1, jMax = multipolys.length; j3 < jMax; j3++) {
53652 if (getBboxOverlap(mpA.bbox, multipolys[j3].bbox) === null) return [];
53656 const queue = new SplayTreeSet(SweepEvent.compare);
53657 for (let i3 = 0, iMax = multipolys.length; i3 < iMax; i3++) {
53658 const sweepEvents = multipolys[i3].getSweepEvents();
53659 for (let j3 = 0, jMax = sweepEvents.length; j3 < jMax; j3++) {
53660 queue.add(sweepEvents[j3]);
53663 const sweepLine = new SweepLine(queue);
53665 if (queue.size != 0) {
53666 evt = queue.first();
53670 const newEvents = sweepLine.process(evt);
53671 for (let i3 = 0, iMax = newEvents.length; i3 < iMax; i3++) {
53672 const evt2 = newEvents[i3];
53673 if (evt2.consumedBy === void 0) queue.add(evt2);
53675 if (queue.size != 0) {
53676 evt = queue.first();
53683 const ringsOut = RingOut.factory(sweepLine.segments);
53684 const result = new MultiPolyOut(ringsOut);
53685 return result.getGeom();
53688 operation = new Operation();
53689 operation_default = operation;
53691 Segment = class _Segment {
53692 /* Warning: a reference to ringWindings input will be stored,
53693 * and possibly will be later modified */
53694 constructor(leftSE, rightSE, rings, windings) {
53695 __publicField(this, "id");
53696 __publicField(this, "leftSE");
53697 __publicField(this, "rightSE");
53698 __publicField(this, "rings");
53699 __publicField(this, "windings");
53700 __publicField(this, "ringOut");
53701 __publicField(this, "consumedBy");
53702 __publicField(this, "prev");
53703 __publicField(this, "_prevInResult");
53704 __publicField(this, "_beforeState");
53705 __publicField(this, "_afterState");
53706 __publicField(this, "_isInResult");
53707 this.id = ++segmentId;
53708 this.leftSE = leftSE;
53709 leftSE.segment = this;
53710 leftSE.otherSE = rightSE;
53711 this.rightSE = rightSE;
53712 rightSE.segment = this;
53713 rightSE.otherSE = leftSE;
53714 this.rings = rings;
53715 this.windings = windings;
53717 /* This compare() function is for ordering segments in the sweep
53718 * line tree, and does so according to the following criteria:
53720 * Consider the vertical line that lies an infinestimal step to the
53721 * right of the right-more of the two left endpoints of the input
53722 * segments. Imagine slowly moving a point up from negative infinity
53723 * in the increasing y direction. Which of the two segments will that
53724 * point intersect first? That segment comes 'before' the other one.
53726 * If neither segment would be intersected by such a line, (if one
53727 * or more of the segments are vertical) then the line to be considered
53728 * is directly on the right-more of the two left inputs.
53730 static compare(a2, b3) {
53731 const alx = a2.leftSE.point.x;
53732 const blx = b3.leftSE.point.x;
53733 const arx = a2.rightSE.point.x;
53734 const brx = b3.rightSE.point.x;
53735 if (brx.isLessThan(alx)) return 1;
53736 if (arx.isLessThan(blx)) return -1;
53737 const aly = a2.leftSE.point.y;
53738 const bly = b3.leftSE.point.y;
53739 const ary = a2.rightSE.point.y;
53740 const bry = b3.rightSE.point.y;
53741 if (alx.isLessThan(blx)) {
53742 if (bly.isLessThan(aly) && bly.isLessThan(ary)) return 1;
53743 if (bly.isGreaterThan(aly) && bly.isGreaterThan(ary)) return -1;
53744 const aCmpBLeft = a2.comparePoint(b3.leftSE.point);
53745 if (aCmpBLeft < 0) return 1;
53746 if (aCmpBLeft > 0) return -1;
53747 const bCmpARight = b3.comparePoint(a2.rightSE.point);
53748 if (bCmpARight !== 0) return bCmpARight;
53751 if (alx.isGreaterThan(blx)) {
53752 if (aly.isLessThan(bly) && aly.isLessThan(bry)) return -1;
53753 if (aly.isGreaterThan(bly) && aly.isGreaterThan(bry)) return 1;
53754 const bCmpALeft = b3.comparePoint(a2.leftSE.point);
53755 if (bCmpALeft !== 0) return bCmpALeft;
53756 const aCmpBRight = a2.comparePoint(b3.rightSE.point);
53757 if (aCmpBRight < 0) return 1;
53758 if (aCmpBRight > 0) return -1;
53761 if (aly.isLessThan(bly)) return -1;
53762 if (aly.isGreaterThan(bly)) return 1;
53763 if (arx.isLessThan(brx)) {
53764 const bCmpARight = b3.comparePoint(a2.rightSE.point);
53765 if (bCmpARight !== 0) return bCmpARight;
53767 if (arx.isGreaterThan(brx)) {
53768 const aCmpBRight = a2.comparePoint(b3.rightSE.point);
53769 if (aCmpBRight < 0) return 1;
53770 if (aCmpBRight > 0) return -1;
53772 if (!arx.eq(brx)) {
53773 const ay = ary.minus(aly);
53774 const ax = arx.minus(alx);
53775 const by = bry.minus(bly);
53776 const bx = brx.minus(blx);
53777 if (ay.isGreaterThan(ax) && by.isLessThan(bx)) return 1;
53778 if (ay.isLessThan(ax) && by.isGreaterThan(bx)) return -1;
53780 if (arx.isGreaterThan(brx)) return 1;
53781 if (arx.isLessThan(brx)) return -1;
53782 if (ary.isLessThan(bry)) return -1;
53783 if (ary.isGreaterThan(bry)) return 1;
53784 if (a2.id < b3.id) return -1;
53785 if (a2.id > b3.id) return 1;
53788 static fromRing(pt1, pt2, ring) {
53789 let leftPt, rightPt, winding;
53790 const cmpPts = SweepEvent.comparePoints(pt1, pt2);
53795 } else if (cmpPts > 0) {
53801 `Tried to create degenerate segment at [${pt1.x}, ${pt1.y}]`
53803 const leftSE = new SweepEvent(leftPt, true);
53804 const rightSE = new SweepEvent(rightPt, false);
53805 return new _Segment(leftSE, rightSE, [ring], [winding]);
53807 /* When a segment is split, the rightSE is replaced with a new sweep event */
53808 replaceRightSE(newRightSE) {
53809 this.rightSE = newRightSE;
53810 this.rightSE.segment = this;
53811 this.rightSE.otherSE = this.leftSE;
53812 this.leftSE.otherSE = this.rightSE;
53815 const y12 = this.leftSE.point.y;
53816 const y22 = this.rightSE.point.y;
53818 ll: { x: this.leftSE.point.x, y: y12.isLessThan(y22) ? y12 : y22 },
53819 ur: { x: this.rightSE.point.x, y: y12.isGreaterThan(y22) ? y12 : y22 }
53822 /* A vector from the left point to the right */
53825 x: this.rightSE.point.x.minus(this.leftSE.point.x),
53826 y: this.rightSE.point.y.minus(this.leftSE.point.y)
53829 isAnEndpoint(pt2) {
53830 return pt2.x.eq(this.leftSE.point.x) && pt2.y.eq(this.leftSE.point.y) || pt2.x.eq(this.rightSE.point.x) && pt2.y.eq(this.rightSE.point.y);
53832 /* Compare this segment with a point.
53834 * A point P is considered to be colinear to a segment if there
53835 * exists a distance D such that if we travel along the segment
53836 * from one * endpoint towards the other a distance D, we find
53837 * ourselves at point P.
53839 * Return value indicates:
53841 * 1: point lies above the segment (to the left of vertical)
53842 * 0: point is colinear to segment
53843 * -1: point lies below the segment (to the right of vertical)
53845 comparePoint(point) {
53846 return precision.orient(this.leftSE.point, point, this.rightSE.point);
53849 * Given another segment, returns the first non-trivial intersection
53850 * between the two segments (in terms of sweep line ordering), if it exists.
53852 * A 'non-trivial' intersection is one that will cause one or both of the
53853 * segments to be split(). As such, 'trivial' vs. 'non-trivial' intersection:
53855 * * endpoint of segA with endpoint of segB --> trivial
53856 * * endpoint of segA with point along segB --> non-trivial
53857 * * endpoint of segB with point along segA --> non-trivial
53858 * * point along segA with point along segB --> non-trivial
53860 * If no non-trivial intersection exists, return null
53861 * Else, return null.
53863 getIntersection(other) {
53864 const tBbox = this.bbox();
53865 const oBbox = other.bbox();
53866 const bboxOverlap = getBboxOverlap(tBbox, oBbox);
53867 if (bboxOverlap === null) return null;
53868 const tlp = this.leftSE.point;
53869 const trp = this.rightSE.point;
53870 const olp = other.leftSE.point;
53871 const orp = other.rightSE.point;
53872 const touchesOtherLSE = isInBbox(tBbox, olp) && this.comparePoint(olp) === 0;
53873 const touchesThisLSE = isInBbox(oBbox, tlp) && other.comparePoint(tlp) === 0;
53874 const touchesOtherRSE = isInBbox(tBbox, orp) && this.comparePoint(orp) === 0;
53875 const touchesThisRSE = isInBbox(oBbox, trp) && other.comparePoint(trp) === 0;
53876 if (touchesThisLSE && touchesOtherLSE) {
53877 if (touchesThisRSE && !touchesOtherRSE) return trp;
53878 if (!touchesThisRSE && touchesOtherRSE) return orp;
53881 if (touchesThisLSE) {
53882 if (touchesOtherRSE) {
53883 if (tlp.x.eq(orp.x) && tlp.y.eq(orp.y)) return null;
53887 if (touchesOtherLSE) {
53888 if (touchesThisRSE) {
53889 if (trp.x.eq(olp.x) && trp.y.eq(olp.y)) return null;
53893 if (touchesThisRSE && touchesOtherRSE) return null;
53894 if (touchesThisRSE) return trp;
53895 if (touchesOtherRSE) return orp;
53896 const pt2 = intersection(tlp, this.vector(), olp, other.vector());
53897 if (pt2 === null) return null;
53898 if (!isInBbox(bboxOverlap, pt2)) return null;
53899 return precision.snap(pt2);
53902 * Split the given segment into multiple segments on the given points.
53903 * * Each existing segment will retain its leftSE and a new rightSE will be
53904 * generated for it.
53905 * * A new segment will be generated which will adopt the original segment's
53906 * rightSE, and a new leftSE will be generated for it.
53907 * * If there are more than two points given to split on, new segments
53908 * in the middle will be generated with new leftSE and rightSE's.
53909 * * An array of the newly generated SweepEvents will be returned.
53911 * Warning: input array of points is modified
53914 const newEvents = [];
53915 const alreadyLinked = point.events !== void 0;
53916 const newLeftSE = new SweepEvent(point, true);
53917 const newRightSE = new SweepEvent(point, false);
53918 const oldRightSE = this.rightSE;
53919 this.replaceRightSE(newRightSE);
53920 newEvents.push(newRightSE);
53921 newEvents.push(newLeftSE);
53922 const newSeg = new _Segment(
53925 this.rings.slice(),
53926 this.windings.slice()
53928 if (SweepEvent.comparePoints(newSeg.leftSE.point, newSeg.rightSE.point) > 0) {
53929 newSeg.swapEvents();
53931 if (SweepEvent.comparePoints(this.leftSE.point, this.rightSE.point) > 0) {
53934 if (alreadyLinked) {
53935 newLeftSE.checkForConsuming();
53936 newRightSE.checkForConsuming();
53940 /* Swap which event is left and right */
53942 const tmpEvt = this.rightSE;
53943 this.rightSE = this.leftSE;
53944 this.leftSE = tmpEvt;
53945 this.leftSE.isLeft = true;
53946 this.rightSE.isLeft = false;
53947 for (let i3 = 0, iMax = this.windings.length; i3 < iMax; i3++) {
53948 this.windings[i3] *= -1;
53951 /* Consume another segment. We take their rings under our wing
53952 * and mark them as consumed. Use for perfectly overlapping segments */
53954 let consumer = this;
53955 let consumee = other;
53956 while (consumer.consumedBy) consumer = consumer.consumedBy;
53957 while (consumee.consumedBy) consumee = consumee.consumedBy;
53958 const cmp = _Segment.compare(consumer, consumee);
53959 if (cmp === 0) return;
53961 const tmp = consumer;
53962 consumer = consumee;
53965 if (consumer.prev === consumee) {
53966 const tmp = consumer;
53967 consumer = consumee;
53970 for (let i3 = 0, iMax = consumee.rings.length; i3 < iMax; i3++) {
53971 const ring = consumee.rings[i3];
53972 const winding = consumee.windings[i3];
53973 const index = consumer.rings.indexOf(ring);
53974 if (index === -1) {
53975 consumer.rings.push(ring);
53976 consumer.windings.push(winding);
53977 } else consumer.windings[index] += winding;
53979 consumee.rings = null;
53980 consumee.windings = null;
53981 consumee.consumedBy = consumer;
53982 consumee.leftSE.consumedBy = consumer.leftSE;
53983 consumee.rightSE.consumedBy = consumer.rightSE;
53985 /* The first segment previous segment chain that is in the result */
53987 if (this._prevInResult !== void 0) return this._prevInResult;
53988 if (!this.prev) this._prevInResult = null;
53989 else if (this.prev.isInResult()) this._prevInResult = this.prev;
53990 else this._prevInResult = this.prev.prevInResult();
53991 return this._prevInResult;
53994 if (this._beforeState !== void 0) return this._beforeState;
53996 this._beforeState = {
54002 const seg = this.prev.consumedBy || this.prev;
54003 this._beforeState = seg.afterState();
54005 return this._beforeState;
54008 if (this._afterState !== void 0) return this._afterState;
54009 const beforeState = this.beforeState();
54010 this._afterState = {
54011 rings: beforeState.rings.slice(0),
54012 windings: beforeState.windings.slice(0),
54015 const ringsAfter = this._afterState.rings;
54016 const windingsAfter = this._afterState.windings;
54017 const mpsAfter = this._afterState.multiPolys;
54018 for (let i3 = 0, iMax = this.rings.length; i3 < iMax; i3++) {
54019 const ring = this.rings[i3];
54020 const winding = this.windings[i3];
54021 const index = ringsAfter.indexOf(ring);
54022 if (index === -1) {
54023 ringsAfter.push(ring);
54024 windingsAfter.push(winding);
54025 } else windingsAfter[index] += winding;
54027 const polysAfter = [];
54028 const polysExclude = [];
54029 for (let i3 = 0, iMax = ringsAfter.length; i3 < iMax; i3++) {
54030 if (windingsAfter[i3] === 0) continue;
54031 const ring = ringsAfter[i3];
54032 const poly = ring.poly;
54033 if (polysExclude.indexOf(poly) !== -1) continue;
54034 if (ring.isExterior) polysAfter.push(poly);
54036 if (polysExclude.indexOf(poly) === -1) polysExclude.push(poly);
54037 const index = polysAfter.indexOf(ring.poly);
54038 if (index !== -1) polysAfter.splice(index, 1);
54041 for (let i3 = 0, iMax = polysAfter.length; i3 < iMax; i3++) {
54042 const mp = polysAfter[i3].multiPoly;
54043 if (mpsAfter.indexOf(mp) === -1) mpsAfter.push(mp);
54045 return this._afterState;
54047 /* Is this segment part of the final result? */
54049 if (this.consumedBy) return false;
54050 if (this._isInResult !== void 0) return this._isInResult;
54051 const mpsBefore = this.beforeState().multiPolys;
54052 const mpsAfter = this.afterState().multiPolys;
54053 switch (operation_default.type) {
54055 const noBefores = mpsBefore.length === 0;
54056 const noAfters = mpsAfter.length === 0;
54057 this._isInResult = noBefores !== noAfters;
54060 case "intersection": {
54063 if (mpsBefore.length < mpsAfter.length) {
54064 least = mpsBefore.length;
54065 most = mpsAfter.length;
54067 least = mpsAfter.length;
54068 most = mpsBefore.length;
54070 this._isInResult = most === operation_default.numMultiPolys && least < most;
54074 const diff = Math.abs(mpsBefore.length - mpsAfter.length);
54075 this._isInResult = diff % 2 === 1;
54078 case "difference": {
54079 const isJustSubject = (mps) => mps.length === 1 && mps[0].isSubject;
54080 this._isInResult = isJustSubject(mpsBefore) !== isJustSubject(mpsAfter);
54084 return this._isInResult;
54088 constructor(geomRing, poly, isExterior) {
54089 __publicField(this, "poly");
54090 __publicField(this, "isExterior");
54091 __publicField(this, "segments");
54092 __publicField(this, "bbox");
54093 if (!Array.isArray(geomRing) || geomRing.length === 0) {
54094 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
54097 this.isExterior = isExterior;
54098 this.segments = [];
54099 if (typeof geomRing[0][0] !== "number" || typeof geomRing[0][1] !== "number") {
54100 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
54102 const firstPoint = precision.snap({ x: new bignumber_default(geomRing[0][0]), y: new bignumber_default(geomRing[0][1]) });
54104 ll: { x: firstPoint.x, y: firstPoint.y },
54105 ur: { x: firstPoint.x, y: firstPoint.y }
54107 let prevPoint = firstPoint;
54108 for (let i3 = 1, iMax = geomRing.length; i3 < iMax; i3++) {
54109 if (typeof geomRing[i3][0] !== "number" || typeof geomRing[i3][1] !== "number") {
54110 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
54112 const point = precision.snap({ x: new bignumber_default(geomRing[i3][0]), y: new bignumber_default(geomRing[i3][1]) });
54113 if (point.x.eq(prevPoint.x) && point.y.eq(prevPoint.y)) continue;
54114 this.segments.push(Segment.fromRing(prevPoint, point, this));
54115 if (point.x.isLessThan(this.bbox.ll.x)) this.bbox.ll.x = point.x;
54116 if (point.y.isLessThan(this.bbox.ll.y)) this.bbox.ll.y = point.y;
54117 if (point.x.isGreaterThan(this.bbox.ur.x)) this.bbox.ur.x = point.x;
54118 if (point.y.isGreaterThan(this.bbox.ur.y)) this.bbox.ur.y = point.y;
54121 if (!firstPoint.x.eq(prevPoint.x) || !firstPoint.y.eq(prevPoint.y)) {
54122 this.segments.push(Segment.fromRing(prevPoint, firstPoint, this));
54126 const sweepEvents = [];
54127 for (let i3 = 0, iMax = this.segments.length; i3 < iMax; i3++) {
54128 const segment = this.segments[i3];
54129 sweepEvents.push(segment.leftSE);
54130 sweepEvents.push(segment.rightSE);
54132 return sweepEvents;
54136 constructor(geomPoly, multiPoly) {
54137 __publicField(this, "multiPoly");
54138 __publicField(this, "exteriorRing");
54139 __publicField(this, "interiorRings");
54140 __publicField(this, "bbox");
54141 if (!Array.isArray(geomPoly)) {
54142 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
54144 this.exteriorRing = new RingIn(geomPoly[0], this, true);
54146 ll: { x: this.exteriorRing.bbox.ll.x, y: this.exteriorRing.bbox.ll.y },
54147 ur: { x: this.exteriorRing.bbox.ur.x, y: this.exteriorRing.bbox.ur.y }
54149 this.interiorRings = [];
54150 for (let i3 = 1, iMax = geomPoly.length; i3 < iMax; i3++) {
54151 const ring = new RingIn(geomPoly[i3], this, false);
54152 if (ring.bbox.ll.x.isLessThan(this.bbox.ll.x)) this.bbox.ll.x = ring.bbox.ll.x;
54153 if (ring.bbox.ll.y.isLessThan(this.bbox.ll.y)) this.bbox.ll.y = ring.bbox.ll.y;
54154 if (ring.bbox.ur.x.isGreaterThan(this.bbox.ur.x)) this.bbox.ur.x = ring.bbox.ur.x;
54155 if (ring.bbox.ur.y.isGreaterThan(this.bbox.ur.y)) this.bbox.ur.y = ring.bbox.ur.y;
54156 this.interiorRings.push(ring);
54158 this.multiPoly = multiPoly;
54161 const sweepEvents = this.exteriorRing.getSweepEvents();
54162 for (let i3 = 0, iMax = this.interiorRings.length; i3 < iMax; i3++) {
54163 const ringSweepEvents = this.interiorRings[i3].getSweepEvents();
54164 for (let j3 = 0, jMax = ringSweepEvents.length; j3 < jMax; j3++) {
54165 sweepEvents.push(ringSweepEvents[j3]);
54168 return sweepEvents;
54171 MultiPolyIn = class {
54172 constructor(geom, isSubject) {
54173 __publicField(this, "isSubject");
54174 __publicField(this, "polys");
54175 __publicField(this, "bbox");
54176 if (!Array.isArray(geom)) {
54177 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
54180 if (typeof geom[0][0][0] === "number") geom = [geom];
54185 ll: { x: new bignumber_default(Number.POSITIVE_INFINITY), y: new bignumber_default(Number.POSITIVE_INFINITY) },
54186 ur: { x: new bignumber_default(Number.NEGATIVE_INFINITY), y: new bignumber_default(Number.NEGATIVE_INFINITY) }
54188 for (let i3 = 0, iMax = geom.length; i3 < iMax; i3++) {
54189 const poly = new PolyIn(geom[i3], this);
54190 if (poly.bbox.ll.x.isLessThan(this.bbox.ll.x)) this.bbox.ll.x = poly.bbox.ll.x;
54191 if (poly.bbox.ll.y.isLessThan(this.bbox.ll.y)) this.bbox.ll.y = poly.bbox.ll.y;
54192 if (poly.bbox.ur.x.isGreaterThan(this.bbox.ur.x)) this.bbox.ur.x = poly.bbox.ur.x;
54193 if (poly.bbox.ur.y.isGreaterThan(this.bbox.ur.y)) this.bbox.ur.y = poly.bbox.ur.y;
54194 this.polys.push(poly);
54196 this.isSubject = isSubject;
54199 const sweepEvents = [];
54200 for (let i3 = 0, iMax = this.polys.length; i3 < iMax; i3++) {
54201 const polySweepEvents = this.polys[i3].getSweepEvents();
54202 for (let j3 = 0, jMax = polySweepEvents.length; j3 < jMax; j3++) {
54203 sweepEvents.push(polySweepEvents[j3]);
54206 return sweepEvents;
54209 union = (geom, ...moreGeoms) => operation_default.run("union", geom, moreGeoms);
54210 difference = (geom, ...moreGeoms) => operation_default.run("difference", geom, moreGeoms);
54211 setPrecision = precision.set;
54215 // node_modules/wgs84/index.js
54216 var require_wgs84 = __commonJS({
54217 "node_modules/wgs84/index.js"(exports2, module2) {
54218 module2.exports.RADIUS = 6378137;
54219 module2.exports.FLATTENING = 1 / 298.257223563;
54220 module2.exports.POLAR_RADIUS = 63567523142e-4;
54224 // node_modules/@mapbox/geojson-area/index.js
54225 var require_geojson_area = __commonJS({
54226 "node_modules/@mapbox/geojson-area/index.js"(exports2, module2) {
54227 var wgs84 = require_wgs84();
54228 module2.exports.geometry = geometry;
54229 module2.exports.ring = ringArea;
54230 function geometry(_3) {
54234 return polygonArea(_3.coordinates);
54235 case "MultiPolygon":
54236 for (i3 = 0; i3 < _3.coordinates.length; i3++) {
54237 area += polygonArea(_3.coordinates[i3]);
54243 case "MultiLineString":
54245 case "GeometryCollection":
54246 for (i3 = 0; i3 < _3.geometries.length; i3++) {
54247 area += geometry(_3.geometries[i3]);
54252 function polygonArea(coords) {
54254 if (coords && coords.length > 0) {
54255 area += Math.abs(ringArea(coords[0]));
54256 for (var i3 = 1; i3 < coords.length; i3++) {
54257 area -= Math.abs(ringArea(coords[i3]));
54262 function ringArea(coords) {
54263 var p1, p2, p3, lowerIndex, middleIndex, upperIndex, i3, area = 0, coordsLength = coords.length;
54264 if (coordsLength > 2) {
54265 for (i3 = 0; i3 < coordsLength; i3++) {
54266 if (i3 === coordsLength - 2) {
54267 lowerIndex = coordsLength - 2;
54268 middleIndex = coordsLength - 1;
54270 } else if (i3 === coordsLength - 1) {
54271 lowerIndex = coordsLength - 1;
54276 middleIndex = i3 + 1;
54277 upperIndex = i3 + 2;
54279 p1 = coords[lowerIndex];
54280 p2 = coords[middleIndex];
54281 p3 = coords[upperIndex];
54282 area += (rad(p3[0]) - rad(p1[0])) * Math.sin(rad(p2[1]));
54284 area = area * wgs84.RADIUS * wgs84.RADIUS / 2;
54289 return _3 * Math.PI / 180;
54294 // node_modules/circle-to-polygon/input-validation/validateCenter.js
54295 var require_validateCenter = __commonJS({
54296 "node_modules/circle-to-polygon/input-validation/validateCenter.js"(exports2) {
54297 exports2.validateCenter = function validateCenter(center) {
54298 var validCenterLengths = [2, 3];
54299 if (!Array.isArray(center) || !validCenterLengths.includes(center.length)) {
54300 throw new Error("ERROR! Center has to be an array of length two or three");
54302 var [lng, lat] = center;
54303 if (typeof lng !== "number" || typeof lat !== "number") {
54305 `ERROR! Longitude and Latitude has to be numbers but where ${typeof lng} and ${typeof lat}`
54308 if (lng > 180 || lng < -180) {
54309 throw new Error(`ERROR! Longitude has to be between -180 and 180 but was ${lng}`);
54311 if (lat > 90 || lat < -90) {
54312 throw new Error(`ERROR! Latitude has to be between -90 and 90 but was ${lat}`);
54318 // node_modules/circle-to-polygon/input-validation/validateRadius.js
54319 var require_validateRadius = __commonJS({
54320 "node_modules/circle-to-polygon/input-validation/validateRadius.js"(exports2) {
54321 exports2.validateRadius = function validateRadius(radius) {
54322 if (typeof radius !== "number") {
54323 throw new Error(`ERROR! Radius has to be a positive number but was: ${typeof radius}`);
54326 throw new Error(`ERROR! Radius has to be a positive number but was: ${radius}`);
54332 // node_modules/circle-to-polygon/input-validation/validateNumberOfEdges.js
54333 var require_validateNumberOfEdges = __commonJS({
54334 "node_modules/circle-to-polygon/input-validation/validateNumberOfEdges.js"(exports2) {
54335 exports2.validateNumberOfEdges = function validateNumberOfEdges(numberOfEdges) {
54336 if (typeof numberOfEdges !== "number") {
54337 const ARGUMENT_TYPE = Array.isArray(numberOfEdges) ? "array" : typeof numberOfEdges;
54338 throw new Error(`ERROR! Number of edges has to be a number but was: ${ARGUMENT_TYPE}`);
54340 if (numberOfEdges < 3) {
54341 throw new Error(`ERROR! Number of edges has to be at least 3 but was: ${numberOfEdges}`);
54347 // node_modules/circle-to-polygon/input-validation/validateEarthRadius.js
54348 var require_validateEarthRadius = __commonJS({
54349 "node_modules/circle-to-polygon/input-validation/validateEarthRadius.js"(exports2) {
54350 exports2.validateEarthRadius = function validateEarthRadius(earthRadius2) {
54351 if (typeof earthRadius2 !== "number") {
54352 const ARGUMENT_TYPE = Array.isArray(earthRadius2) ? "array" : typeof earthRadius2;
54353 throw new Error(`ERROR! Earth radius has to be a number but was: ${ARGUMENT_TYPE}`);
54355 if (earthRadius2 <= 0) {
54356 throw new Error(`ERROR! Earth radius has to be a positive number but was: ${earthRadius2}`);
54362 // node_modules/circle-to-polygon/input-validation/validateBearing.js
54363 var require_validateBearing = __commonJS({
54364 "node_modules/circle-to-polygon/input-validation/validateBearing.js"(exports2) {
54365 exports2.validateBearing = function validateBearing(bearing) {
54366 if (typeof bearing !== "number") {
54367 const ARGUMENT_TYPE = Array.isArray(bearing) ? "array" : typeof bearing;
54368 throw new Error(`ERROR! Bearing has to be a number but was: ${ARGUMENT_TYPE}`);
54374 // node_modules/circle-to-polygon/input-validation/index.js
54375 var require_input_validation = __commonJS({
54376 "node_modules/circle-to-polygon/input-validation/index.js"(exports2) {
54377 var validateCenter = require_validateCenter().validateCenter;
54378 var validateRadius = require_validateRadius().validateRadius;
54379 var validateNumberOfEdges = require_validateNumberOfEdges().validateNumberOfEdges;
54380 var validateEarthRadius = require_validateEarthRadius().validateEarthRadius;
54381 var validateBearing = require_validateBearing().validateBearing;
54382 function validateInput({ center, radius, numberOfEdges, earthRadius: earthRadius2, bearing }) {
54383 validateCenter(center);
54384 validateRadius(radius);
54385 validateNumberOfEdges(numberOfEdges);
54386 validateEarthRadius(earthRadius2);
54387 validateBearing(bearing);
54389 exports2.validateCenter = validateCenter;
54390 exports2.validateRadius = validateRadius;
54391 exports2.validateNumberOfEdges = validateNumberOfEdges;
54392 exports2.validateEarthRadius = validateEarthRadius;
54393 exports2.validateBearing = validateBearing;
54394 exports2.validateInput = validateInput;
54398 // node_modules/circle-to-polygon/index.js
54399 var require_circle_to_polygon = __commonJS({
54400 "node_modules/circle-to-polygon/index.js"(exports2, module2) {
54402 var { validateInput } = require_input_validation();
54403 var defaultEarthRadius = 6378137;
54404 function toRadians(angleInDegrees) {
54405 return angleInDegrees * Math.PI / 180;
54407 function toDegrees(angleInRadians) {
54408 return angleInRadians * 180 / Math.PI;
54410 function offset(c1, distance, earthRadius2, bearing) {
54411 var lat1 = toRadians(c1[1]);
54412 var lon1 = toRadians(c1[0]);
54413 var dByR = distance / earthRadius2;
54414 var lat = Math.asin(
54415 Math.sin(lat1) * Math.cos(dByR) + Math.cos(lat1) * Math.sin(dByR) * Math.cos(bearing)
54417 var lon = lon1 + Math.atan2(
54418 Math.sin(bearing) * Math.sin(dByR) * Math.cos(lat1),
54419 Math.cos(dByR) - Math.sin(lat1) * Math.sin(lat)
54421 return [toDegrees(lon), toDegrees(lat)];
54423 module2.exports = function circleToPolygon2(center, radius, options) {
54424 var n3 = getNumberOfEdges(options);
54425 var earthRadius2 = getEarthRadius(options);
54426 var bearing = getBearing(options);
54427 var direction = getDirection(options);
54428 validateInput({ center, radius, numberOfEdges: n3, earthRadius: earthRadius2, bearing });
54429 var start2 = toRadians(bearing);
54430 var coordinates = [];
54431 for (var i3 = 0; i3 < n3; ++i3) {
54437 start2 + direction * 2 * Math.PI * -i3 / n3
54441 coordinates.push(coordinates[0]);
54444 coordinates: [coordinates]
54447 function getNumberOfEdges(options) {
54448 if (isUndefinedOrNull(options)) {
54450 } else if (isObjectNotArray(options)) {
54451 var numberOfEdges = options.numberOfEdges;
54452 return numberOfEdges === void 0 ? 32 : numberOfEdges;
54456 function getEarthRadius(options) {
54457 if (isUndefinedOrNull(options)) {
54458 return defaultEarthRadius;
54459 } else if (isObjectNotArray(options)) {
54460 var earthRadius2 = options.earthRadius;
54461 return earthRadius2 === void 0 ? defaultEarthRadius : earthRadius2;
54463 return defaultEarthRadius;
54465 function getDirection(options) {
54466 if (isObjectNotArray(options) && options.rightHandRule) {
54471 function getBearing(options) {
54472 if (isUndefinedOrNull(options)) {
54474 } else if (isObjectNotArray(options)) {
54475 var bearing = options.bearing;
54476 return bearing === void 0 ? 0 : bearing;
54480 function isObjectNotArray(argument) {
54481 return argument !== null && typeof argument === "object" && !Array.isArray(argument);
54483 function isUndefinedOrNull(argument) {
54484 return argument === null || argument === void 0;
54489 // node_modules/geojson-precision/index.js
54490 var require_geojson_precision = __commonJS({
54491 "node_modules/geojson-precision/index.js"(exports2, module2) {
54493 function parse(t2, coordinatePrecision, extrasPrecision) {
54494 function point(p2) {
54495 return p2.map(function(e3, index) {
54497 return 1 * e3.toFixed(coordinatePrecision);
54499 return 1 * e3.toFixed(extrasPrecision);
54503 function multi(l4) {
54504 return l4.map(point);
54506 function poly(p2) {
54507 return p2.map(multi);
54509 function multiPoly(m3) {
54510 return m3.map(poly);
54512 function geometry(obj) {
54516 switch (obj.type) {
54518 obj.coordinates = point(obj.coordinates);
54522 obj.coordinates = multi(obj.coordinates);
54525 case "MultiLineString":
54526 obj.coordinates = poly(obj.coordinates);
54528 case "MultiPolygon":
54529 obj.coordinates = multiPoly(obj.coordinates);
54531 case "GeometryCollection":
54532 obj.geometries = obj.geometries.map(geometry);
54538 function feature3(obj) {
54539 obj.geometry = geometry(obj.geometry);
54542 function featureCollection(f2) {
54543 f2.features = f2.features.map(feature3);
54546 function geometryCollection(g3) {
54547 g3.geometries = g3.geometries.map(geometry);
54555 return feature3(t2);
54556 case "GeometryCollection":
54557 return geometryCollection(t2);
54558 case "FeatureCollection":
54559 return featureCollection(t2);
54564 case "MultiPolygon":
54565 case "MultiLineString":
54566 return geometry(t2);
54571 module2.exports = parse;
54572 module2.exports.parse = parse;
54577 // node_modules/@aitodotai/json-stringify-pretty-compact/index.js
54578 var require_json_stringify_pretty_compact = __commonJS({
54579 "node_modules/@aitodotai/json-stringify-pretty-compact/index.js"(exports2, module2) {
54580 function isObject2(obj) {
54581 return typeof obj === "object" && obj !== null;
54583 function forEach(obj, cb) {
54584 if (Array.isArray(obj)) {
54586 } else if (isObject2(obj)) {
54587 Object.keys(obj).forEach(function(key) {
54588 var val = obj[key];
54593 function getTreeDepth(obj) {
54595 if (Array.isArray(obj) || isObject2(obj)) {
54596 forEach(obj, function(val) {
54597 if (Array.isArray(val) || isObject2(val)) {
54598 var tmpDepth = getTreeDepth(val);
54599 if (tmpDepth > depth) {
54608 function stringify3(obj, options) {
54609 options = options || {};
54610 var indent = JSON.stringify([1], null, get4(options, "indent", 2)).slice(2, -3);
54611 var addMargin = get4(options, "margins", false);
54612 var addArrayMargin = get4(options, "arrayMargins", false);
54613 var addObjectMargin = get4(options, "objectMargins", false);
54614 var maxLength = indent === "" ? Infinity : get4(options, "maxLength", 80);
54615 var maxNesting = get4(options, "maxNesting", Infinity);
54616 return (function _stringify(obj2, currentIndent, reserved) {
54617 if (obj2 && typeof obj2.toJSON === "function") {
54618 obj2 = obj2.toJSON();
54620 var string = JSON.stringify(obj2);
54621 if (string === void 0) {
54624 var length2 = maxLength - currentIndent.length - reserved;
54625 var treeDepth = getTreeDepth(obj2);
54626 if (treeDepth <= maxNesting && string.length <= length2) {
54627 var prettified = prettify(string, {
54632 if (prettified.length <= length2) {
54636 if (isObject2(obj2)) {
54637 var nextIndent = currentIndent + indent;
54640 var comma = function(array2, index2) {
54641 return index2 === array2.length - 1 ? 0 : 1;
54643 if (Array.isArray(obj2)) {
54644 for (var index = 0; index < obj2.length; index++) {
54646 _stringify(obj2[index], nextIndent, comma(obj2, index)) || "null"
54651 Object.keys(obj2).forEach(function(key, index2, array2) {
54652 var keyPart = JSON.stringify(key) + ": ";
54653 var value = _stringify(
54656 keyPart.length + comma(array2, index2)
54658 if (value !== void 0) {
54659 items.push(keyPart + value);
54664 if (items.length > 0) {
54667 indent + items.join(",\n" + nextIndent),
54669 ].join("\n" + currentIndent);
54675 var stringOrChar = /("(?:[^\\"]|\\.)*")|[:,\][}{]/g;
54676 function prettify(string, options) {
54677 options = options || {};
54686 if (options.addMargin || options.addObjectMargin) {
54687 tokens["{"] = "{ ";
54688 tokens["}"] = " }";
54690 if (options.addMargin || options.addArrayMargin) {
54691 tokens["["] = "[ ";
54692 tokens["]"] = " ]";
54694 return string.replace(stringOrChar, function(match, string2) {
54695 return string2 ? match : tokens[match];
54698 function get4(options, name, defaultValue) {
54699 return name in options ? options[name] : defaultValue;
54701 module2.exports = stringify3;
54705 // node_modules/@rapideditor/location-conflation/index.mjs
54706 function _clip(features, which) {
54707 if (!Array.isArray(features) || !features.length) return null;
54708 const fn = { UNION: union, DIFFERENCE: difference }[which];
54709 const args = features.map((feature3) => feature3.geometry.coordinates);
54710 const coords = fn.apply(null, args);
54715 type: whichType(coords),
54716 coordinates: coords
54719 function whichType(coords2) {
54720 const a2 = Array.isArray(coords2);
54721 const b3 = a2 && Array.isArray(coords2[0]);
54722 const c2 = b3 && Array.isArray(coords2[0][0]);
54723 const d4 = c2 && Array.isArray(coords2[0][0][0]);
54724 return d4 ? "MultiPolygon" : "Polygon";
54727 function _cloneDeep(obj) {
54728 return JSON.parse(JSON.stringify(obj));
54730 function _sortLocations(a2, b3) {
54731 const rank = { countrycoder: 1, geojson: 2, point: 3 };
54732 const aRank = rank[a2.type];
54733 const bRank = rank[b3.type];
54734 return aRank > bRank ? 1 : aRank < bRank ? -1 : a2.id.localeCompare(b3.id);
54736 var import_geojson_area, import_circle_to_polygon, import_geojson_precision, import_json_stringify_pretty_compact, LocationConflation;
54737 var init_location_conflation = __esm({
54738 "node_modules/@rapideditor/location-conflation/index.mjs"() {
54739 init_country_coder();
54741 import_geojson_area = __toESM(require_geojson_area(), 1);
54742 import_circle_to_polygon = __toESM(require_circle_to_polygon(), 1);
54743 import_geojson_precision = __toESM(require_geojson_precision(), 1);
54744 import_json_stringify_pretty_compact = __toESM(require_json_stringify_pretty_compact(), 1);
54745 LocationConflation = class {
54748 // `fc` Optional FeatureCollection of known features
54750 // Optionally pass a GeoJSON FeatureCollection of known features which we can refer to later.
54751 // Each feature must have a filename-like `id`, for example: `something.geojson`
54754 // "type": "FeatureCollection"
54757 // "type": "Feature",
54758 // "id": "philly_metro.geojson",
54759 // "properties": { … },
54760 // "geometry": { … }
54766 this.strict = true;
54767 if (fc && fc.type === "FeatureCollection" && Array.isArray(fc.features)) {
54768 fc.features.forEach((feature3) => {
54769 feature3.properties = feature3.properties || {};
54770 let props = feature3.properties;
54771 let id2 = feature3.id || props.id;
54772 if (!id2 || !/^\S+\.geojson$/i.test(id2)) return;
54773 id2 = id2.toLowerCase();
54777 const area = import_geojson_area.default.geometry(feature3.geometry) / 1e6;
54778 props.area = Number(area.toFixed(2));
54780 this._cache[id2] = feature3;
54783 let world = _cloneDeep(feature("Q2"));
54786 coordinates: [[[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]]
54789 world.properties.id = "Q2";
54790 world.properties.area = import_geojson_area.default.geometry(world.geometry) / 1e6;
54791 this._cache.Q2 = world;
54793 // validateLocation
54794 // `location` The location to validate
54796 // Pass a `location` value to validate
54798 // Returns a result like:
54800 // type: 'point', 'geojson', or 'countrycoder'
54801 // location: the queried location
54802 // id: the stable identifier for the feature
54804 // or `null` if the location is invalid
54806 validateLocation(location) {
54807 if (Array.isArray(location) && (location.length === 2 || location.length === 3)) {
54808 const lon = location[0];
54809 const lat = location[1];
54810 const radius = location[2];
54811 if (Number.isFinite(lon) && lon >= -180 && lon <= 180 && Number.isFinite(lat) && lat >= -90 && lat <= 90 && (location.length === 2 || Number.isFinite(radius) && radius > 0)) {
54812 const id2 = "[" + location.toString() + "]";
54813 return { type: "point", location, id: id2 };
54815 } else if (typeof location === "string" && /^\S+\.geojson$/i.test(location)) {
54816 const id2 = location.toLowerCase();
54817 if (this._cache[id2]) {
54818 return { type: "geojson", location, id: id2 };
54820 } else if (typeof location === "string" || typeof location === "number") {
54821 const feature3 = feature(location);
54823 const id2 = feature3.properties.wikidata;
54824 return { type: "countrycoder", location, id: id2 };
54828 throw new Error(`validateLocation: Invalid location: "${location}".`);
54834 // `location` The location to resolve
54836 // Pass a `location` value to resolve
54838 // Returns a result like:
54840 // type: 'point', 'geojson', or 'countrycoder'
54841 // location: the queried location
54842 // id: a stable identifier for the feature
54843 // feature: the resolved GeoJSON feature
54845 // or `null` if the location is invalid
54847 resolveLocation(location) {
54848 const valid = this.validateLocation(location);
54849 if (!valid) return null;
54850 const id2 = valid.id;
54851 if (this._cache[id2]) {
54852 return Object.assign(valid, { feature: this._cache[id2] });
54854 if (valid.type === "point") {
54855 const lon = location[0];
54856 const lat = location[1];
54857 const radius = location[2] || 25;
54859 const PRECISION = 3;
54860 const area = Math.PI * radius * radius;
54861 const feature3 = this._cache[id2] = (0, import_geojson_precision.default)({
54864 properties: { id: id2, area: Number(area.toFixed(2)) },
54865 geometry: (0, import_circle_to_polygon.default)([lon, lat], radius * 1e3, EDGES)
54868 return Object.assign(valid, { feature: feature3 });
54869 } else if (valid.type === "geojson") {
54870 } else if (valid.type === "countrycoder") {
54871 let feature3 = _cloneDeep(feature(id2));
54872 let props = feature3.properties;
54873 if (Array.isArray(props.members)) {
54874 let aggregate = aggregateFeature(id2);
54875 aggregate.geometry.coordinates = _clip([aggregate], "UNION").geometry.coordinates;
54876 feature3.geometry = aggregate.geometry;
54879 const area = import_geojson_area.default.geometry(feature3.geometry) / 1e6;
54880 props.area = Number(area.toFixed(2));
54884 this._cache[id2] = feature3;
54885 return Object.assign(valid, { feature: feature3 });
54888 throw new Error(`resolveLocation: Couldn't resolve location "${location}".`);
54893 // validateLocationSet
54894 // `locationSet` the locationSet to validate
54896 // Pass a locationSet Object to validate like:
54898 // include: [ Array of locations ],
54899 // exclude: [ Array of locations ]
54902 // Returns a result like:
54904 // type: 'locationset'
54905 // locationSet: the queried locationSet
54906 // id: the stable identifier for the feature
54908 // or `null` if the locationSet is invalid
54910 validateLocationSet(locationSet) {
54911 locationSet = locationSet || {};
54912 const validator = this.validateLocation.bind(this);
54913 let include = (locationSet.include || []).map(validator).filter(Boolean);
54914 let exclude = (locationSet.exclude || []).map(validator).filter(Boolean);
54915 if (!include.length) {
54917 throw new Error(`validateLocationSet: LocationSet includes nothing.`);
54919 locationSet.include = ["Q2"];
54920 include = [{ type: "countrycoder", location: "Q2", id: "Q2" }];
54923 include.sort(_sortLocations);
54924 let id2 = "+[" + include.map((d4) => d4.id).join(",") + "]";
54925 if (exclude.length) {
54926 exclude.sort(_sortLocations);
54927 id2 += "-[" + exclude.map((d4) => d4.id).join(",") + "]";
54929 return { type: "locationset", locationSet, id: id2 };
54931 // resolveLocationSet
54932 // `locationSet` the locationSet to resolve
54934 // Pass a locationSet Object to validate like:
54936 // include: [ Array of locations ],
54937 // exclude: [ Array of locations ]
54940 // Returns a result like:
54942 // type: 'locationset'
54943 // locationSet: the queried locationSet
54944 // id: the stable identifier for the feature
54945 // feature: the resolved GeoJSON feature
54947 // or `null` if the locationSet is invalid
54949 resolveLocationSet(locationSet) {
54950 locationSet = locationSet || {};
54951 const valid = this.validateLocationSet(locationSet);
54952 if (!valid) return null;
54953 const id2 = valid.id;
54954 if (this._cache[id2]) {
54955 return Object.assign(valid, { feature: this._cache[id2] });
54957 const resolver = this.resolveLocation.bind(this);
54958 const includes = (locationSet.include || []).map(resolver).filter(Boolean);
54959 const excludes = (locationSet.exclude || []).map(resolver).filter(Boolean);
54960 if (includes.length === 1 && excludes.length === 0) {
54961 return Object.assign(valid, { feature: includes[0].feature });
54963 const includeGeoJSON = _clip(includes.map((d4) => d4.feature), "UNION");
54964 const excludeGeoJSON = _clip(excludes.map((d4) => d4.feature), "UNION");
54965 let resultGeoJSON = excludeGeoJSON ? _clip([includeGeoJSON, excludeGeoJSON], "DIFFERENCE") : includeGeoJSON;
54966 const area = import_geojson_area.default.geometry(resultGeoJSON.geometry) / 1e6;
54967 resultGeoJSON.id = id2;
54968 resultGeoJSON.properties = { id: id2, area: Number(area.toFixed(2)) };
54969 this._cache[id2] = resultGeoJSON;
54970 return Object.assign(valid, { feature: resultGeoJSON });
54973 // convenience method to prettyStringify the given object
54974 stringify(obj, options) {
54975 return (0, import_json_stringify_pretty_compact.default)(obj, options);
54981 // modules/core/LocationManager.js
54982 var LocationManager_exports = {};
54983 __export(LocationManager_exports, {
54984 LocationManager: () => LocationManager,
54985 locationManager: () => _sharedLocationManager
54987 var import_which_polygon3, import_geojson_area2, _loco, LocationManager, _sharedLocationManager;
54988 var init_LocationManager = __esm({
54989 "modules/core/LocationManager.js"() {
54991 init_location_conflation();
54992 import_which_polygon3 = __toESM(require_which_polygon(), 1);
54993 import_geojson_area2 = __toESM(require_geojson_area(), 1);
54994 _loco = new LocationConflation();
54995 LocationManager = class {
55001 this._resolved = /* @__PURE__ */ new Map();
55002 this._knownLocationSets = /* @__PURE__ */ new Map();
55003 this._locationIncludedIn = /* @__PURE__ */ new Map();
55004 this._locationExcludedIn = /* @__PURE__ */ new Map();
55005 const world = { locationSet: { include: ["Q2"] } };
55006 this._resolveLocationSet(world);
55007 this._rebuildIndex();
55010 * _validateLocationSet
55011 * Pass an Object with a `locationSet` property.
55012 * Validates the `locationSet` and sets a `locationSetID` property on the object.
55013 * To avoid so much computation we only resolve the include and exclude regions, but not the locationSet itself.
55015 * Use `_resolveLocationSet()` instead if you need to resolve geojson of locationSet, for example to render it.
55016 * Note: You need to call `_rebuildIndex()` after you're all finished validating the locationSets.
55018 * @param `obj` Object to check, it should have `locationSet` property
55020 _validateLocationSet(obj) {
55021 if (obj.locationSetID) return;
55023 let locationSet = obj.locationSet;
55024 if (!locationSet) {
55025 throw new Error("object missing locationSet property");
55027 if (!locationSet.include) {
55028 locationSet.include = ["Q2"];
55030 const locationSetID = _loco.validateLocationSet(locationSet).id;
55031 obj.locationSetID = locationSetID;
55032 if (this._knownLocationSets.has(locationSetID)) return;
55034 (locationSet.include || []).forEach((location) => {
55035 const locationID = _loco.validateLocation(location).id;
55036 let geojson = this._resolved.get(locationID);
55038 geojson = _loco.resolveLocation(location).feature;
55039 this._resolved.set(locationID, geojson);
55041 area += geojson.properties.area;
55042 let s2 = this._locationIncludedIn.get(locationID);
55044 s2 = /* @__PURE__ */ new Set();
55045 this._locationIncludedIn.set(locationID, s2);
55047 s2.add(locationSetID);
55049 (locationSet.exclude || []).forEach((location) => {
55050 const locationID = _loco.validateLocation(location).id;
55051 let geojson = this._resolved.get(locationID);
55053 geojson = _loco.resolveLocation(location).feature;
55054 this._resolved.set(locationID, geojson);
55056 area -= geojson.properties.area;
55057 let s2 = this._locationExcludedIn.get(locationID);
55059 s2 = /* @__PURE__ */ new Set();
55060 this._locationExcludedIn.set(locationID, s2);
55062 s2.add(locationSetID);
55064 this._knownLocationSets.set(locationSetID, area);
55066 obj.locationSet = { include: ["Q2"] };
55067 obj.locationSetID = "+[Q2]";
55071 * _resolveLocationSet
55072 * Does everything that `_validateLocationSet()` does, but then "resolves" the locationSet into GeoJSON.
55073 * This step is a bit more computationally expensive, so really only needed if you intend to render the shape.
55075 * Note: You need to call `_rebuildIndex()` after you're all finished validating the locationSets.
55077 * @param `obj` Object to check, it should have `locationSet` property
55079 _resolveLocationSet(obj) {
55080 this._validateLocationSet(obj);
55081 if (this._resolved.has(obj.locationSetID)) return;
55083 const result = _loco.resolveLocationSet(obj.locationSet);
55084 const locationSetID = result.id;
55085 obj.locationSetID = locationSetID;
55086 if (!result.feature.geometry.coordinates.length || !result.feature.properties.area) {
55087 throw new Error(`locationSet ${locationSetID} resolves to an empty feature.`);
55089 let geojson = JSON.parse(JSON.stringify(result.feature));
55090 geojson.id = locationSetID;
55091 geojson.properties.id = locationSetID;
55092 this._resolved.set(locationSetID, geojson);
55094 obj.locationSet = { include: ["Q2"] };
55095 obj.locationSetID = "+[Q2]";
55100 * Rebuilds the whichPolygon index with whatever features have been resolved into GeoJSON.
55103 this._wp = (0, import_which_polygon3.default)({ features: [...this._resolved.values()] });
55106 * mergeCustomGeoJSON
55107 * Accepts a FeatureCollection-like object containing custom locations
55108 * Each feature must have a filename-like `id`, for example: `something.geojson`
55110 * "type": "FeatureCollection"
55113 * "type": "Feature",
55114 * "id": "philly_metro.geojson",
55115 * "properties": { … },
55116 * "geometry": { … }
55121 * @param `fc` FeatureCollection-like Object containing custom locations
55123 mergeCustomGeoJSON(fc) {
55124 if (!fc || fc.type !== "FeatureCollection" || !Array.isArray(fc.features)) return;
55125 fc.features.forEach((feature3) => {
55126 feature3.properties = feature3.properties || {};
55127 let props = feature3.properties;
55128 let id2 = feature3.id || props.id;
55129 if (!id2 || !/^\S+\.geojson$/i.test(id2)) return;
55130 id2 = id2.toLowerCase();
55134 const area = import_geojson_area2.default.geometry(feature3.geometry) / 1e6;
55135 props.area = Number(area.toFixed(2));
55137 _loco._cache[id2] = feature3;
55141 * mergeLocationSets
55142 * Accepts an Array of Objects containing `locationSet` properties:
55144 * { id: 'preset1', locationSet: {…} },
55145 * { id: 'preset2', locationSet: {…} },
55148 * After validating, the Objects will be decorated with a `locationSetID` property:
55150 * { id: 'preset1', locationSet: {…}, locationSetID: '+[Q2]' },
55151 * { id: 'preset2', locationSet: {…}, locationSetID: '+[Q30]' },
55155 * @param `objects` Objects to check - they should have `locationSet` property
55156 * @return Promise resolved true (this function used to be slow/async, now it's faster and sync)
55158 mergeLocationSets(objects) {
55159 if (!Array.isArray(objects)) return Promise.reject("nothing to do");
55160 objects.forEach((obj) => this._validateLocationSet(obj));
55161 this._rebuildIndex();
55162 return Promise.resolve(objects);
55166 * Returns a locationSetID for a given locationSet (fallback to `+[Q2]`, world)
55167 * (The locationSet doesn't necessarily need to be resolved to compute its `id`)
55169 * @param `locationSet` A locationSet Object, e.g. `{ include: ['us'] }`
55170 * @return String locationSetID, e.g. `+[Q30]`
55172 locationSetID(locationSet) {
55175 locationSetID = _loco.validateLocationSet(locationSet).id;
55177 locationSetID = "+[Q2]";
55179 return locationSetID;
55183 * Returns the resolved GeoJSON feature for a given locationSetID (fallback to 'world')
55184 * A GeoJSON feature:
55188 * properties: { id: '+[Q30]', area: 21817019.17, … },
55192 * @param `locationSetID` String identifier, e.g. `+[Q30]`
55193 * @return GeoJSON object (fallback to world)
55195 feature(locationSetID = "+[Q2]") {
55196 const feature3 = this._resolved.get(locationSetID);
55197 return feature3 || this._resolved.get("+[Q2]");
55201 * Find all the locationSets valid at the given location.
55202 * Results include the area (in km²) to facilitate sorting.
55204 * Object of locationSetIDs to areas (in km²)
55206 * "+[Q2]": 511207893.3958111,
55207 * "+[Q30]": 21817019.17,
55208 * "+[new_jersey.geojson]": 22390.77,
55212 * @param `loc` `[lon,lat]` location to query, e.g. `[-74.4813, 40.7967]`
55213 * @return Object of locationSetIDs valid at given location
55215 locationSetsAt(loc) {
55217 const hits = this._wp(loc, true) || [];
55219 hits.forEach((prop) => {
55220 if (prop.id[0] !== "+") return;
55221 const locationSetID = prop.id;
55222 const area = thiz._knownLocationSets.get(locationSetID);
55224 result[locationSetID] = area;
55227 hits.forEach((prop) => {
55228 if (prop.id[0] === "+") return;
55229 const locationID = prop.id;
55230 const included = thiz._locationIncludedIn.get(locationID);
55231 (included || []).forEach((locationSetID) => {
55232 const area = thiz._knownLocationSets.get(locationSetID);
55234 result[locationSetID] = area;
55238 hits.forEach((prop) => {
55239 if (prop.id[0] === "+") return;
55240 const locationID = prop.id;
55241 const excluded = thiz._locationExcludedIn.get(locationID);
55242 (excluded || []).forEach((locationSetID) => {
55243 delete result[locationSetID];
55248 // Direct access to the location-conflation resolver
55253 _sharedLocationManager = new LocationManager();
55257 // modules/ui/intro/helper.js
55258 var helper_exports = {};
55259 __export(helper_exports, {
55260 helpHtml: () => helpHtml,
55262 isMostlySquare: () => isMostlySquare,
55263 localize: () => localize,
55264 missingStrings: () => missingStrings,
55266 pointBox: () => pointBox,
55267 selectMenuItem: () => selectMenuItem,
55268 transitionTime: () => transitionTime
55270 function pointBox(loc, context) {
55271 var rect = context.surfaceRect();
55272 var point = context.curtainProjection(loc);
55274 left: point[0] + rect.left - 40,
55275 top: point[1] + rect.top - 60,
55280 function pad2(locOrBox, padding, context) {
55282 if (locOrBox instanceof Array) {
55283 var rect = context.surfaceRect();
55284 var point = context.curtainProjection(locOrBox);
55286 left: point[0] + rect.left,
55287 top: point[1] + rect.top
55293 left: box.left - padding,
55294 top: box.top - padding,
55295 width: (box.width || 0) + 2 * padding,
55296 height: (box.width || 0) + 2 * padding
55299 function icon(name, svgklass, useklass) {
55300 return '<svg class="icon ' + (svgklass || "") + '"><use xlink:href="' + name + '"' + (useklass ? ' class="' + useklass + '"' : "") + "></use></svg>";
55302 function helpHtml(id2, replacements) {
55303 if (!helpStringReplacements) {
55304 helpStringReplacements = {
55305 // insert icons corresponding to various UI elements
55306 point_icon: icon("#iD-icon-point", "inline"),
55307 line_icon: icon("#iD-icon-line", "inline"),
55308 area_icon: icon("#iD-icon-area", "inline"),
55309 note_icon: icon("#iD-icon-note", "inline add-note"),
55310 plus: icon("#iD-icon-plus", "inline"),
55311 minus: icon("#iD-icon-minus", "inline"),
55312 layers_icon: icon("#iD-icon-layers", "inline"),
55313 data_icon: icon("#iD-icon-data", "inline"),
55314 inspect: icon("#iD-icon-inspect", "inline"),
55315 help_icon: icon("#iD-icon-help", "inline"),
55316 undo_icon: icon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-redo" : "#iD-icon-undo", "inline"),
55317 redo_icon: icon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-undo" : "#iD-icon-redo", "inline"),
55318 save_icon: icon("#iD-icon-save", "inline"),
55320 circularize_icon: icon("#iD-operation-circularize", "inline operation"),
55321 continue_icon: icon("#iD-operation-continue", "inline operation"),
55322 copy_icon: icon("#iD-operation-copy", "inline operation"),
55323 delete_icon: icon("#iD-operation-delete", "inline operation"),
55324 disconnect_icon: icon("#iD-operation-disconnect", "inline operation"),
55325 downgrade_icon: icon("#iD-operation-downgrade", "inline operation"),
55326 extract_icon: icon("#iD-operation-extract", "inline operation"),
55327 merge_icon: icon("#iD-operation-merge", "inline operation"),
55328 move_icon: icon("#iD-operation-move", "inline operation"),
55329 orthogonalize_icon: icon("#iD-operation-orthogonalize", "inline operation"),
55330 paste_icon: icon("#iD-operation-paste", "inline operation"),
55331 reflect_long_icon: icon("#iD-operation-reflect-long", "inline operation"),
55332 reflect_short_icon: icon("#iD-operation-reflect-short", "inline operation"),
55333 reverse_icon: icon("#iD-operation-reverse", "inline operation"),
55334 rotate_icon: icon("#iD-operation-rotate", "inline operation"),
55335 split_icon: icon("#iD-operation-split", "inline operation"),
55336 straighten_icon: icon("#iD-operation-straighten", "inline operation"),
55337 // interaction icons
55338 leftclick: icon("#iD-walkthrough-mouse-left", "inline operation"),
55339 rightclick: icon("#iD-walkthrough-mouse-right", "inline operation"),
55340 mousewheel_icon: icon("#iD-walkthrough-mousewheel", "inline operation"),
55341 tap_icon: icon("#iD-walkthrough-tap", "inline operation"),
55342 doubletap_icon: icon("#iD-walkthrough-doubletap", "inline operation"),
55343 longpress_icon: icon("#iD-walkthrough-longpress", "inline operation"),
55344 touchdrag_icon: icon("#iD-walkthrough-touchdrag", "inline operation"),
55345 pinch_icon: icon("#iD-walkthrough-pinch-apart", "inline operation"),
55346 // insert keys; may be localized and platform-dependent
55347 shift: uiCmd.display("\u21E7"),
55348 alt: uiCmd.display("\u2325"),
55349 return: uiCmd.display("\u21B5"),
55350 esc: _t.html("shortcuts.key.esc"),
55351 space: _t.html("shortcuts.key.space"),
55352 add_note_key: _t.html("modes.add_note.key"),
55353 help_key: _t.html("help.key"),
55354 shortcuts_key: _t.html("shortcuts.toggle.key"),
55355 // reference localized UI labels directly so that they'll always match
55356 save: _t.html("save.title"),
55357 undo: _t.html("undo.title"),
55358 redo: _t.html("redo.title"),
55359 upload: _t.html("commit.save"),
55360 point: _t.html("modes.add_point.title"),
55361 line: _t.html("modes.add_line.title"),
55362 area: _t.html("modes.add_area.title"),
55363 note: _t.html("modes.add_note.label"),
55364 circularize: _t.html("operations.circularize.title"),
55365 continue: _t.html("operations.continue.title"),
55366 copy: _t.html("operations.copy.title"),
55367 delete: _t.html("operations.delete.title"),
55368 disconnect: _t.html("operations.disconnect.title"),
55369 downgrade: _t.html("operations.downgrade.title"),
55370 extract: _t.html("operations.extract.title"),
55371 merge: _t.html("operations.merge.title"),
55372 move: _t.html("operations.move.title"),
55373 orthogonalize: _t.html("operations.orthogonalize.title"),
55374 paste: _t.html("operations.paste.title"),
55375 reflect_long: _t.html("operations.reflect.title.long"),
55376 reflect_short: _t.html("operations.reflect.title.short"),
55377 reverse: _t.html("operations.reverse.title"),
55378 rotate: _t.html("operations.rotate.title"),
55379 split: _t.html("operations.split.title"),
55380 straighten: _t.html("operations.straighten.title"),
55381 map_data: _t.html("map_data.title"),
55382 osm_notes: _t.html("map_data.layers.notes.title"),
55383 fields: _t.html("inspector.fields"),
55384 tags: _t.html("inspector.tags"),
55385 relations: _t.html("inspector.relations"),
55386 new_relation: _t.html("inspector.new_relation"),
55387 turn_restrictions: _t.html("_tagging.presets.fields.restrictions.label"),
55388 background_settings: _t.html("background.description"),
55389 imagery_offset: _t.html("background.fix_misalignment"),
55390 start_the_walkthrough: _t.html("splash.walkthrough"),
55391 help: _t.html("help.title"),
55392 ok: _t.html("intro.ok")
55394 for (var key in helpStringReplacements) {
55395 helpStringReplacements[key] = { html: helpStringReplacements[key] };
55399 if (replacements) {
55400 reps = Object.assign(replacements, helpStringReplacements);
55402 reps = helpStringReplacements;
55404 return _t.html(id2, reps).replace(/\`(.*?)\`/g, "<kbd>$1</kbd>");
55406 function slugify(text) {
55407 return text.toString().toLowerCase().replace(/\s+/g, "-").replace(/[^\w\-]+/g, "").replace(/\-\-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
55409 function checkKey(key, text) {
55410 if (_t(key, { default: void 0 }) === void 0) {
55411 if (missingStrings.hasOwnProperty(key)) return;
55412 missingStrings[key] = text;
55413 var missing = key + ": " + text;
55414 if (typeof console !== "undefined") console.log(missing);
55417 function localize(obj) {
55419 var name = obj.tags && obj.tags.name;
55421 key = "intro.graph.name." + slugify(name);
55422 obj.tags.name = _t(key, { default: name });
55423 checkKey(key, name);
55425 var street = obj.tags && obj.tags["addr:street"];
55427 key = "intro.graph.name." + slugify(street);
55428 obj.tags["addr:street"] = _t(key, { default: street });
55429 checkKey(key, street);
55444 addrTags.forEach(function(k2) {
55445 var key2 = "intro.graph." + k2;
55446 var tag = "addr:" + k2;
55447 var val = obj.tags && obj.tags[tag];
55448 var str = _t(key2, { default: val });
55450 if (str.match(/^<.*>$/) !== null) {
55451 delete obj.tags[tag];
55453 obj.tags[tag] = str;
55460 function isMostlySquare(points) {
55461 var threshold = 15;
55462 var lowerBound = Math.cos((90 - threshold) * Math.PI / 180);
55463 var upperBound = Math.cos(threshold * Math.PI / 180);
55464 for (var i3 = 0; i3 < points.length; i3++) {
55465 var a2 = points[(i3 - 1 + points.length) % points.length];
55466 var origin = points[i3];
55467 var b3 = points[(i3 + 1) % points.length];
55468 var dotp = geoVecNormalizedDot(a2, b3, origin);
55469 var mag = Math.abs(dotp);
55470 if (mag > lowerBound && mag < upperBound) {
55476 function selectMenuItem(context, operation2) {
55477 return context.container().select(".edit-menu .edit-menu-item-" + operation2);
55479 function transitionTime(point1, point2) {
55480 var distance = geoSphericalDistance(point1, point2);
55481 if (distance === 0) {
55483 } else if (distance < 80) {
55489 var helpStringReplacements, missingStrings;
55490 var init_helper = __esm({
55491 "modules/ui/intro/helper.js"() {
55496 missingStrings = {};
55500 // modules/ui/field_help.js
55501 var field_help_exports = {};
55502 __export(field_help_exports, {
55503 uiFieldHelp: () => uiFieldHelp
55505 function uiFieldHelp(context, fieldName) {
55506 var fieldHelp = {};
55507 var _inspector = select_default2(null);
55508 var _wrap = select_default2(null);
55509 var _body = select_default2(null);
55510 var fieldHelpKeys = {
55538 "indirect_example",
55543 var fieldHelpHeadings = {};
55544 var replacements = {
55545 distField: { html: _t.html("restriction.controls.distance") },
55546 viaField: { html: _t.html("restriction.controls.via") },
55547 fromShadow: { html: icon("#iD-turn-shadow", "inline shadow from") },
55548 allowShadow: { html: icon("#iD-turn-shadow", "inline shadow allow") },
55549 restrictShadow: { html: icon("#iD-turn-shadow", "inline shadow restrict") },
55550 onlyShadow: { html: icon("#iD-turn-shadow", "inline shadow only") },
55551 allowTurn: { html: icon("#iD-turn-yes", "inline turn") },
55552 restrictTurn: { html: icon("#iD-turn-no", "inline turn") },
55553 onlyTurn: { html: icon("#iD-turn-only", "inline turn") }
55555 var docs = fieldHelpKeys[fieldName].map(function(key) {
55556 var helpkey = "help.field." + fieldName + "." + key[0];
55557 var text = key[1].reduce(function(all, part) {
55558 var subkey = helpkey + "." + part;
55559 var depth = fieldHelpHeadings[subkey];
55560 var hhh = depth ? Array(depth + 1).join("#") + " " : "";
55561 return all + hhh + _t.html(subkey, replacements) + "\n\n";
55565 title: _t.html(helpkey + ".title"),
55566 html: d(text.trim())
55571 _body.classed("hide", false).style("opacity", "0").transition().duration(200).style("opacity", "1");
55574 _body.classed("hide", true).transition().duration(200).style("opacity", "0").on("end", function() {
55575 _body.classed("hide", true);
55578 function clickHelp(index) {
55579 var d4 = docs[index];
55580 var tkeys = fieldHelpKeys[fieldName][index][1];
55581 _body.selectAll(".field-help-nav-item").classed("active", function(d5, i3) {
55582 return i3 === index;
55584 var content = _body.selectAll(".field-help-content").html(d4.html);
55585 content.selectAll("p").attr("class", function(d5, i3) {
55588 if (d4.key === "help.field.restrictions.inspecting") {
55589 content.insert("img", "p.from_shadow").attr("class", "field-help-image cf").attr("src", context.imagePath("tr_inspect.gif"));
55590 } else if (d4.key === "help.field.restrictions.modifying") {
55591 content.insert("img", "p.allow_turn").attr("class", "field-help-image cf").attr("src", context.imagePath("tr_modify.gif"));
55594 fieldHelp.button = function(selection2) {
55595 if (_body.empty()) return;
55596 var button = selection2.selectAll(".field-help-button").data([0]);
55597 button.enter().append("button").attr("class", "field-help-button").call(svgIcon("#iD-icon-help")).merge(button).on("click", function(d3_event) {
55598 d3_event.stopPropagation();
55599 d3_event.preventDefault();
55600 if (_body.classed("hide")) {
55607 function updatePosition() {
55608 var wrap2 = _wrap.node();
55609 var inspector = _inspector.node();
55610 var wRect = wrap2.getBoundingClientRect();
55611 var iRect = inspector.getBoundingClientRect();
55612 _body.style("top", wRect.top + inspector.scrollTop - iRect.top + "px");
55614 fieldHelp.body = function(selection2) {
55615 _wrap = selection2.selectAll(".form-field-input-wrap");
55616 if (_wrap.empty()) return;
55617 _inspector = context.container().select(".sidebar .entity-editor-pane .inspector-body");
55618 if (_inspector.empty()) return;
55619 _body = _inspector.selectAll(".field-help-body").data([0]);
55620 var enter = _body.enter().append("div").attr("class", "field-help-body hide");
55621 var titleEnter = enter.append("div").attr("class", "field-help-title cf");
55622 titleEnter.append("h2").attr("class", _mainLocalizer.textDirection() === "rtl" ? "fr" : "fl").call(_t.append("help.field." + fieldName + ".title"));
55623 titleEnter.append("button").attr("class", "fr close").attr("title", _t("icons.close")).on("click", function(d3_event) {
55624 d3_event.stopPropagation();
55625 d3_event.preventDefault();
55627 }).call(svgIcon("#iD-icon-close"));
55628 var navEnter = enter.append("div").attr("class", "field-help-nav cf");
55629 var titles = docs.map(function(d4) {
55632 navEnter.selectAll(".field-help-nav-item").data(titles).enter().append("div").attr("class", "field-help-nav-item").html(function(d4) {
55634 }).on("click", function(d3_event, d4) {
55635 d3_event.stopPropagation();
55636 d3_event.preventDefault();
55637 clickHelp(titles.indexOf(d4));
55639 enter.append("div").attr("class", "field-help-content");
55640 _body = _body.merge(enter);
55645 var init_field_help = __esm({
55646 "modules/ui/field_help.js"() {
55656 // modules/ui/fields/check.js
55657 var check_exports = {};
55658 __export(check_exports, {
55659 uiFieldCheck: () => uiFieldCheck,
55660 uiFieldDefaultCheck: () => uiFieldCheck,
55661 uiFieldOnewayCheck: () => uiFieldCheck
55663 function uiFieldCheck(field, context) {
55664 var dispatch14 = dispatch_default("change");
55665 var options = field.options;
55669 var input = select_default2(null);
55670 var text = select_default2(null);
55671 var label = select_default2(null);
55672 var reverser = select_default2(null);
55674 var _entityIDs = [];
55676 var stringsField = field.resolveReference("stringsCrossReference");
55677 if (!options && stringsField.options) {
55678 options = stringsField.options;
55681 for (var i3 in options) {
55682 var v3 = options[i3];
55683 values.push(v3 === "undefined" ? void 0 : v3);
55684 texts.push(stringsField.t.html("options." + v3, { "default": v3 }));
55687 values = [void 0, "yes"];
55688 texts = [_t.html("inspector.unknown"), _t.html("inspector.check.yes")];
55689 if (field.type !== "defaultCheck") {
55691 texts.push(_t.html("inspector.check.no"));
55694 function checkImpliedYes() {
55695 _impliedYes = field.id === "oneway_yes";
55696 if (field.id === "oneway") {
55697 var entity = context.entity(_entityIDs[0]);
55698 if (entity.type === "way" && !!utilCheckTagDictionary(entity.tags, omit_default(osmOneWayTags, "oneway"))) {
55699 _impliedYes = true;
55700 texts[0] = _t.html("_tagging.presets.fields.oneway_yes.options.undefined");
55704 function reverserHidden() {
55705 if (!context.container().select("div.inspector-hover").empty()) return true;
55706 return !(_value === "yes" || _impliedYes && !_value);
55708 function reverserSetText(selection2) {
55709 var entity = _entityIDs.length && context.hasEntity(_entityIDs[0]);
55710 if (reverserHidden() || !entity) return selection2;
55711 var first = entity.first();
55712 var last2 = entity.isClosed() ? entity.nodes[entity.nodes.length - 2] : entity.last();
55713 var pseudoDirection = first < last2;
55714 var icon2 = pseudoDirection ? "#iD-icon-forward" : "#iD-icon-backward";
55715 selection2.selectAll(".reverser-span").html("").call(_t.append("inspector.check.reverser")).call(svgIcon(icon2, "inline"));
55718 var check = function(selection2) {
55720 label = selection2.selectAll(".form-field-input-wrap").data([0]);
55721 var enter = label.enter().append("label").attr("class", "form-field-input-wrap form-field-input-check");
55722 enter.append("input").property("indeterminate", field.type !== "defaultCheck").attr("type", "checkbox").attr("id", field.domId);
55723 enter.append("span").html(texts[0]).attr("class", "value");
55724 if (field.type === "onewayCheck") {
55725 enter.append("button").attr("class", "reverser" + (reverserHidden() ? " hide" : "")).append("span").attr("class", "reverser-span");
55727 label = label.merge(enter);
55728 input = label.selectAll("input");
55729 text = label.selectAll("span.value");
55730 input.on("click", function(d3_event) {
55731 d3_event.stopPropagation();
55733 if (Array.isArray(_tags[field.key])) {
55734 if (values.indexOf("yes") !== -1) {
55735 t2[field.key] = "yes";
55737 t2[field.key] = values[0];
55740 t2[field.key] = values[(values.indexOf(_value) + 1) % values.length];
55742 if (t2[field.key] === "reversible" || t2[field.key] === "alternating") {
55743 t2[field.key] = values[0];
55745 dispatch14.call("change", this, t2);
55747 if (field.type === "onewayCheck") {
55748 reverser = label.selectAll(".reverser");
55749 reverser.call(reverserSetText).on("click", function(d3_event) {
55750 d3_event.preventDefault();
55751 d3_event.stopPropagation();
55754 for (var i4 in _entityIDs) {
55755 graph = actionReverse(_entityIDs[i4])(graph);
55759 _t("operations.reverse.annotation.line", { n: 1 })
55761 context.validator().validate();
55762 select_default2(this).call(reverserSetText);
55766 check.entityIDs = function(val) {
55767 if (!arguments.length) return _entityIDs;
55771 check.tags = function(tags) {
55773 function isChecked(val) {
55774 return val !== "no" && val !== "" && val !== void 0 && val !== null;
55776 function textFor(val) {
55777 if (val === "") val = void 0;
55778 var index = values.indexOf(val);
55779 return index !== -1 ? texts[index] : '"' + val + '"';
55782 var isMixed = Array.isArray(tags[field.key]);
55783 _value = !isMixed && tags[field.key] && tags[field.key].toLowerCase();
55784 if (field.type === "onewayCheck" && (_value === "1" || _value === "-1")) {
55787 input.property("indeterminate", isMixed || field.type !== "defaultCheck" && !_value).property("checked", isChecked(_value));
55788 text.html(isMixed ? _t.html("inspector.multiple_values") : textFor(_value)).classed("mixed", isMixed);
55789 label.classed("set", !!_value);
55790 if (field.type === "onewayCheck") {
55791 reverser.classed("hide", reverserHidden()).call(reverserSetText);
55794 check.focus = function() {
55795 input.node().focus();
55797 return utilRebind(check, dispatch14, "on");
55799 var init_check = __esm({
55800 "modules/ui/fields/check.js"() {
55814 // modules/svg/helpers.js
55815 var helpers_exports = {};
55816 __export(helpers_exports, {
55817 svgMarkerSegments: () => svgMarkerSegments,
55818 svgPassiveVertex: () => svgPassiveVertex,
55819 svgPath: () => svgPath,
55820 svgPointTransform: () => svgPointTransform,
55821 svgRelationMemberTags: () => svgRelationMemberTags,
55822 svgSegmentWay: () => svgSegmentWay
55824 function svgPassiveVertex(node, graph, activeID) {
55825 if (!activeID) return 1;
55826 if (activeID === node.id) return 0;
55827 var parents = graph.parentWays(node);
55828 var i3, j3, nodes, isClosed, ix1, ix2, ix3, ix4, max3;
55829 for (i3 = 0; i3 < parents.length; i3++) {
55830 nodes = parents[i3].nodes;
55831 isClosed = parents[i3].isClosed();
55832 for (j3 = 0; j3 < nodes.length; j3++) {
55833 if (nodes[j3] === node.id) {
55839 max3 = nodes.length - 1;
55840 if (ix1 < 0) ix1 = max3 + ix1;
55841 if (ix2 < 0) ix2 = max3 + ix2;
55842 if (ix3 > max3) ix3 = ix3 - max3;
55843 if (ix4 > max3) ix4 = ix4 - max3;
55845 if (nodes[ix1] === activeID) return 0;
55846 else if (nodes[ix2] === activeID) return 2;
55847 else if (nodes[ix3] === activeID) return 2;
55848 else if (nodes[ix4] === activeID) return 0;
55849 else if (isClosed && nodes.indexOf(activeID) !== -1) return 0;
55855 function svgMarkerSegments(projection2, graph, dt2, shouldReverse = () => false, bothDirections = () => false) {
55856 return function(entity) {
55858 let offset = dt2 / 2;
55859 const segments = [];
55860 const clip = paddedClipExtent(projection2);
55861 const coordinates = graph.childNodes(entity).map(function(n3) {
55865 const _shouldReverse = shouldReverse(entity);
55866 const _bothDirections = bothDirections(entity);
55868 type: "LineString",
55870 }, projection2.stream(clip({
55871 lineStart: function() {
55873 lineEnd: function() {
55876 point: function(x2, y3) {
55879 let span = geoVecLength(a2, b3) - offset;
55881 const heading = geoVecAngle(a2, b3);
55882 const dx = dt2 * Math.cos(heading);
55883 const dy = dt2 * Math.sin(heading);
55885 a2[0] + offset * Math.cos(heading),
55886 a2[1] + offset * Math.sin(heading)
55888 const coord2 = [a2, p2];
55889 for (span -= dt2; span >= 0; span -= dt2) {
55890 p2 = geoVecAdd(p2, [dx, dy]);
55895 if (!_shouldReverse || _bothDirections) {
55896 for (let j3 = 0; j3 < coord2.length; j3++) {
55897 segment += (j3 === 0 ? "M" : "L") + coord2[j3][0] + "," + coord2[j3][1];
55899 segments.push({ id: entity.id, index: i3++, d: segment });
55901 if (_shouldReverse || _bothDirections) {
55903 for (let j3 = coord2.length - 1; j3 >= 0; j3--) {
55904 segment += (j3 === coord2.length - 1 ? "M" : "L") + coord2[j3][0] + "," + coord2[j3][1];
55906 segments.push({ id: entity.id, index: i3++, d: segment });
55917 function svgPath(projection2, graph, isArea) {
55919 const project = projection2.stream;
55920 const clip = paddedClipExtent(projection2, isArea);
55921 const path = path_default().projection({ stream: function(output) {
55922 return project(clip(output));
55924 const svgpath = function(entity) {
55925 if (entity.id in cache) {
55926 return cache[entity.id];
55928 return cache[entity.id] = path(entity.asGeoJSON(graph));
55931 svgpath.geojson = function(d4) {
55932 if (d4.__featurehash__ !== void 0) {
55933 if (d4.__featurehash__ in cache) {
55934 return cache[d4.__featurehash__];
55936 return cache[d4.__featurehash__] = path(d4);
55944 function svgPointTransform(projection2) {
55945 var svgpoint = function(entity) {
55946 var pt2 = projection2(entity.loc);
55947 return "translate(" + pt2[0] + "," + pt2[1] + ")";
55949 svgpoint.geojson = function(d4) {
55950 return svgpoint(d4.properties.entity);
55954 function svgRelationMemberTags(graph) {
55955 return function(entity) {
55956 var tags = entity.tags;
55957 var shouldCopyMultipolygonTags = !entity.hasInterestingTags();
55958 graph.parentRelations(entity).forEach(function(relation) {
55959 var type2 = relation.tags.type;
55960 if (type2 === "multipolygon" && shouldCopyMultipolygonTags || type2 === "boundary") {
55961 tags = Object.assign({}, relation.tags, tags);
55967 function svgSegmentWay(way, graph, activeID) {
55968 if (activeID === void 0) {
55969 return graph.transient(way, "waySegments", getWaySegments);
55971 return getWaySegments();
55973 function getWaySegments() {
55974 var isActiveWay = way.nodes.indexOf(activeID) !== -1;
55975 var features = { passive: [], active: [] };
55979 for (var i3 = 0; i3 < way.nodes.length; i3++) {
55980 node = graph.entity(way.nodes[i3]);
55981 type2 = svgPassiveVertex(node, graph, activeID);
55982 end = { node, type: type2 };
55983 if (start2.type !== void 0) {
55984 if (start2.node.id === activeID || end.node.id === activeID) {
55985 } else if (isActiveWay && (start2.type === 2 || end.type === 2)) {
55986 pushActive(start2, end, i3);
55987 } else if (start2.type === 0 && end.type === 0) {
55988 pushActive(start2, end, i3);
55990 pushPassive(start2, end, i3);
55996 function pushActive(start3, end2, index) {
55997 features.active.push({
55999 id: way.id + "-" + index + "-nope",
56004 nodes: [start3.node, end2.node],
56008 type: "LineString",
56009 coordinates: [start3.node.loc, end2.node.loc]
56013 function pushPassive(start3, end2, index) {
56014 features.passive.push({
56016 id: way.id + "-" + index,
56020 nodes: [start3.node, end2.node],
56024 type: "LineString",
56025 coordinates: [start3.node.loc, end2.node.loc]
56031 function paddedClipExtent(projection2, isArea = false) {
56032 var padding = isArea ? 65 : 5;
56033 var viewport = projection2.clipExtent();
56034 var paddedExtent = [
56035 [viewport[0][0] - padding, viewport[0][1] - padding],
56036 [viewport[1][0] + padding, viewport[1][1] + padding]
56038 return identity_default2().clipExtent(paddedExtent).stream;
56040 var init_helpers = __esm({
56041 "modules/svg/helpers.js"() {
56048 // modules/svg/tag_classes.js
56049 var tag_classes_exports = {};
56050 __export(tag_classes_exports, {
56051 svgTagClasses: () => svgTagClasses
56053 function svgTagClasses() {
56078 var statuses = Object.keys(osmLifecyclePrefixes);
56079 var secondaries = [
56092 "public_transport",
56103 var _tags = function(entity) {
56104 return entity.tags;
56106 var tagClasses = function(selection2) {
56107 selection2.each(function tagClassesEach(entity) {
56108 var value = this.className;
56109 if (value.baseVal !== void 0) {
56110 value = value.baseVal;
56112 var t2 = _tags(entity);
56113 var computed = tagClasses.getClassesString(t2, value);
56114 if (computed !== value) {
56115 select_default2(this).attr("class", computed);
56119 tagClasses.getClassesString = function(t2, value) {
56120 var primary, status;
56121 var i3, j3, k2, v3;
56122 var overrideGeometry;
56123 if (/\bstroke\b/.test(value)) {
56124 if (!!t2.barrier && t2.barrier !== "no") {
56125 overrideGeometry = "line";
56128 var classes = value.trim().split(/\s+/).filter(function(klass) {
56129 return klass.length && !/^tag-/.test(klass);
56130 }).map(function(klass) {
56131 return klass === "line" || klass === "area" ? overrideGeometry || klass : klass;
56133 for (i3 = 0; i3 < primaries.length; i3++) {
56134 k2 = primaries[i3];
56136 if (!v3 || v3 === "no") continue;
56137 if (k2 === "piste:type") {
56139 } else if (k2 === "building:part") {
56140 k2 = "building_part";
56143 if (statuses.indexOf(v3) !== -1) {
56145 classes.push("tag-" + k2);
56147 classes.push("tag-" + k2);
56148 classes.push("tag-" + k2 + "-" + v3);
56153 for (i3 = 0; i3 < statuses.length; i3++) {
56154 for (j3 = 0; j3 < primaries.length; j3++) {
56155 k2 = statuses[i3] + ":" + primaries[j3];
56157 if (!v3 || v3 === "no") continue;
56158 status = statuses[i3];
56164 for (i3 = 0; i3 < statuses.length; i3++) {
56167 if (!v3 || v3 === "no") continue;
56168 if (v3 === "yes") {
56170 } else if (primary && primary === v3) {
56172 } else if (!primary && primaries.indexOf(v3) !== -1) {
56175 classes.push("tag-" + v3);
56181 classes.push("tag-status");
56182 classes.push("tag-status-" + status);
56184 for (i3 = 0; i3 < secondaries.length; i3++) {
56185 k2 = secondaries[i3];
56187 if (!v3 || v3 === "no" || k2 === primary) continue;
56188 classes.push("tag-" + k2);
56189 classes.push("tag-" + k2 + "-" + v3);
56191 if (primary === "highway" && !osmPathHighwayTagValues[t2.highway] || primary === "aeroway") {
56192 var surface = t2.highway === "track" ? "unpaved" : "paved";
56195 if (k2 in osmPavedTags) {
56196 surface = osmPavedTags[k2][v3] ? "paved" : "unpaved";
56198 if (k2 in osmSemipavedTags && !!osmSemipavedTags[k2][v3]) {
56199 surface = "semipaved";
56202 classes.push("tag-" + surface);
56204 var qid = t2.wikidata || t2["flag:wikidata"] || t2["brand:wikidata"] || t2["network:wikidata"] || t2["operator:wikidata"];
56206 classes.push("tag-wikidata");
56208 return classes.filter((klass) => /^[-_a-z0-9]+$/.test(klass)).join(" ").trim();
56210 tagClasses.tags = function(val) {
56211 if (!arguments.length) return _tags;
56217 var init_tag_classes = __esm({
56218 "modules/svg/tag_classes.js"() {
56225 // modules/svg/tag_pattern.js
56226 var tag_pattern_exports = {};
56227 __export(tag_pattern_exports, {
56228 svgTagPattern: () => svgTagPattern
56230 function svgTagPattern(tags) {
56231 if (tags.building && tags.building !== "no") {
56234 for (var tag in patterns) {
56235 var entityValue = tags[tag];
56236 if (!entityValue) continue;
56237 if (typeof patterns[tag] === "string") {
56238 return "pattern-" + patterns[tag];
56240 var values = patterns[tag];
56241 for (var value in values) {
56242 if (entityValue !== value) continue;
56243 var rules = values[value];
56244 if (typeof rules === "string") {
56245 return "pattern-" + rules;
56247 for (var ruleKey in rules) {
56248 var rule = rules[ruleKey];
56250 for (var criterion in rule) {
56251 if (criterion !== "pattern") {
56252 var v3 = tags[criterion];
56253 if (!v3 || v3 !== rule[criterion]) {
56260 return "pattern-" + rule.pattern;
56269 var init_tag_pattern = __esm({
56270 "modules/svg/tag_pattern.js"() {
56273 // tag - pattern name
56275 // tag - value - pattern name
56277 // tag - value - rules (optional tag-values, pattern name)
56278 // (matches earlier rules first, so fallback should be last entry)
56280 grave_yard: "cemetery",
56281 fountain: "water_standing"
56285 { religion: "christian", pattern: "cemetery_christian" },
56286 { religion: "buddhist", pattern: "cemetery_buddhist" },
56287 { religion: "muslim", pattern: "cemetery_muslim" },
56288 { religion: "jewish", pattern: "cemetery_jewish" },
56289 { pattern: "cemetery" }
56291 construction: "construction",
56292 farmland: "farmland",
56293 farmyard: "farmyard",
56295 { leaf_type: "broadleaved", pattern: "forest_broadleaved" },
56296 { leaf_type: "needleleaved", pattern: "forest_needleleaved" },
56297 { leaf_type: "leafless", pattern: "forest_leafless" },
56298 { pattern: "forest" }
56299 // same as 'leaf_type:mixed'
56301 grave_yard: "cemetery",
56303 landfill: "landfill",
56305 military: "construction",
56306 orchard: "orchard",
56308 vineyard: "vineyard"
56311 horse_riding: "farmyard"
56315 grassland: "grass",
56319 { water: "pond", pattern: "pond" },
56320 { water: "reservoir", pattern: "water_standing" },
56321 { pattern: "waves" }
56324 { wetland: "marsh", pattern: "wetland_marsh" },
56325 { wetland: "swamp", pattern: "wetland_swamp" },
56326 { wetland: "bog", pattern: "wetland_bog" },
56327 { wetland: "reedbed", pattern: "wetland_reedbed" },
56328 { pattern: "wetland" }
56331 { leaf_type: "broadleaved", pattern: "forest_broadleaved" },
56332 { leaf_type: "needleleaved", pattern: "forest_needleleaved" },
56333 { leaf_type: "leafless", pattern: "forest_leafless" },
56334 { pattern: "forest" }
56335 // same as 'leaf_type:mixed'
56339 green: "golf_green",
56352 // modules/svg/areas.js
56353 var areas_exports = {};
56354 __export(areas_exports, {
56355 svgAreas: () => svgAreas
56357 function svgAreas(projection2, context) {
56358 function getPatternStyle(tags) {
56359 var imageID = svgTagPattern(tags);
56361 return 'url("#ideditor-' + imageID + '")';
56365 function drawTargets(selection2, graph, entities, filter2) {
56366 var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
56367 var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
56368 var getPath = svgPath(projection2).geojson;
56369 var activeID = context.activeID();
56370 var base = context.history().base();
56371 var data = { targets: [], nopes: [] };
56372 entities.forEach(function(way) {
56373 var features = svgSegmentWay(way, graph, activeID);
56374 data.targets.push.apply(data.targets, features.passive);
56375 data.nopes.push.apply(data.nopes, features.active);
56377 var targetData = data.targets.filter(getPath);
56378 var targets = selection2.selectAll(".area.target-allowed").filter(function(d4) {
56379 return filter2(d4.properties.entity);
56380 }).data(targetData, function key(d4) {
56383 targets.exit().remove();
56384 var segmentWasEdited = function(d4) {
56385 var wayID = d4.properties.entity.id;
56386 if (!base.entities[wayID] || !(0, import_fast_deep_equal6.default)(graph.entities[wayID].nodes, base.entities[wayID].nodes)) {
56389 return d4.properties.nodes.some(function(n3) {
56390 return !base.entities[n3.id] || !(0, import_fast_deep_equal6.default)(graph.entities[n3.id].loc, base.entities[n3.id].loc);
56393 targets.enter().append("path").merge(targets).attr("d", getPath).attr("class", function(d4) {
56394 return "way area target target-allowed " + targetClass + d4.id;
56395 }).classed("segment-edited", segmentWasEdited);
56396 var nopeData = data.nopes.filter(getPath);
56397 var nopes = selection2.selectAll(".area.target-nope").filter(function(d4) {
56398 return filter2(d4.properties.entity);
56399 }).data(nopeData, function key(d4) {
56402 nopes.exit().remove();
56403 nopes.enter().append("path").merge(nopes).attr("d", getPath).attr("class", function(d4) {
56404 return "way area target target-nope " + nopeClass + d4.id;
56405 }).classed("segment-edited", segmentWasEdited);
56407 function drawAreas(selection2, graph, entities, filter2) {
56408 var path = svgPath(projection2, graph, true);
56410 var base = context.history().base();
56411 for (var i3 = 0; i3 < entities.length; i3++) {
56412 var entity = entities[i3];
56413 if (entity.geometry(graph) !== "area") continue;
56414 if (!areas[entity.id]) {
56415 areas[entity.id] = {
56417 area: Math.abs(entity.area(graph))
56421 var fills = Object.values(areas).filter(function hasPath(a2) {
56422 return path(a2.entity);
56424 fills.sort(function areaSort(a2, b3) {
56425 return b3.area - a2.area;
56427 fills = fills.map(function(a2) {
56430 var strokes = fills.filter(function(area) {
56431 return area.type === "way";
56439 var clipPaths = context.surface().selectAll("defs").selectAll(".clipPath-osm").filter(filter2).data(data.clip, osmEntity.key);
56440 clipPaths.exit().remove();
56441 var clipPathsEnter = clipPaths.enter().append("clipPath").attr("class", "clipPath-osm").attr("id", function(entity2) {
56442 return "ideditor-" + entity2.id + "-clippath";
56444 clipPathsEnter.append("path");
56445 clipPaths.merge(clipPathsEnter).selectAll("path").attr("d", path);
56446 var drawLayer = selection2.selectAll(".layer-osm.areas");
56447 var touchLayer = selection2.selectAll(".layer-touch.areas");
56448 var areagroup = drawLayer.selectAll("g.areagroup").data(["fill", "shadow", "stroke"]);
56449 areagroup = areagroup.enter().append("g").attr("class", function(d4) {
56450 return "areagroup area-" + d4;
56451 }).merge(areagroup);
56452 var paths = areagroup.selectAll("path").filter(filter2).data(function(layer) {
56453 return data[layer];
56455 paths.exit().remove();
56456 var fillpaths = selection2.selectAll(".area-fill path.area").nodes();
56457 var bisect = bisector(function(node) {
56458 return -node.__data__.area(graph);
56460 function sortedByArea(entity2) {
56461 if (this._parent.__data__ === "fill") {
56462 return fillpaths[bisect(fillpaths, -entity2.area(graph))];
56465 paths = paths.enter().insert("path", sortedByArea).merge(paths).each(function(entity2) {
56466 var layer = this.parentNode.__data__;
56467 this.setAttribute("class", entity2.type + " area " + layer + " " + entity2.id);
56468 if (layer === "fill") {
56469 this.setAttribute("clip-path", "url(#ideditor-" + entity2.id + "-clippath)");
56470 this.style.fill = this.style.stroke = getPatternStyle(entity2.tags);
56472 }).classed("added", function(d4) {
56473 return !base.entities[d4.id];
56474 }).classed("geometry-edited", function(d4) {
56475 return graph.entities[d4.id] && base.entities[d4.id] && !(0, import_fast_deep_equal6.default)(graph.entities[d4.id].nodes, base.entities[d4.id].nodes);
56476 }).classed("retagged", function(d4) {
56477 return graph.entities[d4.id] && base.entities[d4.id] && !(0, import_fast_deep_equal6.default)(graph.entities[d4.id].tags, base.entities[d4.id].tags);
56478 }).call(svgTagClasses()).attr("d", path);
56479 touchLayer.call(drawTargets, graph, data.stroke, filter2);
56483 var import_fast_deep_equal6;
56484 var init_areas = __esm({
56485 "modules/svg/areas.js"() {
56487 import_fast_deep_equal6 = __toESM(require_fast_deep_equal(), 1);
56491 init_tag_classes();
56492 init_tag_pattern();
56496 // node_modules/@tmcw/togeojson/dist/togeojson.es.mjs
56497 function $2(element, tagName) {
56498 return Array.from(element.getElementsByTagName(tagName));
56500 function normalizeId(id2) {
56501 return id2[0] === "#" ? id2 : `#${id2}`;
56503 function $ns(element, tagName, ns) {
56504 return Array.from(element.getElementsByTagNameNS(ns, tagName));
56506 function nodeVal(node) {
56507 node == null ? void 0 : node.normalize();
56508 return (node == null ? void 0 : node.textContent) || "";
56510 function get1(node, tagName, callback) {
56511 const n3 = node.getElementsByTagName(tagName);
56512 const result = n3.length ? n3[0] : null;
56513 if (result && callback)
56517 function get3(node, tagName, callback) {
56518 const properties = {};
56521 const n3 = node.getElementsByTagName(tagName);
56522 const result = n3.length ? n3[0] : null;
56523 if (result && callback) {
56524 return callback(result, properties);
56528 function val1(node, tagName, callback) {
56529 const val = nodeVal(get1(node, tagName));
56530 if (val && callback)
56531 return callback(val) || {};
56534 function $num(node, tagName, callback) {
56535 const val = Number.parseFloat(nodeVal(get1(node, tagName)));
56536 if (Number.isNaN(val))
56538 if (val && callback)
56539 return callback(val) || {};
56542 function num1(node, tagName, callback) {
56543 const val = Number.parseFloat(nodeVal(get1(node, tagName)));
56544 if (Number.isNaN(val))
56550 function getMulti(node, propertyNames) {
56551 const properties = {};
56552 for (const property of propertyNames) {
56553 val1(node, property, (val) => {
56554 properties[property] = val;
56559 function isElement(node) {
56560 return (node == null ? void 0 : node.nodeType) === 1;
56562 function getExtensions(node) {
56566 for (const child of Array.from(node.childNodes)) {
56567 if (!isElement(child))
56569 const name = abbreviateName(child.nodeName);
56570 if (name === "gpxtpx:TrackPointExtension") {
56571 values = values.concat(getExtensions(child));
56573 const val = nodeVal(child);
56574 values.push([name, parseNumeric(val)]);
56579 function abbreviateName(name) {
56580 return ["heart", "gpxtpx:hr", "hr"].includes(name) ? "heart" : name;
56582 function parseNumeric(val) {
56583 const num = Number.parseFloat(val);
56584 return Number.isNaN(num) ? val : num;
56586 function coordPair$1(node) {
56588 Number.parseFloat(node.getAttribute("lon") || ""),
56589 Number.parseFloat(node.getAttribute("lat") || "")
56591 if (Number.isNaN(ll[0]) || Number.isNaN(ll[1])) {
56594 num1(node, "ele", (val) => {
56597 const time = get1(node, "time");
56600 time: time ? nodeVal(time) : null,
56601 extendedValues: getExtensions(get1(node, "extensions"))
56604 function getLineStyle(node) {
56605 return get3(node, "line", (lineStyle) => {
56606 const val = Object.assign({}, val1(lineStyle, "color", (color2) => {
56607 return { stroke: `#${color2}` };
56608 }), $num(lineStyle, "opacity", (opacity) => {
56609 return { "stroke-opacity": opacity };
56610 }), $num(lineStyle, "width", (width) => {
56611 return { "stroke-width": width * 96 / 25.4 };
56616 function extractProperties(ns, node) {
56618 const properties = getMulti(node, [
56626 for (const [n3, url] of ns) {
56627 for (const child of Array.from(node.getElementsByTagNameNS(url, "*"))) {
56628 properties[child.tagName.replace(":", "_")] = (_a4 = nodeVal(child)) == null ? void 0 : _a4.trim();
56631 const links = $2(node, "link");
56632 if (links.length) {
56633 properties.links = links.map((link2) => Object.assign({ href: link2.getAttribute("href") }, getMulti(link2, ["text", "type"])));
56637 function getPoints$1(node, pointname) {
56638 const pts = $2(node, pointname);
56641 const extendedValues = {};
56642 for (let i3 = 0; i3 < pts.length; i3++) {
56643 const c2 = coordPair$1(pts[i3]);
56647 line.push(c2.coordinates);
56649 times.push(c2.time);
56650 for (const [name, val] of c2.extendedValues) {
56651 const plural = name === "heart" ? name : `${name.replace("gpxtpx:", "")}s`;
56652 if (!extendedValues[plural]) {
56653 extendedValues[plural] = Array(pts.length).fill(null);
56655 extendedValues[plural][i3] = val;
56658 if (line.length < 2)
56666 function getRoute(ns, node) {
56667 const line = getPoints$1(node, "rtept");
56672 properties: Object.assign({ _gpxType: "rte" }, extractProperties(ns, node), getLineStyle(get1(node, "extensions"))),
56674 type: "LineString",
56675 coordinates: line.line
56679 function getTrack(ns, node) {
56681 const segments = $2(node, "trkseg");
56684 const extractedLines = [];
56685 for (const segment of segments) {
56686 const line = getPoints$1(segment, "trkpt");
56688 extractedLines.push(line);
56689 if ((_a4 = line.times) == null ? void 0 : _a4.length)
56690 times.push(line.times);
56693 if (extractedLines.length === 0)
56695 const multi = extractedLines.length > 1;
56696 const properties = Object.assign({ _gpxType: "trk" }, extractProperties(ns, node), getLineStyle(get1(node, "extensions")), times.length ? {
56697 coordinateProperties: {
56698 times: multi ? times : times[0]
56701 for (let i3 = 0; i3 < extractedLines.length; i3++) {
56702 const line = extractedLines[i3];
56703 track.push(line.line);
56704 if (!properties.coordinateProperties) {
56705 properties.coordinateProperties = {};
56707 const props = properties.coordinateProperties;
56708 for (const [name, val] of Object.entries(line.extendedValues)) {
56710 if (!props[name]) {
56711 props[name] = extractedLines.map((line2) => new Array(line2.line.length).fill(null));
56713 props[name][i3] = val;
56722 geometry: multi ? {
56723 type: "MultiLineString",
56726 type: "LineString",
56727 coordinates: track[0]
56731 function getPoint(ns, node) {
56732 const properties = Object.assign(extractProperties(ns, node), getMulti(node, ["sym"]));
56733 const pair3 = coordPair$1(node);
56741 coordinates: pair3.coordinates
56745 function* gpxGen(node) {
56748 const GPXX = "gpxx";
56749 const GPXX_URI = "http://www.garmin.com/xmlschemas/GpxExtensions/v3";
56750 const ns = [[GPXX, GPXX_URI]];
56751 const attrs = (_a4 = n3.getElementsByTagName("gpx")[0]) == null ? void 0 : _a4.attributes;
56753 for (const attr of Array.from(attrs)) {
56754 if (((_b2 = attr.name) == null ? void 0 : _b2.startsWith("xmlns:")) && attr.value !== GPXX_URI) {
56755 ns.push([attr.name, attr.value]);
56759 for (const track of $2(n3, "trk")) {
56760 const feature3 = getTrack(ns, track);
56764 for (const route of $2(n3, "rte")) {
56765 const feature3 = getRoute(ns, route);
56769 for (const waypoint of $2(n3, "wpt")) {
56770 const point = getPoint(ns, waypoint);
56775 function gpx(node) {
56777 type: "FeatureCollection",
56778 features: Array.from(gpxGen(node))
56781 function fixColor(v3, prefix) {
56782 const properties = {};
56783 const colorProp = prefix === "stroke" || prefix === "fill" ? prefix : `${prefix}-color`;
56784 if (v3[0] === "#") {
56785 v3 = v3.substring(1);
56787 if (v3.length === 6 || v3.length === 3) {
56788 properties[colorProp] = `#${v3}`;
56789 } else if (v3.length === 8) {
56790 properties[`${prefix}-opacity`] = Number.parseInt(v3.substring(0, 2), 16) / 255;
56791 properties[colorProp] = `#${v3.substring(6, 8)}${v3.substring(4, 6)}${v3.substring(2, 4)}`;
56795 function numericProperty(node, source, target) {
56796 const properties = {};
56797 num1(node, source, (val) => {
56798 properties[target] = val;
56802 function getColor(node, output) {
56803 return get3(node, "color", (elem) => fixColor(nodeVal(elem), output));
56805 function extractIconHref(node) {
56806 return get3(node, "Icon", (icon2, properties) => {
56807 val1(icon2, "href", (href) => {
56808 properties.icon = href;
56813 function extractIcon(node) {
56814 return get3(node, "IconStyle", (iconStyle) => {
56815 return Object.assign(getColor(iconStyle, "icon"), numericProperty(iconStyle, "scale", "icon-scale"), numericProperty(iconStyle, "heading", "icon-heading"), get3(iconStyle, "hotSpot", (hotspot) => {
56816 const left = Number.parseFloat(hotspot.getAttribute("x") || "");
56817 const top = Number.parseFloat(hotspot.getAttribute("y") || "");
56818 const xunits = hotspot.getAttribute("xunits") || "";
56819 const yunits = hotspot.getAttribute("yunits") || "";
56820 if (!Number.isNaN(left) && !Number.isNaN(top))
56822 "icon-offset": [left, top],
56823 "icon-offset-units": [xunits, yunits]
56826 }), extractIconHref(iconStyle));
56829 function extractLabel(node) {
56830 return get3(node, "LabelStyle", (labelStyle) => {
56831 return Object.assign(getColor(labelStyle, "label"), numericProperty(labelStyle, "scale", "label-scale"));
56834 function extractLine(node) {
56835 return get3(node, "LineStyle", (lineStyle) => {
56836 return Object.assign(getColor(lineStyle, "stroke"), numericProperty(lineStyle, "width", "stroke-width"));
56839 function extractPoly(node) {
56840 return get3(node, "PolyStyle", (polyStyle, properties) => {
56841 return Object.assign(properties, get3(polyStyle, "color", (elem) => fixColor(nodeVal(elem), "fill")), val1(polyStyle, "fill", (fill) => {
56843 return { "fill-opacity": 0 };
56844 }), val1(polyStyle, "outline", (outline) => {
56845 if (outline === "0")
56846 return { "stroke-opacity": 0 };
56850 function extractStyle(node) {
56851 return Object.assign({}, extractPoly(node), extractLine(node), extractLabel(node), extractIcon(node));
56853 function coord1(value) {
56854 return value.replace(removeSpace, "").split(",").map(Number.parseFloat).filter((num) => !Number.isNaN(num)).slice(0, 3);
56856 function coord(value) {
56857 return value.replace(trimSpace, "").split(splitSpace).map(coord1).filter((coord2) => {
56858 return coord2.length >= 2;
56861 function gxCoords(node) {
56862 let elems = $2(node, "coord");
56863 if (elems.length === 0) {
56864 elems = $ns(node, "coord", "*");
56866 const coordinates = elems.map((elem) => {
56867 return nodeVal(elem).split(" ").map(Number.parseFloat);
56869 if (coordinates.length === 0) {
56873 geometry: coordinates.length > 2 ? {
56874 type: "LineString",
56878 coordinates: coordinates[0]
56880 times: $2(node, "when").map((elem) => nodeVal(elem))
56883 function fixRing(ring) {
56884 if (ring.length === 0)
56886 const first = ring[0];
56887 const last2 = ring[ring.length - 1];
56889 for (let i3 = 0; i3 < Math.max(first.length, last2.length); i3++) {
56890 if (first[i3] !== last2[i3]) {
56896 return ring.concat([ring[0]]);
56900 function getCoordinates(node) {
56901 return nodeVal(get1(node, "coordinates"));
56903 function getGeometry(node) {
56904 let geometries = [];
56905 let coordTimes = [];
56906 for (let i3 = 0; i3 < node.childNodes.length; i3++) {
56907 const child = node.childNodes.item(i3);
56908 if (isElement(child)) {
56909 switch (child.tagName) {
56910 case "MultiGeometry":
56912 case "gx:MultiTrack": {
56913 const childGeometries = getGeometry(child);
56914 geometries = geometries.concat(childGeometries.geometries);
56915 coordTimes = coordTimes.concat(childGeometries.coordTimes);
56919 const coordinates = coord1(getCoordinates(child));
56920 if (coordinates.length >= 2) {
56929 case "LineString": {
56930 const coordinates = coord(getCoordinates(child));
56931 if (coordinates.length >= 2) {
56933 type: "LineString",
56941 for (const linearRing of $2(child, "LinearRing")) {
56942 const ring = fixRing(coord(getCoordinates(linearRing)));
56943 if (ring.length >= 4) {
56947 if (coords.length) {
56950 coordinates: coords
56957 const gx = gxCoords(child);
56960 const { times, geometry } = gx;
56961 geometries.push(geometry);
56963 coordTimes.push(times);
56974 function extractExtendedData(node, schema) {
56975 return get3(node, "ExtendedData", (extendedData, properties) => {
56976 for (const data of $2(extendedData, "Data")) {
56977 properties[data.getAttribute("name") || ""] = nodeVal(get1(data, "value"));
56979 for (const simpleData of $2(extendedData, "SimpleData")) {
56980 const name = simpleData.getAttribute("name") || "";
56981 const typeConverter = schema[name] || typeConverters.string;
56982 properties[name] = typeConverter(nodeVal(simpleData));
56987 function getMaybeHTMLDescription(node) {
56988 const descriptionNode = get1(node, "description");
56989 for (const c2 of Array.from((descriptionNode == null ? void 0 : descriptionNode.childNodes) || [])) {
56990 if (c2.nodeType === 4) {
57001 function extractTimeSpan(node) {
57002 return get3(node, "TimeSpan", (timeSpan) => {
57005 begin: nodeVal(get1(timeSpan, "begin")),
57006 end: nodeVal(get1(timeSpan, "end"))
57011 function extractTimeStamp(node) {
57012 return get3(node, "TimeStamp", (timeStamp) => {
57013 return { timestamp: nodeVal(get1(timeStamp, "when")) };
57016 function extractCascadedStyle(node, styleMap) {
57017 return val1(node, "styleUrl", (styleUrl) => {
57018 styleUrl = normalizeId(styleUrl);
57019 if (styleMap[styleUrl]) {
57020 return Object.assign({ styleUrl }, styleMap[styleUrl]);
57022 return { styleUrl };
57025 function processAltitudeMode(mode) {
57026 switch (mode == null ? void 0 : mode.textContent) {
57027 case AltitudeMode.ABSOLUTE:
57028 return AltitudeMode.ABSOLUTE;
57029 case AltitudeMode.CLAMP_TO_GROUND:
57030 return AltitudeMode.CLAMP_TO_GROUND;
57031 case AltitudeMode.CLAMP_TO_SEAFLOOR:
57032 return AltitudeMode.CLAMP_TO_SEAFLOOR;
57033 case AltitudeMode.RELATIVE_TO_GROUND:
57034 return AltitudeMode.RELATIVE_TO_GROUND;
57035 case AltitudeMode.RELATIVE_TO_SEAFLOOR:
57036 return AltitudeMode.RELATIVE_TO_SEAFLOOR;
57040 function getGroundOverlayBox(node) {
57041 const latLonQuad = get1(node, "gx:LatLonQuad");
57043 const ring = fixRing(coord(getCoordinates(node)));
57047 coordinates: [ring]
57051 return getLatLonBox(node);
57053 function rotateBox(bbox2, coordinates, rotation) {
57054 const center = [(bbox2[0] + bbox2[2]) / 2, (bbox2[1] + bbox2[3]) / 2];
57056 coordinates[0].map((coordinate) => {
57057 const dy = coordinate[1] - center[1];
57058 const dx = coordinate[0] - center[0];
57059 const distance = Math.sqrt(dy ** 2 + dx ** 2);
57060 const angle2 = Math.atan2(dy, dx) + rotation * DEGREES_TO_RADIANS;
57062 center[0] + Math.cos(angle2) * distance,
57063 center[1] + Math.sin(angle2) * distance
57068 function getLatLonBox(node) {
57069 const latLonBox = get1(node, "LatLonBox");
57071 const north = num1(latLonBox, "north");
57072 const west = num1(latLonBox, "west");
57073 const east = num1(latLonBox, "east");
57074 const south = num1(latLonBox, "south");
57075 const rotation = num1(latLonBox, "rotation");
57076 if (typeof north === "number" && typeof south === "number" && typeof west === "number" && typeof east === "number") {
57077 const bbox2 = [west, south, east, north];
57078 let coordinates = [
57089 // top left (again)
57092 if (typeof rotation === "number") {
57093 coordinates = rotateBox(bbox2, coordinates, rotation);
57106 function getGroundOverlay(node, styleMap, schema, options) {
57108 const box = getGroundOverlayBox(node);
57109 const geometry = (box == null ? void 0 : box.geometry) || null;
57110 if (!geometry && options.skipNullGeometry) {
57116 properties: Object.assign(
57119 * https://gist.github.com/tmcw/037a1cb6660d74a392e9da7446540f46
57121 { "@geometry-type": "groundoverlay" },
57130 getMaybeHTMLDescription(node),
57131 extractCascadedStyle(node, styleMap),
57132 extractStyle(node),
57133 extractIconHref(node),
57134 extractExtendedData(node, schema),
57135 extractTimeSpan(node),
57136 extractTimeStamp(node)
57139 if (box == null ? void 0 : box.bbox) {
57140 feature3.bbox = box.bbox;
57142 if (((_a4 = feature3.properties) == null ? void 0 : _a4.visibility) !== void 0) {
57143 feature3.properties.visibility = feature3.properties.visibility !== "0";
57145 const id2 = node.getAttribute("id");
57146 if (id2 !== null && id2 !== "")
57150 function getNetworkLinkRegion(node) {
57151 const region = get1(node, "Region");
57154 coordinateBox: getLatLonAltBox(region),
57160 function getLod(node) {
57161 var _a4, _b2, _c, _d;
57162 const lod = get1(node, "Lod");
57165 (_a4 = num1(lod, "minLodPixels")) != null ? _a4 : -1,
57166 (_b2 = num1(lod, "maxLodPixels")) != null ? _b2 : -1,
57167 (_c = num1(lod, "minFadeExtent")) != null ? _c : null,
57168 (_d = num1(lod, "maxFadeExtent")) != null ? _d : null
57173 function getLatLonAltBox(node) {
57174 const latLonAltBox = get1(node, "LatLonAltBox");
57175 if (latLonAltBox) {
57176 const north = num1(latLonAltBox, "north");
57177 const west = num1(latLonAltBox, "west");
57178 const east = num1(latLonAltBox, "east");
57179 const south = num1(latLonAltBox, "south");
57180 const altitudeMode = processAltitudeMode(get1(latLonAltBox, "altitudeMode") || get1(latLonAltBox, "gx:altitudeMode"));
57181 if (altitudeMode) {
57182 console.debug("Encountered an unsupported feature of KML for togeojson: please contact developers for support of altitude mode.");
57184 if (typeof north === "number" && typeof south === "number" && typeof west === "number" && typeof east === "number") {
57185 const bbox2 = [west, south, east, north];
57186 const coordinates = [
57197 // top left (again)
57211 function getLinkObject(node) {
57212 const linkObj = get1(node, "Link");
57214 return getMulti(linkObj, [
57227 function getNetworkLink(node, styleMap, schema, options) {
57229 const box = getNetworkLinkRegion(node);
57230 const geometry = ((_a4 = box == null ? void 0 : box.coordinateBox) == null ? void 0 : _a4.geometry) || null;
57231 if (!geometry && options.skipNullGeometry) {
57237 properties: Object.assign(
57240 * https://gist.github.com/tmcw/037a1cb6660d74a392e9da7446540f46
57242 { "@geometry-type": "networklink" },
57250 "refreshVisibility",
57254 getMaybeHTMLDescription(node),
57255 extractCascadedStyle(node, styleMap),
57256 extractStyle(node),
57257 extractIconHref(node),
57258 extractExtendedData(node, schema),
57259 extractTimeSpan(node),
57260 extractTimeStamp(node),
57261 getLinkObject(node),
57262 (box == null ? void 0 : box.lod) ? { lod: box.lod } : {}
57265 if ((_b2 = box == null ? void 0 : box.coordinateBox) == null ? void 0 : _b2.bbox) {
57266 feature3.bbox = box.coordinateBox.bbox;
57268 if (((_c = feature3.properties) == null ? void 0 : _c.visibility) !== void 0) {
57269 feature3.properties.visibility = feature3.properties.visibility !== "0";
57271 const id2 = node.getAttribute("id");
57272 if (id2 !== null && id2 !== "")
57276 function geometryListToGeometry(geometries) {
57277 return geometries.length === 0 ? null : geometries.length === 1 ? geometries[0] : {
57278 type: "GeometryCollection",
57282 function getPlacemark(node, styleMap, schema, options) {
57284 const { coordTimes, geometries } = getGeometry(node);
57285 const geometry = geometryListToGeometry(geometries);
57286 if (!geometry && options.skipNullGeometry) {
57292 properties: Object.assign(getMulti(node, [
57299 ]), getMaybeHTMLDescription(node), extractCascadedStyle(node, styleMap), extractStyle(node), extractExtendedData(node, schema), extractTimeSpan(node), extractTimeStamp(node), coordTimes.length ? {
57300 coordinateProperties: {
57301 times: coordTimes.length === 1 ? coordTimes[0] : coordTimes
57305 if (((_a4 = feature3.properties) == null ? void 0 : _a4.visibility) !== void 0) {
57306 feature3.properties.visibility = feature3.properties.visibility !== "0";
57308 const id2 = node.getAttribute("id");
57309 if (id2 !== null && id2 !== "")
57313 function getStyleId(style) {
57314 let id2 = style.getAttribute("id");
57315 const parentNode = style.parentNode;
57316 if (!id2 && isElement(parentNode) && parentNode.localName === "CascadingStyle") {
57317 id2 = parentNode.getAttribute("kml:id") || parentNode.getAttribute("id");
57319 return normalizeId(id2 || "");
57321 function buildStyleMap(node) {
57322 const styleMap = {};
57323 for (const style of $2(node, "Style")) {
57324 styleMap[getStyleId(style)] = extractStyle(style);
57326 for (const map2 of $2(node, "StyleMap")) {
57327 const id2 = normalizeId(map2.getAttribute("id") || "");
57328 val1(map2, "styleUrl", (styleUrl) => {
57329 styleUrl = normalizeId(styleUrl);
57330 if (styleMap[styleUrl]) {
57331 styleMap[id2] = styleMap[styleUrl];
57337 function buildSchema(node) {
57339 for (const field of $2(node, "SimpleField")) {
57340 schema[field.getAttribute("name") || ""] = typeConverters[field.getAttribute("type") || ""] || typeConverters.string;
57344 function* kmlGen(node, options = {
57345 skipNullGeometry: false
57348 const styleMap = buildStyleMap(n3);
57349 const schema = buildSchema(n3);
57350 for (const placemark of $2(n3, "Placemark")) {
57351 const feature3 = getPlacemark(placemark, styleMap, schema, options);
57355 for (const groundOverlay of $2(n3, "GroundOverlay")) {
57356 const feature3 = getGroundOverlay(groundOverlay, styleMap, schema, options);
57360 for (const networkLink of $2(n3, "NetworkLink")) {
57361 const feature3 = getNetworkLink(networkLink, styleMap, schema, options);
57366 function kml(node, options = {
57367 skipNullGeometry: false
57370 type: "FeatureCollection",
57371 features: Array.from(kmlGen(node, options))
57374 var removeSpace, trimSpace, splitSpace, toNumber2, typeConverters, AltitudeMode, DEGREES_TO_RADIANS;
57375 var init_togeojson_es = __esm({
57376 "node_modules/@tmcw/togeojson/dist/togeojson.es.mjs"() {
57377 removeSpace = /\s*/g;
57378 trimSpace = /^\s*|\s*$/g;
57379 splitSpace = /\s+/;
57380 toNumber2 = (x2) => Number(x2);
57382 string: (x2) => x2,
57389 bool: (x2) => Boolean(x2)
57391 (function(AltitudeMode2) {
57392 AltitudeMode2["ABSOLUTE"] = "absolute";
57393 AltitudeMode2["RELATIVE_TO_GROUND"] = "relativeToGround";
57394 AltitudeMode2["CLAMP_TO_GROUND"] = "clampToGround";
57395 AltitudeMode2["CLAMP_TO_SEAFLOOR"] = "clampToSeaFloor";
57396 AltitudeMode2["RELATIVE_TO_SEAFLOOR"] = "relativeToSeaFloor";
57397 })(AltitudeMode || (AltitudeMode = {}));
57398 DEGREES_TO_RADIANS = Math.PI / 180;
57402 // modules/svg/data.js
57403 var data_exports = {};
57404 __export(data_exports, {
57405 svgData: () => svgData
57407 function svgData(projection2, context, dispatch14) {
57408 var throttledRedraw = throttle_default(function() {
57409 dispatch14.call("change");
57411 var _showLabels = true;
57412 var detected = utilDetect();
57413 var layer = select_default2(null);
57418 const supportedFormats = [
57425 if (_initialized) return;
57428 function over(d3_event) {
57429 d3_event.stopPropagation();
57430 d3_event.preventDefault();
57431 d3_event.dataTransfer.dropEffect = "copy";
57433 context.container().attr("dropzone", "copy").on("drop.svgData", function(d3_event) {
57434 d3_event.stopPropagation();
57435 d3_event.preventDefault();
57436 if (!detected.filedrop) return;
57437 var f2 = d3_event.dataTransfer.files[0];
57438 var extension = getExtension(f2.name);
57439 if (!supportedFormats.includes(extension)) return;
57440 drawData.fileList(d3_event.dataTransfer.files);
57441 }).on("dragenter.svgData", over).on("dragexit.svgData", over).on("dragover.svgData", over);
57442 _initialized = true;
57444 function getService() {
57445 if (services.vectorTile && !_vtService) {
57446 _vtService = services.vectorTile;
57447 _vtService.event.on("loadedData", throttledRedraw);
57448 } else if (!services.vectorTile && _vtService) {
57453 function showLayer() {
57455 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
57456 dispatch14.call("change");
57459 function hideLayer() {
57460 throttledRedraw.cancel();
57461 layer.transition().duration(250).style("opacity", 0).on("end", layerOff);
57463 function layerOn() {
57464 layer.style("display", "block");
57466 function layerOff() {
57467 layer.selectAll(".viewfield-group").remove();
57468 layer.style("display", "none");
57470 function ensureIDs(gj) {
57471 if (!gj) return null;
57472 if (gj.type === "FeatureCollection") {
57473 for (var i3 = 0; i3 < gj.features.length; i3++) {
57474 ensureFeatureID(gj.features[i3]);
57477 ensureFeatureID(gj);
57481 function ensureFeatureID(feature3) {
57482 if (!feature3) return;
57483 feature3.__featurehash__ = utilHashcode((0, import_fast_json_stable_stringify2.default)(feature3));
57486 function getFeatures(gj) {
57487 if (!gj) return [];
57488 if (gj.type === "FeatureCollection") {
57489 return gj.features;
57494 function featureKey(d4) {
57495 return d4.__featurehash__;
57497 function isPolygon(d4) {
57498 return d4.geometry.type === "Polygon" || d4.geometry.type === "MultiPolygon";
57500 function clipPathID(d4) {
57501 return "ideditor-data-" + d4.__featurehash__ + "-clippath";
57503 function featureClasses(d4) {
57505 "data" + d4.__featurehash__,
57507 isPolygon(d4) ? "area" : "",
57508 d4.__layerID__ || ""
57509 ].filter(Boolean).join(" ");
57511 function drawData(selection2) {
57512 var vtService = getService();
57513 var getPath = svgPath(projection2).geojson;
57514 var getAreaPath = svgPath(projection2, null, true).geojson;
57515 var hasData = drawData.hasData();
57516 layer = selection2.selectAll(".layer-mapdata").data(_enabled && hasData ? [0] : []);
57517 layer.exit().remove();
57518 layer = layer.enter().append("g").attr("class", "layer-mapdata").merge(layer);
57519 var surface = context.surface();
57520 if (!surface || surface.empty()) return;
57521 var geoData, polygonData;
57522 if (_template && vtService) {
57523 var sourceID = _template;
57524 vtService.loadTiles(sourceID, _template, projection2);
57525 geoData = vtService.data(sourceID, projection2);
57527 geoData = getFeatures(_geojson);
57529 geoData = geoData.filter(getPath);
57530 polygonData = geoData.filter(isPolygon);
57531 var clipPaths = surface.selectAll("defs").selectAll(".clipPath-data").data(polygonData, featureKey);
57532 clipPaths.exit().remove();
57533 var clipPathsEnter = clipPaths.enter().append("clipPath").attr("class", "clipPath-data").attr("id", clipPathID);
57534 clipPathsEnter.append("path");
57535 clipPaths.merge(clipPathsEnter).selectAll("path").attr("d", getAreaPath);
57536 var datagroups = layer.selectAll("g.datagroup").data(["fill", "shadow", "stroke"]);
57537 datagroups = datagroups.enter().append("g").attr("class", function(d4) {
57538 return "datagroup datagroup-" + d4;
57539 }).merge(datagroups);
57545 var paths = datagroups.selectAll("path").data(function(layer2) {
57546 return pathData[layer2];
57548 paths.exit().remove();
57549 paths = paths.enter().append("path").attr("class", function(d4) {
57550 var datagroup = this.parentNode.__data__;
57551 return "pathdata " + datagroup + " " + featureClasses(d4);
57552 }).attr("clip-path", function(d4) {
57553 var datagroup = this.parentNode.__data__;
57554 return datagroup === "fill" ? "url(#" + clipPathID(d4) + ")" : null;
57555 }).merge(paths).attr("d", function(d4) {
57556 var datagroup = this.parentNode.__data__;
57557 return datagroup === "fill" ? getAreaPath(d4) : getPath(d4);
57559 layer.call(drawLabels, "label-halo", geoData).call(drawLabels, "label", geoData);
57560 function drawLabels(selection3, textClass, data) {
57561 var labelPath = path_default(projection2);
57562 var labelData = data.filter(function(d4) {
57563 return _showLabels && d4.properties && (d4.properties.desc || d4.properties.name);
57565 var labels = selection3.selectAll("text." + textClass).data(labelData, featureKey);
57566 labels.exit().remove();
57567 labels = labels.enter().append("text").attr("class", function(d4) {
57568 return textClass + " " + featureClasses(d4);
57569 }).merge(labels).text(function(d4) {
57570 return d4.properties.desc || d4.properties.name;
57571 }).attr("x", function(d4) {
57572 var centroid = labelPath.centroid(d4);
57573 return centroid[0] + 11;
57574 }).attr("y", function(d4) {
57575 var centroid = labelPath.centroid(d4);
57576 return centroid[1];
57580 function getExtension(fileName) {
57581 if (!fileName) return;
57582 var re4 = /\.(gpx|kml|(geo)?json|png)$/i;
57583 var match = fileName.toLowerCase().match(re4);
57584 return match && match.length && match[0];
57586 function xmlToDom(textdata) {
57587 return new DOMParser().parseFromString(textdata, "text/xml");
57589 function stringifyGeojsonProperties(feature3) {
57590 const properties = feature3.properties;
57591 for (const key in properties) {
57592 const property = properties[key];
57593 if (typeof property === "number" || typeof property === "boolean" || Array.isArray(property)) {
57594 properties[key] = property.toString();
57595 } else if (property === null) {
57596 properties[key] = "null";
57597 } else if (typeof property === "object") {
57598 properties[key] = JSON.stringify(property);
57602 drawData.setFile = function(extension, data) {
57608 switch (extension) {
57610 gj = gpx(xmlToDom(data));
57613 gj = kml(xmlToDom(data));
57617 gj = JSON.parse(data);
57618 if (gj.type === "FeatureCollection") {
57619 gj.features.forEach(stringifyGeojsonProperties);
57620 } else if (gj.type === "Feature") {
57621 stringifyGeojsonProperties(gj);
57626 if (Object.keys(gj).length) {
57627 _geojson = ensureIDs(gj);
57628 _src = extension + " data file";
57631 dispatch14.call("change");
57634 drawData.showLabels = function(val) {
57635 if (!arguments.length) return _showLabels;
57639 drawData.enabled = function(val) {
57640 if (!arguments.length) return _enabled;
57647 dispatch14.call("change");
57650 drawData.hasData = function() {
57651 var gj = _geojson || {};
57652 return !!(_template || Object.keys(gj).length);
57654 drawData.template = function(val, src) {
57655 if (!arguments.length) return _template;
57656 var osm = context.connection();
57658 var blocklists = osm.imageryBlocklists();
57662 for (var i3 = 0; i3 < blocklists.length; i3++) {
57663 regex = blocklists[i3];
57664 fail = regex.test(val);
57669 regex = /.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/;
57670 fail = regex.test(val);
57676 _src = src || "vectortile:" + val.split(/[?#]/)[0];
57677 dispatch14.call("change");
57680 drawData.geojson = function(gj, src) {
57681 if (!arguments.length) return _geojson;
57687 if (Object.keys(gj).length) {
57688 _geojson = ensureIDs(gj);
57689 _src = src || "unknown.geojson";
57691 dispatch14.call("change");
57694 drawData.fileList = function(fileList) {
57695 if (!arguments.length) return _fileList;
57699 _fileList = fileList;
57700 if (!fileList || !fileList.length) return this;
57701 var f2 = fileList[0];
57702 var extension = getExtension(f2.name);
57703 var reader = new FileReader();
57704 reader.onload = /* @__PURE__ */ (function() {
57705 return function(e3) {
57706 drawData.setFile(extension, e3.target.result);
57709 reader.readAsText(f2);
57712 drawData.url = function(url, defaultExtension) {
57717 var testUrl = url.split(/[?#]/)[0];
57718 var extension = getExtension(testUrl) || defaultExtension;
57721 text_default3(url).then(function(data) {
57722 drawData.setFile(extension, data);
57723 }).catch(function() {
57726 drawData.template(url);
57730 drawData.getSrc = function() {
57733 drawData.fitZoom = function() {
57734 var features = getFeatures(_geojson);
57735 if (!features.length) return;
57736 var map2 = context.map();
57737 var viewport = map2.trimmedExtent().polygon();
57738 var coords = features.reduce(function(coords2, feature3) {
57739 var geom = feature3.geometry;
57740 if (!geom) return coords2;
57741 var c2 = geom.coordinates;
57742 switch (geom.type) {
57748 case "MultiPolygon":
57749 c2 = utilArrayFlatten(c2);
57751 case "MultiLineString":
57752 c2 = utilArrayFlatten(c2);
57755 return utilArrayUnion(coords2, c2);
57757 if (!geoPolygonIntersectsPolygon(viewport, coords, true)) {
57758 var extent = geoExtent(bounds_default({ type: "LineString", coordinates: coords }));
57759 map2.centerZoom(extent.center(), map2.trimmedExtentZoom(extent));
57766 var import_fast_json_stable_stringify2, _initialized, _enabled, _geojson;
57767 var init_data2 = __esm({
57768 "modules/svg/data.js"() {
57774 import_fast_json_stable_stringify2 = __toESM(require_fast_json_stable_stringify(), 1);
57775 init_togeojson_es();
57781 _initialized = false;
57786 // modules/svg/debug.js
57787 var debug_exports = {};
57788 __export(debug_exports, {
57789 svgDebug: () => svgDebug
57791 function svgDebug(projection2, context) {
57792 function drawDebug(selection2) {
57793 const showTile = context.getDebug("tile");
57794 const showCollision = context.getDebug("collision");
57795 const showImagery = context.getDebug("imagery");
57796 const showTouchTargets = context.getDebug("target");
57797 const showDownloaded = context.getDebug("downloaded");
57798 let debugData = [];
57800 debugData.push({ class: "red", label: "tile" });
57802 if (showCollision) {
57803 debugData.push({ class: "yellow", label: "collision" });
57806 debugData.push({ class: "orange", label: "imagery" });
57808 if (showTouchTargets) {
57809 debugData.push({ class: "pink", label: "touchTargets" });
57811 if (showDownloaded) {
57812 debugData.push({ class: "purple", label: "downloaded" });
57814 let legend = context.container().select(".main-content").selectAll(".debug-legend").data(debugData.length ? [0] : []);
57815 legend.exit().remove();
57816 legend = legend.enter().append("div").attr("class", "fillD debug-legend").merge(legend);
57817 let legendItems = legend.selectAll(".debug-legend-item").data(debugData, (d4) => d4.label);
57818 legendItems.exit().remove();
57819 legendItems.enter().append("span").attr("class", (d4) => `debug-legend-item ${d4.class}`).text((d4) => d4.label);
57820 let layer = selection2.selectAll(".layer-debug").data(showImagery || showDownloaded ? [0] : []);
57821 layer.exit().remove();
57822 layer = layer.enter().append("g").attr("class", "layer-debug").merge(layer);
57823 const extent = context.map().extent();
57824 _mainFileFetcher.get("imagery").then((d4) => {
57825 const hits = showImagery && d4.query.bbox(extent.rectangle(), true) || [];
57826 const features = hits.map((d5) => d5.features[d5.id]);
57827 let imagery = layer.selectAll("path.debug-imagery").data(features);
57828 imagery.exit().remove();
57829 imagery.enter().append("path").attr("class", "debug-imagery debug orange");
57832 const osm = context.connection();
57833 let dataDownloaded = [];
57834 if (osm && showDownloaded) {
57835 const rtree = osm.caches("get").tile.rtree;
57836 dataDownloaded = rtree.all().map((bbox2) => {
57839 properties: { id: bbox2.id },
57843 [bbox2.minX, bbox2.minY],
57844 [bbox2.minX, bbox2.maxY],
57845 [bbox2.maxX, bbox2.maxY],
57846 [bbox2.maxX, bbox2.minY],
57847 [bbox2.minX, bbox2.minY]
57853 let downloaded = layer.selectAll("path.debug-downloaded").data(showDownloaded ? dataDownloaded : []);
57854 downloaded.exit().remove();
57855 downloaded.enter().append("path").attr("class", "debug-downloaded debug purple");
57856 layer.selectAll("path").attr("d", svgPath(projection2).geojson);
57858 drawDebug.enabled = function() {
57859 if (!arguments.length) {
57860 return context.getDebug("tile") || context.getDebug("collision") || context.getDebug("imagery") || context.getDebug("target") || context.getDebug("downloaded");
57867 var init_debug = __esm({
57868 "modules/svg/debug.js"() {
57870 init_file_fetcher();
57875 // modules/svg/defs.js
57876 var defs_exports = {};
57877 __export(defs_exports, {
57878 svgDefs: () => svgDefs
57880 function svgDefs(context) {
57881 var _defsSelection = select_default2(null);
57882 var _spritesheetIds = [
57890 function drawDefs(selection2) {
57891 _defsSelection = selection2.append("defs");
57892 function addOnewayMarker(name, colour) {
57893 _defsSelection.append("marker").attr("id", `ideditor-oneway-marker-${name}`).attr("viewBox", "0 0 10 5").attr("refX", 4).attr("refY", 2.5).attr("markerWidth", 2).attr("markerHeight", 2).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("class", "oneway-marker-path").attr("d", "M 6,3 L 0,3 L 0,2 L 6,2 L 5,0 L 10,2.5 L 5,5 z").attr("stroke", "none").attr("fill", colour).attr("opacity", "1");
57895 addOnewayMarker("black", "#333");
57896 addOnewayMarker("white", "#fff");
57897 addOnewayMarker("gray", "#eee");
57898 function addSidedMarker(name, color2, offset) {
57899 _defsSelection.append("marker").attr("id", "ideditor-sided-marker-" + name).attr("viewBox", "0 0 2 2").attr("refX", 1).attr("refY", -offset).attr("markerWidth", 1.5).attr("markerHeight", 1.5).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("class", "sided-marker-path sided-marker-" + name + "-path").attr("d", "M 0,0 L 1,1 L 2,0 z").attr("stroke", "none").attr("fill", color2);
57901 addSidedMarker("natural", "rgb(170, 170, 170)", 0);
57902 addSidedMarker("coastline", "#77dede", 1);
57903 addSidedMarker("waterway", "#77dede", 1);
57904 addSidedMarker("barrier", "#ddd", 1);
57905 addSidedMarker("man_made", "#fff", 0);
57906 _defsSelection.append("marker").attr("id", "ideditor-viewfield-marker").attr("viewBox", "0 0 16 16").attr("refX", 8).attr("refY", 16).attr("markerWidth", 4).attr("markerHeight", 4).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("class", "viewfield-marker-path").attr("d", "M 6,14 C 8,13.4 8,13.4 10,14 L 16,3 C 12,0 4,0 0,3 z").attr("fill", "#333").attr("fill-opacity", "0.75").attr("stroke", "#fff").attr("stroke-width", "0.5px").attr("stroke-opacity", "0.75");
57907 _defsSelection.append("marker").attr("id", "ideditor-viewfield-marker-wireframe").attr("viewBox", "0 0 16 16").attr("refX", 8).attr("refY", 16).attr("markerWidth", 4).attr("markerHeight", 4).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("class", "viewfield-marker-path").attr("d", "M 6,14 C 8,13.4 8,13.4 10,14 L 16,3 C 12,0 4,0 0,3 z").attr("fill", "none").attr("stroke", "#fff").attr("stroke-width", "0.5px").attr("stroke-opacity", "0.75");
57908 var patterns2 = _defsSelection.selectAll("pattern").data([
57909 // pattern name, pattern image name
57911 ["construction", "construction"],
57912 ["cemetery", "cemetery"],
57913 ["cemetery_christian", "cemetery_christian"],
57914 ["cemetery_buddhist", "cemetery_buddhist"],
57915 ["cemetery_muslim", "cemetery_muslim"],
57916 ["cemetery_jewish", "cemetery_jewish"],
57917 ["farmland", "farmland"],
57918 ["farmyard", "farmyard"],
57919 ["forest", "forest"],
57920 ["forest_broadleaved", "forest_broadleaved"],
57921 ["forest_needleleaved", "forest_needleleaved"],
57922 ["forest_leafless", "forest_leafless"],
57923 ["golf_green", "grass"],
57924 ["grass", "grass"],
57925 ["landfill", "landfill"],
57926 ["meadow", "grass"],
57927 ["orchard", "orchard"],
57929 ["quarry", "quarry"],
57930 ["scrub", "bushes"],
57931 ["vineyard", "vineyard"],
57932 ["water_standing", "lines"],
57933 ["waves", "waves"],
57934 ["wetland", "wetland"],
57935 ["wetland_marsh", "wetland_marsh"],
57936 ["wetland_swamp", "wetland_swamp"],
57937 ["wetland_bog", "wetland_bog"],
57938 ["wetland_reedbed", "wetland_reedbed"]
57939 ]).enter().append("pattern").attr("id", function(d4) {
57940 return "ideditor-pattern-" + d4[0];
57941 }).attr("width", 32).attr("height", 32).attr("patternUnits", "userSpaceOnUse");
57942 patterns2.append("rect").attr("x", 0).attr("y", 0).attr("width", 32).attr("height", 32).attr("class", function(d4) {
57943 return "pattern-color-" + d4[0];
57945 patterns2.append("image").attr("x", 0).attr("y", 0).attr("width", 32).attr("height", 32).attr("xlink:href", function(d4) {
57946 return context.imagePath("pattern/" + d4[1] + ".png");
57948 _defsSelection.selectAll("clipPath").data([12, 18, 20, 32, 45]).enter().append("clipPath").attr("id", function(d4) {
57949 return "ideditor-clip-square-" + d4;
57950 }).append("rect").attr("x", 0).attr("y", 0).attr("width", function(d4) {
57952 }).attr("height", function(d4) {
57955 const filters = _defsSelection.selectAll("filter").data(["alpha-slope5"]).enter().append("filter").attr("id", (d4) => d4);
57956 const alphaSlope5 = filters.filter("#alpha-slope5").append("feComponentTransfer");
57957 alphaSlope5.append("feFuncR").attr("type", "identity");
57958 alphaSlope5.append("feFuncG").attr("type", "identity");
57959 alphaSlope5.append("feFuncB").attr("type", "identity");
57960 alphaSlope5.append("feFuncA").attr("type", "linear").attr("slope", 5);
57961 addSprites(_spritesheetIds, true);
57963 function addSprites(ids, overrideColors) {
57964 _spritesheetIds = utilArrayUniq(_spritesheetIds.concat(ids));
57965 var spritesheets = _defsSelection.selectAll(".spritesheet").data(_spritesheetIds);
57966 spritesheets.enter().append("g").attr("class", function(d4) {
57967 return "spritesheet spritesheet-" + d4;
57968 }).each(function(d4) {
57969 var url = context.imagePath(d4 + ".svg");
57970 var node = select_default2(this).node();
57971 svg(url).then(function(svg2) {
57973 select_default2(svg2.documentElement).attr("id", "ideditor-" + d4).node()
57975 if (overrideColors && d4 !== "iD-sprite") {
57976 select_default2(node).selectAll("path").attr("fill", "currentColor");
57978 }).catch(function() {
57981 spritesheets.exit().remove();
57983 drawDefs.addSprites = addSprites;
57986 var init_defs = __esm({
57987 "modules/svg/defs.js"() {
57995 // modules/svg/keepRight.js
57996 var keepRight_exports2 = {};
57997 __export(keepRight_exports2, {
57998 svgKeepRight: () => svgKeepRight
58000 function svgKeepRight(projection2, context, dispatch14) {
58001 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
58002 const minZoom5 = 12;
58003 let touchLayer = select_default2(null);
58004 let drawLayer = select_default2(null);
58005 let layerVisible = false;
58006 function markerPath(selection2, klass) {
58007 selection2.attr("class", klass).attr("transform", "translate(-4, -24)").attr("d", "M11.6,6.2H7.1l1.4-5.1C8.6,0.6,8.1,0,7.5,0H2.2C1.7,0,1.3,0.3,1.3,0.8L0,10.2c-0.1,0.6,0.4,1.1,0.9,1.1h4.6l-1.8,7.6C3.6,19.4,4.1,20,4.7,20c0.3,0,0.6-0.2,0.8-0.5l6.9-11.9C12.7,7,12.3,6.2,11.6,6.2z");
58009 function getService() {
58010 if (services.keepRight && !_qaService) {
58011 _qaService = services.keepRight;
58012 _qaService.on("loaded", throttledRedraw);
58013 } else if (!services.keepRight && _qaService) {
58018 function editOn() {
58019 if (!layerVisible) {
58020 layerVisible = true;
58021 drawLayer.style("display", "block");
58024 function editOff() {
58025 if (layerVisible) {
58026 layerVisible = false;
58027 drawLayer.style("display", "none");
58028 drawLayer.selectAll(".qaItem.keepRight").remove();
58029 touchLayer.selectAll(".qaItem.keepRight").remove();
58032 function layerOn() {
58034 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", () => dispatch14.call("change"));
58036 function layerOff() {
58037 throttledRedraw.cancel();
58038 drawLayer.interrupt();
58039 touchLayer.selectAll(".qaItem.keepRight").remove();
58040 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", () => {
58042 dispatch14.call("change");
58045 function updateMarkers() {
58046 if (!layerVisible || !_layerEnabled) return;
58047 const service = getService();
58048 const selectedID = context.selectedErrorID();
58049 const data = service ? service.getItems(projection2) : [];
58050 const getTransform = svgPointTransform(projection2);
58051 const markers = drawLayer.selectAll(".qaItem.keepRight").data(data, (d4) => d4.id);
58052 markers.exit().remove();
58053 const markersEnter = markers.enter().append("g").attr("class", (d4) => `qaItem ${d4.service} itemId-${d4.id} itemType-${d4.parentIssueType}`);
58054 markersEnter.append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
58055 markersEnter.append("path").call(markerPath, "shadow");
58056 markersEnter.append("use").attr("class", "qaItem-fill").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").attr("xlink:href", "#iD-icon-bolt");
58057 markers.merge(markersEnter).sort(sortY).classed("selected", (d4) => d4.id === selectedID).attr("transform", getTransform);
58058 if (touchLayer.empty()) return;
58059 const fillClass = context.getDebug("target") ? "pink " : "nocolor ";
58060 const targets = touchLayer.selectAll(".qaItem.keepRight").data(data, (d4) => d4.id);
58061 targets.exit().remove();
58062 targets.enter().append("rect").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").merge(targets).sort(sortY).attr("class", (d4) => `qaItem ${d4.service} target ${fillClass} itemId-${d4.id}`).attr("transform", getTransform);
58063 function sortY(a2, b3) {
58064 return a2.id === selectedID ? 1 : b3.id === selectedID ? -1 : a2.severity === "error" && b3.severity !== "error" ? 1 : b3.severity === "error" && a2.severity !== "error" ? -1 : b3.loc[1] - a2.loc[1];
58067 function drawKeepRight(selection2) {
58068 const service = getService();
58069 const surface = context.surface();
58070 if (surface && !surface.empty()) {
58071 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
58073 drawLayer = selection2.selectAll(".layer-keepRight").data(service ? [0] : []);
58074 drawLayer.exit().remove();
58075 drawLayer = drawLayer.enter().append("g").attr("class", "layer-keepRight").style("display", _layerEnabled ? "block" : "none").merge(drawLayer);
58076 if (_layerEnabled) {
58077 if (service && ~~context.map().zoom() >= minZoom5) {
58079 service.loadIssues(projection2);
58086 drawKeepRight.enabled = function(val) {
58087 if (!arguments.length) return _layerEnabled;
58088 _layerEnabled = val;
58089 if (_layerEnabled) {
58093 if (context.selectedErrorID()) {
58094 context.enter(modeBrowse(context));
58097 dispatch14.call("change");
58100 drawKeepRight.supported = () => !!getService();
58101 return drawKeepRight;
58103 var _layerEnabled, _qaService;
58104 var init_keepRight2 = __esm({
58105 "modules/svg/keepRight.js"() {
58112 _layerEnabled = false;
58116 // modules/svg/geolocate.js
58117 var geolocate_exports = {};
58118 __export(geolocate_exports, {
58119 svgGeolocate: () => svgGeolocate
58121 function svgGeolocate(projection2) {
58122 var layer = select_default2(null);
58125 if (svgGeolocate.initialized) return;
58126 svgGeolocate.enabled = false;
58127 svgGeolocate.initialized = true;
58129 function showLayer() {
58130 layer.style("display", "block");
58132 function hideLayer() {
58133 layer.transition().duration(250).style("opacity", 0);
58135 function layerOn() {
58136 layer.style("opacity", 0).transition().duration(250).style("opacity", 1);
58138 function layerOff() {
58139 layer.style("display", "none");
58141 function transform2(d4) {
58142 return svgPointTransform(projection2)(d4);
58144 function accuracy(accuracy2, loc) {
58145 var degreesRadius = geoMetersToLat(accuracy2), tangentLoc = [loc[0], loc[1] + degreesRadius], projectedTangent = projection2(tangentLoc), projectedLoc = projection2([loc[0], loc[1]]);
58146 return Math.round(projectedLoc[1] - projectedTangent[1]).toString();
58148 function update() {
58149 var geolocation = { loc: [_position.coords.longitude, _position.coords.latitude] };
58150 var groups = layer.selectAll(".geolocations").selectAll(".geolocation").data([geolocation]);
58151 groups.exit().remove();
58152 var pointsEnter = groups.enter().append("g").attr("class", "geolocation");
58153 pointsEnter.append("circle").attr("class", "geolocate-radius").attr("dx", "0").attr("dy", "0").attr("fill", "rgb(15,128,225)").attr("fill-opacity", "0.3").attr("r", "0");
58154 pointsEnter.append("circle").attr("dx", "0").attr("dy", "0").attr("fill", "rgb(15,128,225)").attr("stroke", "white").attr("stroke-width", "1.5").attr("r", "6");
58155 groups.merge(pointsEnter).attr("transform", transform2);
58156 layer.select(".geolocate-radius").attr("r", accuracy(_position.coords.accuracy, geolocation.loc));
58158 function drawLocation(selection2) {
58159 var enabled = svgGeolocate.enabled;
58160 layer = selection2.selectAll(".layer-geolocate").data([0]);
58161 layer.exit().remove();
58162 var layerEnter = layer.enter().append("g").attr("class", "layer-geolocate").style("display", enabled ? "block" : "none");
58163 layerEnter.append("g").attr("class", "geolocations");
58164 layer = layerEnter.merge(layer);
58171 drawLocation.enabled = function(position, enabled) {
58172 if (!arguments.length) return svgGeolocate.enabled;
58173 _position = position;
58174 svgGeolocate.enabled = enabled;
58175 if (svgGeolocate.enabled) {
58184 return drawLocation;
58186 var init_geolocate = __esm({
58187 "modules/svg/geolocate.js"() {
58195 // modules/svg/labels.js
58196 var labels_exports = {};
58197 __export(labels_exports, {
58198 isAddressPoint: () => isAddressPoint,
58199 svgLabels: () => svgLabels,
58200 textWidth: () => textWidth
58202 function svgLabels(projection2, context) {
58203 var path = path_default(projection2);
58204 var detected = utilDetect();
58205 var baselineHack = detected.browser.toLowerCase() === "safari";
58206 var _rdrawn = new RBush();
58207 var _rskipped = new RBush();
58208 var _entitybboxes = {};
58209 const labelStack = [
58210 ["line", "aeroway", "*", 12],
58211 ["line", "highway", "motorway", 12],
58212 ["line", "highway", "trunk", 12],
58213 ["line", "highway", "primary", 12],
58214 ["line", "highway", "secondary", 12],
58215 ["line", "highway", "tertiary", 12],
58216 ["line", "highway", "*", 12],
58217 ["line", "railway", "*", 12],
58218 ["line", "waterway", "*", 12],
58219 ["area", "aeroway", "*", 12],
58220 ["area", "amenity", "*", 12],
58221 ["area", "building", "*", 12],
58222 ["area", "historic", "*", 12],
58223 ["area", "leisure", "*", 12],
58224 ["area", "man_made", "*", 12],
58225 ["area", "natural", "*", 12],
58226 ["area", "shop", "*", 12],
58227 ["area", "tourism", "*", 12],
58228 ["area", "camp_site", "*", 12],
58229 ["point", "aeroway", "*", 10],
58230 ["point", "amenity", "*", 10],
58231 ["point", "building", "*", 10],
58232 ["point", "historic", "*", 10],
58233 ["point", "leisure", "*", 10],
58234 ["point", "man_made", "*", 10],
58235 ["point", "natural", "*", 10],
58236 ["point", "shop", "*", 10],
58237 ["point", "tourism", "*", 10],
58238 ["point", "camp_site", "*", 10],
58239 ["*", "alt_name", "*", 12],
58240 ["*", "official_name", "*", 12],
58241 ["*", "loc_name", "*", 12],
58242 ["*", "loc_ref", "*", 12],
58243 ["*", "unsigned_ref", "*", 12],
58244 ["*", "seamark:name", "*", 12],
58245 ["*", "sector:name", "*", 12],
58246 ["*", "lock_name", "*", 12],
58247 ["*", "distance", "*", 12],
58248 ["*", "railway:position", "*", 12],
58249 ["line", "ref", "*", 12],
58250 ["area", "ref", "*", 12],
58251 ["point", "ref", "*", 10],
58252 ["line", "name", "*", 12],
58253 ["area", "name", "*", 12],
58254 ["point", "name", "*", 10],
58255 ["point", "addr:housenumber", "*", 10],
58256 ["point", "addr:housename", "*", 10]
58258 function shouldSkipIcon(preset) {
58259 var noIcons = ["building", "landuse", "natural"];
58260 return noIcons.some(function(s2) {
58261 return preset.id.indexOf(s2) >= 0;
58264 function drawLinePaths(selection2, labels, filter2, classes) {
58265 var paths = selection2.selectAll("path:not(.debug)").filter((d4) => filter2(d4.entity)).data(labels, (d4) => osmEntity.key(d4.entity));
58266 paths.exit().remove();
58267 paths.enter().append("path").style("stroke-width", (d4) => d4.position["font-size"]).attr("id", (d4) => "ideditor-labelpath-" + d4.entity.id).attr("class", classes).merge(paths).attr("d", (d4) => d4.position.lineString);
58269 function drawLineLabels(selection2, labels, filter2, classes) {
58270 var texts = selection2.selectAll("text." + classes).filter((d4) => filter2(d4.entity)).data(labels, (d4) => osmEntity.key(d4.entity));
58271 texts.exit().remove();
58272 texts.enter().append("text").attr("class", (d4) => classes + " " + d4.position.classes + " " + d4.entity.id).attr("dy", baselineHack ? "0.35em" : null).append("textPath").attr("class", "textpath");
58273 selection2.selectAll("text." + classes).selectAll(".textpath").filter((d4) => filter2(d4.entity)).data(labels, (d4) => osmEntity.key(d4.entity)).attr("startOffset", "50%").attr("xlink:href", function(d4) {
58274 return "#ideditor-labelpath-" + d4.entity.id;
58275 }).text((d4) => d4.name);
58277 function drawPointLabels(selection2, labels, filter2, classes) {
58278 if (classes.includes("pointlabel-halo")) {
58279 labels = labels.filter((d4) => !d4.position.isAddr);
58281 var texts = selection2.selectAll("text." + classes).filter((d4) => filter2(d4.entity)).data(labels, (d4) => osmEntity.key(d4.entity));
58282 texts.exit().remove();
58283 texts.enter().append("text").attr("class", (d4) => classes + " " + d4.position.classes + " " + d4.entity.id).style("text-anchor", (d4) => d4.position.textAnchor).text((d4) => d4.name).merge(texts).attr("x", (d4) => d4.position.x).attr("y", (d4) => d4.position.y);
58285 function drawAreaLabels(selection2, labels, filter2, classes) {
58286 labels = labels.filter(hasText);
58287 drawPointLabels(selection2, labels, filter2, classes);
58288 function hasText(d4) {
58289 return d4.position.hasOwnProperty("x") && d4.position.hasOwnProperty("y");
58292 function drawAreaIcons(selection2, labels, filter2, classes) {
58293 var icons = selection2.selectAll("use." + classes).filter((d4) => filter2(d4.entity)).data(labels, (d4) => osmEntity.key(d4.entity));
58294 icons.exit().remove();
58295 icons.enter().append("use").attr("class", "icon " + classes).attr("width", "17px").attr("height", "17px").merge(icons).attr("transform", (d4) => d4.position.transform).attr("xlink:href", function(d4) {
58296 var preset = _mainPresetIndex.match(d4.entity, context.graph());
58297 var picon = preset && preset.icon;
58298 return picon ? "#" + picon : "";
58301 function drawCollisionBoxes(selection2, rtree, which) {
58302 var classes = "debug " + which + " " + (which === "debug-skipped" ? "orange" : "yellow");
58304 if (context.getDebug("collision")) {
58305 gj = rtree.all().map(function(d4) {
58306 return { type: "Polygon", coordinates: [[
58307 [d4.minX, d4.minY],
58308 [d4.maxX, d4.minY],
58309 [d4.maxX, d4.maxY],
58310 [d4.minX, d4.maxY],
58315 var boxes = selection2.selectAll("." + which).data(gj);
58316 boxes.exit().remove();
58317 boxes.enter().append("path").attr("class", classes).merge(boxes).attr("d", path_default());
58319 function drawLabels(selection2, graph, entities, filter2, dimensions, fullRedraw) {
58320 var wireframe = context.surface().classed("fill-wireframe");
58321 var zoom = geoScaleToZoom(projection2.scale());
58322 var labelable = [];
58323 var renderNodeAs = {};
58324 var i3, j3, k2, entity, geometry;
58325 for (i3 = 0; i3 < labelStack.length; i3++) {
58326 labelable.push([]);
58331 _entitybboxes = {};
58333 for (i3 = 0; i3 < entities.length; i3++) {
58334 entity = entities[i3];
58335 var toRemove = [].concat(_entitybboxes[entity.id] || []).concat(_entitybboxes[entity.id + "I"] || []);
58336 for (j3 = 0; j3 < toRemove.length; j3++) {
58337 _rdrawn.remove(toRemove[j3]);
58338 _rskipped.remove(toRemove[j3]);
58342 for (i3 = 0; i3 < entities.length; i3++) {
58343 entity = entities[i3];
58344 geometry = entity.geometry(graph);
58345 if (geometry === "point" || geometry === "vertex" && isInterestingVertex(entity)) {
58346 const isAddr = isAddressPoint(entity.tags);
58347 var hasDirections = entity.directions(graph, projection2).length;
58348 var markerPadding = 0;
58350 renderNodeAs[entity.id] = { geometry: "vertex", isAddr };
58351 } else if (geometry === "vertex") {
58352 renderNodeAs[entity.id] = { geometry: "vertex", isAddr };
58353 } else if (zoom >= 18 && hasDirections) {
58354 renderNodeAs[entity.id] = { geometry: "vertex", isAddr };
58356 renderNodeAs[entity.id] = { geometry: "point", isAddr };
58357 markerPadding = 20;
58360 undoInsert(entity.id + "P");
58362 var coord2 = projection2(entity.loc);
58363 var nodePadding = 10;
58365 minX: coord2[0] - nodePadding,
58366 minY: coord2[1] - nodePadding - markerPadding,
58367 maxX: coord2[0] + nodePadding,
58368 maxY: coord2[1] + nodePadding
58370 doInsert(bbox2, entity.id + "P");
58373 if (geometry === "vertex") {
58374 geometry = "point";
58376 var preset = geometry === "area" && _mainPresetIndex.match(entity, graph);
58377 var icon2 = preset && !shouldSkipIcon(preset) && preset.icon;
58378 if (!icon2 && !utilDisplayName(entity, void 0, true)) continue;
58379 for (k2 = 0; k2 < labelStack.length; k2++) {
58380 var matchGeom = labelStack[k2][0];
58381 var matchKey = labelStack[k2][1];
58382 var matchVal = labelStack[k2][2];
58383 var hasVal = entity.tags[matchKey];
58384 if ((matchGeom === "*" || geometry === matchGeom) && hasVal && (matchVal === "*" || matchVal === hasVal)) {
58385 labelable[k2].push(entity);
58395 for (k2 = 0; k2 < labelable.length; k2++) {
58396 var fontSize = labelStack[k2][3];
58397 for (i3 = 0; i3 < labelable[k2].length; i3++) {
58398 entity = labelable[k2][i3];
58399 geometry = entity.geometry(graph);
58400 let name = geometry === "line" ? utilDisplayNameForPath(entity) : utilDisplayName(entity, void 0, true);
58401 var width = name && textWidth(name, fontSize, selection2.select("g.layer-osm.labels").node());
58403 if (geometry === "point" || geometry === "vertex") {
58404 if (wireframe) continue;
58405 var renderAs = renderNodeAs[entity.id];
58406 if (renderAs.geometry === "vertex" && zoom < 17) continue;
58407 while (renderAs.isAddr && width > 36) {
58408 name = `${name.substring(0, name.replace(/…$/, "").length - 1)}\u2026`;
58409 width = textWidth(name, fontSize, selection2.select("g.layer-osm.labels").node());
58411 p2 = getPointLabel(entity, width, fontSize, renderAs);
58412 } else if (geometry === "line") {
58413 p2 = getLineLabel(entity, width, fontSize);
58414 } else if (geometry === "area") {
58415 p2 = getAreaLabel(entity, width, fontSize);
58418 if (geometry === "vertex") {
58419 geometry = "point";
58421 p2.classes = geometry + " tag-" + labelStack[k2][1];
58422 labelled[geometry].push({
58430 function isInterestingVertex(entity2) {
58431 var selectedIDs = context.selectedIDs();
58432 return entity2.hasInterestingTags() || entity2.isEndpoint(graph) || entity2.isConnected(graph) || selectedIDs.indexOf(entity2.id) !== -1 || graph.parentWays(entity2).some(function(parent2) {
58433 return selectedIDs.indexOf(parent2.id) !== -1;
58436 function getPointLabel(entity2, width2, height, style) {
58437 var y3 = style.geometry === "point" ? -12 : 0;
58438 var pointOffsets = {
58439 ltr: [15, y3, "start"],
58440 rtl: [-15, y3, "end"]
58442 const isAddrMarker = style.isAddr && style.geometry !== "vertex";
58443 var textDirection = _mainLocalizer.textDirection();
58444 var coord3 = projection2(entity2.loc);
58445 var textPadding = 2;
58446 var offset = pointOffsets[textDirection];
58447 if (isAddrMarker) offset = [0, 1, "middle"];
58451 x: coord3[0] + offset[0],
58452 y: coord3[1] + offset[1],
58453 textAnchor: offset[2]
58456 if (isAddrMarker) {
58458 minX: p3.x - width2 / 2 - textPadding,
58459 minY: p3.y - height / 2 - textPadding,
58460 maxX: p3.x + width2 / 2 + textPadding,
58461 maxY: p3.y + height / 2 + textPadding
58463 } else if (textDirection === "rtl") {
58465 minX: p3.x - width2 - textPadding,
58466 minY: p3.y - height / 2 - textPadding,
58467 maxX: p3.x + textPadding,
58468 maxY: p3.y + height / 2 + textPadding
58472 minX: p3.x - textPadding,
58473 minY: p3.y - height / 2 - textPadding,
58474 maxX: p3.x + width2 + textPadding,
58475 maxY: p3.y + height / 2 + textPadding
58478 if (tryInsert([bbox3], entity2.id, true)) {
58482 function getLineLabel(entity2, width2, height) {
58483 var viewport = geoExtent(context.projection.clipExtent()).polygon();
58484 var points = graph.childNodes(entity2).map(function(node) {
58485 return projection2(node.loc);
58487 var length2 = geoPathLength(points);
58488 if (length2 < width2 + 20) return;
58489 var lineOffsets = [
58511 for (var i4 = 0; i4 < lineOffsets.length; i4++) {
58512 var offset = lineOffsets[i4];
58513 var middle = offset / 100 * length2;
58514 var start2 = middle - width2 / 2;
58515 if (start2 < 0 || start2 + width2 > length2) continue;
58516 var sub = subpath(points, start2, start2 + width2);
58517 if (!sub || !geoPolygonIntersectsPolygon(viewport, sub, true)) {
58520 var isReverse = reverse(sub);
58522 sub = sub.reverse();
58525 var boxsize = (height + 2) / 2;
58526 for (var j4 = 0; j4 < sub.length - 1; j4++) {
58528 var b3 = sub[j4 + 1];
58529 var num = Math.max(1, Math.floor(geoVecLength(a2, b3) / boxsize / 2));
58530 for (var box = 0; box < num; box++) {
58531 var p3 = geoVecInterp(a2, b3, box / num);
58532 var x05 = p3[0] - boxsize - padding;
58533 var y05 = p3[1] - boxsize - padding;
58534 var x12 = p3[0] + boxsize + padding;
58535 var y12 = p3[1] + boxsize + padding;
58537 minX: Math.min(x05, x12),
58538 minY: Math.min(y05, y12),
58539 maxX: Math.max(x05, x12),
58540 maxY: Math.max(y05, y12)
58544 if (tryInsert(bboxes, entity2.id, false)) {
58546 "font-size": height + 2,
58547 lineString: lineString2(sub),
58548 startOffset: offset + "%"
58552 function reverse(p4) {
58553 var angle2 = Math.atan2(p4[1][1] - p4[0][1], p4[1][0] - p4[0][0]);
58554 return !(p4[0][0] < p4[p4.length - 1][0] && angle2 < Math.PI / 2 && angle2 > -Math.PI / 2);
58556 function lineString2(points2) {
58557 return "M" + points2.join("L");
58559 function subpath(points2, from, to) {
58561 var start3, end, i0, i1;
58562 for (var i5 = 0; i5 < points2.length - 1; i5++) {
58563 var a3 = points2[i5];
58564 var b4 = points2[i5 + 1];
58565 var current = geoVecLength(a3, b4);
58567 if (!start3 && sofar + current >= from) {
58568 portion = (from - sofar) / current;
58570 a3[0] + portion * (b4[0] - a3[0]),
58571 a3[1] + portion * (b4[1] - a3[1])
58575 if (!end && sofar + current >= to) {
58576 portion = (to - sofar) / current;
58578 a3[0] + portion * (b4[0] - a3[0]),
58579 a3[1] + portion * (b4[1] - a3[1])
58585 var result = points2.slice(i0, i1);
58586 result.unshift(start3);
58591 function getAreaLabel(entity2, width2, height) {
58592 var centroid = path.centroid(entity2.asGeoJSON(graph));
58593 var extent = entity2.extent(graph);
58594 var areaWidth = projection2(extent[1])[0] - projection2(extent[0])[0];
58595 if (isNaN(centroid[0]) || areaWidth < 20) return;
58596 var preset2 = _mainPresetIndex.match(entity2, context.graph());
58597 var picon = preset2 && preset2.icon;
58601 if (picon && !shouldSkipIcon(preset2)) {
58603 addLabel(iconSize + padding);
58611 function addIcon() {
58612 var iconX = centroid[0] - iconSize / 2;
58613 var iconY = centroid[1] - iconSize / 2;
58617 maxX: iconX + iconSize,
58618 maxY: iconY + iconSize
58620 if (tryInsert([bbox3], entity2.id + "I", true)) {
58621 p3.transform = "translate(" + iconX + "," + iconY + ")";
58626 function addLabel(yOffset) {
58627 if (width2 && areaWidth >= width2 + 20) {
58628 var labelX = centroid[0];
58629 var labelY = centroid[1] + yOffset;
58631 minX: labelX - width2 / 2 - padding,
58632 minY: labelY - height / 2 - padding,
58633 maxX: labelX + width2 / 2 + padding,
58634 maxY: labelY + height / 2 + padding
58636 if (tryInsert([bbox3], entity2.id, true)) {
58639 p3.textAnchor = "middle";
58640 p3.height = height;
58647 function doInsert(bbox3, id2) {
58649 var oldbox = _entitybboxes[id2];
58651 _rdrawn.remove(oldbox);
58653 _entitybboxes[id2] = bbox3;
58654 _rdrawn.insert(bbox3);
58656 function undoInsert(id2) {
58657 var oldbox = _entitybboxes[id2];
58659 _rdrawn.remove(oldbox);
58661 delete _entitybboxes[id2];
58663 function tryInsert(bboxes, id2, saveSkipped) {
58664 var skipped = false;
58665 for (var i4 = 0; i4 < bboxes.length; i4++) {
58666 var bbox3 = bboxes[i4];
58668 if (bbox3.minX < 0 || bbox3.minY < 0 || bbox3.maxX > dimensions[0] || bbox3.maxY > dimensions[1]) {
58672 if (_rdrawn.collides(bbox3)) {
58677 _entitybboxes[id2] = bboxes;
58680 _rskipped.load(bboxes);
58683 _rdrawn.load(bboxes);
58687 var layer = selection2.selectAll(".layer-osm.labels");
58688 layer.selectAll(".labels-group").data(["halo", "label", "debug"]).enter().append("g").attr("class", function(d4) {
58689 return "labels-group " + d4;
58691 var halo = layer.selectAll(".labels-group.halo");
58692 var label = layer.selectAll(".labels-group.label");
58693 var debug2 = layer.selectAll(".labels-group.debug");
58694 drawPointLabels(label, labelled.point, filter2, "pointlabel");
58695 drawPointLabels(halo, labelled.point, filter2, "pointlabel-halo");
58696 drawLinePaths(layer, labelled.line, filter2, "");
58697 drawLineLabels(label, labelled.line, filter2, "linelabel");
58698 drawLineLabels(halo, labelled.line, filter2, "linelabel-halo");
58699 drawAreaLabels(label, labelled.area, filter2, "arealabel");
58700 drawAreaLabels(halo, labelled.area, filter2, "arealabel-halo");
58701 drawAreaIcons(label, labelled.area, filter2, "areaicon");
58702 drawAreaIcons(halo, labelled.area, filter2, "areaicon-halo");
58703 drawCollisionBoxes(debug2, _rskipped, "debug-skipped");
58704 drawCollisionBoxes(debug2, _rdrawn, "debug-drawn");
58705 layer.call(filterLabels);
58707 function filterLabels(selection2) {
58709 var drawLayer = selection2.selectAll(".layer-osm.labels");
58710 var layers = drawLayer.selectAll(".labels-group.halo, .labels-group.label");
58711 layers.selectAll(".nolabel").classed("nolabel", false);
58712 const graph = context.graph();
58713 const mouse = context.map().mouse();
58716 if (mouse && context.mode().id !== "browse") {
58718 bbox2 = { minX: mouse[0] - pad3, minY: mouse[1] - pad3, maxX: mouse[0] + pad3, maxY: mouse[1] + pad3 };
58719 const nearMouse = _rdrawn.search(bbox2).map((entity) => entity.id).filter((id2) => context.mode().id !== "select" || // in select mode: hide labels of currently selected line(s)
58720 // to still allow accessing midpoints
58721 // https://github.com/openstreetmap/iD/issues/11220
58722 context.mode().selectedIDs().includes(id2) && graph.hasEntity(id2).geometry(graph) === "line");
58723 hideIds.push.apply(hideIds, nearMouse);
58724 hideIds = utilArrayUniq(hideIds);
58726 const selected = (((_b2 = (_a4 = context.mode()) == null ? void 0 : _a4.selectedIDs) == null ? void 0 : _b2.call(_a4)) || []).filter((id2) => {
58728 return ((_a5 = graph.hasEntity(id2)) == null ? void 0 : _a5.geometry(graph)) !== "line";
58730 hideIds = utilArrayDifference(hideIds, selected);
58731 layers.selectAll(utilEntitySelector(hideIds)).classed("nolabel", true);
58732 var debug2 = selection2.selectAll(".labels-group.debug");
58734 if (context.getDebug("collision")) {
58738 [bbox2.minX, bbox2.minY],
58739 [bbox2.maxX, bbox2.minY],
58740 [bbox2.maxX, bbox2.maxY],
58741 [bbox2.minX, bbox2.maxY],
58742 [bbox2.minX, bbox2.minY]
58746 var box = debug2.selectAll(".debug-mouse").data(gj);
58747 box.exit().remove();
58748 box.enter().append("path").attr("class", "debug debug-mouse yellow").merge(box).attr("d", path_default());
58750 var throttleFilterLabels = throttle_default(filterLabels, 100);
58751 drawLabels.observe = function(selection2) {
58752 var listener = function() {
58753 throttleFilterLabels(selection2);
58755 selection2.on("mousemove.hidelabels", listener);
58756 context.on("enter.hidelabels", listener);
58758 drawLabels.off = function(selection2) {
58759 throttleFilterLabels.cancel();
58760 selection2.on("mousemove.hidelabels", null);
58761 context.on("enter.hidelabels", null);
58765 function textWidth(text, size, container) {
58766 let c2 = _textWidthCache[size];
58767 if (!c2) c2 = _textWidthCache[size] = {};
58771 const elem = document.createElementNS("http://www.w3.org/2000/svg", "text");
58772 elem.style.fontSize = `${size}px`;
58773 elem.style.fontWeight = "bold";
58774 elem.textContent = text;
58775 container.appendChild(elem);
58776 c2[text] = elem.getComputedTextLength();
58780 function isAddressPoint(tags) {
58781 const keys2 = Object.keys(tags).filter(
58782 (key) => osmIsInterestingTag(key) && !nonPrimaryKeys.has(key) && !nonPrimaryKeysRegex.test(key)
58784 return keys2.length > 0 && keys2.every(
58785 (key) => key.startsWith("addr:")
58788 var _textWidthCache, nonPrimaryKeys, nonPrimaryKeysRegex;
58789 var init_labels = __esm({
58790 "modules/svg/labels.js"() {
58801 _textWidthCache = {};
58802 nonPrimaryKeys = /* @__PURE__ */ new Set([
58811 nonPrimaryKeysRegex = /^(ref|survey|note|([^:]+:|old_|alt_)addr):/;
58815 // node_modules/exifr/dist/full.esm.mjs
58816 function l3(e3, t2 = o) {
58818 return "function" == typeof __require ? Promise.resolve(t2(__require(e3))) : import(
58819 /* webpackIgnore: true */
58823 console.warn(`Couldn't load ${e3}`);
58826 function c(e3, t2, i3) {
58827 return t2 in e3 ? Object.defineProperty(e3, t2, { value: i3, enumerable: true, configurable: true, writable: true }) : e3[t2] = i3, e3;
58830 return void 0 === e3 || (e3 instanceof Map ? 0 === e3.size : 0 === Object.values(e3).filter(d2).length);
58833 let t2 = new Error(e3);
58834 throw delete t2.stack, t2;
58837 return "" === (e3 = (function(e4) {
58838 for (; e4.endsWith("\0"); ) e4 = e4.slice(0, -1);
58840 })(e3).trim()) ? void 0 : e3;
58843 let t2 = (function(e4) {
58845 return e4.ifd0.enabled && (t3 += 1024), e4.exif.enabled && (t3 += 2048), e4.makerNote && (t3 += 2048), e4.userComment && (t3 += 1024), e4.gps.enabled && (t3 += 512), e4.interop.enabled && (t3 += 100), e4.ifd1.enabled && (t3 += 1024), t3 + 2048;
58847 return e3.jfif.enabled && (t2 += 50), e3.xmp.enabled && (t2 += 2e4), e3.iptc.enabled && (t2 += 14e3), e3.icc.enabled && (t2 += 6e3), t2;
58850 return y2 ? y2.decode(e3) : a ? Buffer.from(e3).toString("utf8") : decodeURIComponent(escape(C2(e3)));
58852 function P2(e3, t2) {
58853 g2(`${e3} '${t2}' was not loaded, try using full build of exifr.`);
58855 function D2(e3, n3) {
58856 return "string" == typeof e3 ? O2(e3, n3) : t && !i2 && e3 instanceof HTMLImageElement ? O2(e3.src, n3) : e3 instanceof Uint8Array || e3 instanceof ArrayBuffer || e3 instanceof DataView ? new I2(e3) : t && e3 instanceof Blob ? x(e3, n3, "blob", R2) : void g2("Invalid input argument");
58858 function O2(e3, i3) {
58859 return (s2 = e3).startsWith("data:") || s2.length > 1e4 ? v2(e3, i3, "base64") : n2 && e3.includes("://") ? x(e3, i3, "url", M2) : n2 ? v2(e3, i3, "fs") : t ? x(e3, i3, "url", M2) : void g2("Invalid input argument");
58862 async function x(e3, t2, i3, n3) {
58863 return A.has(i3) ? v2(e3, t2, i3) : n3 ? (async function(e4, t3) {
58864 let i4 = await t3(e4);
58866 })(e3, n3) : void g2(`Parser ${i3} is not loaded`);
58868 async function v2(e3, t2, i3) {
58869 let n3 = new (A.get(i3))(e3, t2);
58870 return await n3.read(), n3;
58872 function U2(e3, t2, i3) {
58874 for (let [e4, t3] of i3) n3.set(e4, t3);
58875 if (Array.isArray(t2)) for (let i4 of t2) e3.set(i4, n3);
58876 else e3.set(t2, n3);
58879 function F2(e3, t2, i3) {
58880 let n3, s2 = e3.get(t2);
58881 for (n3 of i3) s2.set(n3[0], n3[1]);
58883 function Q2(e3, t2) {
58884 let i3, n3, s2, r2, a2 = [];
58886 for (r2 of (i3 = E2.get(s2), n3 = [], i3)) (e3.includes(r2[0]) || e3.includes(r2[1])) && n3.push(r2[0]);
58887 n3.length && a2.push([s2, n3]);
58891 function Z(e3, t2) {
58892 return void 0 !== e3 ? e3 : void 0 !== t2 ? t2 : void 0;
58894 function ee(e3, t2) {
58895 for (let i3 of t2) e3.add(i3);
58897 async function ie2(e3, t2) {
58898 let i3 = new te(t2);
58899 return await i3.read(e3), i3.parse();
58902 return 192 === e3 || 194 === e3 || 196 === e3 || 219 === e3 || 221 === e3 || 218 === e3 || 254 === e3;
58905 return e3 >= 224 && e3 <= 239;
58907 function le2(e3, t2, i3) {
58908 for (let [n3, s2] of T) if (s2.canHandle(e3, t2, i3)) return n3;
58910 function de2(e3, t2, i3, n3) {
58911 var s2 = e3 + t2 / 60 + i3 / 3600;
58912 return "S" !== n3 && "W" !== n3 || (s2 *= -1), s2;
58914 async function Se2(e3) {
58915 let t2 = new te(me);
58917 let i3 = await t2.parse();
58918 if (i3 && i3.gps) {
58919 let { latitude: e4, longitude: t3 } = i3.gps;
58920 return { latitude: e4, longitude: t3 };
58923 async function ye2(e3) {
58924 let t2 = new te(Ce2);
58926 let i3 = await t2.extractThumbnail();
58927 return i3 && a ? s.from(i3) : i3;
58929 async function be2(e3) {
58930 let t2 = await this.thumbnail(e3);
58931 if (void 0 !== t2) {
58932 let e4 = new Blob([t2]);
58933 return URL.createObjectURL(e4);
58936 async function Pe2(e3) {
58937 let t2 = new te(Ie2);
58939 let i3 = await t2.parse();
58940 if (i3 && i3.ifd0) return i3.ifd0[274];
58942 async function Ae2(e3) {
58943 let t2 = await Pe2(e3);
58944 return Object.assign({ canvas: we2, css: Te2 }, ke2[t2]);
58946 function xe2(e3, t2, i3) {
58947 return e3 <= t2 && t2 <= i3;
58950 return "object" == typeof e3 && void 0 !== e3.length ? e3[0] : e3;
58953 let t2 = Array.from(e3).slice(1);
58954 return t2[1] > 15 && (t2 = t2.map(((e4) => String.fromCharCode(e4)))), "0" !== t2[2] && 0 !== t2[2] || t2.pop(), t2.join(".");
58957 if ("string" == typeof e3) {
58958 var [t2, i3, n3, s2, r2, a2] = e3.trim().split(/[-: ]/g).map(Number), o2 = new Date(t2, i3 - 1, n3);
58959 return Number.isNaN(s2) || Number.isNaN(r2) || Number.isNaN(a2) || (o2.setHours(s2), o2.setMinutes(r2), o2.setSeconds(a2)), Number.isNaN(+o2) ? e3 : o2;
58963 if ("string" == typeof e3) return e3;
58965 if (0 === e3[1] && 0 === e3[e3.length - 1]) for (let i3 = 0; i3 < e3.length; i3 += 2) t2.push(je2(e3[i3 + 1], e3[i3]));
58966 else for (let i3 = 0; i3 < e3.length; i3 += 2) t2.push(je2(e3[i3], e3[i3 + 1]));
58967 return m2(String.fromCodePoint(...t2));
58969 function je2(e3, t2) {
58970 return e3 << 8 | t2;
58972 function _e2(e3, t2) {
58973 let i3 = e3.serialize();
58974 void 0 !== i3 && (t2[e3.name] = i3);
58976 function qe2(e3, t2) {
58978 if (!e3) return n3;
58979 for (; null !== (i3 = t2.exec(e3)); ) n3.push(i3);
58983 if ((function(e4) {
58984 return null == e4 || "null" === e4 || "undefined" === e4 || "" === e4 || "" === e4.trim();
58986 let t2 = Number(e3);
58987 if (!Number.isNaN(t2)) return t2;
58988 let i3 = e3.toLowerCase();
58989 return "true" === i3 || "false" !== i3 && e3.trim();
58991 function mt(e3, t2) {
58992 return m2(e3.getString(t2, 4));
58994 var e, t, i2, n2, s, r, a, o, h2, u, f, d2, C2, y2, I2, k, w2, T, A, M2, R2, L2, E2, B2, N2, G, V2, z2, H2, j2, W2, K2, X3, _2, Y, $3, J2, q2, te, ne, se2, re3, he2, ue2, ce2, fe2, pe2, ge2, me, Ce2, Ie2, ke2, we2, Te2, De2, Oe2, ve2, Me2, Re2, Le2, Ue2, Fe2, Ee2, Be2, Ne2, We2, Ke2, Xe2, Ye, $e2, Je2, Ze2, et, tt, at, ot, lt, ht, ut, ct, ft, dt, pt, gt, St, Ct, yt, full_esm_default;
58995 var init_full_esm = __esm({
58996 "node_modules/exifr/dist/full.esm.mjs"() {
58997 e = "undefined" != typeof self ? self : global;
58998 t = "undefined" != typeof navigator;
58999 i2 = t && "undefined" == typeof HTMLImageElement;
59000 n2 = !("undefined" == typeof global || "undefined" == typeof process || !process.versions || !process.versions.node);
59006 u = (e3) => h2 = e3;
59008 const e3 = l3("http", ((e4) => e4)), t2 = l3("https", ((e4) => e4)), i3 = (n3, { headers: s2 } = {}) => new Promise((async (r2, a2) => {
59009 let { port: o2, hostname: l4, pathname: h3, protocol: u2, search: c2 } = new URL(n3);
59010 const f2 = { method: "GET", hostname: l4, path: encodeURI(h3) + c2, headers: s2 };
59011 "" !== o2 && (f2.port = Number(o2));
59012 const d4 = ("https:" === u2 ? await t2 : await e3).request(f2, ((e4) => {
59013 if (301 === e4.statusCode || 302 === e4.statusCode) {
59014 let t3 = new URL(e4.headers.location, n3).toString();
59015 return i3(t3, { headers: s2 }).then(r2).catch(a2);
59017 r2({ status: e4.statusCode, arrayBuffer: () => new Promise(((t3) => {
59019 e4.on("data", ((e6) => i4.push(e6))), e4.on("end", (() => t3(Buffer.concat(i4))));
59022 d4.on("error", a2), d4.end();
59026 f = (e3) => p(e3) ? void 0 : e3;
59027 d2 = (e3) => void 0 !== e3;
59028 C2 = (e3) => String.fromCharCode.apply(null, e3);
59029 y2 = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : void 0;
59031 static from(e3, t2) {
59032 return e3 instanceof this && e3.le === t2 ? e3 : new _I(e3, void 0, void 0, t2);
59034 constructor(e3, t2 = 0, i3, n3) {
59035 if ("boolean" == typeof n3 && (this.le = n3), Array.isArray(e3) && (e3 = new Uint8Array(e3)), 0 === e3) this.byteOffset = 0, this.byteLength = 0;
59036 else if (e3 instanceof ArrayBuffer) {
59037 void 0 === i3 && (i3 = e3.byteLength - t2);
59038 let n4 = new DataView(e3, t2, i3);
59039 this._swapDataView(n4);
59040 } else if (e3 instanceof Uint8Array || e3 instanceof DataView || e3 instanceof _I) {
59041 void 0 === i3 && (i3 = e3.byteLength - t2), (t2 += e3.byteOffset) + i3 > e3.byteOffset + e3.byteLength && g2("Creating view outside of available memory in ArrayBuffer");
59042 let n4 = new DataView(e3.buffer, t2, i3);
59043 this._swapDataView(n4);
59044 } else if ("number" == typeof e3) {
59045 let t3 = new DataView(new ArrayBuffer(e3));
59046 this._swapDataView(t3);
59047 } else g2("Invalid input argument for BufferView: " + e3);
59049 _swapArrayBuffer(e3) {
59050 this._swapDataView(new DataView(e3));
59053 this._swapDataView(new DataView(e3.buffer, e3.byteOffset, e3.byteLength));
59055 _swapDataView(e3) {
59056 this.dataView = e3, this.buffer = e3.buffer, this.byteOffset = e3.byteOffset, this.byteLength = e3.byteLength;
59059 return this.byteLength - e3;
59061 set(e3, t2, i3 = _I) {
59062 return e3 instanceof DataView || e3 instanceof _I ? e3 = new Uint8Array(e3.buffer, e3.byteOffset, e3.byteLength) : e3 instanceof ArrayBuffer && (e3 = new Uint8Array(e3)), e3 instanceof Uint8Array || g2("BufferView.set(): Invalid data argument."), this.toUint8().set(e3, t2), new i3(this, t2, e3.byteLength);
59065 return t2 = t2 || this._lengthToEnd(e3), new _I(this, e3, t2);
59068 return new Uint8Array(this.buffer, this.byteOffset, this.byteLength);
59070 getUint8Array(e3, t2) {
59071 return new Uint8Array(this.buffer, this.byteOffset + e3, t2);
59073 getString(e3 = 0, t2 = this.byteLength) {
59074 return b2(this.getUint8Array(e3, t2));
59076 getLatin1String(e3 = 0, t2 = this.byteLength) {
59077 let i3 = this.getUint8Array(e3, t2);
59080 getUnicodeString(e3 = 0, t2 = this.byteLength) {
59082 for (let n3 = 0; n3 < t2 && e3 + n3 < this.byteLength; n3 += 2) i3.push(this.getUint16(e3 + n3));
59086 return this.dataView.getInt8(e3);
59089 return this.dataView.getUint8(e3);
59091 getInt16(e3, t2 = this.le) {
59092 return this.dataView.getInt16(e3, t2);
59094 getInt32(e3, t2 = this.le) {
59095 return this.dataView.getInt32(e3, t2);
59097 getUint16(e3, t2 = this.le) {
59098 return this.dataView.getUint16(e3, t2);
59100 getUint32(e3, t2 = this.le) {
59101 return this.dataView.getUint32(e3, t2);
59103 getFloat32(e3, t2 = this.le) {
59104 return this.dataView.getFloat32(e3, t2);
59106 getFloat64(e3, t2 = this.le) {
59107 return this.dataView.getFloat64(e3, t2);
59109 getFloat(e3, t2 = this.le) {
59110 return this.dataView.getFloat32(e3, t2);
59112 getDouble(e3, t2 = this.le) {
59113 return this.dataView.getFloat64(e3, t2);
59115 getUintBytes(e3, t2, i3) {
59118 return this.getUint8(e3, i3);
59120 return this.getUint16(e3, i3);
59122 return this.getUint32(e3, i3);
59124 return this.getUint64 && this.getUint64(e3, i3);
59127 getUint(e3, t2, i3) {
59130 return this.getUint8(e3, i3);
59132 return this.getUint16(e3, i3);
59134 return this.getUint32(e3, i3);
59136 return this.getUint64 && this.getUint64(e3, i3);
59140 return this.dataView.toString(e3, this.constructor.name);
59145 k = class extends Map {
59147 super(), this.kind = e3;
59150 return this.has(e3) || P2(this.kind, e3), t2 && (e3 in t2 || (function(e4, t3) {
59151 g2(`Unknown ${e4} '${t3}'.`);
59152 })(this.kind, e3), t2[e3].enabled || P2(this.kind, e3)), super.get(e3);
59155 return Array.from(this.keys());
59158 w2 = new k("file parser");
59159 T = new k("segment parser");
59160 A = new k("file reader");
59161 M2 = (e3) => h2(e3).then(((e4) => e4.arrayBuffer()));
59162 R2 = (e3) => new Promise(((t2, i3) => {
59163 let n3 = new FileReader();
59164 n3.onloadend = () => t2(n3.result || new ArrayBuffer()), n3.onerror = i3, n3.readAsArrayBuffer(e3);
59166 L2 = class extends Map {
59168 return this.allKeys || (this.allKeys = Array.from(this.keys())), this.allKeys;
59171 return this.allValues || (this.allValues = Array.from(this.values())), this.allValues;
59174 E2 = /* @__PURE__ */ new Map();
59175 B2 = /* @__PURE__ */ new Map();
59176 N2 = /* @__PURE__ */ new Map();
59177 G = ["chunked", "firstChunkSize", "firstChunkSizeNode", "firstChunkSizeBrowser", "chunkSize", "chunkLimit"];
59178 V2 = ["jfif", "xmp", "icc", "iptc", "ihdr"];
59179 z2 = ["tiff", ...V2];
59180 H2 = ["ifd0", "ifd1", "exif", "gps", "interop"];
59181 j2 = [...z2, ...H2];
59182 W2 = ["makerNote", "userComment"];
59183 K2 = ["translateKeys", "translateValues", "reviveValues", "multiSegment"];
59184 X3 = [...K2, "sanitize", "mergeOutput", "silentErrors"];
59187 return this.translateKeys || this.translateValues || this.reviveValues;
59190 Y = class extends _2 {
59192 return this.enabled || this.deps.size > 0;
59194 constructor(e3, t2, i3, n3) {
59195 if (super(), c(this, "enabled", false), c(this, "skip", /* @__PURE__ */ new Set()), c(this, "pick", /* @__PURE__ */ new Set()), c(this, "deps", /* @__PURE__ */ new Set()), c(this, "translateKeys", false), c(this, "translateValues", false), c(this, "reviveValues", false), this.key = e3, this.enabled = t2, this.parse = this.enabled, this.applyInheritables(n3), this.canBeFiltered = H2.includes(e3), this.canBeFiltered && (this.dict = E2.get(e3)), void 0 !== i3) if (Array.isArray(i3)) this.parse = this.enabled = true, this.canBeFiltered && i3.length > 0 && this.translateTagSet(i3, this.pick);
59196 else if ("object" == typeof i3) {
59197 if (this.enabled = true, this.parse = false !== i3.parse, this.canBeFiltered) {
59198 let { pick: e4, skip: t3 } = i3;
59199 e4 && e4.length > 0 && this.translateTagSet(e4, this.pick), t3 && t3.length > 0 && this.translateTagSet(t3, this.skip);
59201 this.applyInheritables(i3);
59202 } else true === i3 || false === i3 ? this.parse = this.enabled = i3 : g2(`Invalid options argument: ${i3}`);
59204 applyInheritables(e3) {
59206 for (t2 of K2) i3 = e3[t2], void 0 !== i3 && (this[t2] = i3);
59208 translateTagSet(e3, t2) {
59210 let i3, n3, { tagKeys: s2, tagValues: r2 } = this.dict;
59211 for (i3 of e3) "string" == typeof i3 ? (n3 = r2.indexOf(i3), -1 === n3 && (n3 = s2.indexOf(Number(i3))), -1 !== n3 && t2.add(Number(s2[n3]))) : t2.add(i3);
59212 } else for (let i3 of e3) t2.add(i3);
59214 finalizeFilters() {
59215 !this.enabled && this.deps.size > 0 ? (this.enabled = true, ee(this.pick, this.deps)) : this.enabled && this.pick.size > 0 && ee(this.pick, this.deps);
59218 $3 = { jfif: false, tiff: true, xmp: false, icc: false, iptc: false, ifd0: true, ifd1: false, exif: true, gps: true, interop: false, ihdr: void 0, makerNote: false, userComment: false, multiSegment: false, skip: [], pick: [], translateKeys: true, translateValues: true, reviveValues: true, sanitize: true, mergeOutput: true, silentErrors: true, chunked: true, firstChunkSize: void 0, firstChunkSizeNode: 512, firstChunkSizeBrowser: 65536, chunkSize: 65536, chunkLimit: 5 };
59219 J2 = /* @__PURE__ */ new Map();
59220 q2 = class extends _2 {
59221 static useCached(e3) {
59222 let t2 = J2.get(e3);
59223 return void 0 !== t2 || (t2 = new this(e3), J2.set(e3, t2)), t2;
59226 super(), true === e3 ? this.setupFromTrue() : void 0 === e3 ? this.setupFromUndefined() : Array.isArray(e3) ? this.setupFromArray(e3) : "object" == typeof e3 ? this.setupFromObject(e3) : g2(`Invalid options argument ${e3}`), void 0 === this.firstChunkSize && (this.firstChunkSize = t ? this.firstChunkSizeBrowser : this.firstChunkSizeNode), this.mergeOutput && (this.ifd1.enabled = false), this.filterNestedSegmentTags(), this.traverseTiffDependencyTree(), this.checkLoadedPlugins();
59228 setupFromUndefined() {
59230 for (e3 of G) this[e3] = $3[e3];
59231 for (e3 of X3) this[e3] = $3[e3];
59232 for (e3 of W2) this[e3] = $3[e3];
59233 for (e3 of j2) this[e3] = new Y(e3, $3[e3], void 0, this);
59237 for (e3 of G) this[e3] = $3[e3];
59238 for (e3 of X3) this[e3] = $3[e3];
59239 for (e3 of W2) this[e3] = true;
59240 for (e3 of j2) this[e3] = new Y(e3, true, void 0, this);
59242 setupFromArray(e3) {
59244 for (t2 of G) this[t2] = $3[t2];
59245 for (t2 of X3) this[t2] = $3[t2];
59246 for (t2 of W2) this[t2] = $3[t2];
59247 for (t2 of j2) this[t2] = new Y(t2, false, void 0, this);
59248 this.setupGlobalFilters(e3, void 0, H2);
59250 setupFromObject(e3) {
59252 for (t2 of (H2.ifd0 = H2.ifd0 || H2.image, H2.ifd1 = H2.ifd1 || H2.thumbnail, Object.assign(this, e3), G)) this[t2] = Z(e3[t2], $3[t2]);
59253 for (t2 of X3) this[t2] = Z(e3[t2], $3[t2]);
59254 for (t2 of W2) this[t2] = Z(e3[t2], $3[t2]);
59255 for (t2 of z2) this[t2] = new Y(t2, $3[t2], e3[t2], this);
59256 for (t2 of H2) this[t2] = new Y(t2, $3[t2], e3[t2], this.tiff);
59257 this.setupGlobalFilters(e3.pick, e3.skip, H2, j2), true === e3.tiff ? this.batchEnableWithBool(H2, true) : false === e3.tiff ? this.batchEnableWithUserValue(H2, e3) : Array.isArray(e3.tiff) ? this.setupGlobalFilters(e3.tiff, void 0, H2) : "object" == typeof e3.tiff && this.setupGlobalFilters(e3.tiff.pick, e3.tiff.skip, H2);
59259 batchEnableWithBool(e3, t2) {
59260 for (let i3 of e3) this[i3].enabled = t2;
59262 batchEnableWithUserValue(e3, t2) {
59263 for (let i3 of e3) {
59265 this[i3].enabled = false !== e4 && void 0 !== e4;
59268 setupGlobalFilters(e3, t2, i3, n3 = i3) {
59269 if (e3 && e3.length) {
59270 for (let e4 of n3) this[e4].enabled = false;
59271 let t3 = Q2(e3, i3);
59272 for (let [e4, i4] of t3) ee(this[e4].pick, i4), this[e4].enabled = true;
59273 } else if (t2 && t2.length) {
59274 let e4 = Q2(t2, i3);
59275 for (let [t3, i4] of e4) ee(this[t3].skip, i4);
59278 filterNestedSegmentTags() {
59279 let { ifd0: e3, exif: t2, xmp: i3, iptc: n3, icc: s2 } = this;
59280 this.makerNote ? t2.deps.add(37500) : t2.skip.add(37500), this.userComment ? t2.deps.add(37510) : t2.skip.add(37510), i3.enabled || e3.skip.add(700), n3.enabled || e3.skip.add(33723), s2.enabled || e3.skip.add(34675);
59282 traverseTiffDependencyTree() {
59283 let { ifd0: e3, exif: t2, gps: i3, interop: n3 } = this;
59284 n3.needed && (t2.deps.add(40965), e3.deps.add(40965)), t2.needed && e3.deps.add(34665), i3.needed && e3.deps.add(34853), this.tiff.enabled = H2.some(((e4) => true === this[e4].enabled)) || this.makerNote || this.userComment;
59285 for (let e4 of H2) this[e4].finalizeFilters();
59288 return !V2.map(((e3) => this[e3].enabled)).some(((e3) => true === e3)) && this.tiff.enabled;
59290 checkLoadedPlugins() {
59291 for (let e3 of z2) this[e3].enabled && !T.has(e3) && P2("segment parser", e3);
59294 c(q2, "default", $3);
59297 c(this, "parsers", {}), c(this, "output", {}), c(this, "errors", []), c(this, "pushToErrors", ((e4) => this.errors.push(e4))), this.options = q2.useCached(e3);
59300 this.file = await D2(e3, this.options);
59303 if (this.fileParser) return;
59304 let { file: e3 } = this, t2 = e3.getUint16(0);
59305 for (let [i3, n3] of w2) if (n3.canHandle(e3, t2)) return this.fileParser = new n3(this.options, this.file, this.parsers), e3[i3] = true;
59306 this.file.close && this.file.close(), g2("Unknown file format");
59309 let { output: e3, errors: t2 } = this;
59310 return this.setup(), this.options.silentErrors ? (await this.executeParsers().catch(this.pushToErrors), t2.push(...this.fileParser.errors)) : await this.executeParsers(), this.file.close && this.file.close(), this.options.silentErrors && t2.length > 0 && (e3.errors = t2), f(e3);
59312 async executeParsers() {
59313 let { output: e3 } = this;
59314 await this.fileParser.parse();
59315 let t2 = Object.values(this.parsers).map((async (t3) => {
59316 let i3 = await t3.parse();
59317 t3.assignToOutput(e3, i3);
59319 this.options.silentErrors && (t2 = t2.map(((e4) => e4.catch(this.pushToErrors)))), await Promise.all(t2);
59321 async extractThumbnail() {
59323 let { options: e3, file: t2 } = this, i3 = T.get("tiff", e3);
59325 if (t2.tiff ? n3 = { start: 0, type: "tiff" } : t2.jpeg && (n3 = await this.fileParser.getOrFindSegment("tiff")), void 0 === n3) return;
59326 let s2 = await this.fileParser.ensureSegmentChunk(n3), r2 = this.parsers.tiff = new i3(s2, e3, t2), a2 = await r2.extractThumbnail();
59327 return t2.close && t2.close(), a2;
59330 ne = Object.freeze({ __proto__: null, parse: ie2, Exifr: te, fileParsers: w2, segmentParsers: T, fileReaders: A, tagKeys: E2, tagValues: B2, tagRevivers: N2, createDictionary: U2, extendDictionary: F2, fetchUrlAsArrayBuffer: M2, readBlobAsArrayBuffer: R2, chunkedProps: G, otherSegments: V2, segments: z2, tiffBlocks: H2, segmentsAndBlocks: j2, tiffExtractables: W2, inheritables: K2, allFormatters: X3, Options: q2 });
59332 constructor(e3, t2, i3) {
59333 c(this, "errors", []), c(this, "ensureSegmentChunk", (async (e4) => {
59334 let t3 = e4.start, i4 = e4.size || 65536;
59335 if (this.file.chunked) if (this.file.available(t3, i4)) e4.chunk = this.file.subarray(t3, i4);
59337 e4.chunk = await this.file.readChunk(t3, i4);
59339 g2(`Couldn't read segment: ${JSON.stringify(e4)}. ${t4.message}`);
59341 else this.file.byteLength > t3 + i4 ? e4.chunk = this.file.subarray(t3, i4) : void 0 === e4.size ? e4.chunk = this.file.subarray(t3) : g2("Segment unreachable: " + JSON.stringify(e4));
59343 })), this.extendOptions && this.extendOptions(e3), this.options = e3, this.file = t2, this.parsers = i3;
59345 injectSegment(e3, t2) {
59346 this.options[e3].enabled && this.createParser(e3, t2);
59348 createParser(e3, t2) {
59349 let i3 = new (T.get(e3))(t2, this.options, this.file);
59350 return this.parsers[e3] = i3;
59352 createParsers(e3) {
59353 for (let t2 of e3) {
59354 let { type: e4, chunk: i3 } = t2, n3 = this.options[e4];
59355 if (n3 && n3.enabled) {
59356 let t3 = this.parsers[e4];
59357 t3 && t3.append || t3 || this.createParser(e4, i3);
59361 async readSegments(e3) {
59362 let t2 = e3.map(this.ensureSegmentChunk);
59363 await Promise.all(t2);
59367 static findPosition(e3, t2) {
59368 let i3 = e3.getUint16(t2 + 2) + 2, n3 = "function" == typeof this.headerLength ? this.headerLength(e3, t2, i3) : this.headerLength, s2 = t2 + n3, r2 = i3 - n3;
59369 return { offset: t2, length: i3, headerLength: n3, start: s2, size: r2, end: s2 + r2 };
59371 static parse(e3, t2 = {}) {
59372 return new this(e3, new q2({ [this.type]: t2 }), e3).parse();
59374 normalizeInput(e3) {
59375 return e3 instanceof I2 ? e3 : new I2(e3);
59377 constructor(e3, t2 = {}, i3) {
59378 c(this, "errors", []), c(this, "raw", /* @__PURE__ */ new Map()), c(this, "handleError", ((e4) => {
59379 if (!this.options.silentErrors) throw e4;
59380 this.errors.push(e4.message);
59381 })), this.chunk = this.normalizeInput(e3), this.file = i3, this.type = this.constructor.type, this.globalOptions = this.options = t2, this.localOptions = t2[this.type], this.canTranslate = this.localOptions && this.localOptions.translate;
59384 this.canTranslate && (this.translated = this.translateBlock(this.raw, this.type));
59387 return this.translated ? this.translated : this.raw ? Object.fromEntries(this.raw) : void 0;
59389 translateBlock(e3, t2) {
59390 let i3 = N2.get(t2), n3 = B2.get(t2), s2 = E2.get(t2), r2 = this.options[t2], a2 = r2.reviveValues && !!i3, o2 = r2.translateValues && !!n3, l4 = r2.translateKeys && !!s2, h3 = {};
59391 for (let [t3, r3] of e3) a2 && i3.has(t3) ? r3 = i3.get(t3)(r3) : o2 && n3.has(t3) && (r3 = this.translateValue(r3, n3.get(t3))), l4 && s2.has(t3) && (t3 = s2.get(t3) || t3), h3[t3] = r3;
59394 translateValue(e3, t2) {
59395 return t2[e3] || t2.DEFAULT || e3;
59397 assignToOutput(e3, t2) {
59398 this.assignObjectToOutput(e3, this.constructor.type, t2);
59400 assignObjectToOutput(e3, t2, i3) {
59401 if (this.globalOptions.mergeOutput) return Object.assign(e3, i3);
59402 e3[t2] ? Object.assign(e3[t2], i3) : e3[t2] = i3;
59405 c(re3, "headerLength", 4), c(re3, "type", void 0), c(re3, "multiSegment", false), c(re3, "canHandle", (() => false));
59406 he2 = class extends se2 {
59407 constructor(...e3) {
59408 super(...e3), c(this, "appSegments", []), c(this, "jpegSegments", []), c(this, "unknownSegments", []);
59410 static canHandle(e3, t2) {
59411 return 65496 === t2;
59414 await this.findAppSegments(), await this.readSegments(this.appSegments), this.mergeMultiSegments(), this.createParsers(this.mergedAppSegments || this.appSegments);
59416 setupSegmentFinderArgs(e3) {
59417 true === e3 ? (this.findAll = true, this.wanted = new Set(T.keyList())) : (e3 = void 0 === e3 ? T.keyList().filter(((e4) => this.options[e4].enabled)) : e3.filter(((e4) => this.options[e4].enabled && T.has(e4))), this.findAll = false, this.remaining = new Set(e3), this.wanted = new Set(e3)), this.unfinishedMultiSegment = false;
59419 async findAppSegments(e3 = 0, t2) {
59420 this.setupSegmentFinderArgs(t2);
59421 let { file: i3, findAll: n3, wanted: s2, remaining: r2 } = this;
59422 if (!n3 && this.file.chunked && (n3 = Array.from(s2).some(((e4) => {
59423 let t3 = T.get(e4), i4 = this.options[e4];
59424 return t3.multiSegment && i4.multiSegment;
59425 })), n3 && await this.file.readWhole()), e3 = this.findAppSegmentsInRange(e3, i3.byteLength), !this.options.onlyTiff && i3.chunked) {
59427 for (; r2.size > 0 && !t3 && (i3.canReadNextChunk || this.unfinishedMultiSegment); ) {
59428 let { nextChunkOffset: n4 } = i3, s3 = this.appSegments.some(((e4) => !this.file.available(e4.offset || e4.start, e4.length || e4.size)));
59429 if (t3 = e3 > n4 && !s3 ? !await i3.readNextChunk(e3) : !await i3.readNextChunk(n4), void 0 === (e3 = this.findAppSegmentsInRange(e3, i3.byteLength))) return;
59433 findAppSegmentsInRange(e3, t2) {
59435 let i3, n3, s2, r2, a2, o2, { file: l4, findAll: h3, wanted: u2, remaining: c2, options: f2 } = this;
59436 for (; e3 < t2; e3++) if (255 === l4.getUint8(e3)) {
59437 if (i3 = l4.getUint8(e3 + 1), oe2(i3)) {
59438 if (n3 = l4.getUint16(e3 + 2), s2 = le2(l4, e3, n3), s2 && u2.has(s2) && (r2 = T.get(s2), a2 = r2.findPosition(l4, e3), o2 = f2[s2], a2.type = s2, this.appSegments.push(a2), !h3 && (r2.multiSegment && o2.multiSegment ? (this.unfinishedMultiSegment = a2.chunkNumber < a2.chunkCount, this.unfinishedMultiSegment || c2.delete(s2)) : c2.delete(s2), 0 === c2.size))) break;
59439 f2.recordUnknownSegments && (a2 = re3.findPosition(l4, e3), a2.marker = i3, this.unknownSegments.push(a2)), e3 += n3 + 1;
59440 } else if (ae2(i3)) {
59441 if (n3 = l4.getUint16(e3 + 2), 218 === i3 && false !== f2.stopAfterSos) return;
59442 f2.recordJpegSegments && this.jpegSegments.push({ offset: e3, length: n3, marker: i3 }), e3 += n3 + 1;
59447 mergeMultiSegments() {
59448 if (!this.appSegments.some(((e4) => e4.multiSegment))) return;
59449 let e3 = (function(e4, t2) {
59450 let i3, n3, s2, r2 = /* @__PURE__ */ new Map();
59451 for (let a2 = 0; a2 < e4.length; a2++) i3 = e4[a2], n3 = i3[t2], r2.has(n3) ? s2 = r2.get(n3) : r2.set(n3, s2 = []), s2.push(i3);
59452 return Array.from(r2);
59453 })(this.appSegments, "type");
59454 this.mergedAppSegments = e3.map((([e4, t2]) => {
59455 let i3 = T.get(e4, this.options);
59456 if (i3.handleMultiSegments) {
59457 return { type: e4, chunk: i3.handleMultiSegments(t2) };
59463 return this.appSegments.find(((t2) => t2.type === e3));
59465 async getOrFindSegment(e3) {
59466 let t2 = this.getSegment(e3);
59467 return void 0 === t2 && (await this.findAppSegments(0, [e3]), t2 = this.getSegment(e3)), t2;
59470 c(he2, "type", "jpeg"), w2.set("jpeg", he2);
59471 ue2 = [void 0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4];
59472 ce2 = class extends re3 {
59474 var e3 = this.chunk.getUint16();
59475 18761 === e3 ? this.le = true : 19789 === e3 && (this.le = false), this.chunk.le = this.le, this.headerParsed = true;
59477 parseTags(e3, t2, i3 = /* @__PURE__ */ new Map()) {
59478 let { pick: n3, skip: s2 } = this.options[t2];
59480 let r2 = n3.size > 0, a2 = 0 === s2.size, o2 = this.chunk.getUint16(e3);
59482 for (let l4 = 0; l4 < o2; l4++) {
59483 let o3 = this.chunk.getUint16(e3);
59485 if (n3.has(o3) && (i3.set(o3, this.parseTag(e3, o3, t2)), n3.delete(o3), 0 === n3.size)) break;
59486 } else !a2 && s2.has(o3) || i3.set(o3, this.parseTag(e3, o3, t2));
59491 parseTag(e3, t2, i3) {
59492 let { chunk: n3 } = this, s2 = n3.getUint16(e3 + 2), r2 = n3.getUint32(e3 + 4), a2 = ue2[s2];
59493 if (a2 * r2 <= 4 ? e3 += 8 : e3 = n3.getUint32(e3 + 8), (s2 < 1 || s2 > 13) && g2(`Invalid TIFF value type. block: ${i3.toUpperCase()}, tag: ${t2.toString(16)}, type: ${s2}, offset ${e3}`), e3 > n3.byteLength && g2(`Invalid TIFF value offset. block: ${i3.toUpperCase()}, tag: ${t2.toString(16)}, type: ${s2}, offset ${e3} is outside of chunk size ${n3.byteLength}`), 1 === s2) return n3.getUint8Array(e3, r2);
59494 if (2 === s2) return m2(n3.getString(e3, r2));
59495 if (7 === s2) return n3.getUint8Array(e3, r2);
59496 if (1 === r2) return this.parseTagValue(s2, e3);
59498 let t3 = new ((function(e4) {
59503 return Uint16Array;
59505 return Uint32Array;
59517 return Float32Array;
59519 return Float64Array;
59523 })(s2))(r2), i4 = a2;
59524 for (let n4 = 0; n4 < r2; n4++) t3[n4] = this.parseTagValue(s2, e3), e3 += i4;
59528 parseTagValue(e3, t2) {
59529 let { chunk: i3 } = this;
59532 return i3.getUint8(t2);
59534 return i3.getUint16(t2);
59536 return i3.getUint32(t2);
59538 return i3.getUint32(t2) / i3.getUint32(t2 + 4);
59540 return i3.getInt8(t2);
59542 return i3.getInt16(t2);
59544 return i3.getInt32(t2);
59546 return i3.getInt32(t2) / i3.getInt32(t2 + 4);
59548 return i3.getFloat(t2);
59550 return i3.getDouble(t2);
59552 return i3.getUint32(t2);
59554 g2(`Invalid tiff type ${e3}`);
59558 fe2 = class extends ce2 {
59559 static canHandle(e3, t2) {
59560 return 225 === e3.getUint8(t2 + 1) && 1165519206 === e3.getUint32(t2 + 4) && 0 === e3.getUint16(t2 + 8);
59563 this.parseHeader();
59564 let { options: e3 } = this;
59565 return e3.ifd0.enabled && await this.parseIfd0Block(), e3.exif.enabled && await this.safeParse("parseExifBlock"), e3.gps.enabled && await this.safeParse("parseGpsBlock"), e3.interop.enabled && await this.safeParse("parseInteropBlock"), e3.ifd1.enabled && await this.safeParse("parseThumbnailBlock"), this.createOutput();
59568 let t2 = this[e3]();
59569 return void 0 !== t2.catch && (t2 = t2.catch(this.handleError)), t2;
59572 void 0 === this.ifd0Offset && (this.ifd0Offset = this.chunk.getUint32(4));
59575 if (void 0 === this.ifd1Offset) {
59576 this.findIfd0Offset();
59577 let e3 = this.chunk.getUint16(this.ifd0Offset), t2 = this.ifd0Offset + 2 + 12 * e3;
59578 this.ifd1Offset = this.chunk.getUint32(t2);
59581 parseBlock(e3, t2) {
59582 let i3 = /* @__PURE__ */ new Map();
59583 return this[t2] = i3, this.parseTags(e3, t2, i3), i3;
59585 async parseIfd0Block() {
59586 if (this.ifd0) return;
59587 let { file: e3 } = this;
59588 this.findIfd0Offset(), this.ifd0Offset < 8 && g2("Malformed EXIF data"), !e3.chunked && this.ifd0Offset > e3.byteLength && g2(`IFD0 offset points to outside of file.
59589 this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e3.byteLength}`), e3.tiff && await e3.ensureChunk(this.ifd0Offset, S2(this.options));
59590 let t2 = this.parseBlock(this.ifd0Offset, "ifd0");
59591 return 0 !== t2.size ? (this.exifOffset = t2.get(34665), this.interopOffset = t2.get(40965), this.gpsOffset = t2.get(34853), this.xmp = t2.get(700), this.iptc = t2.get(33723), this.icc = t2.get(34675), this.options.sanitize && (t2.delete(34665), t2.delete(40965), t2.delete(34853), t2.delete(700), t2.delete(33723), t2.delete(34675)), t2) : void 0;
59593 async parseExifBlock() {
59594 if (this.exif) return;
59595 if (this.ifd0 || await this.parseIfd0Block(), void 0 === this.exifOffset) return;
59596 this.file.tiff && await this.file.ensureChunk(this.exifOffset, S2(this.options));
59597 let e3 = this.parseBlock(this.exifOffset, "exif");
59598 return this.interopOffset || (this.interopOffset = e3.get(40965)), this.makerNote = e3.get(37500), this.userComment = e3.get(37510), this.options.sanitize && (e3.delete(40965), e3.delete(37500), e3.delete(37510)), this.unpack(e3, 41728), this.unpack(e3, 41729), e3;
59601 let i3 = e3.get(t2);
59602 i3 && 1 === i3.length && e3.set(t2, i3[0]);
59604 async parseGpsBlock() {
59605 if (this.gps) return;
59606 if (this.ifd0 || await this.parseIfd0Block(), void 0 === this.gpsOffset) return;
59607 let e3 = this.parseBlock(this.gpsOffset, "gps");
59608 return e3 && e3.has(2) && e3.has(4) && (e3.set("latitude", de2(...e3.get(2), e3.get(1))), e3.set("longitude", de2(...e3.get(4), e3.get(3)))), e3;
59610 async parseInteropBlock() {
59611 if (!this.interop && (this.ifd0 || await this.parseIfd0Block(), void 0 !== this.interopOffset || this.exif || await this.parseExifBlock(), void 0 !== this.interopOffset)) return this.parseBlock(this.interopOffset, "interop");
59613 async parseThumbnailBlock(e3 = false) {
59614 if (!this.ifd1 && !this.ifd1Parsed && (!this.options.mergeOutput || e3)) return this.findIfd1Offset(), this.ifd1Offset > 0 && (this.parseBlock(this.ifd1Offset, "ifd1"), this.ifd1Parsed = true), this.ifd1;
59616 async extractThumbnail() {
59617 if (this.headerParsed || this.parseHeader(), this.ifd1Parsed || await this.parseThumbnailBlock(true), void 0 === this.ifd1) return;
59618 let e3 = this.ifd1.get(513), t2 = this.ifd1.get(514);
59619 return this.chunk.getUint8Array(e3, t2);
59628 let e3, t2, i3, n3 = {};
59629 for (t2 of H2) if (e3 = this[t2], !p(e3)) if (i3 = this.canTranslate ? this.translateBlock(e3, t2) : Object.fromEntries(e3), this.options.mergeOutput) {
59630 if ("ifd1" === t2) continue;
59631 Object.assign(n3, i3);
59632 } else n3[t2] = i3;
59633 return this.makerNote && (n3.makerNote = this.makerNote), this.userComment && (n3.userComment = this.userComment), n3;
59635 assignToOutput(e3, t2) {
59636 if (this.globalOptions.mergeOutput) Object.assign(e3, t2);
59637 else for (let [i3, n3] of Object.entries(t2)) this.assignObjectToOutput(e3, i3, n3);
59640 c(fe2, "type", "tiff"), c(fe2, "headerLength", 10), T.set("tiff", fe2);
59641 pe2 = Object.freeze({ __proto__: null, default: ne, Exifr: te, fileParsers: w2, segmentParsers: T, fileReaders: A, tagKeys: E2, tagValues: B2, tagRevivers: N2, createDictionary: U2, extendDictionary: F2, fetchUrlAsArrayBuffer: M2, readBlobAsArrayBuffer: R2, chunkedProps: G, otherSegments: V2, segments: z2, tiffBlocks: H2, segmentsAndBlocks: j2, tiffExtractables: W2, inheritables: K2, allFormatters: X3, Options: q2, parse: ie2 });
59642 ge2 = { ifd0: false, ifd1: false, exif: false, gps: false, interop: false, sanitize: false, reviveValues: true, translateKeys: false, translateValues: false, mergeOutput: false };
59643 me = Object.assign({}, ge2, { firstChunkSize: 4e4, gps: [1, 2, 3, 4] });
59644 Ce2 = Object.assign({}, ge2, { tiff: false, ifd1: true, mergeOutput: false });
59645 Ie2 = Object.assign({}, ge2, { firstChunkSize: 4e4, ifd0: [274] });
59646 ke2 = Object.freeze({ 1: { dimensionSwapped: false, scaleX: 1, scaleY: 1, deg: 0, rad: 0 }, 2: { dimensionSwapped: false, scaleX: -1, scaleY: 1, deg: 0, rad: 0 }, 3: { dimensionSwapped: false, scaleX: 1, scaleY: 1, deg: 180, rad: 180 * Math.PI / 180 }, 4: { dimensionSwapped: false, scaleX: -1, scaleY: 1, deg: 180, rad: 180 * Math.PI / 180 }, 5: { dimensionSwapped: true, scaleX: 1, scaleY: -1, deg: 90, rad: 90 * Math.PI / 180 }, 6: { dimensionSwapped: true, scaleX: 1, scaleY: 1, deg: 90, rad: 90 * Math.PI / 180 }, 7: { dimensionSwapped: true, scaleX: 1, scaleY: -1, deg: 270, rad: 270 * Math.PI / 180 }, 8: { dimensionSwapped: true, scaleX: 1, scaleY: 1, deg: 270, rad: 270 * Math.PI / 180 } });
59649 if ("object" == typeof navigator) {
59650 let e3 = navigator.userAgent;
59651 if (e3.includes("iPad") || e3.includes("iPhone")) {
59652 let t2 = e3.match(/OS (\d+)_(\d+)/);
59654 let [, e4, i3] = t2, n3 = Number(e4) + 0.1 * Number(i3);
59655 we2 = n3 < 13.4, Te2 = false;
59657 } else if (e3.includes("OS X 10")) {
59658 let [, t2] = e3.match(/OS X 10[_.](\d+)/);
59659 we2 = Te2 = Number(t2) < 15;
59661 if (e3.includes("Chrome/")) {
59662 let [, t2] = e3.match(/Chrome\/(\d+)/);
59663 we2 = Te2 = Number(t2) < 81;
59664 } else if (e3.includes("Firefox/")) {
59665 let [, t2] = e3.match(/Firefox\/(\d+)/);
59666 we2 = Te2 = Number(t2) < 77;
59669 De2 = class extends I2 {
59670 constructor(...e3) {
59671 super(...e3), c(this, "ranges", new Oe2()), 0 !== this.byteLength && this.ranges.add(0, this.byteLength);
59673 _tryExtend(e3, t2, i3) {
59674 if (0 === e3 && 0 === this.byteLength && i3) {
59675 let e4 = new DataView(i3.buffer || i3, i3.byteOffset, i3.byteLength);
59676 this._swapDataView(e4);
59679 if (i4 > this.byteLength) {
59680 let { dataView: e4 } = this._extend(i4);
59681 this._swapDataView(e4);
59687 t2 = a ? s.allocUnsafe(e3) : new Uint8Array(e3);
59688 let i3 = new DataView(t2.buffer, t2.byteOffset, t2.byteLength);
59689 return t2.set(new Uint8Array(this.buffer, this.byteOffset, this.byteLength), 0), { uintView: t2, dataView: i3 };
59691 subarray(e3, t2, i3 = false) {
59692 return t2 = t2 || this._lengthToEnd(e3), i3 && this._tryExtend(e3, t2), this.ranges.add(e3, t2), super.subarray(e3, t2);
59694 set(e3, t2, i3 = false) {
59695 i3 && this._tryExtend(t2, e3.byteLength, e3);
59696 let n3 = super.set(e3, t2);
59697 return this.ranges.add(t2, n3.byteLength), n3;
59699 async ensureChunk(e3, t2) {
59700 this.chunked && (this.ranges.available(e3, t2) || await this.readChunk(e3, t2));
59702 available(e3, t2) {
59703 return this.ranges.available(e3, t2);
59708 c(this, "list", []);
59711 return this.list.length;
59713 add(e3, t2, i3 = 0) {
59714 let n3 = e3 + t2, s2 = this.list.filter(((t3) => xe2(e3, t3.offset, n3) || xe2(e3, t3.end, n3)));
59715 if (s2.length > 0) {
59716 e3 = Math.min(e3, ...s2.map(((e4) => e4.offset))), n3 = Math.max(n3, ...s2.map(((e4) => e4.end))), t2 = n3 - e3;
59717 let i4 = s2.shift();
59718 i4.offset = e3, i4.length = t2, i4.end = n3, this.list = this.list.filter(((e4) => !s2.includes(e4)));
59719 } else this.list.push({ offset: e3, length: t2, end: n3 });
59721 available(e3, t2) {
59723 return this.list.some(((t3) => t3.offset <= e3 && i3 <= t3.end));
59726 ve2 = class extends De2 {
59727 constructor(e3, t2) {
59728 super(0), c(this, "chunksRead", 0), this.input = e3, this.options = t2;
59730 async readWhole() {
59731 this.chunked = false, await this.readChunk(this.nextChunkOffset);
59733 async readChunked() {
59734 this.chunked = true, await this.readChunk(0, this.options.firstChunkSize);
59736 async readNextChunk(e3 = this.nextChunkOffset) {
59737 if (this.fullyRead) return this.chunksRead++, false;
59738 let t2 = this.options.chunkSize, i3 = await this.readChunk(e3, t2);
59739 return !!i3 && i3.byteLength === t2;
59741 async readChunk(e3, t2) {
59742 if (this.chunksRead++, 0 !== (t2 = this.safeWrapAddress(e3, t2))) return this._readChunk(e3, t2);
59744 safeWrapAddress(e3, t2) {
59745 return void 0 !== this.size && e3 + t2 > this.size ? Math.max(0, this.size - e3) : t2;
59747 get nextChunkOffset() {
59748 if (0 !== this.ranges.list.length) return this.ranges.list[0].length;
59750 get canReadNextChunk() {
59751 return this.chunksRead < this.options.chunkLimit;
59754 return void 0 !== this.size && this.nextChunkOffset === this.size;
59757 return this.options.chunked ? this.readChunked() : this.readWhole();
59762 A.set("blob", class extends ve2 {
59763 async readWhole() {
59764 this.chunked = false;
59765 let e3 = await R2(this.input);
59766 this._swapArrayBuffer(e3);
59769 return this.chunked = true, this.size = this.input.size, super.readChunked();
59771 async _readChunk(e3, t2) {
59772 let i3 = t2 ? e3 + t2 : void 0, n3 = this.input.slice(e3, i3), s2 = await R2(n3);
59773 return this.set(s2, e3, true);
59776 Me2 = Object.freeze({ __proto__: null, default: pe2, Exifr: te, fileParsers: w2, segmentParsers: T, fileReaders: A, tagKeys: E2, tagValues: B2, tagRevivers: N2, createDictionary: U2, extendDictionary: F2, fetchUrlAsArrayBuffer: M2, readBlobAsArrayBuffer: R2, chunkedProps: G, otherSegments: V2, segments: z2, tiffBlocks: H2, segmentsAndBlocks: j2, tiffExtractables: W2, inheritables: K2, allFormatters: X3, Options: q2, parse: ie2, gpsOnlyOptions: me, gps: Se2, thumbnailOnlyOptions: Ce2, thumbnail: ye2, thumbnailUrl: be2, orientationOnlyOptions: Ie2, orientation: Pe2, rotations: ke2, get rotateCanvas() {
59778 }, get rotateCss() {
59780 }, rotation: Ae2 });
59781 A.set("url", class extends ve2 {
59782 async readWhole() {
59783 this.chunked = false;
59784 let e3 = await M2(this.input);
59785 e3 instanceof ArrayBuffer ? this._swapArrayBuffer(e3) : e3 instanceof Uint8Array && this._swapBuffer(e3);
59787 async _readChunk(e3, t2) {
59788 let i3 = t2 ? e3 + t2 - 1 : void 0, n3 = this.options.httpHeaders || {};
59789 (e3 || i3) && (n3.range = `bytes=${[e3, i3].join("-")}`);
59790 let s2 = await h2(this.input, { headers: n3 }), r2 = await s2.arrayBuffer(), a2 = r2.byteLength;
59791 if (416 !== s2.status) return a2 !== t2 && (this.size = e3 + a2), this.set(r2, e3, true);
59794 I2.prototype.getUint64 = function(e3) {
59795 let t2 = this.getUint32(e3), i3 = this.getUint32(e3 + 4);
59796 return t2 < 1048575 ? t2 << 32 | i3 : void 0 !== typeof r ? (console.warn("Using BigInt because of type 64uint but JS can only handle 53b numbers."), r(t2) << r(32) | r(i3)) : void g2("Trying to read 64b value but JS can only handle 53b numbers.");
59798 Re2 = class extends se2 {
59799 parseBoxes(e3 = 0) {
59801 for (; e3 < this.file.byteLength - 4; ) {
59802 let i3 = this.parseBoxHead(e3);
59803 if (t2.push(i3), 0 === i3.length) break;
59808 parseSubBoxes(e3) {
59809 e3.boxes = this.parseBoxes(e3.start);
59812 return void 0 === e3.boxes && this.parseSubBoxes(e3), e3.boxes.find(((e4) => e4.kind === t2));
59815 let t2 = this.file.getUint32(e3), i3 = this.file.getString(e3 + 4, 4), n3 = e3 + 8;
59816 return 1 === t2 && (t2 = this.file.getUint64(e3 + 8), n3 += 8), { offset: e3, length: t2, kind: i3, start: n3 };
59818 parseBoxFullHead(e3) {
59819 if (void 0 !== e3.version) return;
59820 let t2 = this.file.getUint32(e3.start);
59821 e3.version = t2 >> 24, e3.start += 4;
59824 Le2 = class extends Re2 {
59825 static canHandle(e3, t2) {
59826 if (0 !== t2) return false;
59827 let i3 = e3.getUint16(2);
59828 if (i3 > 50) return false;
59829 let n3 = 16, s2 = [];
59830 for (; n3 < i3; ) s2.push(e3.getString(n3, 4)), n3 += 4;
59831 return s2.includes(this.type);
59834 let e3 = this.file.getUint32(0), t2 = this.parseBoxHead(e3);
59835 for (; "meta" !== t2.kind; ) e3 += t2.length, await this.file.ensureChunk(e3, 16), t2 = this.parseBoxHead(e3);
59836 await this.file.ensureChunk(t2.offset, t2.length), this.parseBoxFullHead(t2), this.parseSubBoxes(t2), this.options.icc.enabled && await this.findIcc(t2), this.options.tiff.enabled && await this.findExif(t2);
59838 async registerSegment(e3, t2, i3) {
59839 await this.file.ensureChunk(t2, i3);
59840 let n3 = this.file.subarray(t2, i3);
59841 this.createParser(e3, n3);
59843 async findIcc(e3) {
59844 let t2 = this.findBox(e3, "iprp");
59845 if (void 0 === t2) return;
59846 let i3 = this.findBox(t2, "ipco");
59847 if (void 0 === i3) return;
59848 let n3 = this.findBox(i3, "colr");
59849 void 0 !== n3 && await this.registerSegment("icc", n3.offset + 12, n3.length);
59851 async findExif(e3) {
59852 let t2 = this.findBox(e3, "iinf");
59853 if (void 0 === t2) return;
59854 let i3 = this.findBox(e3, "iloc");
59855 if (void 0 === i3) return;
59856 let n3 = this.findExifLocIdInIinf(t2), s2 = this.findExtentInIloc(i3, n3);
59857 if (void 0 === s2) return;
59859 await this.file.ensureChunk(r2, a2);
59860 let o2 = 4 + this.file.getUint32(r2);
59861 r2 += o2, a2 -= o2, await this.registerSegment("tiff", r2, a2);
59863 findExifLocIdInIinf(e3) {
59864 this.parseBoxFullHead(e3);
59865 let t2, i3, n3, s2, r2 = e3.start, a2 = this.file.getUint16(r2);
59866 for (r2 += 2; a2--; ) {
59867 if (t2 = this.parseBoxHead(r2), this.parseBoxFullHead(t2), i3 = t2.start, t2.version >= 2 && (n3 = 3 === t2.version ? 4 : 2, s2 = this.file.getString(i3 + n3 + 2, 4), "Exif" === s2)) return this.file.getUintBytes(i3, n3);
59872 let t2 = this.file.getUint8(e3);
59873 return [t2 >> 4, 15 & t2];
59875 findExtentInIloc(e3, t2) {
59876 this.parseBoxFullHead(e3);
59877 let i3 = e3.start, [n3, s2] = this.get8bits(i3++), [r2, a2] = this.get8bits(i3++), o2 = 2 === e3.version ? 4 : 2, l4 = 1 === e3.version || 2 === e3.version ? 2 : 0, h3 = a2 + n3 + s2, u2 = 2 === e3.version ? 4 : 2, c2 = this.file.getUintBytes(i3, u2);
59878 for (i3 += u2; c2--; ) {
59879 let e4 = this.file.getUintBytes(i3, o2);
59880 i3 += o2 + l4 + 2 + r2;
59881 let u3 = this.file.getUint16(i3);
59882 if (i3 += 2, e4 === t2) return u3 > 1 && console.warn("ILOC box has more than one extent but we're only processing one\nPlease create an issue at https://github.com/MikeKovarik/exifr with this file"), [this.file.getUintBytes(i3 + a2, n3), this.file.getUintBytes(i3 + a2 + n3, s2)];
59887 Ue2 = class extends Le2 {
59889 c(Ue2, "type", "heic");
59890 Fe2 = class extends Le2 {
59892 c(Fe2, "type", "avif"), w2.set("heic", Ue2), w2.set("avif", Fe2), U2(E2, ["ifd0", "ifd1"], [[256, "ImageWidth"], [257, "ImageHeight"], [258, "BitsPerSample"], [259, "Compression"], [262, "PhotometricInterpretation"], [270, "ImageDescription"], [271, "Make"], [272, "Model"], [273, "StripOffsets"], [274, "Orientation"], [277, "SamplesPerPixel"], [278, "RowsPerStrip"], [279, "StripByteCounts"], [282, "XResolution"], [283, "YResolution"], [284, "PlanarConfiguration"], [296, "ResolutionUnit"], [301, "TransferFunction"], [305, "Software"], [306, "ModifyDate"], [315, "Artist"], [316, "HostComputer"], [317, "Predictor"], [318, "WhitePoint"], [319, "PrimaryChromaticities"], [513, "ThumbnailOffset"], [514, "ThumbnailLength"], [529, "YCbCrCoefficients"], [530, "YCbCrSubSampling"], [531, "YCbCrPositioning"], [532, "ReferenceBlackWhite"], [700, "ApplicationNotes"], [33432, "Copyright"], [33723, "IPTC"], [34665, "ExifIFD"], [34675, "ICC"], [34853, "GpsIFD"], [330, "SubIFD"], [40965, "InteropIFD"], [40091, "XPTitle"], [40092, "XPComment"], [40093, "XPAuthor"], [40094, "XPKeywords"], [40095, "XPSubject"]]), U2(E2, "exif", [[33434, "ExposureTime"], [33437, "FNumber"], [34850, "ExposureProgram"], [34852, "SpectralSensitivity"], [34855, "ISO"], [34858, "TimeZoneOffset"], [34859, "SelfTimerMode"], [34864, "SensitivityType"], [34865, "StandardOutputSensitivity"], [34866, "RecommendedExposureIndex"], [34867, "ISOSpeed"], [34868, "ISOSpeedLatitudeyyy"], [34869, "ISOSpeedLatitudezzz"], [36864, "ExifVersion"], [36867, "DateTimeOriginal"], [36868, "CreateDate"], [36873, "GooglePlusUploadCode"], [36880, "OffsetTime"], [36881, "OffsetTimeOriginal"], [36882, "OffsetTimeDigitized"], [37121, "ComponentsConfiguration"], [37122, "CompressedBitsPerPixel"], [37377, "ShutterSpeedValue"], [37378, "ApertureValue"], [37379, "BrightnessValue"], [37380, "ExposureCompensation"], [37381, "MaxApertureValue"], [37382, "SubjectDistance"], [37383, "MeteringMode"], [37384, "LightSource"], [37385, "Flash"], [37386, "FocalLength"], [37393, "ImageNumber"], [37394, "SecurityClassification"], [37395, "ImageHistory"], [37396, "SubjectArea"], [37500, "MakerNote"], [37510, "UserComment"], [37520, "SubSecTime"], [37521, "SubSecTimeOriginal"], [37522, "SubSecTimeDigitized"], [37888, "AmbientTemperature"], [37889, "Humidity"], [37890, "Pressure"], [37891, "WaterDepth"], [37892, "Acceleration"], [37893, "CameraElevationAngle"], [40960, "FlashpixVersion"], [40961, "ColorSpace"], [40962, "ExifImageWidth"], [40963, "ExifImageHeight"], [40964, "RelatedSoundFile"], [41483, "FlashEnergy"], [41486, "FocalPlaneXResolution"], [41487, "FocalPlaneYResolution"], [41488, "FocalPlaneResolutionUnit"], [41492, "SubjectLocation"], [41493, "ExposureIndex"], [41495, "SensingMethod"], [41728, "FileSource"], [41729, "SceneType"], [41730, "CFAPattern"], [41985, "CustomRendered"], [41986, "ExposureMode"], [41987, "WhiteBalance"], [41988, "DigitalZoomRatio"], [41989, "FocalLengthIn35mmFormat"], [41990, "SceneCaptureType"], [41991, "GainControl"], [41992, "Contrast"], [41993, "Saturation"], [41994, "Sharpness"], [41996, "SubjectDistanceRange"], [42016, "ImageUniqueID"], [42032, "OwnerName"], [42033, "SerialNumber"], [42034, "LensInfo"], [42035, "LensMake"], [42036, "LensModel"], [42037, "LensSerialNumber"], [42080, "CompositeImage"], [42081, "CompositeImageCount"], [42082, "CompositeImageExposureTimes"], [42240, "Gamma"], [59932, "Padding"], [59933, "OffsetSchema"], [65e3, "OwnerName"], [65001, "SerialNumber"], [65002, "Lens"], [65100, "RawFile"], [65101, "Converter"], [65102, "WhiteBalance"], [65105, "Exposure"], [65106, "Shadows"], [65107, "Brightness"], [65108, "Contrast"], [65109, "Saturation"], [65110, "Sharpness"], [65111, "Smoothness"], [65112, "MoireFilter"], [40965, "InteropIFD"]]), U2(E2, "gps", [[0, "GPSVersionID"], [1, "GPSLatitudeRef"], [2, "GPSLatitude"], [3, "GPSLongitudeRef"], [4, "GPSLongitude"], [5, "GPSAltitudeRef"], [6, "GPSAltitude"], [7, "GPSTimeStamp"], [8, "GPSSatellites"], [9, "GPSStatus"], [10, "GPSMeasureMode"], [11, "GPSDOP"], [12, "GPSSpeedRef"], [13, "GPSSpeed"], [14, "GPSTrackRef"], [15, "GPSTrack"], [16, "GPSImgDirectionRef"], [17, "GPSImgDirection"], [18, "GPSMapDatum"], [19, "GPSDestLatitudeRef"], [20, "GPSDestLatitude"], [21, "GPSDestLongitudeRef"], [22, "GPSDestLongitude"], [23, "GPSDestBearingRef"], [24, "GPSDestBearing"], [25, "GPSDestDistanceRef"], [26, "GPSDestDistance"], [27, "GPSProcessingMethod"], [28, "GPSAreaInformation"], [29, "GPSDateStamp"], [30, "GPSDifferential"], [31, "GPSHPositioningError"]]), U2(B2, ["ifd0", "ifd1"], [[274, { 1: "Horizontal (normal)", 2: "Mirror horizontal", 3: "Rotate 180", 4: "Mirror vertical", 5: "Mirror horizontal and rotate 270 CW", 6: "Rotate 90 CW", 7: "Mirror horizontal and rotate 90 CW", 8: "Rotate 270 CW" }], [296, { 1: "None", 2: "inches", 3: "cm" }]]);
59893 Ee2 = U2(B2, "exif", [[34850, { 0: "Not defined", 1: "Manual", 2: "Normal program", 3: "Aperture priority", 4: "Shutter priority", 5: "Creative program", 6: "Action program", 7: "Portrait mode", 8: "Landscape mode" }], [37121, { 0: "-", 1: "Y", 2: "Cb", 3: "Cr", 4: "R", 5: "G", 6: "B" }], [37383, { 0: "Unknown", 1: "Average", 2: "CenterWeightedAverage", 3: "Spot", 4: "MultiSpot", 5: "Pattern", 6: "Partial", 255: "Other" }], [37384, { 0: "Unknown", 1: "Daylight", 2: "Fluorescent", 3: "Tungsten (incandescent light)", 4: "Flash", 9: "Fine weather", 10: "Cloudy weather", 11: "Shade", 12: "Daylight fluorescent (D 5700 - 7100K)", 13: "Day white fluorescent (N 4600 - 5400K)", 14: "Cool white fluorescent (W 3900 - 4500K)", 15: "White fluorescent (WW 3200 - 3700K)", 17: "Standard light A", 18: "Standard light B", 19: "Standard light C", 20: "D55", 21: "D65", 22: "D75", 23: "D50", 24: "ISO studio tungsten", 255: "Other" }], [37385, { 0: "Flash did not fire", 1: "Flash fired", 5: "Strobe return light not detected", 7: "Strobe return light detected", 9: "Flash fired, compulsory flash mode", 13: "Flash fired, compulsory flash mode, return light not detected", 15: "Flash fired, compulsory flash mode, return light detected", 16: "Flash did not fire, compulsory flash mode", 24: "Flash did not fire, auto mode", 25: "Flash fired, auto mode", 29: "Flash fired, auto mode, return light not detected", 31: "Flash fired, auto mode, return light detected", 32: "No flash function", 65: "Flash fired, red-eye reduction mode", 69: "Flash fired, red-eye reduction mode, return light not detected", 71: "Flash fired, red-eye reduction mode, return light detected", 73: "Flash fired, compulsory flash mode, red-eye reduction mode", 77: "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected", 79: "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected", 89: "Flash fired, auto mode, red-eye reduction mode", 93: "Flash fired, auto mode, return light not detected, red-eye reduction mode", 95: "Flash fired, auto mode, return light detected, red-eye reduction mode" }], [41495, { 1: "Not defined", 2: "One-chip color area sensor", 3: "Two-chip color area sensor", 4: "Three-chip color area sensor", 5: "Color sequential area sensor", 7: "Trilinear sensor", 8: "Color sequential linear sensor" }], [41728, { 1: "Film Scanner", 2: "Reflection Print Scanner", 3: "Digital Camera" }], [41729, { 1: "Directly photographed" }], [41985, { 0: "Normal", 1: "Custom", 2: "HDR (no original saved)", 3: "HDR (original saved)", 4: "Original (for HDR)", 6: "Panorama", 7: "Portrait HDR", 8: "Portrait" }], [41986, { 0: "Auto", 1: "Manual", 2: "Auto bracket" }], [41987, { 0: "Auto", 1: "Manual" }], [41990, { 0: "Standard", 1: "Landscape", 2: "Portrait", 3: "Night", 4: "Other" }], [41991, { 0: "None", 1: "Low gain up", 2: "High gain up", 3: "Low gain down", 4: "High gain down" }], [41996, { 0: "Unknown", 1: "Macro", 2: "Close", 3: "Distant" }], [42080, { 0: "Unknown", 1: "Not a Composite Image", 2: "General Composite Image", 3: "Composite Image Captured While Shooting" }]]);
59894 Be2 = { 1: "No absolute unit of measurement", 2: "Inch", 3: "Centimeter" };
59895 Ee2.set(37392, Be2), Ee2.set(41488, Be2);
59896 Ne2 = { 0: "Normal", 1: "Low", 2: "High" };
59897 Ee2.set(41992, Ne2), Ee2.set(41993, Ne2), Ee2.set(41994, Ne2), U2(N2, ["ifd0", "ifd1"], [[50827, function(e3) {
59898 return "string" != typeof e3 ? b2(e3) : e3;
59899 }], [306, ze2], [40091, He2], [40092, He2], [40093, He2], [40094, He2], [40095, He2]]), U2(N2, "exif", [[40960, Ve], [36864, Ve], [36867, ze2], [36868, ze2], [40962, Ge2], [40963, Ge2]]), U2(N2, "gps", [[0, (e3) => Array.from(e3).join(".")], [7, (e3) => Array.from(e3).join(":")]]);
59900 We2 = class extends re3 {
59901 static canHandle(e3, t2) {
59902 return 225 === e3.getUint8(t2 + 1) && 1752462448 === e3.getUint32(t2 + 4) && "http://ns.adobe.com/" === e3.getString(t2 + 4, "http://ns.adobe.com/".length);
59904 static headerLength(e3, t2) {
59905 return "http://ns.adobe.com/xmp/extension/" === e3.getString(t2 + 4, "http://ns.adobe.com/xmp/extension/".length) ? 79 : 4 + "http://ns.adobe.com/xap/1.0/".length + 1;
59907 static findPosition(e3, t2) {
59908 let i3 = super.findPosition(e3, t2);
59909 return i3.multiSegment = i3.extended = 79 === i3.headerLength, i3.multiSegment ? (i3.chunkCount = e3.getUint8(t2 + 72), i3.chunkNumber = e3.getUint8(t2 + 76), 0 !== e3.getUint8(t2 + 77) && i3.chunkNumber++) : (i3.chunkCount = 1 / 0, i3.chunkNumber = -1), i3;
59911 static handleMultiSegments(e3) {
59912 return e3.map(((e4) => e4.chunk.getString())).join("");
59914 normalizeInput(e3) {
59915 return "string" == typeof e3 ? e3 : I2.from(e3).getString();
59917 parse(e3 = this.chunk) {
59918 if (!this.localOptions.parse) return e3;
59919 e3 = (function(e4) {
59920 let t3 = {}, i4 = {};
59921 for (let e6 of Ze2) t3[e6] = [], i4[e6] = 0;
59922 return e4.replace(et, ((e6, n4, s2) => {
59925 return t3[s2].push(n5), `${e6}#${n5}`;
59927 return `${e6}#${t3[s2].pop()}`;
59930 let t2 = Xe2.findAll(e3, "rdf", "Description");
59931 0 === t2.length && t2.push(new Xe2("rdf", "Description", void 0, e3));
59933 for (let e4 of t2) for (let t3 of e4.properties) i3 = Je2(t3.ns, n3), _e2(t3, i3);
59934 return (function(e4) {
59936 for (let i4 in e4) t3 = e4[i4] = f(e4[i4]), void 0 === t3 && delete e4[i4];
59940 assignToOutput(e3, t2) {
59941 if (this.localOptions.parse) for (let [i3, n3] of Object.entries(t2)) switch (i3) {
59943 this.assignObjectToOutput(e3, "ifd0", n3);
59946 this.assignObjectToOutput(e3, "exif", n3);
59951 this.assignObjectToOutput(e3, i3, n3);
59956 c(We2, "type", "xmp"), c(We2, "multiSegment", true), T.set("xmp", We2);
59958 static findAll(e3) {
59959 return qe2(e3, /([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(_Ke.unpackMatch);
59961 static unpackMatch(e3) {
59962 let t2 = e3[1], i3 = e3[2], n3 = e3[3].slice(1, -1);
59963 return n3 = Qe2(n3), new _Ke(t2, i3, n3);
59965 constructor(e3, t2, i3) {
59966 this.ns = e3, this.name = t2, this.value = i3;
59973 static findAll(e3, t2, i3) {
59974 if (void 0 !== t2 || void 0 !== i3) {
59975 t2 = t2 || "[\\w\\d-]+", i3 = i3 || "[\\w\\d-]+";
59976 var n3 = new RegExp(`<(${t2}):(${i3})(#\\d+)?((\\s+?[\\w\\d-:]+=("[^"]*"|'[^']*'))*\\s*)(\\/>|>([\\s\\S]*?)<\\/\\1:\\2\\3>)`, "gm");
59977 } else n3 = /<([\w\d-]+):([\w\d-]+)(#\d+)?((\s+?[\w\d-:]+=("[^"]*"|'[^']*'))*\s*)(\/>|>([\s\S]*?)<\/\1:\2\3>)/gm;
59978 return qe2(e3, n3).map(_Xe.unpackMatch);
59980 static unpackMatch(e3) {
59981 let t2 = e3[1], i3 = e3[2], n3 = e3[4], s2 = e3[8];
59982 return new _Xe(t2, i3, n3, s2);
59984 constructor(e3, t2, i3, n3) {
59985 this.ns = e3, this.name = t2, this.attrString = i3, this.innerXml = n3, this.attrs = Ke2.findAll(i3), this.children = _Xe.findAll(n3), this.value = 0 === this.children.length ? Qe2(n3) : void 0, this.properties = [...this.attrs, ...this.children];
59987 get isPrimitive() {
59988 return void 0 !== this.value && 0 === this.attrs.length && 0 === this.children.length;
59990 get isListContainer() {
59991 return 1 === this.children.length && this.children[0].isList;
59994 let { ns: e3, name: t2 } = this;
59995 return "rdf" === e3 && ("Seq" === t2 || "Bag" === t2 || "Alt" === t2);
59998 return "rdf" === this.ns && "li" === this.name;
60001 if (0 === this.properties.length && void 0 === this.value) return;
60002 if (this.isPrimitive) return this.value;
60003 if (this.isListContainer) return this.children[0].serialize();
60004 if (this.isList) return $e2(this.children.map(Ye));
60005 if (this.isListItem && 1 === this.children.length && 0 === this.attrs.length) return this.children[0].serialize();
60007 for (let t2 of this.properties) _e2(t2, e3);
60008 return void 0 !== this.value && (e3.value = this.value), f(e3);
60011 Ye = (e3) => e3.serialize();
60012 $e2 = (e3) => 1 === e3.length ? e3[0] : e3;
60013 Je2 = (e3, t2) => t2[e3] ? t2[e3] : t2[e3] = {};
60014 Ze2 = ["rdf:li", "rdf:Seq", "rdf:Bag", "rdf:Alt", "rdf:Description"];
60015 et = new RegExp(`(<|\\/)(${Ze2.join("|")})`, "g");
60016 tt = Object.freeze({ __proto__: null, default: Me2, Exifr: te, fileParsers: w2, segmentParsers: T, fileReaders: A, tagKeys: E2, tagValues: B2, tagRevivers: N2, createDictionary: U2, extendDictionary: F2, fetchUrlAsArrayBuffer: M2, readBlobAsArrayBuffer: R2, chunkedProps: G, otherSegments: V2, segments: z2, tiffBlocks: H2, segmentsAndBlocks: j2, tiffExtractables: W2, inheritables: K2, allFormatters: X3, Options: q2, parse: ie2, gpsOnlyOptions: me, gps: Se2, thumbnailOnlyOptions: Ce2, thumbnail: ye2, thumbnailUrl: be2, orientationOnlyOptions: Ie2, orientation: Pe2, rotations: ke2, get rotateCanvas() {
60018 }, get rotateCss() {
60020 }, rotation: Ae2 });
60021 at = l3("fs", ((e3) => e3.promises));
60022 A.set("fs", class extends ve2 {
60023 async readWhole() {
60024 this.chunked = false, this.fs = await at;
60025 let e3 = await this.fs.readFile(this.input);
60026 this._swapBuffer(e3);
60028 async readChunked() {
60029 this.chunked = true, this.fs = await at, await this.open(), await this.readChunk(0, this.options.firstChunkSize);
60032 void 0 === this.fh && (this.fh = await this.fs.open(this.input, "r"), this.size = (await this.fh.stat(this.input)).size);
60034 async _readChunk(e3, t2) {
60035 void 0 === this.fh && await this.open(), e3 + t2 > this.size && (t2 = this.size - e3);
60036 var i3 = this.subarray(e3, t2, true);
60037 return await this.fh.read(i3.dataView, 0, t2, e3), i3;
60042 this.fh = void 0, await e3.close();
60046 A.set("base64", class extends ve2 {
60047 constructor(...e3) {
60048 super(...e3), this.input = this.input.replace(/^data:([^;]+);base64,/gim, ""), this.size = this.input.length / 4 * 3, this.input.endsWith("==") ? this.size -= 2 : this.input.endsWith("=") && (this.size -= 1);
60050 async _readChunk(e3, t2) {
60051 let i3, n3, r2 = this.input;
60052 void 0 === e3 ? (e3 = 0, i3 = 0, n3 = 0) : (i3 = 4 * Math.floor(e3 / 3), n3 = e3 - i3 / 4 * 3), void 0 === t2 && (t2 = this.size);
60053 let o2 = e3 + t2, l4 = i3 + 4 * Math.ceil(o2 / 3);
60054 r2 = r2.slice(i3, l4);
60055 let h3 = Math.min(t2, this.size - e3);
60057 let t3 = s.from(r2, "base64").slice(n3, n3 + h3);
60058 return this.set(t3, e3, true);
60061 let t3 = this.subarray(e3, h3, true), i4 = atob(r2), s2 = t3.toUint8();
60062 for (let e4 = 0; e4 < h3; e4++) s2[e4] = i4.charCodeAt(n3 + e4);
60067 ot = class extends se2 {
60068 static canHandle(e3, t2) {
60069 return 18761 === t2 || 19789 === t2;
60071 extendOptions(e3) {
60072 let { ifd0: t2, xmp: i3, iptc: n3, icc: s2 } = e3;
60073 i3.enabled && t2.deps.add(700), n3.enabled && t2.deps.add(33723), s2.enabled && t2.deps.add(34675), t2.finalizeFilters();
60076 let { tiff: e3, xmp: t2, iptc: i3, icc: n3 } = this.options;
60077 if (e3.enabled || t2.enabled || i3.enabled || n3.enabled) {
60078 let e4 = Math.max(S2(this.options), this.options.chunkSize);
60079 await this.file.ensureChunk(0, e4), this.createParser("tiff", this.file), this.parsers.tiff.parseHeader(), await this.parsers.tiff.parseIfd0Block(), this.adaptTiffPropAsSegment("xmp"), this.adaptTiffPropAsSegment("iptc"), this.adaptTiffPropAsSegment("icc");
60082 adaptTiffPropAsSegment(e3) {
60083 if (this.parsers.tiff[e3]) {
60084 let t2 = this.parsers.tiff[e3];
60085 this.injectSegment(e3, t2);
60089 c(ot, "type", "tiff"), w2.set("tiff", ot);
60091 ht = ["ihdr", "iccp", "text", "itxt", "exif"];
60092 ut = class extends se2 {
60093 constructor(...e3) {
60094 super(...e3), c(this, "catchError", ((e4) => this.errors.push(e4))), c(this, "metaChunks", []), c(this, "unknownChunks", []);
60096 static canHandle(e3, t2) {
60097 return 35152 === t2 && 2303741511 === e3.getUint32(0) && 218765834 === e3.getUint32(4);
60100 let { file: e3 } = this;
60101 await this.findPngChunksInRange("\x89PNG\r\n
\1a\n".length, e3.byteLength), await this.readSegments(this.metaChunks), this.findIhdr(), this.parseTextChunks(), await this.findExif().catch(this.catchError), await this.findXmp().catch(this.catchError), await this.findIcc().catch(this.catchError);
60103 async findPngChunksInRange(e3, t2) {
60104 let { file: i3 } = this;
60105 for (; e3 < t2; ) {
60106 let t3 = i3.getUint32(e3), n3 = i3.getUint32(e3 + 4), s2 = i3.getString(e3 + 4, 4).toLowerCase(), r2 = t3 + 4 + 4 + 4, a2 = { type: s2, offset: e3, length: r2, start: e3 + 4 + 4, size: t3, marker: n3 };
60107 ht.includes(s2) ? this.metaChunks.push(a2) : this.unknownChunks.push(a2), e3 += r2;
60110 parseTextChunks() {
60111 let e3 = this.metaChunks.filter(((e4) => "text" === e4.type));
60112 for (let t2 of e3) {
60113 let [e4, i3] = this.file.getString(t2.start, t2.size).split("\0");
60114 this.injectKeyValToIhdr(e4, i3);
60117 injectKeyValToIhdr(e3, t2) {
60118 let i3 = this.parsers.ihdr;
60119 i3 && i3.raw.set(e3, t2);
60122 let e3 = this.metaChunks.find(((e4) => "ihdr" === e4.type));
60123 e3 && false !== this.options.ihdr.enabled && this.createParser("ihdr", e3.chunk);
60126 let e3 = this.metaChunks.find(((e4) => "exif" === e4.type));
60127 e3 && this.injectSegment("tiff", e3.chunk);
60130 let e3 = this.metaChunks.filter(((e4) => "itxt" === e4.type));
60131 for (let t2 of e3) {
60132 "XML:com.adobe.xmp" === t2.chunk.getString(0, "XML:com.adobe.xmp".length) && this.injectSegment("xmp", t2.chunk);
60136 let e3 = this.metaChunks.find(((e4) => "iccp" === e4.type));
60138 let { chunk: t2 } = e3, i3 = t2.getUint8Array(0, 81), s2 = 0;
60139 for (; s2 < 80 && 0 !== i3[s2]; ) s2++;
60140 let r2 = s2 + 2, a2 = t2.getString(0, s2);
60141 if (this.injectKeyValToIhdr("ProfileName", a2), n2) {
60142 let e4 = await lt, i4 = t2.getUint8Array(r2);
60143 i4 = e4.inflateSync(i4), this.injectSegment("icc", i4);
60147 c(ut, "type", "png"), w2.set("png", ut), U2(E2, "interop", [[1, "InteropIndex"], [2, "InteropVersion"], [4096, "RelatedImageFileFormat"], [4097, "RelatedImageWidth"], [4098, "RelatedImageHeight"]]), F2(E2, "ifd0", [[11, "ProcessingSoftware"], [254, "SubfileType"], [255, "OldSubfileType"], [263, "Thresholding"], [264, "CellWidth"], [265, "CellLength"], [266, "FillOrder"], [269, "DocumentName"], [280, "MinSampleValue"], [281, "MaxSampleValue"], [285, "PageName"], [286, "XPosition"], [287, "YPosition"], [290, "GrayResponseUnit"], [297, "PageNumber"], [321, "HalftoneHints"], [322, "TileWidth"], [323, "TileLength"], [332, "InkSet"], [337, "TargetPrinter"], [18246, "Rating"], [18249, "RatingPercent"], [33550, "PixelScale"], [34264, "ModelTransform"], [34377, "PhotoshopSettings"], [50706, "DNGVersion"], [50707, "DNGBackwardVersion"], [50708, "UniqueCameraModel"], [50709, "LocalizedCameraModel"], [50736, "DNGLensInfo"], [50739, "ShadowScale"], [50740, "DNGPrivateData"], [33920, "IntergraphMatrix"], [33922, "ModelTiePoint"], [34118, "SEMInfo"], [34735, "GeoTiffDirectory"], [34736, "GeoTiffDoubleParams"], [34737, "GeoTiffAsciiParams"], [50341, "PrintIM"], [50721, "ColorMatrix1"], [50722, "ColorMatrix2"], [50723, "CameraCalibration1"], [50724, "CameraCalibration2"], [50725, "ReductionMatrix1"], [50726, "ReductionMatrix2"], [50727, "AnalogBalance"], [50728, "AsShotNeutral"], [50729, "AsShotWhiteXY"], [50730, "BaselineExposure"], [50731, "BaselineNoise"], [50732, "BaselineSharpness"], [50734, "LinearResponseLimit"], [50735, "CameraSerialNumber"], [50741, "MakerNoteSafety"], [50778, "CalibrationIlluminant1"], [50779, "CalibrationIlluminant2"], [50781, "RawDataUniqueID"], [50827, "OriginalRawFileName"], [50828, "OriginalRawFileData"], [50831, "AsShotICCProfile"], [50832, "AsShotPreProfileMatrix"], [50833, "CurrentICCProfile"], [50834, "CurrentPreProfileMatrix"], [50879, "ColorimetricReference"], [50885, "SRawType"], [50898, "PanasonicTitle"], [50899, "PanasonicTitle2"], [50931, "CameraCalibrationSig"], [50932, "ProfileCalibrationSig"], [50933, "ProfileIFD"], [50934, "AsShotProfileName"], [50936, "ProfileName"], [50937, "ProfileHueSatMapDims"], [50938, "ProfileHueSatMapData1"], [50939, "ProfileHueSatMapData2"], [50940, "ProfileToneCurve"], [50941, "ProfileEmbedPolicy"], [50942, "ProfileCopyright"], [50964, "ForwardMatrix1"], [50965, "ForwardMatrix2"], [50966, "PreviewApplicationName"], [50967, "PreviewApplicationVersion"], [50968, "PreviewSettingsName"], [50969, "PreviewSettingsDigest"], [50970, "PreviewColorSpace"], [50971, "PreviewDateTime"], [50972, "RawImageDigest"], [50973, "OriginalRawFileDigest"], [50981, "ProfileLookTableDims"], [50982, "ProfileLookTableData"], [51043, "TimeCodes"], [51044, "FrameRate"], [51058, "TStop"], [51081, "ReelName"], [51089, "OriginalDefaultFinalSize"], [51090, "OriginalBestQualitySize"], [51091, "OriginalDefaultCropSize"], [51105, "CameraLabel"], [51107, "ProfileHueSatMapEncoding"], [51108, "ProfileLookTableEncoding"], [51109, "BaselineExposureOffset"], [51110, "DefaultBlackRender"], [51111, "NewRawImageDigest"], [51112, "RawToPreviewGain"]]);
60148 ct = [[273, "StripOffsets"], [279, "StripByteCounts"], [288, "FreeOffsets"], [289, "FreeByteCounts"], [291, "GrayResponseCurve"], [292, "T4Options"], [293, "T6Options"], [300, "ColorResponseUnit"], [320, "ColorMap"], [324, "TileOffsets"], [325, "TileByteCounts"], [326, "BadFaxLines"], [327, "CleanFaxData"], [328, "ConsecutiveBadFaxLines"], [330, "SubIFD"], [333, "InkNames"], [334, "NumberofInks"], [336, "DotRange"], [338, "ExtraSamples"], [339, "SampleFormat"], [340, "SMinSampleValue"], [341, "SMaxSampleValue"], [342, "TransferRange"], [343, "ClipPath"], [344, "XClipPathUnits"], [345, "YClipPathUnits"], [346, "Indexed"], [347, "JPEGTables"], [351, "OPIProxy"], [400, "GlobalParametersIFD"], [401, "ProfileType"], [402, "FaxProfile"], [403, "CodingMethods"], [404, "VersionYear"], [405, "ModeNumber"], [433, "Decode"], [434, "DefaultImageColor"], [435, "T82Options"], [437, "JPEGTables"], [512, "JPEGProc"], [515, "JPEGRestartInterval"], [517, "JPEGLosslessPredictors"], [518, "JPEGPointTransforms"], [519, "JPEGQTables"], [520, "JPEGDCTables"], [521, "JPEGACTables"], [559, "StripRowCounts"], [999, "USPTOMiscellaneous"], [18247, "XP_DIP_XML"], [18248, "StitchInfo"], [28672, "SonyRawFileType"], [28688, "SonyToneCurve"], [28721, "VignettingCorrection"], [28722, "VignettingCorrParams"], [28724, "ChromaticAberrationCorrection"], [28725, "ChromaticAberrationCorrParams"], [28726, "DistortionCorrection"], [28727, "DistortionCorrParams"], [29895, "SonyCropTopLeft"], [29896, "SonyCropSize"], [32781, "ImageID"], [32931, "WangTag1"], [32932, "WangAnnotation"], [32933, "WangTag3"], [32934, "WangTag4"], [32953, "ImageReferencePoints"], [32954, "RegionXformTackPoint"], [32955, "WarpQuadrilateral"], [32956, "AffineTransformMat"], [32995, "Matteing"], [32996, "DataType"], [32997, "ImageDepth"], [32998, "TileDepth"], [33300, "ImageFullWidth"], [33301, "ImageFullHeight"], [33302, "TextureFormat"], [33303, "WrapModes"], [33304, "FovCot"], [33305, "MatrixWorldToScreen"], [33306, "MatrixWorldToCamera"], [33405, "Model2"], [33421, "CFARepeatPatternDim"], [33422, "CFAPattern2"], [33423, "BatteryLevel"], [33424, "KodakIFD"], [33445, "MDFileTag"], [33446, "MDScalePixel"], [33447, "MDColorTable"], [33448, "MDLabName"], [33449, "MDSampleInfo"], [33450, "MDPrepDate"], [33451, "MDPrepTime"], [33452, "MDFileUnits"], [33589, "AdventScale"], [33590, "AdventRevision"], [33628, "UIC1Tag"], [33629, "UIC2Tag"], [33630, "UIC3Tag"], [33631, "UIC4Tag"], [33918, "IntergraphPacketData"], [33919, "IntergraphFlagRegisters"], [33921, "INGRReserved"], [34016, "Site"], [34017, "ColorSequence"], [34018, "IT8Header"], [34019, "RasterPadding"], [34020, "BitsPerRunLength"], [34021, "BitsPerExtendedRunLength"], [34022, "ColorTable"], [34023, "ImageColorIndicator"], [34024, "BackgroundColorIndicator"], [34025, "ImageColorValue"], [34026, "BackgroundColorValue"], [34027, "PixelIntensityRange"], [34028, "TransparencyIndicator"], [34029, "ColorCharacterization"], [34030, "HCUsage"], [34031, "TrapIndicator"], [34032, "CMYKEquivalent"], [34152, "AFCP_IPTC"], [34232, "PixelMagicJBIGOptions"], [34263, "JPLCartoIFD"], [34306, "WB_GRGBLevels"], [34310, "LeafData"], [34687, "TIFF_FXExtensions"], [34688, "MultiProfiles"], [34689, "SharedData"], [34690, "T88Options"], [34732, "ImageLayer"], [34750, "JBIGOptions"], [34856, "Opto-ElectricConvFactor"], [34857, "Interlace"], [34908, "FaxRecvParams"], [34909, "FaxSubAddress"], [34910, "FaxRecvTime"], [34929, "FedexEDR"], [34954, "LeafSubIFD"], [37387, "FlashEnergy"], [37388, "SpatialFrequencyResponse"], [37389, "Noise"], [37390, "FocalPlaneXResolution"], [37391, "FocalPlaneYResolution"], [37392, "FocalPlaneResolutionUnit"], [37397, "ExposureIndex"], [37398, "TIFF-EPStandardID"], [37399, "SensingMethod"], [37434, "CIP3DataFile"], [37435, "CIP3Sheet"], [37436, "CIP3Side"], [37439, "StoNits"], [37679, "MSDocumentText"], [37680, "MSPropertySetStorage"], [37681, "MSDocumentTextPosition"], [37724, "ImageSourceData"], [40965, "InteropIFD"], [40976, "SamsungRawPointersOffset"], [40977, "SamsungRawPointersLength"], [41217, "SamsungRawByteOrder"], [41218, "SamsungRawUnknown"], [41484, "SpatialFrequencyResponse"], [41485, "Noise"], [41489, "ImageNumber"], [41490, "SecurityClassification"], [41491, "ImageHistory"], [41494, "TIFF-EPStandardID"], [41995, "DeviceSettingDescription"], [42112, "GDALMetadata"], [42113, "GDALNoData"], [44992, "ExpandSoftware"], [44993, "ExpandLens"], [44994, "ExpandFilm"], [44995, "ExpandFilterLens"], [44996, "ExpandScanner"], [44997, "ExpandFlashLamp"], [46275, "HasselbladRawImage"], [48129, "PixelFormat"], [48130, "Transformation"], [48131, "Uncompressed"], [48132, "ImageType"], [48256, "ImageWidth"], [48257, "ImageHeight"], [48258, "WidthResolution"], [48259, "HeightResolution"], [48320, "ImageOffset"], [48321, "ImageByteCount"], [48322, "AlphaOffset"], [48323, "AlphaByteCount"], [48324, "ImageDataDiscard"], [48325, "AlphaDataDiscard"], [50215, "OceScanjobDesc"], [50216, "OceApplicationSelector"], [50217, "OceIDNumber"], [50218, "OceImageLogic"], [50255, "Annotations"], [50459, "HasselbladExif"], [50547, "OriginalFileName"], [50560, "USPTOOriginalContentType"], [50656, "CR2CFAPattern"], [50710, "CFAPlaneColor"], [50711, "CFALayout"], [50712, "LinearizationTable"], [50713, "BlackLevelRepeatDim"], [50714, "BlackLevel"], [50715, "BlackLevelDeltaH"], [50716, "BlackLevelDeltaV"], [50717, "WhiteLevel"], [50718, "DefaultScale"], [50719, "DefaultCropOrigin"], [50720, "DefaultCropSize"], [50733, "BayerGreenSplit"], [50737, "ChromaBlurRadius"], [50738, "AntiAliasStrength"], [50752, "RawImageSegmentation"], [50780, "BestQualityScale"], [50784, "AliasLayerMetadata"], [50829, "ActiveArea"], [50830, "MaskedAreas"], [50935, "NoiseReductionApplied"], [50974, "SubTileBlockSize"], [50975, "RowInterleaveFactor"], [51008, "OpcodeList1"], [51009, "OpcodeList2"], [51022, "OpcodeList3"], [51041, "NoiseProfile"], [51114, "CacheVersion"], [51125, "DefaultUserCrop"], [51157, "NikonNEFInfo"], [65024, "KdcIFD"]];
60149 F2(E2, "ifd0", ct), F2(E2, "exif", ct), U2(B2, "gps", [[23, { M: "Magnetic North", T: "True North" }], [25, { K: "Kilometers", M: "Miles", N: "Nautical Miles" }]]);
60150 ft = class extends re3 {
60151 static canHandle(e3, t2) {
60152 return 224 === e3.getUint8(t2 + 1) && 1246120262 === e3.getUint32(t2 + 4) && 0 === e3.getUint8(t2 + 8);
60155 return this.parseTags(), this.translate(), this.output;
60158 this.raw = /* @__PURE__ */ new Map([[0, this.chunk.getUint16(0)], [2, this.chunk.getUint8(2)], [3, this.chunk.getUint16(3)], [5, this.chunk.getUint16(5)], [7, this.chunk.getUint8(7)], [8, this.chunk.getUint8(8)]]);
60161 c(ft, "type", "jfif"), c(ft, "headerLength", 9), T.set("jfif", ft), U2(E2, "jfif", [[0, "JFIFVersion"], [2, "ResolutionUnit"], [3, "XResolution"], [5, "YResolution"], [7, "ThumbnailWidth"], [8, "ThumbnailHeight"]]);
60162 dt = class extends re3 {
60164 return this.parseTags(), this.translate(), this.output;
60167 this.raw = new Map([[0, this.chunk.getUint32(0)], [4, this.chunk.getUint32(4)], [8, this.chunk.getUint8(8)], [9, this.chunk.getUint8(9)], [10, this.chunk.getUint8(10)], [11, this.chunk.getUint8(11)], [12, this.chunk.getUint8(12)], ...Array.from(this.raw)]);
60170 c(dt, "type", "ihdr"), T.set("ihdr", dt), U2(E2, "ihdr", [[0, "ImageWidth"], [4, "ImageHeight"], [8, "BitDepth"], [9, "ColorType"], [10, "Compression"], [11, "Filter"], [12, "Interlace"]]), U2(B2, "ihdr", [[9, { 0: "Grayscale", 2: "RGB", 3: "Palette", 4: "Grayscale with Alpha", 6: "RGB with Alpha", DEFAULT: "Unknown" }], [10, { 0: "Deflate/Inflate", DEFAULT: "Unknown" }], [11, { 0: "Adaptive", DEFAULT: "Unknown" }], [12, { 0: "Noninterlaced", 1: "Adam7 Interlace", DEFAULT: "Unknown" }]]);
60171 pt = class extends re3 {
60172 static canHandle(e3, t2) {
60173 return 226 === e3.getUint8(t2 + 1) && 1229144927 === e3.getUint32(t2 + 4);
60175 static findPosition(e3, t2) {
60176 let i3 = super.findPosition(e3, t2);
60177 return i3.chunkNumber = e3.getUint8(t2 + 16), i3.chunkCount = e3.getUint8(t2 + 17), i3.multiSegment = i3.chunkCount > 1, i3;
60179 static handleMultiSegments(e3) {
60180 return (function(e4) {
60181 let t2 = (function(e6) {
60182 let t3 = e6[0].constructor, i3 = 0;
60183 for (let t4 of e6) i3 += t4.length;
60184 let n3 = new t3(i3), s2 = 0;
60185 for (let t4 of e6) n3.set(t4, s2), s2 += t4.length;
60187 })(e4.map(((e6) => e6.chunk.toUint8())));
60192 return this.raw = /* @__PURE__ */ new Map(), this.parseHeader(), this.parseTags(), this.translate(), this.output;
60195 let { raw: e3 } = this;
60196 this.chunk.byteLength < 84 && g2("ICC header is too short");
60197 for (let [t2, i3] of Object.entries(gt)) {
60198 t2 = parseInt(t2, 10);
60199 let n3 = i3(this.chunk, t2);
60200 "\0\0\0\0" !== n3 && e3.set(t2, n3);
60204 let e3, t2, i3, n3, s2, { raw: r2 } = this, a2 = this.chunk.getUint32(128), o2 = 132, l4 = this.chunk.byteLength;
60206 if (e3 = this.chunk.getString(o2, 4), t2 = this.chunk.getUint32(o2 + 4), i3 = this.chunk.getUint32(o2 + 8), n3 = this.chunk.getString(t2, 4), t2 + i3 > l4) return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");
60207 s2 = this.parseTag(n3, t2, i3), void 0 !== s2 && "\0\0\0\0" !== s2 && r2.set(e3, s2), o2 += 12;
60210 parseTag(e3, t2, i3) {
60213 return this.parseDesc(t2);
60215 return this.parseMluc(t2);
60217 return this.parseText(t2, i3);
60219 return this.parseSig(t2);
60221 if (!(t2 + i3 > this.chunk.byteLength)) return this.chunk.getUint8Array(t2, i3);
60224 let t2 = this.chunk.getUint32(e3 + 8) - 1;
60225 return m2(this.chunk.getString(e3 + 12, t2));
60227 parseText(e3, t2) {
60228 return m2(this.chunk.getString(e3 + 8, t2 - 8));
60231 return m2(this.chunk.getString(e3 + 8, 4));
60234 let { chunk: t2 } = this, i3 = t2.getUint32(e3 + 8), n3 = t2.getUint32(e3 + 12), s2 = e3 + 16, r2 = [];
60235 for (let a2 = 0; a2 < i3; a2++) {
60236 let i4 = t2.getString(s2 + 0, 2), a3 = t2.getString(s2 + 2, 2), o2 = t2.getUint32(s2 + 4), l4 = t2.getUint32(s2 + 8) + e3, h3 = m2(t2.getUnicodeString(l4, o2));
60237 r2.push({ lang: i4, country: a3, text: h3 }), s2 += n3;
60239 return 1 === i3 ? r2[0].text : r2;
60241 translateValue(e3, t2) {
60242 return "string" == typeof e3 ? t2[e3] || t2[e3.toLowerCase()] || e3 : t2[e3] || e3;
60245 c(pt, "type", "icc"), c(pt, "multiSegment", true), c(pt, "headerLength", 18);
60246 gt = { 4: mt, 8: function(e3, t2) {
60247 return [e3.getUint8(t2), e3.getUint8(t2 + 1) >> 4, e3.getUint8(t2 + 1) % 16].map(((e4) => e4.toString(10))).join(".");
60248 }, 12: mt, 16: mt, 20: mt, 24: function(e3, t2) {
60249 const i3 = e3.getUint16(t2), n3 = e3.getUint16(t2 + 2) - 1, s2 = e3.getUint16(t2 + 4), r2 = e3.getUint16(t2 + 6), a2 = e3.getUint16(t2 + 8), o2 = e3.getUint16(t2 + 10);
60250 return new Date(Date.UTC(i3, n3, s2, r2, a2, o2));
60251 }, 36: mt, 40: mt, 48: mt, 52: mt, 64: (e3, t2) => e3.getUint32(t2), 80: mt };
60252 T.set("icc", pt), U2(E2, "icc", [[4, "ProfileCMMType"], [8, "ProfileVersion"], [12, "ProfileClass"], [16, "ColorSpaceData"], [20, "ProfileConnectionSpace"], [24, "ProfileDateTime"], [36, "ProfileFileSignature"], [40, "PrimaryPlatform"], [44, "CMMFlags"], [48, "DeviceManufacturer"], [52, "DeviceModel"], [56, "DeviceAttributes"], [64, "RenderingIntent"], [68, "ConnectionSpaceIlluminant"], [80, "ProfileCreator"], [84, "ProfileID"], ["Header", "ProfileHeader"], ["MS00", "WCSProfiles"], ["bTRC", "BlueTRC"], ["bXYZ", "BlueMatrixColumn"], ["bfd", "UCRBG"], ["bkpt", "MediaBlackPoint"], ["calt", "CalibrationDateTime"], ["chad", "ChromaticAdaptation"], ["chrm", "Chromaticity"], ["ciis", "ColorimetricIntentImageState"], ["clot", "ColorantTableOut"], ["clro", "ColorantOrder"], ["clrt", "ColorantTable"], ["cprt", "ProfileCopyright"], ["crdi", "CRDInfo"], ["desc", "ProfileDescription"], ["devs", "DeviceSettings"], ["dmdd", "DeviceModelDesc"], ["dmnd", "DeviceMfgDesc"], ["dscm", "ProfileDescriptionML"], ["fpce", "FocalPlaneColorimetryEstimates"], ["gTRC", "GreenTRC"], ["gXYZ", "GreenMatrixColumn"], ["gamt", "Gamut"], ["kTRC", "GrayTRC"], ["lumi", "Luminance"], ["meas", "Measurement"], ["meta", "Metadata"], ["mmod", "MakeAndModel"], ["ncl2", "NamedColor2"], ["ncol", "NamedColor"], ["ndin", "NativeDisplayInfo"], ["pre0", "Preview0"], ["pre1", "Preview1"], ["pre2", "Preview2"], ["ps2i", "PS2RenderingIntent"], ["ps2s", "PostScript2CSA"], ["psd0", "PostScript2CRD0"], ["psd1", "PostScript2CRD1"], ["psd2", "PostScript2CRD2"], ["psd3", "PostScript2CRD3"], ["pseq", "ProfileSequenceDesc"], ["psid", "ProfileSequenceIdentifier"], ["psvm", "PS2CRDVMSize"], ["rTRC", "RedTRC"], ["rXYZ", "RedMatrixColumn"], ["resp", "OutputResponse"], ["rhoc", "ReflectionHardcopyOrigColorimetry"], ["rig0", "PerceptualRenderingIntentGamut"], ["rig2", "SaturationRenderingIntentGamut"], ["rpoc", "ReflectionPrintOutputColorimetry"], ["sape", "SceneAppearanceEstimates"], ["scoe", "SceneColorimetryEstimates"], ["scrd", "ScreeningDesc"], ["scrn", "Screening"], ["targ", "CharTarget"], ["tech", "Technology"], ["vcgt", "VideoCardGamma"], ["view", "ViewingConditions"], ["vued", "ViewingCondDesc"], ["wtpt", "MediaWhitePoint"]]);
60253 St = { "4d2p": "Erdt Systems", AAMA: "Aamazing Technologies", ACER: "Acer", ACLT: "Acolyte Color Research", ACTI: "Actix Sytems", ADAR: "Adara Technology", ADBE: "Adobe", ADI: "ADI Systems", AGFA: "Agfa Graphics", ALMD: "Alps Electric", ALPS: "Alps Electric", ALWN: "Alwan Color Expertise", AMTI: "Amiable Technologies", AOC: "AOC International", APAG: "Apago", APPL: "Apple Computer", AST: "AST", "AT&T": "AT&T", BAEL: "BARBIERI electronic", BRCO: "Barco NV", BRKP: "Breakpoint", BROT: "Brother", BULL: "Bull", BUS: "Bus Computer Systems", "C-IT": "C-Itoh", CAMR: "Intel", CANO: "Canon", CARR: "Carroll Touch", CASI: "Casio", CBUS: "Colorbus PL", CEL: "Crossfield", CELx: "Crossfield", CGS: "CGS Publishing Technologies International", CHM: "Rochester Robotics", CIGL: "Colour Imaging Group, London", CITI: "Citizen", CL00: "Candela", CLIQ: "Color IQ", CMCO: "Chromaco", CMiX: "CHROMiX", COLO: "Colorgraphic Communications", COMP: "Compaq", COMp: "Compeq/Focus Technology", CONR: "Conrac Display Products", CORD: "Cordata Technologies", CPQ: "Compaq", CPRO: "ColorPro", CRN: "Cornerstone", CTX: "CTX International", CVIS: "ColorVision", CWC: "Fujitsu Laboratories", DARI: "Darius Technology", DATA: "Dataproducts", DCP: "Dry Creek Photo", DCRC: "Digital Contents Resource Center, Chung-Ang University", DELL: "Dell Computer", DIC: "Dainippon Ink and Chemicals", DICO: "Diconix", DIGI: "Digital", "DL&C": "Digital Light & Color", DPLG: "Doppelganger", DS: "Dainippon Screen", DSOL: "DOOSOL", DUPN: "DuPont", EPSO: "Epson", ESKO: "Esko-Graphics", ETRI: "Electronics and Telecommunications Research Institute", EVER: "Everex Systems", EXAC: "ExactCODE", Eizo: "Eizo", FALC: "Falco Data Products", FF: "Fuji Photo Film", FFEI: "FujiFilm Electronic Imaging", FNRD: "Fnord Software", FORA: "Fora", FORE: "Forefront Technology", FP: "Fujitsu", FPA: "WayTech Development", FUJI: "Fujitsu", FX: "Fuji Xerox", GCC: "GCC Technologies", GGSL: "Global Graphics Software", GMB: "Gretagmacbeth", GMG: "GMG", GOLD: "GoldStar Technology", GOOG: "Google", GPRT: "Giantprint", GTMB: "Gretagmacbeth", GVC: "WayTech Development", GW2K: "Sony", HCI: "HCI", HDM: "Heidelberger Druckmaschinen", HERM: "Hermes", HITA: "Hitachi America", HP: "Hewlett-Packard", HTC: "Hitachi", HiTi: "HiTi Digital", IBM: "IBM", IDNT: "Scitex", IEC: "Hewlett-Packard", IIYA: "Iiyama North America", IKEG: "Ikegami Electronics", IMAG: "Image Systems", IMI: "Ingram Micro", INTC: "Intel", INTL: "N/A (INTL)", INTR: "Intra Electronics", IOCO: "Iocomm International Technology", IPS: "InfoPrint Solutions Company", IRIS: "Scitex", ISL: "Ichikawa Soft Laboratory", ITNL: "N/A (ITNL)", IVM: "IVM", IWAT: "Iwatsu Electric", Idnt: "Scitex", Inca: "Inca Digital Printers", Iris: "Scitex", JPEG: "Joint Photographic Experts Group", JSFT: "Jetsoft Development", JVC: "JVC Information Products", KART: "Scitex", KFC: "KFC Computek Components", KLH: "KLH Computers", KMHD: "Konica Minolta", KNCA: "Konica", KODA: "Kodak", KYOC: "Kyocera", Kart: "Scitex", LCAG: "Leica", LCCD: "Leeds Colour", LDAK: "Left Dakota", LEAD: "Leading Technology", LEXM: "Lexmark International", LINK: "Link Computer", LINO: "Linotronic", LITE: "Lite-On", Leaf: "Leaf", Lino: "Linotronic", MAGC: "Mag Computronic", MAGI: "MAG Innovision", MANN: "Mannesmann", MICN: "Micron Technology", MICR: "Microtek", MICV: "Microvitec", MINO: "Minolta", MITS: "Mitsubishi Electronics America", MITs: "Mitsuba", MNLT: "Minolta", MODG: "Modgraph", MONI: "Monitronix", MONS: "Monaco Systems", MORS: "Morse Technology", MOTI: "Motive Systems", MSFT: "Microsoft", MUTO: "MUTOH INDUSTRIES", Mits: "Mitsubishi Electric", NANA: "NANAO", NEC: "NEC", NEXP: "NexPress Solutions", NISS: "Nissei Sangyo America", NKON: "Nikon", NONE: "none", OCE: "Oce Technologies", OCEC: "OceColor", OKI: "Oki", OKID: "Okidata", OKIP: "Okidata", OLIV: "Olivetti", OLYM: "Olympus", ONYX: "Onyx Graphics", OPTI: "Optiquest", PACK: "Packard Bell", PANA: "Matsushita Electric Industrial", PANT: "Pantone", PBN: "Packard Bell", PFU: "PFU", PHIL: "Philips Consumer Electronics", PNTX: "HOYA", POne: "Phase One A/S", PREM: "Premier Computer Innovations", PRIN: "Princeton Graphic Systems", PRIP: "Princeton Publishing Labs", QLUX: "Hong Kong", QMS: "QMS", QPCD: "QPcard AB", QUAD: "QuadLaser", QUME: "Qume", RADI: "Radius", RDDx: "Integrated Color Solutions", RDG: "Roland DG", REDM: "REDMS Group", RELI: "Relisys", RGMS: "Rolf Gierling Multitools", RICO: "Ricoh", RNLD: "Edmund Ronald", ROYA: "Royal", RPC: "Ricoh Printing Systems", RTL: "Royal Information Electronics", SAMP: "Sampo", SAMS: "Samsung", SANT: "Jaime Santana Pomares", SCIT: "Scitex", SCRN: "Dainippon Screen", SDP: "Scitex", SEC: "Samsung", SEIK: "Seiko Instruments", SEIk: "Seikosha", SGUY: "ScanGuy.com", SHAR: "Sharp Laboratories", SICC: "International Color Consortium", SONY: "Sony", SPCL: "SpectraCal", STAR: "Star", STC: "Sampo Technology", Scit: "Scitex", Sdp: "Scitex", Sony: "Sony", TALO: "Talon Technology", TAND: "Tandy", TATU: "Tatung", TAXA: "TAXAN America", TDS: "Tokyo Denshi Sekei", TECO: "TECO Information Systems", TEGR: "Tegra", TEKT: "Tektronix", TI: "Texas Instruments", TMKR: "TypeMaker", TOSB: "Toshiba", TOSH: "Toshiba", TOTK: "TOTOKU ELECTRIC", TRIU: "Triumph", TSBT: "Toshiba", TTX: "TTX Computer Products", TVM: "TVM Professional Monitor", TW: "TW Casper", ULSX: "Ulead Systems", UNIS: "Unisys", UTZF: "Utz Fehlau & Sohn", VARI: "Varityper", VIEW: "Viewsonic", VISL: "Visual communication", VIVO: "Vivo Mobile Communication", WANG: "Wang", WLBR: "Wilbur Imaging", WTG2: "Ware To Go", WYSE: "WYSE Technology", XERX: "Xerox", XRIT: "X-Rite", ZRAN: "Zoran", Zebr: "Zebra Technologies", appl: "Apple Computer", bICC: "basICColor", berg: "bergdesign", ceyd: "Integrated Color Solutions", clsp: "MacDermid ColorSpan", ds: "Dainippon Screen", dupn: "DuPont", ffei: "FujiFilm Electronic Imaging", flux: "FluxData", iris: "Scitex", kart: "Scitex", lcms: "Little CMS", lino: "Linotronic", none: "none", ob4d: "Erdt Systems", obic: "Medigraph", quby: "Qubyx Sarl", scit: "Scitex", scrn: "Dainippon Screen", sdp: "Scitex", siwi: "SIWI GRAFIKA", yxym: "YxyMaster" };
60254 Ct = { scnr: "Scanner", mntr: "Monitor", prtr: "Printer", link: "Device Link", abst: "Abstract", spac: "Color Space Conversion Profile", nmcl: "Named Color", cenc: "ColorEncodingSpace profile", mid: "MultiplexIdentification profile", mlnk: "MultiplexLink profile", mvis: "MultiplexVisualization profile", nkpf: "Nikon Input Device Profile (NON-STANDARD!)" };
60255 U2(B2, "icc", [[4, St], [12, Ct], [40, Object.assign({}, St, Ct)], [48, St], [80, St], [64, { 0: "Perceptual", 1: "Relative Colorimetric", 2: "Saturation", 3: "Absolute Colorimetric" }], ["tech", { amd: "Active Matrix Display", crt: "Cathode Ray Tube Display", kpcd: "Photo CD", pmd: "Passive Matrix Display", dcam: "Digital Camera", dcpj: "Digital Cinema Projector", dmpc: "Digital Motion Picture Camera", dsub: "Dye Sublimation Printer", epho: "Electrophotographic Printer", esta: "Electrostatic Printer", flex: "Flexography", fprn: "Film Writer", fscn: "Film Scanner", grav: "Gravure", ijet: "Ink Jet Printer", imgs: "Photo Image Setter", mpfr: "Motion Picture Film Recorder", mpfs: "Motion Picture Film Scanner", offs: "Offset Lithography", pjtv: "Projection Television", rpho: "Photographic Paper Printer", rscn: "Reflective Scanner", silk: "Silkscreen", twax: "Thermal Wax Printer", vidc: "Video Camera", vidm: "Video Monitor" }]]);
60256 yt = class extends re3 {
60257 static canHandle(e3, t2, i3) {
60258 return 237 === e3.getUint8(t2 + 1) && "Photoshop" === e3.getString(t2 + 4, 9) && void 0 !== this.containsIptc8bim(e3, t2, i3);
60260 static headerLength(e3, t2, i3) {
60261 let n3, s2 = this.containsIptc8bim(e3, t2, i3);
60262 if (void 0 !== s2) return n3 = e3.getUint8(t2 + s2 + 7), n3 % 2 != 0 && (n3 += 1), 0 === n3 && (n3 = 4), s2 + 8 + n3;
60264 static containsIptc8bim(e3, t2, i3) {
60265 for (let n3 = 0; n3 < i3; n3++) if (this.isIptcSegmentHead(e3, t2 + n3)) return n3;
60267 static isIptcSegmentHead(e3, t2) {
60268 return 56 === e3.getUint8(t2) && 943868237 === e3.getUint32(t2) && 1028 === e3.getUint16(t2 + 4);
60271 let { raw: e3 } = this, t2 = this.chunk.byteLength - 1, i3 = false;
60272 for (let n3 = 0; n3 < t2; n3++) if (28 === this.chunk.getUint8(n3) && 2 === this.chunk.getUint8(n3 + 1)) {
60274 let t3 = this.chunk.getUint16(n3 + 3), s2 = this.chunk.getUint8(n3 + 2), r2 = this.chunk.getLatin1String(n3 + 5, t3);
60275 e3.set(s2, this.pluralizeValue(e3.get(s2), r2)), n3 += 4 + t3;
60276 } else if (i3) break;
60277 return this.translate(), this.output;
60279 pluralizeValue(e3, t2) {
60280 return void 0 !== e3 ? e3 instanceof Array ? (e3.push(t2), e3) : [e3, t2] : t2;
60283 c(yt, "type", "iptc"), c(yt, "translateValues", false), c(yt, "reviveValues", false), T.set("iptc", yt), U2(E2, "iptc", [[0, "ApplicationRecordVersion"], [3, "ObjectTypeReference"], [4, "ObjectAttributeReference"], [5, "ObjectName"], [7, "EditStatus"], [8, "EditorialUpdate"], [10, "Urgency"], [12, "SubjectReference"], [15, "Category"], [20, "SupplementalCategories"], [22, "FixtureIdentifier"], [25, "Keywords"], [26, "ContentLocationCode"], [27, "ContentLocationName"], [30, "ReleaseDate"], [35, "ReleaseTime"], [37, "ExpirationDate"], [38, "ExpirationTime"], [40, "SpecialInstructions"], [42, "ActionAdvised"], [45, "ReferenceService"], [47, "ReferenceDate"], [50, "ReferenceNumber"], [55, "DateCreated"], [60, "TimeCreated"], [62, "DigitalCreationDate"], [63, "DigitalCreationTime"], [65, "OriginatingProgram"], [70, "ProgramVersion"], [75, "ObjectCycle"], [80, "Byline"], [85, "BylineTitle"], [90, "City"], [92, "Sublocation"], [95, "State"], [100, "CountryCode"], [101, "Country"], [103, "OriginalTransmissionReference"], [105, "Headline"], [110, "Credit"], [115, "Source"], [116, "CopyrightNotice"], [118, "Contact"], [120, "Caption"], [121, "LocalCaption"], [122, "Writer"], [125, "RasterizedCaption"], [130, "ImageType"], [131, "ImageOrientation"], [135, "LanguageIdentifier"], [150, "AudioType"], [151, "AudioSamplingRate"], [152, "AudioSamplingResolution"], [153, "AudioDuration"], [154, "AudioOutcue"], [184, "JobID"], [185, "MasterDocumentID"], [186, "ShortDocumentID"], [187, "UniqueDocumentID"], [188, "OwnerID"], [200, "ObjectPreviewFileFormat"], [201, "ObjectPreviewFileVersion"], [202, "ObjectPreviewData"], [221, "Prefs"], [225, "ClassifyState"], [228, "SimilarityIndex"], [230, "DocumentNotes"], [231, "DocumentHistory"], [232, "ExifCameraInfo"], [255, "CatalogSets"]]), U2(B2, "iptc", [[10, { 0: "0 (reserved)", 1: "1 (most urgent)", 2: "2", 3: "3", 4: "4", 5: "5 (normal urgency)", 6: "6", 7: "7", 8: "8 (least urgent)", 9: "9 (user-defined priority)" }], [75, { a: "Morning", b: "Both Morning and Evening", p: "Evening" }], [131, { L: "Landscape", P: "Portrait", S: "Square" }]]);
60284 full_esm_default = tt;
60288 // modules/svg/local_photos.js
60289 var local_photos_exports = {};
60290 __export(local_photos_exports, {
60291 svgLocalPhotos: () => svgLocalPhotos
60293 function svgLocalPhotos(projection2, context, dispatch14) {
60294 const detected = utilDetect();
60295 let layer = select_default2(null);
60298 let _idAutoinc = 0;
60300 let _activePhotoIdx;
60302 if (_initialized2) return;
60304 function over(d3_event) {
60305 d3_event.stopPropagation();
60306 d3_event.preventDefault();
60307 d3_event.dataTransfer.dropEffect = "copy";
60309 context.container().attr("dropzone", "copy").on("drop.svgLocalPhotos", function(d3_event) {
60310 d3_event.stopPropagation();
60311 d3_event.preventDefault();
60312 if (!detected.filedrop) return;
60313 drawPhotos.fileList(d3_event.dataTransfer.files, (loaded) => {
60314 if (loaded.length > 0) {
60315 drawPhotos.fitZoom(false);
60318 }).on("dragenter.svgLocalPhotos", over).on("dragexit.svgLocalPhotos", over).on("dragover.svgLocalPhotos", over);
60319 _initialized2 = true;
60321 function ensureViewerLoaded(context2) {
60323 return Promise.resolve(_photoFrame);
60325 const viewer = context2.container().select(".photoviewer").selectAll(".local-photos-wrapper").data([0]);
60326 const viewerEnter = viewer.enter().append("div").attr("class", "photo-wrapper local-photos-wrapper").classed("hide", true);
60327 viewerEnter.append("div").attr("class", "photo-attribution photo-attribution-dual fillD");
60328 const controlsEnter = viewerEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls-local");
60329 controlsEnter.append("button").classed("back", true).on("click.back", () => stepPhotos(-1)).text("\u25C0");
60330 controlsEnter.append("button").classed("forward", true).on("click.forward", () => stepPhotos(1)).text("\u25B6");
60331 return plane_photo_default.init(context2, viewerEnter).then((planePhotoFrame) => {
60332 _photoFrame = planePhotoFrame;
60335 function stepPhotos(stepBy) {
60336 if (!_photos || _photos.length === 0) return;
60337 if (_activePhotoIdx === void 0) _activePhotoIdx = 0;
60338 const newIndex = _activePhotoIdx + stepBy;
60339 _activePhotoIdx = Math.max(0, Math.min(_photos.length - 1, newIndex));
60340 click(null, _photos[_activePhotoIdx], false);
60342 function click(d3_event, image, zoomTo) {
60343 _activePhotoIdx = _photos.indexOf(image);
60344 ensureViewerLoaded(context).then(() => {
60345 const viewer = context.container().select(".photoviewer").datum(image).classed("hide", false);
60346 const viewerWrap = viewer.select(".local-photos-wrapper").classed("hide", false);
60347 const controlsWrap = viewer.select(".photo-controls-wrap");
60348 controlsWrap.select(".back").attr("disabled", _activePhotoIdx <= 0 ? true : null);
60349 controlsWrap.select(".forward").attr("disabled", _activePhotoIdx >= _photos.length - 1 ? true : null);
60350 const attribution = viewerWrap.selectAll(".photo-attribution").text("");
60352 attribution.append("span").text(image.date.toLocaleString(_mainLocalizer.localeCode()));
60355 attribution.append("span").classed("filename", true).text(image.name);
60357 _photoFrame.selectPhoto({ image_path: "" });
60358 image.getSrc().then((src) => {
60359 _photoFrame.selectPhoto({ image_path: src }).showPhotoFrame(viewerWrap);
60364 context.map().centerEase(image.loc);
60367 function transform2(d4) {
60368 var svgpoint = projection2(d4.loc);
60369 return "translate(" + svgpoint[0] + "," + svgpoint[1] + ")";
60371 function setStyles(hovered) {
60372 const viewer = context.container().select(".photoviewer");
60373 const selected = viewer.empty() ? void 0 : viewer.datum();
60374 context.container().selectAll(".layer-local-photos .viewfield-group").classed("hovered", (d4) => d4.id === (hovered == null ? void 0 : hovered.id)).classed("highlighted", (d4) => d4.id === (hovered == null ? void 0 : hovered.id) || d4.id === (selected == null ? void 0 : selected.id)).classed("currentView", (d4) => d4.id === (selected == null ? void 0 : selected.id));
60376 function display_markers(imageList) {
60377 imageList = imageList.filter((image) => isArray_default(image.loc) && isNumber_default(image.loc[0]) && isNumber_default(image.loc[1]));
60378 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(imageList, function(d4) {
60381 groups.exit().remove();
60382 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", (d3_event, d4) => setStyles(d4)).on("mouseleave", () => setStyles(null)).on("click", click);
60383 groupsEnter.append("g").attr("class", "viewfield-scale");
60384 const markers = groups.merge(groupsEnter).attr("transform", transform2).select(".viewfield-scale");
60385 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
60386 const showViewfields = context.map().zoom() >= minViewfieldZoom;
60387 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
60388 viewfields.exit().remove();
60389 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", function() {
60391 const d4 = this.parentNode.__data__;
60392 return `rotate(${Math.round((_a4 = d4.direction) != null ? _a4 : 0)},0,0),scale(1.5,1.5),translate(-8,-13)`;
60393 }).attr("d", "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z").style("visibility", function() {
60394 const d4 = this.parentNode.__data__;
60395 return isNumber_default(d4.direction) ? "visible" : "hidden";
60398 function drawPhotos(selection2) {
60399 layer = selection2.selectAll(".layer-local-photos").data(_photos ? [0] : []);
60400 layer.exit().remove();
60401 const layerEnter = layer.enter().append("g").attr("class", "layer-local-photos");
60402 layerEnter.append("g").attr("class", "markers");
60403 layer = layerEnter.merge(layer);
60405 display_markers(_photos);
60408 function readFileAsDataURL(file) {
60409 return new Promise((resolve, reject) => {
60410 const reader = new FileReader();
60411 reader.onload = () => resolve(reader.result);
60412 reader.onerror = (error) => reject(error);
60413 reader.readAsDataURL(file);
60416 async function readmultifiles(files, callback) {
60418 for (const file of files) {
60420 const exifData = await full_esm_default.parse(file);
60425 getSrc: () => readFileAsDataURL(file),
60427 loc: [exifData.longitude, exifData.latitude],
60428 direction: exifData.GPSImgDirection,
60429 date: exifData.CreateDate || exifData.DateTimeOriginal || exifData.ModifyDate
60431 loaded.push(photo);
60432 const sameName = _photos.filter((i3) => i3.name === photo.name);
60433 if (sameName.length === 0) {
60434 _photos.push(photo);
60436 const thisContent = await photo.getSrc();
60437 const sameNameContent = await Promise.allSettled(sameName.map((i3) => i3.getSrc()));
60438 if (!sameNameContent.some((i3) => i3.value === thisContent)) {
60439 _photos.push(photo);
60445 if (typeof callback === "function") callback(loaded);
60446 dispatch14.call("change");
60448 drawPhotos.setFiles = function(fileList, callback) {
60449 readmultifiles(Array.from(fileList), callback);
60452 drawPhotos.fileList = function(fileList, callback) {
60453 if (!arguments.length) return _fileList;
60454 _fileList = fileList;
60455 if (!fileList || !fileList.length) return this;
60456 drawPhotos.setFiles(_fileList, callback);
60459 drawPhotos.getPhotos = function() {
60462 drawPhotos.removePhoto = function(id2) {
60463 _photos = _photos.filter((i3) => i3.id !== id2);
60464 dispatch14.call("change");
60467 drawPhotos.openPhoto = click;
60468 drawPhotos.fitZoom = function(force) {
60469 const coords = _photos.map((image) => image.loc).filter((l4) => isArray_default(l4) && isNumber_default(l4[0]) && isNumber_default(l4[1]));
60470 if (coords.length === 0) return;
60471 const extent = coords.map((l4) => geoExtent(l4, l4)).reduce((a2, b3) => a2.extend(b3));
60472 const map2 = context.map();
60473 var viewport = map2.trimmedExtent().polygon();
60474 if (force !== false || !geoPolygonIntersectsPolygon(viewport, coords, true)) {
60475 map2.centerZoom(extent.center(), Math.min(18, map2.trimmedExtentZoom(extent)));
60478 function showLayer() {
60479 layer.style("display", "block");
60480 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
60481 dispatch14.call("change");
60484 function hideLayer() {
60485 layer.transition().duration(250).style("opacity", 0).on("end", () => {
60486 layer.selectAll(".viewfield-group").remove();
60487 layer.style("display", "none");
60490 drawPhotos.enabled = function(val) {
60491 if (!arguments.length) return _enabled2;
60498 dispatch14.call("change");
60501 drawPhotos.hasData = function() {
60502 return isArray_default(_photos) && _photos.length > 0;
60507 var _initialized2, _enabled2, minViewfieldZoom;
60508 var init_local_photos = __esm({
60509 "modules/svg/local_photos.js"() {
60517 init_plane_photo();
60518 _initialized2 = false;
60520 minViewfieldZoom = 16;
60524 // modules/svg/osmose.js
60525 var osmose_exports2 = {};
60526 __export(osmose_exports2, {
60527 svgOsmose: () => svgOsmose
60529 function svgOsmose(projection2, context, dispatch14) {
60530 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
60531 const minZoom5 = 12;
60532 let touchLayer = select_default2(null);
60533 let drawLayer = select_default2(null);
60534 let layerVisible = false;
60535 function markerPath(selection2, klass) {
60536 selection2.attr("class", klass).attr("transform", "translate(-10, -28)").attr("points", "16,3 4,3 1,6 1,17 4,20 7,20 10,27 13,20 16,20 19,17.033 19,6");
60538 function getService() {
60539 if (services.osmose && !_qaService2) {
60540 _qaService2 = services.osmose;
60541 _qaService2.on("loaded", throttledRedraw);
60542 } else if (!services.osmose && _qaService2) {
60543 _qaService2 = null;
60545 return _qaService2;
60547 function editOn() {
60548 if (!layerVisible) {
60549 layerVisible = true;
60550 drawLayer.style("display", "block");
60553 function editOff() {
60554 if (layerVisible) {
60555 layerVisible = false;
60556 drawLayer.style("display", "none");
60557 drawLayer.selectAll(".qaItem.osmose").remove();
60558 touchLayer.selectAll(".qaItem.osmose").remove();
60561 function layerOn() {
60563 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", () => dispatch14.call("change"));
60565 function layerOff() {
60566 throttledRedraw.cancel();
60567 drawLayer.interrupt();
60568 touchLayer.selectAll(".qaItem.osmose").remove();
60569 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", () => {
60571 dispatch14.call("change");
60574 function updateMarkers() {
60575 if (!layerVisible || !_layerEnabled2) return;
60576 const service = getService();
60577 const selectedID = context.selectedErrorID();
60578 const data = service ? service.getItems(projection2) : [];
60579 const getTransform = svgPointTransform(projection2);
60580 const markers = drawLayer.selectAll(".qaItem.osmose").data(data, (d4) => d4.id);
60581 markers.exit().remove();
60582 const markersEnter = markers.enter().append("g").attr("class", (d4) => `qaItem ${d4.service} itemId-${d4.id} itemType-${d4.itemType}`);
60583 markersEnter.append("polygon").call(markerPath, "shadow");
60584 markersEnter.append("ellipse").attr("cx", 0).attr("cy", 0).attr("rx", 4.5).attr("ry", 2).attr("class", "stroke");
60585 markersEnter.append("polygon").attr("fill", (d4) => service.getColor(d4.item)).call(markerPath, "qaItem-fill");
60586 markersEnter.append("use").attr("class", "icon-annotation").attr("transform", "translate(-6, -22)").attr("width", "12px").attr("height", "12px").attr("xlink:href", (d4) => d4.icon ? "#" + d4.icon : "");
60587 markers.merge(markersEnter).sort(sortY).classed("selected", (d4) => d4.id === selectedID).attr("transform", getTransform);
60588 if (touchLayer.empty()) return;
60589 const fillClass = context.getDebug("target") ? "pink" : "nocolor";
60590 const targets = touchLayer.selectAll(".qaItem.osmose").data(data, (d4) => d4.id);
60591 targets.exit().remove();
60592 targets.enter().append("rect").attr("width", "20px").attr("height", "30px").attr("x", "-10px").attr("y", "-28px").merge(targets).sort(sortY).attr("class", (d4) => `qaItem ${d4.service} target ${fillClass} itemId-${d4.id}`).attr("transform", getTransform);
60593 function sortY(a2, b3) {
60594 return a2.id === selectedID ? 1 : b3.id === selectedID ? -1 : b3.loc[1] - a2.loc[1];
60597 function drawOsmose(selection2) {
60598 const service = getService();
60599 const surface = context.surface();
60600 if (surface && !surface.empty()) {
60601 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
60603 drawLayer = selection2.selectAll(".layer-osmose").data(service ? [0] : []);
60604 drawLayer.exit().remove();
60605 drawLayer = drawLayer.enter().append("g").attr("class", "layer-osmose").style("display", _layerEnabled2 ? "block" : "none").merge(drawLayer);
60606 if (_layerEnabled2) {
60607 if (service && ~~context.map().zoom() >= minZoom5) {
60609 service.loadIssues(projection2);
60616 drawOsmose.enabled = function(val) {
60617 if (!arguments.length) return _layerEnabled2;
60618 _layerEnabled2 = val;
60619 if (_layerEnabled2) {
60620 getService().loadStrings().then(layerOn).catch((err) => {
60625 if (context.selectedErrorID()) {
60626 context.enter(modeBrowse(context));
60629 dispatch14.call("change");
60632 drawOsmose.supported = () => !!getService();
60635 var _layerEnabled2, _qaService2;
60636 var init_osmose2 = __esm({
60637 "modules/svg/osmose.js"() {
60644 _layerEnabled2 = false;
60648 // modules/svg/streetside.js
60649 var streetside_exports2 = {};
60650 __export(streetside_exports2, {
60651 svgStreetside: () => svgStreetside
60653 function svgStreetside(projection2, context, dispatch14) {
60654 var throttledRedraw = throttle_default(function() {
60655 dispatch14.call("change");
60658 var minMarkerZoom = 16;
60659 var minViewfieldZoom2 = 18;
60660 var layer = select_default2(null);
60661 var _viewerYaw = 0;
60662 var _selectedSequence = null;
60665 if (svgStreetside.initialized) return;
60666 svgStreetside.enabled = false;
60667 svgStreetside.initialized = true;
60669 function getService() {
60670 if (services.streetside && !_streetside) {
60671 _streetside = services.streetside;
60672 _streetside.event.on("viewerChanged.svgStreetside", viewerChanged).on("loadedImages.svgStreetside", throttledRedraw);
60673 } else if (!services.streetside && _streetside) {
60674 _streetside = null;
60676 return _streetside;
60678 function showLayer() {
60679 var service = getService();
60680 if (!service) return;
60682 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
60683 dispatch14.call("change");
60686 function hideLayer() {
60687 throttledRedraw.cancel();
60688 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
60690 function editOn() {
60691 layer.style("display", "block");
60693 function editOff() {
60694 layer.selectAll(".viewfield-group").remove();
60695 layer.style("display", "none");
60697 function click(d3_event, d4) {
60698 var service = getService();
60699 if (!service) return;
60700 if (d4.sequenceKey !== _selectedSequence) {
60703 _selectedSequence = d4.sequenceKey;
60704 service.ensureViewerLoaded(context).then(function() {
60705 service.selectImage(context, d4.key).yaw(_viewerYaw).showViewer(context);
60707 context.map().centerEase(d4.loc);
60709 function mouseover(d3_event, d4) {
60710 var service = getService();
60711 if (service) service.setStyles(context, d4);
60713 function mouseout() {
60714 var service = getService();
60715 if (service) service.setStyles(context, null);
60717 function transform2(d4) {
60718 var t2 = svgPointTransform(projection2)(d4);
60719 var rot = d4.ca + _viewerYaw;
60721 t2 += " rotate(" + Math.floor(rot) + ",0,0)";
60725 function viewerChanged() {
60726 var service = getService();
60727 if (!service) return;
60728 var viewer = service.viewer();
60729 if (!viewer) return;
60730 _viewerYaw = viewer.getYaw();
60731 if (context.map().isTransformed()) return;
60732 layer.selectAll(".viewfield-group.currentView").attr("transform", transform2);
60734 function filterBubbles(bubbles, skipDateFilter = false) {
60735 var fromDate = context.photos().fromDate();
60736 var toDate = context.photos().toDate();
60737 var usernames = context.photos().usernames();
60738 if (fromDate && !skipDateFilter) {
60739 var fromTimestamp = new Date(fromDate).getTime();
60740 bubbles = bubbles.filter(function(bubble) {
60741 return new Date(bubble.captured_at).getTime() >= fromTimestamp;
60744 if (toDate && !skipDateFilter) {
60745 var toTimestamp = new Date(toDate).getTime();
60746 bubbles = bubbles.filter(function(bubble) {
60747 return new Date(bubble.captured_at).getTime() <= toTimestamp;
60751 bubbles = bubbles.filter(function(bubble) {
60752 return usernames.indexOf(bubble.captured_by) !== -1;
60757 function filterSequences(sequences, skipDateFilter = false) {
60758 var fromDate = context.photos().fromDate();
60759 var toDate = context.photos().toDate();
60760 var usernames = context.photos().usernames();
60761 if (fromDate && !skipDateFilter) {
60762 var fromTimestamp = new Date(fromDate).getTime();
60763 sequences = sequences.filter(function(sequences2) {
60764 return new Date(sequences2.properties.captured_at).getTime() >= fromTimestamp;
60767 if (toDate && !skipDateFilter) {
60768 var toTimestamp = new Date(toDate).getTime();
60769 sequences = sequences.filter(function(sequences2) {
60770 return new Date(sequences2.properties.captured_at).getTime() <= toTimestamp;
60774 sequences = sequences.filter(function(sequences2) {
60775 return usernames.indexOf(sequences2.properties.captured_by) !== -1;
60780 function update() {
60781 var viewer = context.container().select(".photoviewer");
60782 var selected = viewer.empty() ? void 0 : viewer.datum();
60783 var z3 = ~~context.map().zoom();
60784 var showMarkers = z3 >= minMarkerZoom;
60785 var showViewfields = z3 >= minViewfieldZoom2;
60786 var service = getService();
60787 var sequences = [];
60789 if (context.photos().showsPanoramic()) {
60790 sequences = service ? service.sequences(projection2) : [];
60791 bubbles = service && showMarkers ? service.bubbles(projection2) : [];
60792 sequences = filterSequences(sequences);
60793 bubbles = filterBubbles(bubbles);
60795 var traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d4) {
60796 return d4.properties.key;
60798 dispatch14.call("photoDatesChanged", this, "streetside", [
60799 ...filterBubbles(bubbles, true).map((p2) => p2.captured_at),
60800 ...filterSequences(sequences, true).map((t2) => t2.properties.vintageStart)
60802 traces.exit().remove();
60803 traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
60804 var groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(bubbles, function(d4) {
60805 return d4.key + (d4.sequenceKey ? "v1" : "v0");
60807 groups.exit().remove();
60808 var groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
60809 groupsEnter.append("g").attr("class", "viewfield-scale");
60810 var markers = groups.merge(groupsEnter).sort(function(a2, b3) {
60811 return a2 === selected ? 1 : b3 === selected ? -1 : b3.loc[1] - a2.loc[1];
60812 }).attr("transform", transform2).select(".viewfield-scale");
60813 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
60814 var viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
60815 viewfields.exit().remove();
60816 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
60817 function viewfieldPath() {
60818 var d4 = this.parentNode.__data__;
60820 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
60822 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
60826 function drawImages(selection2) {
60827 var enabled = svgStreetside.enabled;
60828 var service = getService();
60829 layer = selection2.selectAll(".layer-streetside-images").data(service ? [0] : []);
60830 layer.exit().remove();
60831 var layerEnter = layer.enter().append("g").attr("class", "layer-streetside-images").style("display", enabled ? "block" : "none");
60832 layerEnter.append("g").attr("class", "sequences");
60833 layerEnter.append("g").attr("class", "markers");
60834 layer = layerEnter.merge(layer);
60836 if (service && ~~context.map().zoom() >= minZoom5) {
60839 service.loadBubbles(projection2);
60841 dispatch14.call("photoDatesChanged", this, "streetside", []);
60845 dispatch14.call("photoDatesChanged", this, "streetside", []);
60848 drawImages.enabled = function(_3) {
60849 if (!arguments.length) return svgStreetside.enabled;
60850 svgStreetside.enabled = _3;
60851 if (svgStreetside.enabled) {
60853 context.photos().on("change.streetside", update);
60856 context.photos().on("change.streetside", null);
60858 dispatch14.call("change");
60861 drawImages.supported = function() {
60862 return !!getService();
60864 drawImages.rendered = function(zoom) {
60865 return zoom >= minZoom5;
60870 var init_streetside2 = __esm({
60871 "modules/svg/streetside.js"() {
60880 // modules/svg/vegbilder.js
60881 var vegbilder_exports2 = {};
60882 __export(vegbilder_exports2, {
60883 svgVegbilder: () => svgVegbilder
60885 function svgVegbilder(projection2, context, dispatch14) {
60886 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
60887 const minZoom5 = 14;
60888 const minMarkerZoom = 16;
60889 const minViewfieldZoom2 = 18;
60890 let layer = select_default2(null);
60891 let _viewerYaw = 0;
60894 if (svgVegbilder.initialized) return;
60895 svgVegbilder.enabled = false;
60896 svgVegbilder.initialized = true;
60898 function getService() {
60899 if (services.vegbilder && !_vegbilder) {
60900 _vegbilder = services.vegbilder;
60901 _vegbilder.event.on("viewerChanged.svgVegbilder", viewerChanged).on("loadedImages.svgVegbilder", throttledRedraw);
60902 } else if (!services.vegbilder && _vegbilder) {
60907 function showLayer() {
60908 const service = getService();
60909 if (!service) return;
60911 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", () => dispatch14.call("change"));
60913 function hideLayer() {
60914 throttledRedraw.cancel();
60915 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
60917 function editOn() {
60918 layer.style("display", "block");
60920 function editOff() {
60921 layer.selectAll(".viewfield-group").remove();
60922 layer.style("display", "none");
60924 function click(d3_event, d4) {
60925 const service = getService();
60926 if (!service) return;
60927 service.ensureViewerLoaded(context).then(() => {
60928 service.selectImage(context, d4.key).showViewer(context);
60930 context.map().centerEase(d4.loc);
60932 function mouseover(d3_event, d4) {
60933 const service = getService();
60934 if (service) service.setStyles(context, d4);
60936 function mouseout() {
60937 const service = getService();
60938 if (service) service.setStyles(context, null);
60940 function transform2(d4, selected) {
60941 let t2 = svgPointTransform(projection2)(d4);
60943 if (d4 === selected) {
60947 t2 += " rotate(" + Math.floor(rot) + ",0,0)";
60951 function viewerChanged() {
60952 const service = getService();
60953 if (!service) return;
60954 const frame2 = service.photoFrame();
60955 if (!frame2) return;
60956 _viewerYaw = frame2.getYaw();
60957 if (context.map().isTransformed()) return;
60958 layer.selectAll(".viewfield-group.currentView").attr("transform", (d4) => transform2(d4, d4));
60960 function filterImages(images, skipDateFilter) {
60961 const photoContext = context.photos();
60962 const fromDateString = photoContext.fromDate();
60963 const toDateString = photoContext.toDate();
60964 const showsFlat = photoContext.showsFlat();
60965 const showsPano = photoContext.showsPanoramic();
60966 if (fromDateString && !skipDateFilter) {
60967 const fromDate = new Date(fromDateString);
60968 images = images.filter((image) => image.captured_at.getTime() >= fromDate.getTime());
60970 if (toDateString && !skipDateFilter) {
60971 const toDate = new Date(toDateString);
60972 images = images.filter((image) => image.captured_at.getTime() <= toDate.getTime());
60975 images = images.filter((image) => !image.is_sphere);
60978 images = images.filter((image) => image.is_sphere);
60982 function filterSequences(sequences, skipDateFilter) {
60983 const photoContext = context.photos();
60984 const fromDateString = photoContext.fromDate();
60985 const toDateString = photoContext.toDate();
60986 const showsFlat = photoContext.showsFlat();
60987 const showsPano = photoContext.showsPanoramic();
60988 if (fromDateString && !skipDateFilter) {
60989 const fromDate = new Date(fromDateString);
60990 sequences = sequences.filter(({ images }) => images[0].captured_at.getTime() >= fromDate.getTime());
60992 if (toDateString && !skipDateFilter) {
60993 const toDate = new Date(toDateString);
60994 sequences = sequences.filter(({ images }) => images[images.length - 1].captured_at.getTime() <= toDate.getTime());
60997 sequences = sequences.filter(({ images }) => !images[0].is_sphere);
61000 sequences = sequences.filter(({ images }) => images[0].is_sphere);
61004 function update() {
61005 const viewer = context.container().select(".photoviewer");
61006 const selected = viewer.empty() ? void 0 : viewer.datum();
61007 const z3 = ~~context.map().zoom();
61008 const showMarkers = z3 >= minMarkerZoom;
61009 const showViewfields = z3 >= minViewfieldZoom2;
61010 const service = getService();
61011 let sequences = [];
61014 service.loadImages(context);
61015 sequences = service.sequences(projection2);
61016 images = showMarkers ? service.images(projection2) : [];
61017 dispatch14.call("photoDatesChanged", this, "vegbilder", [
61018 ...filterImages(images, true).map((p2) => p2.captured_at),
61019 ...filterSequences(sequences, true).map((s2) => s2.images[0].captured_at)
61021 images = filterImages(images);
61022 sequences = filterSequences(sequences);
61024 let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, (d4) => d4.key);
61025 traces.exit().remove();
61026 traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
61027 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, (d4) => d4.key);
61028 groups.exit().remove();
61029 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
61030 groupsEnter.append("g").attr("class", "viewfield-scale");
61031 const markers = groups.merge(groupsEnter).sort((a2, b3) => {
61032 return a2 === selected ? 1 : b3 === selected ? -1 : b3.loc[1] - a2.loc[1];
61033 }).attr("transform", (d4) => transform2(d4, selected)).select(".viewfield-scale");
61034 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
61035 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
61036 viewfields.exit().remove();
61037 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
61038 function viewfieldPath() {
61039 const d4 = this.parentNode.__data__;
61040 if (d4.is_sphere) {
61041 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
61043 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
61047 function drawImages(selection2) {
61048 const enabled = svgVegbilder.enabled;
61049 const service = getService();
61050 layer = selection2.selectAll(".layer-vegbilder").data(service ? [0] : []);
61051 layer.exit().remove();
61052 const layerEnter = layer.enter().append("g").attr("class", "layer-vegbilder").style("display", enabled ? "block" : "none");
61053 layerEnter.append("g").attr("class", "sequences");
61054 layerEnter.append("g").attr("class", "markers");
61055 layer = layerEnter.merge(layer);
61057 if (service && ~~context.map().zoom() >= minZoom5) {
61060 service.loadImages(context);
61062 dispatch14.call("photoDatesChanged", this, "vegbilder", []);
61066 dispatch14.call("photoDatesChanged", this, "vegbilder", []);
61069 drawImages.enabled = function(_3) {
61070 if (!arguments.length) return svgVegbilder.enabled;
61071 svgVegbilder.enabled = _3;
61072 if (svgVegbilder.enabled) {
61074 context.photos().on("change.vegbilder", update);
61077 context.photos().on("change.vegbilder", null);
61079 dispatch14.call("change");
61082 drawImages.supported = function() {
61083 return !!getService();
61085 drawImages.rendered = function(zoom) {
61086 return zoom >= minZoom5;
61088 drawImages.validHere = function(extent, zoom) {
61089 return zoom >= minZoom5 - 2 && getService().validHere(extent);
61094 var init_vegbilder2 = __esm({
61095 "modules/svg/vegbilder.js"() {
61104 // modules/svg/mapillary_images.js
61105 var mapillary_images_exports = {};
61106 __export(mapillary_images_exports, {
61107 svgMapillaryImages: () => svgMapillaryImages
61109 function svgMapillaryImages(projection2, context, dispatch14) {
61110 const throttledRedraw = throttle_default(function() {
61111 dispatch14.call("change");
61113 const minZoom5 = 12;
61114 const minMarkerZoom = 16;
61115 const minViewfieldZoom2 = 18;
61116 let layer = select_default2(null);
61119 if (svgMapillaryImages.initialized) return;
61120 svgMapillaryImages.enabled = false;
61121 svgMapillaryImages.initialized = true;
61123 function getService() {
61124 if (services.mapillary && !_mapillary) {
61125 _mapillary = services.mapillary;
61126 _mapillary.event.on("loadedImages", throttledRedraw);
61127 } else if (!services.mapillary && _mapillary) {
61132 function showLayer() {
61133 const service = getService();
61134 if (!service) return;
61136 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
61137 dispatch14.call("change");
61140 function hideLayer() {
61141 throttledRedraw.cancel();
61142 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
61144 function editOn() {
61145 layer.style("display", "block");
61147 function editOff() {
61148 layer.selectAll(".viewfield-group").remove();
61149 layer.style("display", "none");
61151 function click(d3_event, image) {
61152 const service = getService();
61153 if (!service) return;
61154 service.ensureViewerLoaded(context).then(function() {
61155 service.selectImage(context, image.id).showViewer(context);
61157 context.map().centerEase(image.loc);
61159 function mouseover(d3_event, image) {
61160 const service = getService();
61161 if (service) service.setStyles(context, image);
61163 function mouseout() {
61164 const service = getService();
61165 if (service) service.setStyles(context, null);
61167 function transform2(d4) {
61168 let t2 = svgPointTransform(projection2)(d4);
61170 t2 += " rotate(" + Math.floor(d4.ca) + ",0,0)";
61174 function filterImages(images, skipDateFilter = false) {
61175 const showsPano = context.photos().showsPanoramic();
61176 const showsFlat = context.photos().showsFlat();
61177 const fromDate = context.photos().fromDate();
61178 const toDate = context.photos().toDate();
61179 if (!showsPano || !showsFlat) {
61180 images = images.filter(function(image) {
61181 if (image.is_pano) return showsPano;
61185 if (fromDate && !skipDateFilter) {
61186 images = images.filter(function(image) {
61187 return new Date(image.captured_at).getTime() >= new Date(fromDate).getTime();
61190 if (toDate && !skipDateFilter) {
61191 images = images.filter(function(image) {
61192 return new Date(image.captured_at).getTime() <= new Date(toDate).getTime();
61197 function filterSequences(sequences, skipDateFilter = false) {
61198 const showsPano = context.photos().showsPanoramic();
61199 const showsFlat = context.photos().showsFlat();
61200 const fromDate = context.photos().fromDate();
61201 const toDate = context.photos().toDate();
61202 if (!showsPano || !showsFlat) {
61203 sequences = sequences.filter(function(sequence) {
61204 if (sequence.properties.hasOwnProperty("is_pano")) {
61205 if (sequence.properties.is_pano) return showsPano;
61211 if (fromDate && !skipDateFilter) {
61212 sequences = sequences.filter(function(sequence) {
61213 return new Date(sequence.properties.captured_at).getTime() >= new Date(fromDate).getTime().toString();
61216 if (toDate && !skipDateFilter) {
61217 sequences = sequences.filter(function(sequence) {
61218 return new Date(sequence.properties.captured_at).getTime() <= new Date(toDate).getTime().toString();
61223 function update() {
61224 const z3 = ~~context.map().zoom();
61225 const showMarkers = z3 >= minMarkerZoom;
61226 const showViewfields = z3 >= minViewfieldZoom2;
61227 const service = getService();
61228 let sequences = service ? service.sequences(projection2) : [];
61229 let images = service && showMarkers ? service.images(projection2) : [];
61230 dispatch14.call("photoDatesChanged", this, "mapillary", [
61231 ...filterImages(images, true).map((p2) => p2.captured_at),
61232 ...filterSequences(sequences, true).map((s2) => s2.properties.captured_at)
61234 images = filterImages(images);
61235 sequences = filterSequences(sequences, service);
61236 service.filterViewer(context);
61237 let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d4) {
61238 return d4.properties.id;
61240 traces.exit().remove();
61241 traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
61242 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d4) {
61245 groups.exit().remove();
61246 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
61247 groupsEnter.append("g").attr("class", "viewfield-scale");
61248 const markers = groups.merge(groupsEnter).sort(function(a2, b3) {
61249 return b3.loc[1] - a2.loc[1];
61250 }).attr("transform", transform2).select(".viewfield-scale");
61251 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
61252 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
61253 viewfields.exit().remove();
61254 viewfields.enter().insert("path", "circle").attr("class", "viewfield").classed("pano", function() {
61255 return this.parentNode.__data__.is_pano;
61256 }).attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
61257 function viewfieldPath() {
61258 if (this.parentNode.__data__.is_pano) {
61259 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
61261 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
61265 function drawImages(selection2) {
61266 const enabled = svgMapillaryImages.enabled;
61267 const service = getService();
61268 layer = selection2.selectAll(".layer-mapillary").data(service ? [0] : []);
61269 layer.exit().remove();
61270 const layerEnter = layer.enter().append("g").attr("class", "layer-mapillary").style("display", enabled ? "block" : "none");
61271 layerEnter.append("g").attr("class", "sequences");
61272 layerEnter.append("g").attr("class", "markers");
61273 layer = layerEnter.merge(layer);
61275 if (service && ~~context.map().zoom() >= minZoom5) {
61278 service.loadImages(projection2);
61280 dispatch14.call("photoDatesChanged", this, "mapillary", []);
61284 dispatch14.call("photoDatesChanged", this, "mapillary", []);
61287 drawImages.enabled = function(_3) {
61288 if (!arguments.length) return svgMapillaryImages.enabled;
61289 svgMapillaryImages.enabled = _3;
61290 if (svgMapillaryImages.enabled) {
61292 context.photos().on("change.mapillary_images", update);
61295 context.photos().on("change.mapillary_images", null);
61297 dispatch14.call("change");
61300 drawImages.supported = function() {
61301 return !!getService();
61303 drawImages.rendered = function(zoom) {
61304 return zoom >= minZoom5;
61309 var init_mapillary_images = __esm({
61310 "modules/svg/mapillary_images.js"() {
61319 // modules/svg/mapillary_position.js
61320 var mapillary_position_exports = {};
61321 __export(mapillary_position_exports, {
61322 svgMapillaryPosition: () => svgMapillaryPosition
61324 function svgMapillaryPosition(projection2, context) {
61325 const throttledRedraw = throttle_default(function() {
61328 const minZoom5 = 12;
61329 const minViewfieldZoom2 = 18;
61330 let layer = select_default2(null);
61332 let viewerCompassAngle;
61334 if (svgMapillaryPosition.initialized) return;
61335 svgMapillaryPosition.initialized = true;
61337 function getService() {
61338 if (services.mapillary && !_mapillary) {
61339 _mapillary = services.mapillary;
61340 _mapillary.event.on("imageChanged", throttledRedraw);
61341 _mapillary.event.on("bearingChanged", function(e3) {
61342 viewerCompassAngle = e3.bearing;
61343 if (context.map().isTransformed()) return;
61344 layer.selectAll(".viewfield-group.currentView").filter(function(d4) {
61346 }).attr("transform", transform2);
61348 } else if (!services.mapillary && _mapillary) {
61353 function editOn() {
61354 layer.style("display", "block");
61356 function editOff() {
61357 layer.selectAll(".viewfield-group").remove();
61358 layer.style("display", "none");
61360 function transform2(d4) {
61361 let t2 = svgPointTransform(projection2)(d4);
61362 if (d4.is_pano && viewerCompassAngle !== null && isFinite(viewerCompassAngle)) {
61363 t2 += " rotate(" + Math.floor(viewerCompassAngle) + ",0,0)";
61364 } else if (d4.ca) {
61365 t2 += " rotate(" + Math.floor(d4.ca) + ",0,0)";
61369 function update() {
61370 const z3 = ~~context.map().zoom();
61371 const showViewfields = z3 >= minViewfieldZoom2;
61372 const service = getService();
61373 const image = service && service.getActiveImage();
61374 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(image ? [image] : [], function(d4) {
61377 groups.exit().remove();
61378 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group currentView highlighted");
61379 groupsEnter.append("g").attr("class", "viewfield-scale");
61380 const markers = groups.merge(groupsEnter).attr("transform", transform2).select(".viewfield-scale");
61381 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
61382 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
61383 viewfields.exit().remove();
61384 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z");
61386 function drawImages(selection2) {
61387 const service = getService();
61388 layer = selection2.selectAll(".layer-mapillary-position").data(service ? [0] : []);
61389 layer.exit().remove();
61390 const layerEnter = layer.enter().append("g").attr("class", "layer-mapillary-position");
61391 layerEnter.append("g").attr("class", "markers");
61392 layer = layerEnter.merge(layer);
61393 if (service && ~~context.map().zoom() >= minZoom5) {
61400 drawImages.enabled = function() {
61404 drawImages.supported = function() {
61405 return !!getService();
61407 drawImages.rendered = function(zoom) {
61408 return zoom >= minZoom5;
61413 var init_mapillary_position = __esm({
61414 "modules/svg/mapillary_position.js"() {
61423 // modules/svg/mapillary_signs.js
61424 var mapillary_signs_exports = {};
61425 __export(mapillary_signs_exports, {
61426 svgMapillarySigns: () => svgMapillarySigns
61428 function svgMapillarySigns(projection2, context, dispatch14) {
61429 const throttledRedraw = throttle_default(function() {
61430 dispatch14.call("change");
61432 const minZoom5 = 12;
61433 let layer = select_default2(null);
61436 if (svgMapillarySigns.initialized) return;
61437 svgMapillarySigns.enabled = false;
61438 svgMapillarySigns.initialized = true;
61440 function getService() {
61441 if (services.mapillary && !_mapillary) {
61442 _mapillary = services.mapillary;
61443 _mapillary.event.on("loadedSigns", throttledRedraw);
61444 } else if (!services.mapillary && _mapillary) {
61449 function showLayer() {
61450 const service = getService();
61451 if (!service) return;
61452 service.loadSignResources(context);
61455 function hideLayer() {
61456 throttledRedraw.cancel();
61459 function editOn() {
61460 layer.style("display", "block");
61462 function editOff() {
61463 layer.selectAll(".icon-sign").remove();
61464 layer.style("display", "none");
61466 function click(d3_event, d4) {
61467 const service = getService();
61468 if (!service) return;
61469 context.map().centerEase(d4.loc);
61470 const selectedImageId = service.getActiveImage() && service.getActiveImage().id;
61471 service.getDetections(d4.id).then((detections) => {
61472 if (detections.length) {
61473 const imageId = detections[0].image.id;
61474 if (imageId === selectedImageId) {
61475 service.highlightDetection(detections[0]).selectImage(context, imageId);
61477 service.ensureViewerLoaded(context).then(function() {
61478 service.highlightDetection(detections[0]).selectImage(context, imageId).showViewer(context);
61484 function filterData(detectedFeatures) {
61485 var fromDate = context.photos().fromDate();
61486 var toDate = context.photos().toDate();
61488 var fromTimestamp = new Date(fromDate).getTime();
61489 detectedFeatures = detectedFeatures.filter(function(feature3) {
61490 return new Date(feature3.last_seen_at).getTime() >= fromTimestamp;
61494 var toTimestamp = new Date(toDate).getTime();
61495 detectedFeatures = detectedFeatures.filter(function(feature3) {
61496 return new Date(feature3.first_seen_at).getTime() <= toTimestamp;
61499 return detectedFeatures;
61501 function update() {
61502 const service = getService();
61503 let data = service ? service.signs(projection2) : [];
61504 data = filterData(data);
61505 const transform2 = svgPointTransform(projection2);
61506 const signs = layer.selectAll(".icon-sign").data(data, function(d4) {
61509 signs.exit().remove();
61510 const enter = signs.enter().append("g").attr("class", "icon-sign icon-detected").on("click", click);
61511 enter.append("use").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px").attr("xlink:href", function(d4) {
61512 return "#" + d4.value;
61514 enter.append("rect").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px");
61515 signs.merge(enter).attr("transform", transform2);
61517 function drawSigns(selection2) {
61518 const enabled = svgMapillarySigns.enabled;
61519 const service = getService();
61520 layer = selection2.selectAll(".layer-mapillary-signs").data(service ? [0] : []);
61521 layer.exit().remove();
61522 layer = layer.enter().append("g").attr("class", "layer-mapillary-signs layer-mapillary-detections").style("display", enabled ? "block" : "none").merge(layer);
61524 if (service && ~~context.map().zoom() >= minZoom5) {
61527 service.loadSigns(projection2);
61528 service.showSignDetections(true);
61532 } else if (service) {
61533 service.showSignDetections(false);
61536 drawSigns.enabled = function(_3) {
61537 if (!arguments.length) return svgMapillarySigns.enabled;
61538 svgMapillarySigns.enabled = _3;
61539 if (svgMapillarySigns.enabled) {
61541 context.photos().on("change.mapillary_signs", update);
61544 context.photos().on("change.mapillary_signs", null);
61546 dispatch14.call("change");
61549 drawSigns.supported = function() {
61550 return !!getService();
61552 drawSigns.rendered = function(zoom) {
61553 return zoom >= minZoom5;
61558 var init_mapillary_signs = __esm({
61559 "modules/svg/mapillary_signs.js"() {
61568 // modules/svg/mapillary_map_features.js
61569 var mapillary_map_features_exports = {};
61570 __export(mapillary_map_features_exports, {
61571 svgMapillaryMapFeatures: () => svgMapillaryMapFeatures
61573 function svgMapillaryMapFeatures(projection2, context, dispatch14) {
61574 const throttledRedraw = throttle_default(function() {
61575 dispatch14.call("change");
61577 const minZoom5 = 12;
61578 let layer = select_default2(null);
61581 if (svgMapillaryMapFeatures.initialized) return;
61582 svgMapillaryMapFeatures.enabled = false;
61583 svgMapillaryMapFeatures.initialized = true;
61585 function getService() {
61586 if (services.mapillary && !_mapillary) {
61587 _mapillary = services.mapillary;
61588 _mapillary.event.on("loadedMapFeatures", throttledRedraw);
61589 } else if (!services.mapillary && _mapillary) {
61594 function showLayer() {
61595 const service = getService();
61596 if (!service) return;
61597 service.loadObjectResources(context);
61600 function hideLayer() {
61601 throttledRedraw.cancel();
61604 function editOn() {
61605 layer.style("display", "block");
61607 function editOff() {
61608 layer.selectAll(".icon-map-feature").remove();
61609 layer.style("display", "none");
61611 function click(d3_event, d4) {
61612 const service = getService();
61613 if (!service) return;
61614 context.map().centerEase(d4.loc);
61615 const selectedImageId = service.getActiveImage() && service.getActiveImage().id;
61616 service.getDetections(d4.id).then((detections) => {
61617 if (detections.length) {
61618 const imageId = detections[0].image.id;
61619 if (imageId === selectedImageId) {
61620 service.highlightDetection(detections[0]).selectImage(context, imageId);
61622 service.ensureViewerLoaded(context).then(function() {
61623 service.highlightDetection(detections[0]).selectImage(context, imageId).showViewer(context);
61629 function filterData(detectedFeatures) {
61630 const fromDate = context.photos().fromDate();
61631 const toDate = context.photos().toDate();
61633 detectedFeatures = detectedFeatures.filter(function(feature3) {
61634 return new Date(feature3.last_seen_at).getTime() >= new Date(fromDate).getTime();
61638 detectedFeatures = detectedFeatures.filter(function(feature3) {
61639 return new Date(feature3.first_seen_at).getTime() <= new Date(toDate).getTime();
61642 return detectedFeatures;
61644 function update() {
61645 const service = getService();
61646 let data = service ? service.mapFeatures(projection2) : [];
61647 data = filterData(data);
61648 const transform2 = svgPointTransform(projection2);
61649 const mapFeatures = layer.selectAll(".icon-map-feature").data(data, function(d4) {
61652 mapFeatures.exit().remove();
61653 const enter = mapFeatures.enter().append("g").attr("class", "icon-map-feature icon-detected").on("click", click);
61654 enter.append("title").text(function(d4) {
61655 var id2 = d4.value.replace(/--/g, ".").replace(/-/g, "_");
61656 return _t("mapillary_map_features." + id2);
61658 enter.append("use").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px").attr("xlink:href", function(d4) {
61659 if (d4.value === "object--billboard") {
61660 return "#object--sign--advertisement";
61662 return "#" + d4.value;
61664 enter.append("rect").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px");
61665 mapFeatures.merge(enter).attr("transform", transform2);
61667 function drawMapFeatures(selection2) {
61668 const enabled = svgMapillaryMapFeatures.enabled;
61669 const service = getService();
61670 layer = selection2.selectAll(".layer-mapillary-map-features").data(service ? [0] : []);
61671 layer.exit().remove();
61672 layer = layer.enter().append("g").attr("class", "layer-mapillary-map-features layer-mapillary-detections").style("display", enabled ? "block" : "none").merge(layer);
61674 if (service && ~~context.map().zoom() >= minZoom5) {
61677 service.loadMapFeatures(projection2);
61678 service.showFeatureDetections(true);
61682 } else if (service) {
61683 service.showFeatureDetections(false);
61686 drawMapFeatures.enabled = function(_3) {
61687 if (!arguments.length) return svgMapillaryMapFeatures.enabled;
61688 svgMapillaryMapFeatures.enabled = _3;
61689 if (svgMapillaryMapFeatures.enabled) {
61691 context.photos().on("change.mapillary_map_features", update);
61694 context.photos().on("change.mapillary_map_features", null);
61696 dispatch14.call("change");
61699 drawMapFeatures.supported = function() {
61700 return !!getService();
61702 drawMapFeatures.rendered = function(zoom) {
61703 return zoom >= minZoom5;
61706 return drawMapFeatures;
61708 var init_mapillary_map_features = __esm({
61709 "modules/svg/mapillary_map_features.js"() {
61719 // modules/svg/kartaview_images.js
61720 var kartaview_images_exports = {};
61721 __export(kartaview_images_exports, {
61722 svgKartaviewImages: () => svgKartaviewImages
61724 function svgKartaviewImages(projection2, context, dispatch14) {
61725 var throttledRedraw = throttle_default(function() {
61726 dispatch14.call("change");
61729 var minMarkerZoom = 16;
61730 var minViewfieldZoom2 = 18;
61731 var layer = select_default2(null);
61734 if (svgKartaviewImages.initialized) return;
61735 svgKartaviewImages.enabled = false;
61736 svgKartaviewImages.initialized = true;
61738 function getService() {
61739 if (services.kartaview && !_kartaview) {
61740 _kartaview = services.kartaview;
61741 _kartaview.event.on("loadedImages", throttledRedraw);
61742 } else if (!services.kartaview && _kartaview) {
61747 function showLayer() {
61748 var service = getService();
61749 if (!service) return;
61751 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
61752 dispatch14.call("change");
61755 function hideLayer() {
61756 throttledRedraw.cancel();
61757 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
61759 function editOn() {
61760 layer.style("display", "block");
61762 function editOff() {
61763 layer.selectAll(".viewfield-group").remove();
61764 layer.style("display", "none");
61766 function click(d3_event, d4) {
61767 var service = getService();
61768 if (!service) return;
61769 service.ensureViewerLoaded(context).then(function() {
61770 service.selectImage(context, d4.key).showViewer(context);
61772 context.map().centerEase(d4.loc);
61774 function mouseover(d3_event, d4) {
61775 var service = getService();
61776 if (service) service.setStyles(context, d4);
61778 function mouseout() {
61779 var service = getService();
61780 if (service) service.setStyles(context, null);
61782 function transform2(d4) {
61783 var t2 = svgPointTransform(projection2)(d4);
61785 t2 += " rotate(" + Math.floor(d4.ca) + ",0,0)";
61789 function filterImages(images, skipDateFilter = false) {
61790 var fromDate = context.photos().fromDate();
61791 var toDate = context.photos().toDate();
61792 var usernames = context.photos().usernames();
61793 if (fromDate && !skipDateFilter) {
61794 var fromTimestamp = new Date(fromDate).getTime();
61795 images = images.filter(function(item) {
61796 return new Date(item.captured_at).getTime() >= fromTimestamp;
61799 if (toDate && !skipDateFilter) {
61800 var toTimestamp = new Date(toDate).getTime();
61801 images = images.filter(function(item) {
61802 return new Date(item.captured_at).getTime() <= toTimestamp;
61806 images = images.filter(function(item) {
61807 return usernames.indexOf(item.captured_by) !== -1;
61812 function filterSequences(sequences, skipDateFilter = false) {
61813 var fromDate = context.photos().fromDate();
61814 var toDate = context.photos().toDate();
61815 var usernames = context.photos().usernames();
61816 if (fromDate && !skipDateFilter) {
61817 var fromTimestamp = new Date(fromDate).getTime();
61818 sequences = sequences.filter(function(sequence) {
61819 return new Date(sequence.properties.captured_at).getTime() >= fromTimestamp;
61822 if (toDate && !skipDateFilter) {
61823 var toTimestamp = new Date(toDate).getTime();
61824 sequences = sequences.filter(function(sequence) {
61825 return new Date(sequence.properties.captured_at).getTime() <= toTimestamp;
61829 sequences = sequences.filter(function(sequence) {
61830 return usernames.indexOf(sequence.properties.captured_by) !== -1;
61835 function update() {
61836 var viewer = context.container().select(".photoviewer");
61837 var selected = viewer.empty() ? void 0 : viewer.datum();
61838 var z3 = ~~context.map().zoom();
61839 var showMarkers = z3 >= minMarkerZoom;
61840 var showViewfields = z3 >= minViewfieldZoom2;
61841 var service = getService();
61842 var sequences = [];
61844 sequences = service ? service.sequences(projection2) : [];
61845 images = service && showMarkers ? service.images(projection2) : [];
61846 dispatch14.call("photoDatesChanged", this, "kartaview", [
61847 ...filterImages(images, true).map((p2) => p2.captured_at),
61848 ...filterSequences(sequences, true).map((s2) => s2.properties.captured_at)
61850 sequences = filterSequences(sequences);
61851 images = filterImages(images);
61852 var traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d4) {
61853 return d4.properties.key;
61855 traces.exit().remove();
61856 traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
61857 var groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d4) {
61860 groups.exit().remove();
61861 var groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
61862 groupsEnter.append("g").attr("class", "viewfield-scale");
61863 var markers = groups.merge(groupsEnter).sort(function(a2, b3) {
61864 return a2 === selected ? 1 : b3 === selected ? -1 : b3.loc[1] - a2.loc[1];
61865 }).attr("transform", transform2).select(".viewfield-scale");
61866 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
61867 var viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
61868 viewfields.exit().remove();
61869 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z");
61871 function drawImages(selection2) {
61872 var enabled = svgKartaviewImages.enabled, service = getService();
61873 layer = selection2.selectAll(".layer-kartaview").data(service ? [0] : []);
61874 layer.exit().remove();
61875 var layerEnter = layer.enter().append("g").attr("class", "layer-kartaview").style("display", enabled ? "block" : "none");
61876 layerEnter.append("g").attr("class", "sequences");
61877 layerEnter.append("g").attr("class", "markers");
61878 layer = layerEnter.merge(layer);
61880 if (service && ~~context.map().zoom() >= minZoom5) {
61883 service.loadImages(projection2);
61885 dispatch14.call("photoDatesChanged", this, "kartaview", []);
61889 dispatch14.call("photoDatesChanged", this, "kartaview", []);
61892 drawImages.enabled = function(_3) {
61893 if (!arguments.length) return svgKartaviewImages.enabled;
61894 svgKartaviewImages.enabled = _3;
61895 if (svgKartaviewImages.enabled) {
61897 context.photos().on("change.kartaview_images", update);
61900 context.photos().on("change.kartaview_images", null);
61902 dispatch14.call("change");
61905 drawImages.supported = function() {
61906 return !!getService();
61908 drawImages.rendered = function(zoom) {
61909 return zoom >= minZoom5;
61914 var init_kartaview_images = __esm({
61915 "modules/svg/kartaview_images.js"() {
61924 // modules/svg/mapilio_images.js
61925 var mapilio_images_exports = {};
61926 __export(mapilio_images_exports, {
61927 svgMapilioImages: () => svgMapilioImages
61929 function svgMapilioImages(projection2, context, dispatch14) {
61930 const throttledRedraw = throttle_default(function() {
61931 dispatch14.call("change");
61933 const imageMinZoom2 = 16;
61934 const lineMinZoom2 = 10;
61935 const viewFieldZoomLevel = 18;
61936 let layer = select_default2(null);
61938 let _viewerYaw = 0;
61940 if (svgMapilioImages.initialized) return;
61941 svgMapilioImages.enabled = false;
61942 svgMapilioImages.initialized = true;
61944 function getService() {
61945 if (services.mapilio && !_mapilio) {
61946 _mapilio = services.mapilio;
61947 _mapilio.event.on("loadedImages", throttledRedraw).on("loadedLines", throttledRedraw);
61948 } else if (!services.mapilio && _mapilio) {
61953 function filterImages(images, skipDateFilter = false) {
61954 var fromDate = context.photos().fromDate();
61955 var toDate = context.photos().toDate();
61956 if (fromDate && !skipDateFilter) {
61957 images = images.filter(function(image) {
61958 return new Date(image.capture_time).getTime() >= new Date(fromDate).getTime();
61961 if (toDate && !skipDateFilter) {
61962 images = images.filter(function(image) {
61963 return new Date(image.capture_time).getTime() <= new Date(toDate).getTime();
61968 function filterSequences(sequences, skipDateFilter = false) {
61969 var fromDate = context.photos().fromDate();
61970 var toDate = context.photos().toDate();
61971 if (fromDate && !skipDateFilter) {
61972 sequences = sequences.filter(function(sequence) {
61973 return new Date(sequence.properties.capture_time).getTime() >= new Date(fromDate).getTime().toString();
61976 if (toDate && !skipDateFilter) {
61977 sequences = sequences.filter(function(sequence) {
61978 return new Date(sequence.properties.capture_time).getTime() <= new Date(toDate).getTime().toString();
61983 function showLayer() {
61984 const service = getService();
61985 if (!service) return;
61987 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
61988 dispatch14.call("change");
61991 function hideLayer() {
61992 throttledRedraw.cancel();
61993 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
61995 function transform2(d4, selectedImageId) {
61996 let t2 = svgPointTransform(projection2)(d4);
61997 let rot = d4.heading || 0;
61998 if (d4.id === selectedImageId) {
62002 t2 += " rotate(" + Math.floor(rot) + ",0,0)";
62006 function editOn() {
62007 layer.style("display", "block");
62009 function editOff() {
62010 layer.selectAll(".viewfield-group").remove();
62011 layer.style("display", "none");
62013 function click(d3_event, image) {
62014 const service = getService();
62015 if (!service) return;
62016 service.ensureViewerLoaded(context, image.id).then(() => {
62017 service.selectImage(context, image.id).showViewer(context);
62019 context.map().centerEase(image.loc);
62021 function mouseover(d3_event, image) {
62022 const service = getService();
62023 if (service) service.setStyles(context, image);
62025 function mouseout() {
62026 const service = getService();
62027 if (service) service.setStyles(context, null);
62029 async function update() {
62031 const zoom = ~~context.map().zoom();
62032 const showViewfields = zoom >= viewFieldZoomLevel;
62033 const service = getService();
62034 let sequences = service ? service.sequences(projection2, zoom) : [];
62035 let images = service && zoom >= imageMinZoom2 ? service.images(projection2) : [];
62036 dispatch14.call("photoDatesChanged", this, "mapilio", [
62037 ...filterImages(images, true).map((p2) => p2.capture_time),
62038 ...filterSequences(sequences, true).map((s2) => s2.properties.capture_time)
62040 images = await filterImages(images);
62041 sequences = await filterSequences(sequences, service);
62042 const activeImage = (_a4 = service.getActiveImage) == null ? void 0 : _a4.call(service);
62043 const activeImageId = activeImage ? activeImage.id : null;
62044 let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d4) {
62045 return d4.properties.id;
62047 traces.exit().remove();
62048 traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
62049 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d4) {
62052 groups.exit().remove();
62053 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
62054 groupsEnter.append("g").attr("class", "viewfield-scale");
62055 const markers = groups.merge(groupsEnter).sort(function(a2, b3) {
62056 if (a2.id === activeImageId) return 1;
62057 if (b3.id === activeImageId) return -1;
62058 return a2.capture_time_parsed - b3.capture_time_parsed;
62059 }).attr("transform", (d4) => transform2(d4, activeImageId)).select(".viewfield-scale");
62060 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
62061 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
62062 viewfields.exit().remove();
62063 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
62064 service.setStyles(context, null);
62065 function viewfieldPath() {
62066 if (this.parentNode.__data__.isPano) {
62067 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
62069 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
62073 function drawImages(selection2) {
62074 const enabled = svgMapilioImages.enabled;
62075 const service = getService();
62076 layer = selection2.selectAll(".layer-mapilio").data(service ? [0] : []);
62077 layer.exit().remove();
62078 const layerEnter = layer.enter().append("g").attr("class", "layer-mapilio").style("display", enabled ? "block" : "none");
62079 layerEnter.append("g").attr("class", "sequences");
62080 layerEnter.append("g").attr("class", "markers");
62081 layer = layerEnter.merge(layer);
62083 let zoom = ~~context.map().zoom();
62085 if (zoom >= imageMinZoom2) {
62088 service.loadImages(projection2);
62089 service.loadLines(projection2, zoom);
62090 } else if (zoom >= lineMinZoom2) {
62093 service.loadImages(projection2);
62094 service.loadLines(projection2, zoom);
62097 dispatch14.call("photoDatesChanged", this, "mapilio", []);
62098 service.selectImage(context, null);
62104 dispatch14.call("photoDatesChanged", this, "mapilio", []);
62107 drawImages.enabled = function(_3) {
62108 if (!arguments.length) return svgMapilioImages.enabled;
62109 svgMapilioImages.enabled = _3;
62110 if (svgMapilioImages.enabled) {
62112 context.photos().on("change.mapilio_images", update);
62115 context.photos().on("change.mapilio_images", null);
62117 dispatch14.call("change");
62120 drawImages.supported = function() {
62121 return !!getService();
62123 drawImages.rendered = function(zoom) {
62124 return zoom >= lineMinZoom2;
62129 var init_mapilio_images = __esm({
62130 "modules/svg/mapilio_images.js"() {
62139 // modules/svg/panoramax_images.js
62140 var panoramax_images_exports = {};
62141 __export(panoramax_images_exports, {
62142 svgPanoramaxImages: () => svgPanoramaxImages
62144 function svgPanoramaxImages(projection2, context, dispatch14) {
62145 const throttledRedraw = throttle_default(function() {
62146 dispatch14.call("change");
62148 const imageMinZoom2 = 15;
62149 const lineMinZoom2 = 10;
62150 const viewFieldZoomLevel = 18;
62151 let layer = select_default2(null);
62153 let _viewerYaw = 0;
62154 let _activeUsernameFilter;
62157 if (svgPanoramaxImages.initialized) return;
62158 svgPanoramaxImages.enabled = false;
62159 svgPanoramaxImages.initialized = true;
62161 function getService() {
62162 if (services.panoramax && !_panoramax) {
62163 _panoramax = services.panoramax;
62164 _panoramax.event.on("viewerChanged", viewerChanged).on("loadedLines", throttledRedraw).on("loadedImages", throttledRedraw);
62165 } else if (!services.panoramax && _panoramax) {
62170 async function filterImages(images, skipDateFilter = false) {
62171 const showsPano = context.photos().showsPanoramic();
62172 const showsFlat = context.photos().showsFlat();
62173 const fromDate = context.photos().fromDate();
62174 const toDate = context.photos().toDate();
62175 const username = context.photos().usernames();
62176 const service = getService();
62177 if (!showsPano || !showsFlat) {
62178 images = images.filter(function(image) {
62179 if (image.isPano) return showsPano;
62183 if (fromDate && !skipDateFilter) {
62184 images = images.filter(function(image) {
62185 return new Date(image.capture_time).getTime() >= new Date(fromDate).getTime();
62188 if (toDate && !skipDateFilter) {
62189 images = images.filter(function(image) {
62190 return new Date(image.capture_time).getTime() <= new Date(toDate).getTime();
62193 if (username && service) {
62194 if (_activeUsernameFilter !== username) {
62195 _activeUsernameFilter = username;
62196 const tempIds = await service.getUserIds(username);
62198 tempIds.forEach((id2) => {
62199 _activeIds[id2] = true;
62202 images = images.filter(function(image) {
62203 return _activeIds[image.account_id];
62208 async function filterSequences(sequences, skipDateFilter = false) {
62209 const showsPano = context.photos().showsPanoramic();
62210 const showsFlat = context.photos().showsFlat();
62211 const fromDate = context.photos().fromDate();
62212 const toDate = context.photos().toDate();
62213 const username = context.photos().usernames();
62214 const service = getService();
62215 if (!showsPano || !showsFlat) {
62216 sequences = sequences.filter(function(sequence) {
62217 if (sequence.properties.type === "equirectangular") return showsPano;
62221 if (fromDate && !skipDateFilter) {
62222 sequences = sequences.filter(function(sequence) {
62223 return new Date(sequence.properties.date).getTime() >= new Date(fromDate).getTime().toString();
62226 if (toDate && !skipDateFilter) {
62227 sequences = sequences.filter(function(sequence) {
62228 return new Date(sequence.properties.date).getTime() <= new Date(toDate).getTime().toString();
62231 if (username && service) {
62232 if (_activeUsernameFilter !== username) {
62233 _activeUsernameFilter = username;
62234 const tempIds = await service.getUserIds(username);
62236 tempIds.forEach((id2) => {
62237 _activeIds[id2] = true;
62240 sequences = sequences.filter(function(sequence) {
62241 return _activeIds[sequence.properties.account_id];
62246 function showLayer() {
62247 const service = getService();
62248 if (!service) return;
62250 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
62251 dispatch14.call("change");
62254 function hideLayer() {
62255 throttledRedraw.cancel();
62256 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
62258 function transform2(d4, selectedImageId) {
62259 let t2 = svgPointTransform(projection2)(d4);
62260 let rot = d4.heading;
62261 if (d4.id === selectedImageId) {
62265 t2 += " rotate(" + Math.floor(rot) + ",0,0)";
62269 function editOn() {
62270 layer.style("display", "block");
62272 function editOff() {
62273 layer.selectAll(".viewfield-group").remove();
62274 layer.style("display", "none");
62276 function click(d3_event, image) {
62277 const service = getService();
62278 if (!service) return;
62279 service.ensureViewerLoaded(context).then(function() {
62280 service.selectImage(context, image.id).showViewer(context);
62282 context.map().centerEase(image.loc);
62284 function mouseover(d3_event, image) {
62285 const service = getService();
62286 if (service) service.setStyles(context, image);
62288 function mouseout() {
62289 const service = getService();
62290 if (service) service.setStyles(context, null);
62292 async function update() {
62294 const zoom = ~~context.map().zoom();
62295 const showViewfields = zoom >= viewFieldZoomLevel;
62296 const service = getService();
62297 let sequences = service ? service.sequences(projection2, zoom) : [];
62298 let images = service && zoom >= imageMinZoom2 ? service.images(projection2) : [];
62299 dispatch14.call("photoDatesChanged", this, "panoramax", [
62300 ...(await filterImages(images, true)).map((p2) => p2.capture_time),
62301 ...(await filterSequences(sequences, true)).map((s2) => s2.properties.date)
62303 images = await filterImages(images);
62304 sequences = await filterSequences(sequences, service);
62305 let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d4) {
62306 return d4.properties.id;
62308 traces.exit().remove();
62309 traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
62310 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d4) {
62313 groups.exit().remove();
62314 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
62315 groupsEnter.append("g").attr("class", "viewfield-scale");
62316 const activeImageId = (_a4 = service.getActiveImage()) == null ? void 0 : _a4.id;
62317 const markers = groups.merge(groupsEnter).sort(function(a2, b3) {
62318 if (a2.id === activeImageId) return 1;
62319 if (b3.id === activeImageId) return -1;
62320 return a2.capture_time_parsed - b3.capture_time_parsed;
62321 }).attr("transform", (d4) => transform2(d4, activeImageId)).select(".viewfield-scale");
62322 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
62323 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
62324 viewfields.exit().remove();
62325 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
62326 service.setStyles(context, null);
62327 function viewfieldPath() {
62328 if (this.parentNode.__data__.isPano) {
62329 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
62331 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
62335 function viewerChanged() {
62336 const service = getService();
62337 if (!service) return;
62338 const frame2 = service.photoFrame();
62339 if (!frame2) return;
62340 _viewerYaw = frame2.getYaw();
62341 if (context.map().isTransformed()) return;
62342 layer.selectAll(".viewfield-group.currentView").attr("transform", (d4) => transform2(d4, d4.id));
62344 function drawImages(selection2) {
62345 const enabled = svgPanoramaxImages.enabled;
62346 const service = getService();
62347 layer = selection2.selectAll(".layer-panoramax").data(service ? [0] : []);
62348 layer.exit().remove();
62349 const layerEnter = layer.enter().append("g").attr("class", "layer-panoramax").style("display", enabled ? "block" : "none");
62350 layerEnter.append("g").attr("class", "sequences");
62351 layerEnter.append("g").attr("class", "markers");
62352 layer = layerEnter.merge(layer);
62354 let zoom = ~~context.map().zoom();
62356 if (zoom >= imageMinZoom2) {
62359 service.loadImages(projection2);
62360 } else if (zoom >= lineMinZoom2) {
62363 service.loadLines(projection2, zoom);
62366 dispatch14.call("photoDatesChanged", this, "panoramax", []);
62372 dispatch14.call("photoDatesChanged", this, "panoramax", []);
62375 drawImages.enabled = function(_3) {
62376 if (!arguments.length) return svgPanoramaxImages.enabled;
62377 svgPanoramaxImages.enabled = _3;
62378 if (svgPanoramaxImages.enabled) {
62380 context.photos().on("change.panoramax_images", update);
62383 context.photos().on("change.panoramax_images", null);
62385 dispatch14.call("change");
62388 drawImages.supported = function() {
62389 return !!getService();
62391 drawImages.rendered = function(zoom) {
62392 return zoom >= lineMinZoom2;
62397 var init_panoramax_images = __esm({
62398 "modules/svg/panoramax_images.js"() {
62407 // modules/svg/osm.js
62408 var osm_exports3 = {};
62409 __export(osm_exports3, {
62410 svgOsm: () => svgOsm
62412 function svgOsm(projection2, context, dispatch14) {
62413 var enabled = true;
62414 function drawOsm(selection2) {
62415 selection2.selectAll(".layer-osm").data(["covered", "areas", "lines", "points", "labels"]).enter().append("g").attr("class", function(d4) {
62416 return "layer-osm " + d4;
62418 selection2.selectAll(".layer-osm.points").selectAll(".points-group").data(["vertices", "midpoints", "points", "turns"]).enter().append("g").attr("class", function(d4) {
62419 return "points-group " + d4;
62422 function showLayer() {
62423 var layer = context.surface().selectAll(".data-layer.osm");
62425 layer.classed("disabled", false).style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", function() {
62426 dispatch14.call("change");
62429 function hideLayer() {
62430 var layer = context.surface().selectAll(".data-layer.osm");
62432 layer.transition().duration(250).style("opacity", 0).on("end interrupt", function() {
62433 layer.classed("disabled", true);
62434 dispatch14.call("change");
62437 drawOsm.enabled = function(val) {
62438 if (!arguments.length) return enabled;
62445 dispatch14.call("change");
62450 var init_osm3 = __esm({
62451 "modules/svg/osm.js"() {
62456 // modules/svg/notes.js
62457 var notes_exports = {};
62458 __export(notes_exports, {
62459 svgNotes: () => svgNotes
62461 function svgNotes(projection2, context, dispatch14) {
62463 dispatch14 = dispatch_default("change");
62465 var throttledRedraw = throttle_default(function() {
62466 dispatch14.call("change");
62469 var touchLayer = select_default2(null);
62470 var drawLayer = select_default2(null);
62471 var _notesVisible = false;
62472 function markerPath(selection2, klass) {
62473 selection2.attr("class", klass).attr("transform", "translate(-8, -22)").attr("d", "m17.5,0l-15,0c-1.37,0 -2.5,1.12 -2.5,2.5l0,11.25c0,1.37 1.12,2.5 2.5,2.5l3.75,0l0,3.28c0,0.38 0.43,0.6 0.75,0.37l4.87,-3.65l5.62,0c1.37,0 2.5,-1.12 2.5,-2.5l0,-11.25c0,-1.37 -1.12,-2.5 -2.5,-2.5z");
62475 function getService() {
62476 if (services.osm && !_osmService) {
62477 _osmService = services.osm;
62478 _osmService.on("loadedNotes", throttledRedraw);
62479 } else if (!services.osm && _osmService) {
62480 _osmService = null;
62482 return _osmService;
62484 function editOn() {
62485 if (!_notesVisible) {
62486 _notesVisible = true;
62487 drawLayer.style("display", "block");
62490 function editOff() {
62491 if (_notesVisible) {
62492 _notesVisible = false;
62493 drawLayer.style("display", "none");
62494 drawLayer.selectAll(".note").remove();
62495 touchLayer.selectAll(".note").remove();
62498 function layerOn() {
62500 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", function() {
62501 dispatch14.call("change");
62504 function layerOff() {
62505 throttledRedraw.cancel();
62506 drawLayer.interrupt();
62507 touchLayer.selectAll(".note").remove();
62508 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", function() {
62510 dispatch14.call("change");
62513 function updateMarkers() {
62514 if (!_notesVisible || !_notesEnabled) return;
62515 var service = getService();
62516 var selectedID = context.selectedNoteID();
62517 var data = service ? service.notes(projection2) : [];
62518 var getTransform = svgPointTransform(projection2);
62519 var notes = drawLayer.selectAll(".note").data(data, function(d4) {
62520 return d4.status + d4.id;
62522 notes.exit().remove();
62523 var notesEnter = notes.enter().append("g").attr("class", function(d4) {
62524 return "note note-" + d4.id + " " + d4.status;
62525 }).classed("new", function(d4) {
62528 notesEnter.append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
62529 notesEnter.append("path").call(markerPath, "shadow");
62530 notesEnter.append("use").attr("class", "note-fill").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").attr("xlink:href", "#iD-icon-note");
62531 notesEnter.selectAll(".icon-annotation").data(function(d4) {
62533 }).enter().append("use").attr("class", "icon-annotation").attr("width", "10px").attr("height", "10px").attr("x", "-3px").attr("y", "-19px").attr("xlink:href", function(d4) {
62534 if (d4.id < 0) return "#iD-icon-plus";
62535 if (d4.status === "open") return "#iD-icon-close";
62536 return "#iD-icon-apply";
62538 notes.merge(notesEnter).sort(sortY).classed("selected", function(d4) {
62539 var mode = context.mode();
62540 var isMoving = mode && mode.id === "drag-note";
62541 return !isMoving && d4.id === selectedID;
62542 }).attr("transform", getTransform);
62543 if (touchLayer.empty()) return;
62544 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
62545 var targets = touchLayer.selectAll(".note").data(data, function(d4) {
62548 targets.exit().remove();
62549 targets.enter().append("rect").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").merge(targets).sort(sortY).attr("class", function(d4) {
62550 var newClass = d4.id < 0 ? "new" : "";
62551 return "note target note-" + d4.id + " " + fillClass + newClass;
62552 }).attr("transform", getTransform);
62553 function sortY(a2, b3) {
62554 if (a2.id === selectedID) return 1;
62555 if (b3.id === selectedID) return -1;
62556 return b3.loc[1] - a2.loc[1];
62559 function drawNotes(selection2) {
62560 var service = getService();
62561 var surface = context.surface();
62562 if (surface && !surface.empty()) {
62563 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
62565 drawLayer = selection2.selectAll(".layer-notes").data(service ? [0] : []);
62566 drawLayer.exit().remove();
62567 drawLayer = drawLayer.enter().append("g").attr("class", "layer-notes").style("display", _notesEnabled ? "block" : "none").merge(drawLayer);
62568 if (_notesEnabled) {
62569 if (service && ~~context.map().zoom() >= minZoom5) {
62571 service.loadNotes(projection2);
62578 drawNotes.enabled = function(val) {
62579 if (!arguments.length) return _notesEnabled;
62580 _notesEnabled = val;
62581 if (_notesEnabled) {
62585 if (context.selectedNoteID()) {
62586 context.enter(modeBrowse(context));
62589 dispatch14.call("change");
62594 var hash, _notesEnabled, _osmService;
62595 var init_notes = __esm({
62596 "modules/svg/notes.js"() {
62605 hash = utilStringQs(window.location.hash);
62606 _notesEnabled = !!hash.notes;
62610 // modules/svg/touch.js
62611 var touch_exports = {};
62612 __export(touch_exports, {
62613 svgTouch: () => svgTouch
62615 function svgTouch() {
62616 function drawTouch(selection2) {
62617 selection2.selectAll(".layer-touch").data(["areas", "lines", "points", "turns", "markers"]).enter().append("g").attr("class", function(d4) {
62618 return "layer-touch " + d4;
62623 var init_touch = __esm({
62624 "modules/svg/touch.js"() {
62629 // modules/util/dimensions.js
62630 var dimensions_exports = {};
62631 __export(dimensions_exports, {
62632 utilGetDimensions: () => utilGetDimensions,
62633 utilSetDimensions: () => utilSetDimensions
62635 function refresh(selection2, node) {
62636 var cr = node.getBoundingClientRect();
62637 var prop = [cr.width, cr.height];
62638 selection2.property("__dimensions__", prop);
62641 function utilGetDimensions(selection2, force) {
62642 if (!selection2 || selection2.empty()) {
62645 var node = selection2.node(), cached = selection2.property("__dimensions__");
62646 return !cached || force ? refresh(selection2, node) : cached;
62648 function utilSetDimensions(selection2, dimensions) {
62649 if (!selection2 || selection2.empty()) {
62652 var node = selection2.node();
62653 if (dimensions === null) {
62654 refresh(selection2, node);
62657 return selection2.property("__dimensions__", [dimensions[0], dimensions[1]]).attr("width", dimensions[0]).attr("height", dimensions[1]);
62659 var init_dimensions = __esm({
62660 "modules/util/dimensions.js"() {
62665 // modules/svg/layers.js
62666 var layers_exports = {};
62667 __export(layers_exports, {
62668 svgLayers: () => svgLayers
62670 function svgLayers(projection2, context) {
62671 var dispatch14 = dispatch_default("change", "photoDatesChanged");
62672 var svg2 = select_default2(null);
62674 { id: "osm", layer: svgOsm(projection2, context, dispatch14) },
62675 { id: "notes", layer: svgNotes(projection2, context, dispatch14) },
62676 { id: "data", layer: svgData(projection2, context, dispatch14) },
62677 { id: "keepRight", layer: svgKeepRight(projection2, context, dispatch14) },
62678 { id: "osmose", layer: svgOsmose(projection2, context, dispatch14) },
62679 { id: "streetside", layer: svgStreetside(projection2, context, dispatch14) },
62680 { id: "mapillary", layer: svgMapillaryImages(projection2, context, dispatch14) },
62681 { id: "mapillary-position", layer: svgMapillaryPosition(projection2, context, dispatch14) },
62682 { id: "mapillary-map-features", layer: svgMapillaryMapFeatures(projection2, context, dispatch14) },
62683 { id: "mapillary-signs", layer: svgMapillarySigns(projection2, context, dispatch14) },
62684 { id: "kartaview", layer: svgKartaviewImages(projection2, context, dispatch14) },
62685 { id: "mapilio", layer: svgMapilioImages(projection2, context, dispatch14) },
62686 { id: "vegbilder", layer: svgVegbilder(projection2, context, dispatch14) },
62687 { id: "panoramax", layer: svgPanoramaxImages(projection2, context, dispatch14) },
62688 { id: "local-photos", layer: svgLocalPhotos(projection2, context, dispatch14) },
62689 { id: "debug", layer: svgDebug(projection2, context, dispatch14) },
62690 { id: "geolocate", layer: svgGeolocate(projection2, context, dispatch14) },
62691 { id: "touch", layer: svgTouch(projection2, context, dispatch14) }
62693 function drawLayers(selection2) {
62694 svg2 = selection2.selectAll(".surface").data([0]);
62695 svg2 = svg2.enter().append("svg").attr("class", "surface").merge(svg2);
62696 var defs = svg2.selectAll(".surface-defs").data([0]);
62697 defs.enter().append("defs").attr("class", "surface-defs");
62698 var groups = svg2.selectAll(".data-layer").data(_layers);
62699 groups.exit().remove();
62700 groups.enter().append("g").attr("class", function(d4) {
62701 return "data-layer " + d4.id;
62702 }).merge(groups).each(function(d4) {
62703 select_default2(this).call(d4.layer);
62706 drawLayers.all = function() {
62709 drawLayers.layer = function(id2) {
62710 var obj = _layers.find(function(o2) {
62711 return o2.id === id2;
62713 return obj && obj.layer;
62715 drawLayers.only = function(what) {
62716 var arr = [].concat(what);
62717 var all = _layers.map(function(layer) {
62720 return drawLayers.remove(utilArrayDifference(all, arr));
62722 drawLayers.remove = function(what) {
62723 var arr = [].concat(what);
62724 arr.forEach(function(id2) {
62725 _layers = _layers.filter(function(o2) {
62726 return o2.id !== id2;
62729 dispatch14.call("change");
62732 drawLayers.add = function(what) {
62733 var arr = [].concat(what);
62734 arr.forEach(function(obj) {
62735 if ("id" in obj && "layer" in obj) {
62739 dispatch14.call("change");
62742 drawLayers.dimensions = function(val) {
62743 if (!arguments.length) return utilGetDimensions(svg2);
62744 utilSetDimensions(svg2, val);
62747 return utilRebind(drawLayers, dispatch14, "on");
62749 var init_layers = __esm({
62750 "modules/svg/layers.js"() {
62755 init_local_photos();
62760 init_streetside2();
62762 init_mapillary_images();
62763 init_mapillary_position();
62764 init_mapillary_signs();
62765 init_mapillary_map_features();
62766 init_kartaview_images();
62767 init_mapilio_images();
62768 init_panoramax_images();
62777 // modules/svg/lines.js
62778 var lines_exports = {};
62779 __export(lines_exports, {
62780 svgLines: () => svgLines
62782 function onewayArrowColour(tags) {
62783 if (tags.highway === "construction" && tags.bridge) return "white";
62784 if (tags.highway === "pedestrian") return "gray";
62785 if (tags.railway && !tags.highway) return "gray";
62786 if (tags.aeroway === "runway") return "white";
62789 function svgLines(projection2, context) {
62790 var detected = utilDetect();
62791 var highway_stack = {
62806 function drawTargets(selection2, graph, entities, filter2) {
62807 var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
62808 var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
62809 var getPath = svgPath(projection2).geojson;
62810 var activeID = context.activeID();
62811 var base = context.history().base();
62812 var data = { targets: [], nopes: [] };
62813 entities.forEach(function(way) {
62814 var features = svgSegmentWay(way, graph, activeID);
62815 data.targets.push.apply(data.targets, features.passive);
62816 data.nopes.push.apply(data.nopes, features.active);
62818 var targetData = data.targets.filter(getPath);
62819 var targets = selection2.selectAll(".line.target-allowed").filter(function(d4) {
62820 return filter2(d4.properties.entity);
62821 }).data(targetData, function key(d4) {
62824 targets.exit().remove();
62825 var segmentWasEdited = function(d4) {
62826 var wayID = d4.properties.entity.id;
62827 if (!base.entities[wayID] || !(0, import_fast_deep_equal7.default)(graph.entities[wayID].nodes, base.entities[wayID].nodes)) {
62830 return d4.properties.nodes.some(function(n3) {
62831 return !base.entities[n3.id] || !(0, import_fast_deep_equal7.default)(graph.entities[n3.id].loc, base.entities[n3.id].loc);
62834 targets.enter().append("path").merge(targets).attr("d", getPath).attr("class", function(d4) {
62835 return "way line target target-allowed " + targetClass + d4.id;
62836 }).classed("segment-edited", segmentWasEdited);
62837 var nopeData = data.nopes.filter(getPath);
62838 var nopes = selection2.selectAll(".line.target-nope").filter(function(d4) {
62839 return filter2(d4.properties.entity);
62840 }).data(nopeData, function key(d4) {
62843 nopes.exit().remove();
62844 nopes.enter().append("path").merge(nopes).attr("d", getPath).attr("class", function(d4) {
62845 return "way line target target-nope " + nopeClass + d4.id;
62846 }).classed("segment-edited", segmentWasEdited);
62848 function drawLines(selection2, graph, entities, filter2) {
62849 var base = context.history().base();
62850 function waystack(a2, b3) {
62851 var selected = context.selectedIDs();
62852 var scoreA = selected.indexOf(a2.id) !== -1 ? 20 : 0;
62853 var scoreB = selected.indexOf(b3.id) !== -1 ? 20 : 0;
62854 if (a2.tags.highway) {
62855 scoreA -= highway_stack[a2.tags.highway];
62857 if (b3.tags.highway) {
62858 scoreB -= highway_stack[b3.tags.highway];
62860 return scoreA - scoreB;
62862 function drawLineGroup(selection3, klass, isSelected) {
62863 var mode = context.mode();
62864 var isDrawing = mode && /^draw/.test(mode.id);
62865 var selectedClass = !isDrawing && isSelected ? "selected " : "";
62866 var lines = selection3.selectAll("path").filter(filter2).data(getPathData(isSelected), osmEntity.key);
62867 lines.exit().remove();
62868 lines.enter().append("path").attr("class", function(d4) {
62869 var prefix = "way line";
62870 if (!d4.hasInterestingTags()) {
62871 var parentRelations = graph.parentRelations(d4);
62872 var parentMultipolygons = parentRelations.filter(function(relation) {
62873 return relation.isMultipolygon();
62875 if (parentMultipolygons.length > 0 && // and only multipolygon relations
62876 parentRelations.length === parentMultipolygons.length) {
62877 prefix = "relation area";
62880 var oldMPClass = oldMultiPolygonOuters[d4.id] ? "old-multipolygon " : "";
62881 return prefix + " " + klass + " " + selectedClass + oldMPClass + d4.id;
62882 }).classed("added", function(d4) {
62883 return !base.entities[d4.id];
62884 }).classed("geometry-edited", function(d4) {
62885 return graph.entities[d4.id] && base.entities[d4.id] && !(0, import_fast_deep_equal7.default)(graph.entities[d4.id].nodes, base.entities[d4.id].nodes);
62886 }).classed("retagged", function(d4) {
62887 return graph.entities[d4.id] && base.entities[d4.id] && !(0, import_fast_deep_equal7.default)(graph.entities[d4.id].tags, base.entities[d4.id].tags);
62888 }).call(svgTagClasses()).merge(lines).sort(waystack).attr("d", getPath).call(svgTagClasses().tags(svgRelationMemberTags(graph)));
62891 function getPathData(isSelected) {
62892 return function() {
62893 var layer = this.parentNode.__data__;
62894 var data = pathdata[layer] || [];
62895 return data.filter(function(d4) {
62897 return context.selectedIDs().indexOf(d4.id) !== -1;
62899 return context.selectedIDs().indexOf(d4.id) === -1;
62904 function addMarkers(layergroup, pathclass, groupclass, groupdata, marker) {
62905 var markergroup = layergroup.selectAll("g." + groupclass).data([pathclass]);
62906 markergroup = markergroup.enter().append("g").attr("class", groupclass).merge(markergroup);
62907 var markers = markergroup.selectAll("path").filter(filter2).data(
62909 return groupdata[this.parentNode.__data__] || [];
62912 return [d4.id, d4.index];
62915 markers.exit().remove();
62916 markers = markers.enter().append("path").attr("class", pathclass).merge(markers).attr("marker-mid", marker).attr("d", function(d4) {
62920 markers.each(function() {
62921 this.parentNode.insertBefore(this, this);
62925 var getPath = svgPath(projection2, graph);
62927 var onewaydata = {};
62928 var sideddata = {};
62929 var oldMultiPolygonOuters = {};
62930 for (var i3 = 0; i3 < entities.length; i3++) {
62931 var entity = entities[i3];
62932 if (entity.geometry(graph) === "line" || entity.geometry(graph) === "area" && entity.sidednessIdentifier && entity.sidednessIdentifier() === "coastline") {
62936 ways = ways.filter(getPath);
62937 const pathdata = utilArrayGroupBy(ways, (way) => Math.trunc(way.layer()));
62938 Object.keys(pathdata).forEach(function(k2) {
62939 var v3 = pathdata[k2];
62940 var onewayArr = v3.filter(function(d4) {
62941 return d4.isOneWay();
62943 var onewaySegments = svgMarkerSegments(
62947 (entity2) => entity2.isOneWayBackwards(),
62948 (entity2) => entity2.isBiDirectional()
62950 onewaydata[k2] = utilArrayFlatten(onewayArr.map(onewaySegments));
62951 var sidedArr = v3.filter(function(d4) {
62952 return d4.isSided();
62954 var sidedSegments = svgMarkerSegments(
62959 sideddata[k2] = utilArrayFlatten(sidedArr.map(sidedSegments));
62961 var covered = selection2.selectAll(".layer-osm.covered");
62962 var uncovered = selection2.selectAll(".layer-osm.lines");
62963 var touchLayer = selection2.selectAll(".layer-touch.lines");
62964 [covered, uncovered].forEach(function(selection3) {
62965 var range3 = selection3 === covered ? range(-10, 0) : range(0, 11);
62966 var layergroup = selection3.selectAll("g.layergroup").data(range3);
62967 layergroup = layergroup.enter().append("g").attr("class", function(d4) {
62968 return "layergroup layer" + String(d4);
62969 }).merge(layergroup);
62970 layergroup.selectAll("g.linegroup").data(["shadow", "casing", "stroke", "shadow-highlighted", "casing-highlighted", "stroke-highlighted"]).enter().append("g").attr("class", function(d4) {
62971 return "linegroup line-" + d4;
62973 layergroup.selectAll("g.line-shadow").call(drawLineGroup, "shadow", false);
62974 layergroup.selectAll("g.line-casing").call(drawLineGroup, "casing", false);
62975 layergroup.selectAll("g.line-stroke").call(drawLineGroup, "stroke", false);
62976 layergroup.selectAll("g.line-shadow-highlighted").call(drawLineGroup, "shadow", true);
62977 layergroup.selectAll("g.line-casing-highlighted").call(drawLineGroup, "casing", true);
62978 layergroup.selectAll("g.line-stroke-highlighted").call(drawLineGroup, "stroke", true);
62979 addMarkers(layergroup, "oneway", "onewaygroup", onewaydata, (d4) => {
62980 const category = onewayArrowColour(graph.entity(d4.id).tags);
62981 return `url(#ideditor-oneway-marker-${category})`;
62988 function marker(d4) {
62989 var category = graph.entity(d4.id).sidednessIdentifier();
62990 return "url(#ideditor-sided-marker-" + category + ")";
62994 touchLayer.call(drawTargets, graph, ways, filter2);
62998 var import_fast_deep_equal7;
62999 var init_lines = __esm({
63000 "modules/svg/lines.js"() {
63002 import_fast_deep_equal7 = __toESM(require_fast_deep_equal(), 1);
63005 init_tag_classes();
63012 // modules/svg/midpoints.js
63013 var midpoints_exports = {};
63014 __export(midpoints_exports, {
63015 svgMidpoints: () => svgMidpoints
63017 function svgMidpoints(projection2, context) {
63018 var targetRadius = 8;
63019 function drawTargets(selection2, graph, entities, filter2) {
63020 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
63021 var getTransform = svgPointTransform(projection2).geojson;
63022 var data = entities.map(function(midpoint) {
63032 coordinates: midpoint.loc
63036 var targets = selection2.selectAll(".midpoint.target").filter(function(d4) {
63037 return filter2(d4.properties.entity);
63038 }).data(data, function key(d4) {
63041 targets.exit().remove();
63042 targets.enter().append("circle").attr("r", targetRadius).merge(targets).attr("class", function(d4) {
63043 return "node midpoint target " + fillClass + d4.id;
63044 }).attr("transform", getTransform);
63046 function drawMidpoints(selection2, graph, entities, filter2, extent) {
63047 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.midpoints");
63048 var touchLayer = selection2.selectAll(".layer-touch.points");
63049 var mode = context.mode();
63050 if (mode && mode.id !== "select" || !context.map().withinEditableZoom()) {
63051 drawLayer.selectAll(".midpoint").remove();
63052 touchLayer.selectAll(".midpoint.target").remove();
63055 var poly = extent.polygon();
63056 var midpoints = {};
63057 for (var i3 = 0; i3 < entities.length; i3++) {
63058 var entity = entities[i3];
63059 if (entity.type !== "way") continue;
63060 if (!filter2(entity)) continue;
63061 if (context.selectedIDs().indexOf(entity.id) < 0) continue;
63062 var nodes = graph.childNodes(entity);
63063 for (var j3 = 0; j3 < nodes.length - 1; j3++) {
63064 var a2 = nodes[j3];
63065 var b3 = nodes[j3 + 1];
63066 var id2 = [a2.id, b3.id].sort().join("-");
63067 if (midpoints[id2]) {
63068 midpoints[id2].parents.push(entity);
63069 } else if (geoVecLength(projection2(a2.loc), projection2(b3.loc)) > 40) {
63070 var point = geoVecInterp(a2.loc, b3.loc, 0.5);
63072 if (extent.intersects(point)) {
63075 for (var k2 = 0; k2 < 4; k2++) {
63076 point = geoLineIntersection([a2.loc, b3.loc], [poly[k2], poly[k2 + 1]]);
63077 if (point && geoVecLength(projection2(a2.loc), projection2(point)) > 20 && geoVecLength(projection2(b3.loc), projection2(point)) > 20) {
63088 edge: [a2.id, b3.id],
63095 function midpointFilter(d4) {
63096 if (midpoints[d4.id]) return true;
63097 for (var i4 = 0; i4 < d4.parents.length; i4++) {
63098 if (filter2(d4.parents[i4])) {
63104 var groups = drawLayer.selectAll(".midpoint").filter(midpointFilter).data(Object.values(midpoints), function(d4) {
63107 groups.exit().remove();
63108 var enter = groups.enter().insert("g", ":first-child").attr("class", "midpoint");
63109 enter.append("polygon").attr("points", "-6,8 10,0 -6,-8").attr("class", "shadow");
63110 enter.append("polygon").attr("points", "-3,4 5,0 -3,-4").attr("class", "fill");
63111 groups = groups.merge(enter).attr("transform", function(d4) {
63112 var translate = svgPointTransform(projection2);
63113 var a3 = graph.entity(d4.edge[0]);
63114 var b4 = graph.entity(d4.edge[1]);
63115 var angle2 = geoAngle(a3, b4, projection2) * (180 / Math.PI);
63116 return translate(d4) + " rotate(" + angle2 + ")";
63117 }).call(svgTagClasses().tags(
63119 return d4.parents[0].tags;
63122 groups.select("polygon.shadow");
63123 groups.select("polygon.fill");
63124 touchLayer.call(drawTargets, graph, Object.values(midpoints), midpointFilter);
63126 return drawMidpoints;
63128 var init_midpoints = __esm({
63129 "modules/svg/midpoints.js"() {
63132 init_tag_classes();
63137 // node_modules/d3-axis/src/index.js
63138 var init_src19 = __esm({
63139 "node_modules/d3-axis/src/index.js"() {
63143 // node_modules/d3-brush/src/constant.js
63144 var init_constant7 = __esm({
63145 "node_modules/d3-brush/src/constant.js"() {
63149 // node_modules/d3-brush/src/event.js
63150 var init_event3 = __esm({
63151 "node_modules/d3-brush/src/event.js"() {
63155 // node_modules/d3-brush/src/noevent.js
63156 var init_noevent3 = __esm({
63157 "node_modules/d3-brush/src/noevent.js"() {
63161 // node_modules/d3-brush/src/brush.js
63162 function number1(e3) {
63163 return [+e3[0], +e3[1]];
63165 function number22(e3) {
63166 return [number1(e3[0]), number1(e3[1])];
63168 function type(t2) {
63169 return { type: t2 };
63171 var abs2, max2, min2, X4, Y3, XY;
63172 var init_brush = __esm({
63173 "node_modules/d3-brush/src/brush.js"() {
63178 ({ abs: abs2, max: max2, min: min2 } = Math);
63181 handles: ["w", "e"].map(type),
63182 input: function(x2, e3) {
63183 return x2 == null ? null : [[+x2[0], e3[0][1]], [+x2[1], e3[1][1]]];
63185 output: function(xy) {
63186 return xy && [xy[0][0], xy[1][0]];
63191 handles: ["n", "s"].map(type),
63192 input: function(y3, e3) {
63193 return y3 == null ? null : [[e3[0][0], +y3[0]], [e3[1][0], +y3[1]]];
63195 output: function(xy) {
63196 return xy && [xy[0][1], xy[1][1]];
63201 handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type),
63202 input: function(xy) {
63203 return xy == null ? null : number22(xy);
63205 output: function(xy) {
63212 // node_modules/d3-brush/src/index.js
63213 var init_src20 = __esm({
63214 "node_modules/d3-brush/src/index.js"() {
63219 // node_modules/d3-path/src/index.js
63220 var init_src21 = __esm({
63221 "node_modules/d3-path/src/index.js"() {
63225 // node_modules/d3-chord/src/index.js
63226 var init_src22 = __esm({
63227 "node_modules/d3-chord/src/index.js"() {
63231 // node_modules/d3-contour/src/index.js
63232 var init_src23 = __esm({
63233 "node_modules/d3-contour/src/index.js"() {
63237 // node_modules/d3-delaunay/src/index.js
63238 var init_src24 = __esm({
63239 "node_modules/d3-delaunay/src/index.js"() {
63243 // node_modules/d3-quadtree/src/index.js
63244 var init_src25 = __esm({
63245 "node_modules/d3-quadtree/src/index.js"() {
63249 // node_modules/d3-force/src/index.js
63250 var init_src26 = __esm({
63251 "node_modules/d3-force/src/index.js"() {
63255 // node_modules/d3-hierarchy/src/index.js
63256 var init_src27 = __esm({
63257 "node_modules/d3-hierarchy/src/index.js"() {
63261 // node_modules/d3-random/src/index.js
63262 var init_src28 = __esm({
63263 "node_modules/d3-random/src/index.js"() {
63267 // node_modules/d3-scale-chromatic/src/index.js
63268 var init_src29 = __esm({
63269 "node_modules/d3-scale-chromatic/src/index.js"() {
63273 // node_modules/d3-shape/src/index.js
63274 var init_src30 = __esm({
63275 "node_modules/d3-shape/src/index.js"() {
63279 // node_modules/d3/src/index.js
63280 var init_src31 = __esm({
63281 "node_modules/d3/src/index.js"() {
63315 // modules/svg/points.js
63316 var points_exports = {};
63317 __export(points_exports, {
63318 svgPoints: () => svgPoints
63320 function svgPoints(projection2, context) {
63321 function markerPath(selection2, klass) {
63322 selection2.attr("class", klass).attr("transform", (d4) => isAddressPoint(d4.tags) ? `translate(-${addressShieldWidth(d4, selection2) / 2}, -8)` : "translate(-8, -23)").attr("d", (d4) => {
63323 if (!isAddressPoint(d4.tags)) {
63324 return "M 17,8 C 17,13 11,21 8.5,23.5 C 6,21 0,13 0,8 C 0,4 4,-0.5 8.5,-0.5 C 13,-0.5 17,4 17,8 z";
63326 const w3 = addressShieldWidth(d4, selection2);
63327 return `M ${w3 - 3.5} 0 a 3.5 3.5 0 0 0 3.5 3.5 l 0 9 a 3.5 3.5 0 0 0 -3.5 3.5 l -${w3 - 7} 0 a 3.5 3.5 0 0 0 -3.5 -3.5 l 0 -9 a 3.5 3.5 0 0 0 3.5 -3.5 z`;
63330 function sortY(a2, b3) {
63331 return b3.loc[1] - a2.loc[1];
63333 function addressShieldWidth(d4, selection2) {
63334 const width = textWidth(d4.tags["addr:housenumber"] || d4.tags["addr:housename"] || "", 10, selection2.node().parentElement);
63335 return clamp_default(width, 10, 34) + 8;
63338 function fastEntityKey(d4) {
63339 const mode = context.mode();
63340 const isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
63341 return isMoving ? d4.id : osmEntity.key(d4);
63343 function drawTargets(selection2, graph, entities, filter2) {
63344 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
63345 var getTransform = svgPointTransform(projection2).geojson;
63346 var activeID = context.activeID();
63348 entities.forEach(function(node) {
63349 if (activeID === node.id) return;
63356 isAddr: isAddressPoint(node.tags)
63358 geometry: node.asGeoJSON()
63361 var targets = selection2.selectAll(".point.target").filter((d4) => filter2(d4.properties.entity)).data(data, (d4) => fastEntityKey(d4.properties.entity));
63362 targets.exit().remove();
63363 targets.enter().append("rect").attr("x", (d4) => d4.properties.isAddr ? -addressShieldWidth(d4.properties.entity, selection2) / 2 : -10).attr("y", (d4) => d4.properties.isAddr ? -8 : -26).attr("width", (d4) => d4.properties.isAddr ? addressShieldWidth(d4.properties.entity, selection2) : 20).attr("height", (d4) => d4.properties.isAddr ? 16 : 30).attr("class", function(d4) {
63364 return "node point target " + fillClass + d4.id;
63365 }).merge(targets).attr("transform", getTransform);
63367 function drawPoints(selection2, graph, entities, filter2) {
63368 var wireframe = context.surface().classed("fill-wireframe");
63369 var zoom = geoScaleToZoom(projection2.scale());
63370 var base = context.history().base();
63371 function renderAsPoint(entity) {
63372 return entity.geometry(graph) === "point" && !(zoom >= 18 && entity.directions(graph, projection2).length);
63374 var points = wireframe ? [] : entities.filter(renderAsPoint);
63375 points.sort(sortY);
63376 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.points");
63377 var touchLayer = selection2.selectAll(".layer-touch.points");
63378 var groups = drawLayer.selectAll("g.point").filter(filter2).data(points, fastEntityKey);
63379 groups.exit().remove();
63380 var enter = groups.enter().append("g").attr("class", function(d4) {
63381 return "node point " + d4.id;
63383 enter.append("path").call(markerPath, "shadow");
63384 enter.each(function(d4) {
63385 if (isAddressPoint(d4.tags)) return;
63386 select_default2(this).append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
63388 enter.append("path").call(markerPath, "stroke");
63389 enter.append("use").attr("transform", "translate(-5.5, -20)").attr("class", "icon").attr("width", "12px").attr("height", "12px");
63390 groups = groups.merge(enter).attr("transform", svgPointTransform(projection2)).classed("added", function(d4) {
63391 return !base.entities[d4.id];
63392 }).classed("moved", function(d4) {
63393 return base.entities[d4.id] && !(0, import_fast_deep_equal8.default)(graph.entities[d4.id].loc, base.entities[d4.id].loc);
63394 }).classed("retagged", function(d4) {
63395 return base.entities[d4.id] && !(0, import_fast_deep_equal8.default)(graph.entities[d4.id].tags, base.entities[d4.id].tags);
63396 }).call(svgTagClasses());
63397 groups.select(".shadow");
63398 groups.select(".stroke");
63399 groups.select(".icon").attr("xlink:href", function(entity) {
63400 var preset = _mainPresetIndex.match(entity, graph);
63401 var picon = preset && preset.icon;
63402 return picon ? "#" + picon : "";
63404 touchLayer.call(drawTargets, graph, points, filter2);
63408 var import_fast_deep_equal8;
63409 var init_points = __esm({
63410 "modules/svg/points.js"() {
63412 import_fast_deep_equal8 = __toESM(require_fast_deep_equal(), 1);
63418 init_tag_classes();
63424 // modules/svg/turns.js
63425 var turns_exports = {};
63426 __export(turns_exports, {
63427 svgTurns: () => svgTurns
63429 function svgTurns(projection2, context) {
63430 function icon2(turn) {
63431 var u2 = turn.u ? "-u" : "";
63432 if (turn.no) return "#iD-turn-no" + u2;
63433 if (turn.only) return "#iD-turn-only" + u2;
63434 return "#iD-turn-yes" + u2;
63436 function drawTurns(selection2, graph, turns) {
63437 function turnTransform(d4) {
63439 var toWay = graph.entity(d4.to.way);
63440 var toPoints = graph.childNodes(toWay).map(function(n3) {
63442 }).map(projection2);
63443 var toLength = geoPathLength(toPoints);
63444 var mid = toLength / 2;
63445 var toNode = graph.entity(d4.to.node);
63446 var toVertex = graph.entity(d4.to.vertex);
63447 var a2 = geoAngle(toVertex, toNode, projection2);
63448 var o2 = projection2(toVertex.loc);
63449 var r2 = d4.u ? 0 : !toWay.__via ? pxRadius : Math.min(mid, pxRadius);
63450 return "translate(" + (r2 * Math.cos(a2) + o2[0]) + "," + (r2 * Math.sin(a2) + o2[1]) + ") rotate(" + a2 * 180 / Math.PI + ")";
63452 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.turns");
63453 var touchLayer = selection2.selectAll(".layer-touch.turns");
63454 var groups = drawLayer.selectAll("g.turn").data(turns, function(d4) {
63457 groups.exit().remove();
63458 var groupsEnter = groups.enter().append("g").attr("class", function(d4) {
63459 return "turn " + d4.key;
63461 var turnsEnter = groupsEnter.filter(function(d4) {
63464 turnsEnter.append("rect").attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
63465 turnsEnter.append("use").attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
63466 var uEnter = groupsEnter.filter(function(d4) {
63469 uEnter.append("circle").attr("r", "16");
63470 uEnter.append("use").attr("transform", "translate(-16, -16)").attr("width", "32").attr("height", "32");
63471 groups = groups.merge(groupsEnter).attr("opacity", function(d4) {
63472 return d4.direct === false ? "0.7" : null;
63473 }).attr("transform", turnTransform);
63474 groups.select("use").attr("xlink:href", icon2);
63475 groups.select("rect");
63476 groups.select("circle");
63477 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
63478 groups = touchLayer.selectAll("g.turn").data(turns, function(d4) {
63481 groups.exit().remove();
63482 groupsEnter = groups.enter().append("g").attr("class", function(d4) {
63483 return "turn " + d4.key;
63485 turnsEnter = groupsEnter.filter(function(d4) {
63488 turnsEnter.append("rect").attr("class", "target " + fillClass).attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
63489 uEnter = groupsEnter.filter(function(d4) {
63492 uEnter.append("circle").attr("class", "target " + fillClass).attr("r", "16");
63493 groups = groups.merge(groupsEnter).attr("transform", turnTransform);
63494 groups.select("rect");
63495 groups.select("circle");
63500 var init_turns = __esm({
63501 "modules/svg/turns.js"() {
63507 // modules/svg/vertices.js
63508 var vertices_exports = {};
63509 __export(vertices_exports, {
63510 svgVertices: () => svgVertices
63512 function svgVertices(projection2, context) {
63514 // z16-, z17, z18+, w/icon
63515 shadow: [6, 7.5, 7.5, 12],
63516 stroke: [2.5, 3.5, 3.5, 8],
63517 fill: [1, 1.5, 1.5, 1.5]
63519 var _currHoverTarget;
63520 var _currPersistent = {};
63521 var _currHover = {};
63522 var _prevHover = {};
63523 var _currSelected = {};
63524 var _prevSelected = {};
63526 function sortY(a2, b3) {
63527 return b3.loc[1] - a2.loc[1];
63529 function fastEntityKey(d4) {
63530 var mode = context.mode();
63531 var isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
63532 return isMoving ? d4.id : osmEntity.key(d4);
63534 function draw(selection2, graph, vertices, sets2, filter2) {
63535 sets2 = sets2 || { selected: {}, important: {}, hovered: {} };
63537 var directions = {};
63538 var wireframe = context.surface().classed("fill-wireframe");
63539 var zoom = geoScaleToZoom(projection2.scale());
63540 var z3 = zoom < 17 ? 0 : zoom < 18 ? 1 : 2;
63541 var activeID = context.activeID();
63542 var base = context.history().base();
63543 function getIcon(d4) {
63544 var entity = graph.entity(d4.id);
63545 if (entity.id in icons) return icons[entity.id];
63546 icons[entity.id] = entity.hasInterestingTags() && _mainPresetIndex.match(entity, graph).icon;
63547 return icons[entity.id];
63549 function getDirections(entity) {
63550 if (entity.id in directions) return directions[entity.id];
63551 var angles = entity.directions(graph, projection2);
63552 directions[entity.id] = angles.length ? angles : false;
63555 function updateAttributes(selection3) {
63556 ["shadow", "stroke", "fill"].forEach(function(klass) {
63557 var rads = radiuses[klass];
63558 selection3.selectAll("." + klass).each(function(entity) {
63559 var i3 = z3 && getIcon(entity);
63560 var r2 = rads[i3 ? 3 : z3];
63561 if (entity.id !== activeID && entity.isEndpoint(graph) && !entity.isConnected(graph)) {
63564 if (klass === "shadow") {
63565 _radii[entity.id] = r2;
63567 select_default2(this).attr("r", r2).attr("visibility", i3 && klass === "fill" ? "hidden" : null);
63571 vertices.sort(sortY);
63572 var groups = selection2.selectAll("g.vertex").filter(filter2).data(vertices, fastEntityKey);
63573 groups.exit().remove();
63574 var enter = groups.enter().append("g").attr("class", function(d4) {
63575 return "node vertex " + d4.id;
63577 enter.append("circle").attr("class", "shadow");
63578 enter.append("circle").attr("class", "stroke");
63579 enter.filter(function(d4) {
63580 return d4.hasInterestingTags();
63581 }).append("circle").attr("class", "fill");
63582 groups = groups.merge(enter).attr("transform", svgPointTransform(projection2)).classed("sibling", function(d4) {
63583 return d4.id in sets2.selected;
63584 }).classed("shared", function(d4) {
63585 return graph.isShared(d4);
63586 }).classed("endpoint", function(d4) {
63587 return d4.isEndpoint(graph);
63588 }).classed("added", function(d4) {
63589 return !base.entities[d4.id];
63590 }).classed("moved", function(d4) {
63591 return base.entities[d4.id] && !(0, import_fast_deep_equal9.default)(graph.entities[d4.id].loc, base.entities[d4.id].loc);
63592 }).classed("retagged", function(d4) {
63593 return base.entities[d4.id] && !(0, import_fast_deep_equal9.default)(graph.entities[d4.id].tags, base.entities[d4.id].tags);
63594 }).call(svgTagClasses()).call(updateAttributes);
63595 var iconUse = groups.selectAll(".icon").data(function data(d4) {
63596 return zoom >= 17 && getIcon(d4) ? [d4] : [];
63598 iconUse.exit().remove();
63599 iconUse.enter().append("use").attr("class", "icon").attr("width", "12px").attr("height", "12px").attr("transform", "translate(-6, -6)").attr("xlink:href", function(d4) {
63600 var picon = getIcon(d4);
63601 return picon ? "#" + picon : "";
63603 var dgroups = groups.selectAll(".viewfieldgroup").data(function data(d4) {
63604 return zoom >= 18 && getDirections(d4) ? [d4] : [];
63606 dgroups.exit().remove();
63607 dgroups = dgroups.enter().insert("g", ".shadow").attr("class", "viewfieldgroup").merge(dgroups);
63608 var viewfields = dgroups.selectAll(".viewfield").data(getDirections, function key(d4) {
63609 return osmEntity.key(d4);
63611 viewfields.exit().remove();
63612 viewfields.enter().append("path").attr("class", "viewfield").attr("d", "M0,0H0").merge(viewfields).attr("marker-start", "url(#ideditor-viewfield-marker" + (wireframe ? "-wireframe" : "") + ")").attr("transform", function(d4) {
63613 return "rotate(" + d4 + ")";
63616 function drawTargets(selection2, graph, entities, filter2) {
63617 var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
63618 var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
63619 var getTransform = svgPointTransform(projection2).geojson;
63620 var activeID = context.activeID();
63621 var data = { targets: [], nopes: [] };
63622 entities.forEach(function(node) {
63623 if (activeID === node.id) return;
63624 var vertexType = svgPassiveVertex(node, graph, activeID);
63625 if (vertexType !== 0) {
63626 data.targets.push({
63633 geometry: node.asGeoJSON()
63638 id: node.id + "-nope",
63644 geometry: node.asGeoJSON()
63648 var targets = selection2.selectAll(".vertex.target-allowed").filter(function(d4) {
63649 return filter2(d4.properties.entity);
63650 }).data(data.targets, function key(d4) {
63653 targets.exit().remove();
63654 targets.enter().append("circle").attr("r", function(d4) {
63655 return _radii[d4.id] || radiuses.shadow[3];
63656 }).merge(targets).attr("class", function(d4) {
63657 return "node vertex target target-allowed " + targetClass + d4.id;
63658 }).attr("transform", getTransform);
63659 var nopes = selection2.selectAll(".vertex.target-nope").filter(function(d4) {
63660 return filter2(d4.properties.entity);
63661 }).data(data.nopes, function key(d4) {
63664 nopes.exit().remove();
63665 nopes.enter().append("circle").attr("r", function(d4) {
63666 return _radii[d4.properties.entity.id] || radiuses.shadow[3];
63667 }).merge(nopes).attr("class", function(d4) {
63668 return "node vertex target target-nope " + nopeClass + d4.id;
63669 }).attr("transform", getTransform);
63671 function renderAsVertex(entity, graph, wireframe, zoom) {
63672 var geometry = entity.geometry(graph);
63673 return geometry === "vertex" || geometry === "point" && (wireframe || zoom >= 18 && entity.directions(graph, projection2).length);
63675 function isEditedNode(node, base, head) {
63676 var baseNode = base.entities[node.id];
63677 var headNode = head.entities[node.id];
63678 return !headNode || !baseNode || !(0, import_fast_deep_equal9.default)(headNode.tags, baseNode.tags) || !(0, import_fast_deep_equal9.default)(headNode.loc, baseNode.loc);
63680 function getSiblingAndChildVertices(ids, graph, wireframe, zoom) {
63683 function addChildVertices(entity) {
63684 if (seenIds[entity.id]) return;
63685 seenIds[entity.id] = true;
63686 var geometry = entity.geometry(graph);
63687 if (!context.features().isHiddenFeature(entity, graph, geometry)) {
63689 if (entity.type === "way") {
63690 for (i3 = 0; i3 < entity.nodes.length; i3++) {
63691 var child = graph.hasEntity(entity.nodes[i3]);
63693 addChildVertices(child);
63696 } else if (entity.type === "relation") {
63697 for (i3 = 0; i3 < entity.members.length; i3++) {
63698 var member = graph.hasEntity(entity.members[i3].id);
63700 addChildVertices(member);
63703 } else if (renderAsVertex(entity, graph, wireframe, zoom)) {
63704 results[entity.id] = entity;
63708 ids.forEach(function(id2) {
63709 var entity = graph.hasEntity(id2);
63710 if (!entity) return;
63711 if (entity.type === "node") {
63712 if (renderAsVertex(entity, graph, wireframe, zoom)) {
63713 results[entity.id] = entity;
63714 graph.parentWays(entity).forEach(function(entity2) {
63715 addChildVertices(entity2);
63719 addChildVertices(entity);
63724 function drawVertices(selection2, graph, entities, filter2, extent, fullRedraw) {
63725 var wireframe = context.surface().classed("fill-wireframe");
63726 var visualDiff = context.surface().classed("highlight-edited");
63727 var zoom = geoScaleToZoom(projection2.scale());
63728 var mode = context.mode();
63729 var isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
63730 var base = context.history().base();
63731 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.vertices");
63732 var touchLayer = selection2.selectAll(".layer-touch.points");
63734 _currPersistent = {};
63737 for (var i3 = 0; i3 < entities.length; i3++) {
63738 var entity = entities[i3];
63739 var geometry = entity.geometry(graph);
63741 if (geometry === "point" && renderAsVertex(entity, graph, wireframe, zoom)) {
63742 _currPersistent[entity.id] = entity;
63744 } else if (geometry === "vertex" && (entity.hasInterestingTags() || entity.isEndpoint(graph) || entity.isConnected(graph) || visualDiff && isEditedNode(entity, base, graph))) {
63745 _currPersistent[entity.id] = entity;
63748 if (!keep && !fullRedraw) {
63749 delete _currPersistent[entity.id];
63753 persistent: _currPersistent,
63754 // persistent = important vertices (render always)
63755 selected: _currSelected,
63756 // selected + siblings of selected (render always)
63757 hovered: _currHover
63758 // hovered + siblings of hovered (render only in draw modes)
63760 var all = Object.assign({}, isMoving ? _currHover : {}, _currSelected, _currPersistent);
63761 var filterRendered = function(d4) {
63762 return d4.id in _currPersistent || d4.id in _currSelected || d4.id in _currHover || filter2(d4);
63764 drawLayer.call(draw, graph, currentVisible(all), sets2, filterRendered);
63765 var filterTouch = function(d4) {
63766 return isMoving ? true : filterRendered(d4);
63768 touchLayer.call(drawTargets, graph, currentVisible(all), filterTouch);
63769 function currentVisible(which) {
63770 return Object.keys(which).map(graph.hasEntity, graph).filter(function(entity2) {
63771 return entity2 && entity2.intersects(extent, graph);
63775 drawVertices.drawSelected = function(selection2, graph, extent) {
63776 var wireframe = context.surface().classed("fill-wireframe");
63777 var zoom = geoScaleToZoom(projection2.scale());
63778 _prevSelected = _currSelected || {};
63779 if (context.map().isInWideSelection()) {
63780 _currSelected = {};
63781 context.selectedIDs().forEach(function(id2) {
63782 var entity = graph.hasEntity(id2);
63783 if (!entity) return;
63784 if (entity.type === "node") {
63785 if (renderAsVertex(entity, graph, wireframe, zoom)) {
63786 _currSelected[entity.id] = entity;
63791 _currSelected = getSiblingAndChildVertices(context.selectedIDs(), graph, wireframe, zoom);
63793 var filter2 = function(d4) {
63794 return d4.id in _prevSelected;
63796 drawVertices(selection2, graph, Object.values(_prevSelected), filter2, extent, false);
63798 drawVertices.drawHover = function(selection2, graph, target, extent) {
63799 if (target === _currHoverTarget) return;
63800 var wireframe = context.surface().classed("fill-wireframe");
63801 var zoom = geoScaleToZoom(projection2.scale());
63802 _prevHover = _currHover || {};
63803 _currHoverTarget = target;
63804 var entity = target && target.properties && target.properties.entity;
63806 _currHover = getSiblingAndChildVertices([entity.id], graph, wireframe, zoom);
63810 var filter2 = function(d4) {
63811 return d4.id in _prevHover;
63813 drawVertices(selection2, graph, Object.values(_prevHover), filter2, extent, false);
63815 return drawVertices;
63817 var import_fast_deep_equal9;
63818 var init_vertices = __esm({
63819 "modules/svg/vertices.js"() {
63821 import_fast_deep_equal9 = __toESM(require_fast_deep_equal(), 1);
63827 init_tag_classes();
63831 // modules/svg/index.js
63832 var svg_exports = {};
63833 __export(svg_exports, {
63834 svgAreas: () => svgAreas,
63835 svgData: () => svgData,
63836 svgDebug: () => svgDebug,
63837 svgDefs: () => svgDefs,
63838 svgGeolocate: () => svgGeolocate,
63839 svgIcon: () => svgIcon,
63840 svgKartaviewImages: () => svgKartaviewImages,
63841 svgKeepRight: () => svgKeepRight,
63842 svgLabels: () => svgLabels,
63843 svgLayers: () => svgLayers,
63844 svgLines: () => svgLines,
63845 svgMapilioImages: () => svgMapilioImages,
63846 svgMapillaryImages: () => svgMapillaryImages,
63847 svgMapillarySigns: () => svgMapillarySigns,
63848 svgMarkerSegments: () => svgMarkerSegments,
63849 svgMidpoints: () => svgMidpoints,
63850 svgNotes: () => svgNotes,
63851 svgOsm: () => svgOsm,
63852 svgPanoramaxImages: () => svgPanoramaxImages,
63853 svgPassiveVertex: () => svgPassiveVertex,
63854 svgPath: () => svgPath,
63855 svgPointTransform: () => svgPointTransform,
63856 svgPoints: () => svgPoints,
63857 svgRelationMemberTags: () => svgRelationMemberTags,
63858 svgSegmentWay: () => svgSegmentWay,
63859 svgStreetside: () => svgStreetside,
63860 svgTagClasses: () => svgTagClasses,
63861 svgTagPattern: () => svgTagPattern,
63862 svgTouch: () => svgTouch,
63863 svgTurns: () => svgTurns,
63864 svgVegbilder: () => svgVegbilder,
63865 svgVertices: () => svgVertices
63867 var init_svg = __esm({
63868 "modules/svg/index.js"() {
63880 init_mapillary_images();
63881 init_mapillary_signs();
63885 init_kartaview_images();
63893 init_streetside2();
63895 init_tag_classes();
63896 init_tag_pattern();
63900 init_mapilio_images();
63901 init_panoramax_images();
63905 // modules/ui/length_indicator.js
63906 var length_indicator_exports = {};
63907 __export(length_indicator_exports, {
63908 uiLengthIndicator: () => uiLengthIndicator
63910 function uiLengthIndicator(maxChars) {
63911 var _wrap = select_default2(null);
63912 var _tooltip = uiPopover("tooltip max-length-warning").placement("bottom").hasArrow(true).content(() => (selection2) => {
63913 selection2.text("");
63914 selection2.call(svgIcon("#iD-icon-alert", "inline"));
63915 selection2.call(_t.append("inspector.max_length_reached", { maxChars }));
63917 var _silent = false;
63918 var lengthIndicator = function(selection2) {
63919 _wrap = selection2.selectAll("span.length-indicator-wrap").data([0]);
63920 _wrap = _wrap.enter().append("span").merge(_wrap).classed("length-indicator-wrap", true);
63921 selection2.call(_tooltip);
63923 lengthIndicator.update = function(val) {
63924 const strLen = utilUnicodeCharsCount(utilCleanOsmString(val, Number.POSITIVE_INFINITY));
63925 let indicator = _wrap.selectAll("span.length-indicator").data([strLen]);
63926 indicator.enter().append("span").merge(indicator).classed("length-indicator", true).classed("limit-reached", (d4) => d4 > maxChars).style("border-right-width", (d4) => `${Math.abs(maxChars - d4) * 2}px`).style("margin-right", (d4) => d4 > maxChars ? `${(maxChars - d4) * 2}px` : 0).style("opacity", (d4) => d4 > maxChars * 0.8 ? Math.min(1, (d4 / maxChars - 0.8) / (1 - 0.8)) : 0).style("pointer-events", (d4) => d4 > maxChars * 0.8 ? null : "none");
63927 if (_silent) return;
63928 if (strLen > maxChars) {
63934 lengthIndicator.silent = function(val) {
63935 if (!arguments.length) return _silent;
63937 return lengthIndicator;
63939 return lengthIndicator;
63941 var init_length_indicator = __esm({
63942 "modules/ui/length_indicator.js"() {
63952 // modules/ui/fields/combo.js
63953 var combo_exports = {};
63954 __export(combo_exports, {
63955 uiFieldCombo: () => uiFieldCombo,
63956 uiFieldManyCombo: () => uiFieldCombo,
63957 uiFieldMultiCombo: () => uiFieldCombo,
63958 uiFieldNetworkCombo: () => uiFieldCombo,
63959 uiFieldSemiCombo: () => uiFieldCombo,
63960 uiFieldTypeCombo: () => uiFieldCombo
63962 function uiFieldCombo(field, context) {
63963 var dispatch14 = dispatch_default("change");
63964 var _isMulti = field.type === "multiCombo" || field.type === "manyCombo";
63965 var _isNetwork = field.type === "networkCombo";
63966 var _isSemi = field.type === "semiCombo";
63967 var _showTagInfoSuggestions = field.type !== "manyCombo" && field.autoSuggestions !== false;
63968 var _allowCustomValues = field.type !== "manyCombo" && field.customValues !== false;
63969 var _snake_case = field.snake_case || field.snake_case === void 0;
63970 var _combobox = uiCombobox(context, "combo-" + field.safeid).caseSensitive(field.caseSensitive).minItems(1);
63971 var _container = select_default2(null);
63972 var _inputWrap = select_default2(null);
63973 var _input = select_default2(null);
63974 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
63975 var _comboData = [];
63976 var _multiData = [];
63977 var _entityIDs = [];
63980 var _staticPlaceholder;
63981 var _customOptions = [];
63982 var _dataDeprecated = [];
63983 _mainFileFetcher.get("deprecated").then(function(d4) {
63984 _dataDeprecated = d4;
63985 }).catch(function() {
63987 if (_isMulti && field.key && /[^:]$/.test(field.key)) {
63990 function snake(s2) {
63991 return s2.replace(/\s+/g, "_");
63993 function clean2(s2) {
63994 return s2.split(";").map(function(s3) {
63998 function tagValue(dval) {
63999 dval = clean2(dval || "");
64000 var found = getOptions(true).find(function(o2) {
64001 return o2.key && clean2(o2.value) === dval;
64003 if (found) return found.key;
64004 if (field.type === "typeCombo" && !dval) {
64007 return restrictTagValueSpelling(dval) || void 0;
64009 function restrictTagValueSpelling(dval) {
64011 dval = snake(dval);
64013 if (!field.caseSensitive) {
64014 if (!(field.key === "type" && dval === "associatedStreet")) {
64015 dval = dval.toLowerCase();
64020 function getLabelId(field2, v3) {
64021 return field2.hasTextForStringId(`options.${v3}.title`) ? `options.${v3}.title` : `options.${v3}`;
64023 function displayValue(tval) {
64025 var stringsField = field.resolveReference("stringsCrossReference");
64026 const labelId = getLabelId(stringsField, tval);
64027 if (stringsField.hasTextForStringId(labelId)) {
64028 return stringsField.t(labelId, { default: tval });
64030 if (field.type === "typeCombo" && tval.toLowerCase() === "yes") {
64035 function renderValue(tval) {
64037 var stringsField = field.resolveReference("stringsCrossReference");
64038 const labelId = getLabelId(stringsField, tval);
64039 if (stringsField.hasTextForStringId(labelId)) {
64040 return stringsField.t.append(labelId, { default: tval });
64042 if (field.type === "typeCombo" && tval.toLowerCase() === "yes") {
64045 return (selection2) => selection2.text(tval);
64047 function objectDifference(a2, b3) {
64048 return a2.filter(function(d1) {
64049 return !b3.some(function(d22) {
64050 return d1.value === d22.value;
64054 function initCombo(selection2, attachTo) {
64055 if (!_allowCustomValues) {
64056 selection2.attr("readonly", "readonly");
64058 if (_showTagInfoSuggestions && services.taginfo) {
64059 selection2.call(_combobox.fetcher(setTaginfoValues), attachTo);
64060 setTaginfoValues("", setPlaceholder);
64062 selection2.call(_combobox, attachTo);
64063 setTimeout(() => setStaticValues(setPlaceholder), 0);
64066 function getOptions(allOptions) {
64067 var stringsField = field.resolveReference("stringsCrossReference");
64068 if (!(field.options || stringsField.options)) return [];
64070 if (allOptions !== true) {
64071 options = field.options || stringsField.options;
64073 options = [].concat(field.options, stringsField.options).filter(Boolean);
64075 const result = options.map(function(v3) {
64076 const labelId = getLabelId(stringsField, v3);
64079 value: stringsField.t(labelId, { default: v3 }),
64080 title: stringsField.t(`options.${v3}.description`, { default: v3 }),
64081 display: addComboboxIcons(stringsField.t.append(labelId, { default: v3 }), v3),
64082 klass: stringsField.hasTextForStringId(labelId) ? "" : "raw-option"
64085 return [...result, ..._customOptions];
64087 function hasStaticValues() {
64088 return getOptions().length > 0;
64090 function setStaticValues(callback, filter2) {
64091 _comboData = getOptions();
64092 if (filter2 !== void 0) {
64093 _comboData = _comboData.filter(filter2);
64095 if (!field.allowDuplicates) {
64096 _comboData = objectDifference(_comboData, _multiData);
64098 _combobox.data(_comboData);
64099 _container.classed("empty-combobox", _comboData.length === 0);
64100 if (callback) callback(_comboData);
64102 function setTaginfoValues(q3, callback) {
64103 var queryFilter = (d4) => d4.value.toLowerCase().includes(q3.toLowerCase()) || d4.key.toLowerCase().includes(q3.toLowerCase());
64104 if (hasStaticValues()) {
64105 setStaticValues(callback, queryFilter);
64107 var stringsField = field.resolveReference("stringsCrossReference");
64108 var fn = _isMulti ? "multikeys" : "values";
64109 var query = (_isMulti ? field.key : "") + q3;
64110 var hasCountryPrefix = _isNetwork && _countryCode && _countryCode.indexOf(q3.toLowerCase()) === 0;
64111 if (hasCountryPrefix) {
64112 query = _countryCode + ":";
64115 debounce: q3 !== "",
64119 if (_entityIDs.length) {
64120 params.geometry = context.graph().geometry(_entityIDs[0]);
64122 services.taginfo[fn](params, function(err, data) {
64124 data = data.filter((d4) => field.type !== "typeCombo" || d4.value !== "yes");
64125 data = data.filter((d4) => {
64126 var value = d4.value;
64128 value = value.slice(field.key.length);
64130 return value === restrictTagValueSpelling(value);
64132 var deprecatedValues = deprecatedTagValuesByKey(_dataDeprecated)[field.key];
64133 if (deprecatedValues) {
64134 data = data.filter((d4) => !deprecatedValues.includes(d4.value));
64136 if (hasCountryPrefix) {
64137 data = data.filter((d4) => d4.value.toLowerCase().indexOf(_countryCode + ":") === 0);
64139 const additionalOptions = (field.options || stringsField.options || []).filter((v3) => !data.some((dv) => dv.value === (_isMulti ? field.key + v3 : v3))).map((v3) => ({ value: v3 }));
64140 _container.classed("empty-combobox", data.length === 0);
64141 _comboData = data.concat(additionalOptions).map(function(d4) {
64143 if (_isMulti) v3 = v3.replace(field.key, "");
64144 const labelId = getLabelId(stringsField, v3);
64145 var isLocalizable = stringsField.hasTextForStringId(labelId);
64146 var label = stringsField.t(labelId, { default: v3 });
64150 title: stringsField.t(`options.${v3}.description`, { default: isLocalizable ? v3 : d4.title !== label ? d4.title : "" }),
64151 display: addComboboxIcons(stringsField.t.append(labelId, { default: v3 }), v3),
64152 klass: isLocalizable ? "" : "raw-option"
64155 _comboData = _comboData.filter(queryFilter);
64156 if (!field.allowDuplicates) {
64157 _comboData = objectDifference(_comboData, _multiData);
64159 if (callback) callback(_comboData, hasStaticValues());
64162 function addComboboxIcons(disp, value) {
64163 const iconsField = field.resolveReference("iconsCrossReference");
64164 if (iconsField.icons) {
64165 return function(selection2) {
64166 var span = selection2.insert("span", ":first-child").attr("class", "tag-value-icon");
64167 if (iconsField.icons[value]) {
64168 span.call(svgIcon(`#${iconsField.icons[value]}`));
64170 disp.call(this, selection2);
64175 function setPlaceholder(values) {
64176 if (_isMulti || _isSemi) {
64177 _staticPlaceholder = field.placeholder() || _t("inspector.add");
64179 var vals = values.map(function(d4) {
64181 }).filter(function(s2) {
64182 return s2.length < 20;
64184 var placeholders = vals.length > 1 ? vals : values.map(function(d4) {
64187 _staticPlaceholder = field.placeholder() || placeholders.slice(0, 3).join(", ");
64189 if (!/(…|\.\.\.)$/.test(_staticPlaceholder)) {
64190 _staticPlaceholder += "\u2026";
64193 if (!_isMulti && !_isSemi && _tags && Array.isArray(_tags[field.key])) {
64194 ph = _t("inspector.multiple_values");
64196 ph = _staticPlaceholder;
64198 _container.selectAll("input").attr("placeholder", ph);
64199 var hideAdd = !_allowCustomValues && !values.length;
64200 _container.selectAll(".chiplist .input-wrap").style("display", hideAdd ? "none" : null);
64202 function change() {
64205 if (_isMulti || _isSemi) {
64208 vals = [tagValue(utilGetSetValue(_input))];
64209 } else if (_isSemi) {
64210 val = tagValue(utilGetSetValue(_input)) || "";
64211 val = val.replace(/,/g, ";");
64212 vals = val.split(";");
64214 vals = vals.filter(Boolean);
64215 if (!vals.length) return;
64216 _container.classed("active", false);
64217 utilGetSetValue(_input, "");
64219 utilArrayUniq(vals).forEach(function(v3) {
64220 var key = (field.key || "") + v3;
64222 var old = _tags[key];
64223 if (typeof old === "string" && old.toLowerCase() !== "no") return;
64225 key = context.cleanTagKey(key);
64226 field.keys.push(key);
64229 } else if (_isSemi) {
64230 var arr = _multiData.map(function(d4) {
64233 arr = arr.concat(vals);
64234 if (!field.allowDuplicates) {
64235 arr = utilArrayUniq(arr);
64237 t2[field.key] = context.cleanTagValue(arr.filter(Boolean).join(";"));
64239 window.setTimeout(function() {
64240 _input.node().focus();
64243 var rawValue = utilGetSetValue(_input);
64244 if (!rawValue && Array.isArray(_tags[field.key])) return;
64245 val = context.cleanTagValue(tagValue(rawValue));
64246 t2[field.key] = val || void 0;
64248 dispatch14.call("change", this, t2);
64250 function removeMultikey(d3_event, d4) {
64251 d3_event.preventDefault();
64252 d3_event.stopPropagation();
64255 t2[d4.key] = void 0;
64256 } else if (_isSemi) {
64257 let arr = _multiData.map((item) => item.key);
64258 arr.splice(d4.index, 1);
64259 if (!field.allowDuplicates) {
64260 arr = utilArrayUniq(arr);
64262 t2[field.key] = arr.length ? arr.join(";") : void 0;
64263 _lengthIndicator.update(t2[field.key]);
64265 dispatch14.call("change", this, t2);
64267 function invertMultikey(d3_event, d4) {
64268 d3_event.preventDefault();
64269 d3_event.stopPropagation();
64272 t2[d4.key] = _tags[d4.key] === "yes" ? "no" : "yes";
64274 dispatch14.call("change", this, t2);
64276 function combo(selection2) {
64277 _container = selection2.selectAll(".form-field-input-wrap").data([0]);
64278 var type2 = _isMulti || _isSemi ? "multicombo" : "combo";
64279 _container = _container.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + type2).merge(_container);
64280 if (_isMulti || _isSemi) {
64281 _container = _container.selectAll(".chiplist").data([0]);
64282 var listClass = "chiplist";
64283 if (field.key === "destination" || field.key === "via") {
64284 listClass += " full-line-chips";
64286 _container = _container.enter().append("ul").attr("class", listClass).on("click", function() {
64287 window.setTimeout(function() {
64288 _input.node().focus();
64290 }).merge(_container);
64291 _inputWrap = _container.selectAll(".input-wrap").data([0]);
64292 _inputWrap = _inputWrap.enter().append("li").attr("class", "input-wrap").merge(_inputWrap);
64293 var hideAdd = !_allowCustomValues && !_comboData.length;
64294 _inputWrap.style("display", hideAdd ? "none" : null);
64295 _input = _inputWrap.selectAll("input").data([0]);
64297 _input = _container.selectAll("input").data([0]);
64299 _input = _input.enter().append("input").attr("type", "text").attr("dir", "auto").attr("id", field.domId).call(utilNoAuto).call(initCombo, _container).merge(_input);
64301 _inputWrap.call(_lengthIndicator);
64302 } else if (!_isMulti) {
64303 _container.call(_lengthIndicator);
64306 var extent = combinedEntityExtent();
64307 var countryCode = extent && iso1A2Code(extent.center());
64308 _countryCode = countryCode && countryCode.toLowerCase();
64310 _input.on("change", change).on("blur", change).on("input", function() {
64311 let val = utilGetSetValue(_input);
64313 if (_isSemi && _tags[field.key]) {
64314 val += ";" + _tags[field.key];
64316 _lengthIndicator.update(val);
64318 _input.on("keydown.field", function(d3_event) {
64319 switch (d3_event.keyCode) {
64321 _input.node().blur();
64322 d3_event.stopPropagation();
64326 if (_isMulti || _isSemi) {
64327 _combobox.on("accept", function() {
64328 _input.node().blur();
64329 _input.node().focus();
64331 _input.on("focus", function() {
64332 _container.classed("active", true);
64335 _combobox.on("cancel", function() {
64336 _input.node().blur();
64337 }).on("update", function() {
64338 updateIcon(utilGetSetValue(_input));
64341 function updateIcon(value) {
64342 value = tagValue(value);
64343 let container = _container;
64344 if (field.type === "multiCombo" || field.type === "semiCombo") {
64345 container = _container.select(".input-wrap");
64347 const iconsField = field.resolveReference("iconsCrossReference");
64348 if (iconsField.icons) {
64349 container.selectAll(".tag-value-icon").remove();
64350 if (iconsField.icons[value]) {
64351 container.selectAll(".tag-value-icon").data([value]).enter().insert("div", "input").attr("class", "tag-value-icon").call(svgIcon(`#${iconsField.icons[value]}`));
64355 combo.tags = function(tags) {
64357 var stringsField = field.resolveReference("stringsCrossReference");
64358 var isMixed = Array.isArray(tags[field.key]);
64359 var showsValue = (value) => !isMixed && value && !(field.type === "typeCombo" && value === "yes");
64360 var isRawValue = (value) => showsValue(value) && !stringsField.hasTextForStringId(`options.${value}`) && !stringsField.hasTextForStringId(`options.${value}.title`);
64361 var isKnownValue = (value) => showsValue(value) && !isRawValue(value);
64362 var isReadOnly = !_allowCustomValues;
64363 if (_isMulti || _isSemi) {
64367 for (var k2 in tags) {
64368 if (field.key && k2.indexOf(field.key) !== 0) continue;
64369 if (!field.key && field.keys.indexOf(k2) === -1) continue;
64371 var suffix = field.key ? k2.slice(field.key.length) : k2;
64374 value: displayValue(suffix),
64375 display: addComboboxIcons(renderValue(suffix), suffix),
64376 state: typeof v3 === "string" ? v3.toLowerCase() : "",
64377 isMixed: Array.isArray(v3)
64381 field.keys = _multiData.map(function(d4) {
64384 maxLength = context.maxCharsForTagKey() - utilUnicodeCharsCount(field.key);
64386 maxLength = context.maxCharsForTagKey();
64388 } else if (_isSemi) {
64389 var allValues = [];
64391 if (Array.isArray(tags[field.key])) {
64392 tags[field.key].forEach(function(tagVal) {
64393 var thisVals = (tagVal || "").split(";").filter(Boolean);
64394 allValues = allValues.concat(thisVals);
64395 if (!commonValues) {
64396 commonValues = thisVals;
64398 commonValues = commonValues.filter((value) => thisVals.includes(value));
64401 allValues = allValues.filter(Boolean);
64403 allValues = (tags[field.key] || "").split(";").filter(Boolean);
64404 commonValues = allValues;
64406 if (!field.allowDuplicates) {
64407 commonValues = utilArrayUniq(commonValues);
64408 allValues = utilArrayUniq(allValues);
64410 _multiData = allValues.map(function(v4) {
64413 value: displayValue(v4),
64414 display: addComboboxIcons(renderValue(v4), v4),
64415 isMixed: !commonValues.includes(v4)
64418 var currLength = utilUnicodeCharsCount(commonValues.join(";"));
64419 maxLength = context.maxCharsForTagValue() - currLength;
64420 if (currLength > 0) {
64424 maxLength = Math.max(0, maxLength);
64425 var hideAdd = maxLength <= 0 || !_allowCustomValues && !_comboData.length;
64426 _container.selectAll(".chiplist .input-wrap").style("display", hideAdd ? "none" : null);
64427 var allowDragAndDrop = _isSemi && !Array.isArray(tags[field.key]);
64428 var chips = _container.selectAll(".chip").data(_multiData.map((item, index) => ({ ...item, index })));
64429 chips.exit().remove();
64430 var enter = chips.enter().insert("li", ".input-wrap").attr("class", "chip");
64431 enter.append("span");
64432 const field_buttons = enter.append("div").attr("class", "field_buttons");
64433 field_buttons.append("a").attr("class", "remove");
64434 chips = chips.merge(enter).order().classed("raw-value", function(d4) {
64436 if (_isMulti) k3 = k3.replace(field.key, "");
64437 return !stringsField.hasTextForStringId("options." + k3);
64438 }).classed("draggable", allowDragAndDrop).classed("mixed", function(d4) {
64440 }).attr("title", function(d4) {
64442 return _t("inspector.unshared_value_tooltip");
64444 if (!["yes", "no"].includes(d4.state)) {
64448 }).classed("negated", (d4) => d4.state === "no");
64450 chips.selectAll("input[type=checkbox]").remove();
64451 chips.insert("input", "span").attr("type", "checkbox").property("checked", (d4) => d4.state === "yes").property("indeterminate", (d4) => d4.isMixed || !["yes", "no"].includes(d4.state)).on("click", invertMultikey);
64453 if (allowDragAndDrop) {
64454 registerDragAndDrop(chips);
64456 chips.each(function(d4) {
64457 const selection2 = select_default2(this);
64458 const text_span = selection2.select("span");
64459 const field_buttons2 = selection2.select(".field_buttons");
64460 const clean_value = d4.value.trim();
64461 text_span.text("");
64462 if (!field_buttons2.select("button").empty()) {
64463 field_buttons2.select("button").remove();
64465 if (clean_value.startsWith("https://")) {
64466 text_span.text(clean_value);
64467 field_buttons2.append("button").call(svgIcon("#iD-icon-out-link")).attr("class", "form-field-button foreign-id-permalink").attr("title", () => _t("icons.visit_website")).attr("aria-label", () => _t("icons.visit_website")).on("click", function(d3_event) {
64468 d3_event.preventDefault();
64469 window.open(clean_value, "_blank");
64474 d4.display(text_span);
64477 text_span.text(d4.value);
64479 chips.select("a.remove").attr("href", "#").on("click", removeMultikey).attr("class", "remove").text("\xD7");
64482 var mixedValues = isMixed && tags[field.key].map(function(val) {
64483 return displayValue(val);
64484 }).filter(Boolean);
64485 utilGetSetValue(_input, !isMixed ? displayValue(tags[field.key]) : "").data([tags[field.key]]).classed("raw-value", isRawValue).classed("known-value", isKnownValue).attr("readonly", isReadOnly ? "readonly" : void 0).attr("title", isMixed ? mixedValues.join("\n") : void 0).attr("placeholder", isMixed ? _t("inspector.multiple_values") : _staticPlaceholder || "").classed("mixed", isMixed).on("keydown.deleteCapture", function(d3_event) {
64486 if (isReadOnly && isKnownValue(tags[field.key]) && (d3_event.keyCode === utilKeybinding.keyCodes["\u232B"] || d3_event.keyCode === utilKeybinding.keyCodes["\u2326"])) {
64487 d3_event.preventDefault();
64488 d3_event.stopPropagation();
64490 t2[field.key] = void 0;
64491 dispatch14.call("change", this, t2);
64494 if (!Array.isArray(tags[field.key])) {
64495 updateIcon(tags[field.key]);
64498 _lengthIndicator.update(tags[field.key]);
64501 const refreshStyles = () => {
64502 _input.data([tagValue(utilGetSetValue(_input))]).classed("raw-value", isRawValue).classed("known-value", isKnownValue);
64504 _input.on("input.refreshStyles", refreshStyles);
64505 _combobox.on("update.refreshStyles", refreshStyles);
64508 function registerDragAndDrop(selection2) {
64509 var dragOrigin, targetIndex;
64511 drag_default().on("start", function(d3_event) {
64516 targetIndex = null;
64517 }).on("drag", function(d3_event) {
64518 var x2 = d3_event.x - dragOrigin.x, y3 = d3_event.y - dragOrigin.y;
64519 if (!select_default2(this).classed("dragging") && // don't display drag until dragging beyond a distance threshold
64520 Math.sqrt(Math.pow(x2, 2) + Math.pow(y3, 2)) <= 5) return;
64521 var index = selection2.nodes().indexOf(this);
64522 select_default2(this).classed("dragging", true);
64523 targetIndex = null;
64524 var targetIndexOffsetTop = null;
64525 var draggedTagWidth = select_default2(this).node().offsetWidth;
64526 if (field.key === "destination" || field.key === "via") {
64527 _container.selectAll(".chip").style("transform", function(d22, index2) {
64528 var node = select_default2(this).node();
64529 if (index === index2) {
64530 return "translate(" + x2 + "px, " + y3 + "px)";
64531 } else if (index2 > index && d3_event.y > node.offsetTop) {
64532 if (targetIndex === null || index2 > targetIndex) {
64533 targetIndex = index2;
64535 return "translateY(-100%)";
64536 } else if (index2 < index && d3_event.y < node.offsetTop + node.offsetHeight) {
64537 if (targetIndex === null || index2 < targetIndex) {
64538 targetIndex = index2;
64540 return "translateY(100%)";
64545 _container.selectAll(".chip").each(function(d22, index2) {
64546 var node = select_default2(this).node();
64547 if (index !== index2 && d3_event.x < node.offsetLeft + node.offsetWidth + 5 && d3_event.x > node.offsetLeft && d3_event.y < node.offsetTop + node.offsetHeight && d3_event.y > node.offsetTop) {
64548 targetIndex = index2;
64549 targetIndexOffsetTop = node.offsetTop;
64551 }).style("transform", function(d22, index2) {
64552 var node = select_default2(this).node();
64553 if (index === index2) {
64554 return "translate(" + x2 + "px, " + y3 + "px)";
64556 if (node.offsetTop === targetIndexOffsetTop) {
64557 if (index2 < index && index2 >= targetIndex) {
64558 return "translateX(" + draggedTagWidth + "px)";
64559 } else if (index2 > index && index2 <= targetIndex) {
64560 return "translateX(-" + draggedTagWidth + "px)";
64566 }).on("end", function() {
64567 if (!select_default2(this).classed("dragging")) {
64570 var index = selection2.nodes().indexOf(this);
64571 select_default2(this).classed("dragging", false);
64572 _container.selectAll(".chip").style("transform", null);
64573 if (typeof targetIndex === "number") {
64574 var element = _multiData[index];
64575 _multiData.splice(index, 1);
64576 _multiData.splice(targetIndex, 0, element);
64578 if (_multiData.length) {
64579 t2[field.key] = _multiData.map(function(element2) {
64580 return element2.key;
64583 t2[field.key] = void 0;
64585 dispatch14.call("change", this, t2);
64587 dragOrigin = void 0;
64588 targetIndex = void 0;
64592 combo.setCustomOptions = (newValue) => {
64593 _customOptions = newValue;
64595 combo.focus = function() {
64596 _input.node().focus();
64598 combo.entityIDs = function(val) {
64599 if (!arguments.length) return _entityIDs;
64603 function combinedEntityExtent() {
64604 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
64606 return utilRebind(combo, dispatch14, "on");
64608 var init_combo = __esm({
64609 "modules/ui/fields/combo.js"() {
64614 init_country_coder();
64615 init_file_fetcher();
64622 init_length_indicator();
64627 // modules/behavior/hash.js
64628 var hash_exports = {};
64629 __export(hash_exports, {
64630 behaviorHash: () => behaviorHash
64632 function behaviorHash(context) {
64633 var _cachedHash = null;
64634 var _latitudeLimit = 90 - 1e-8;
64635 function computedHashParameters() {
64636 var map2 = context.map();
64637 var center = map2.center();
64638 var zoom = map2.zoom();
64639 var precision3 = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
64640 var oldParams = utilObjectOmit(
64641 utilStringQs(window.location.hash),
64642 ["comment", "source", "hashtags", "walkthrough"]
64644 var newParams = {};
64645 delete oldParams.id;
64646 var selected = context.selectedIDs().filter(function(id2) {
64647 return context.hasEntity(id2);
64649 if (selected.length) {
64650 newParams.id = selected.join(",");
64651 } else if (context.selectedNoteID()) {
64652 newParams.id = `note/${context.selectedNoteID()}`;
64654 newParams.map = zoom.toFixed(2) + "/" + center[1].toFixed(precision3) + "/" + center[0].toFixed(precision3);
64655 return Object.assign(oldParams, newParams);
64657 function computedHash() {
64658 return "#" + utilQsString(computedHashParameters(), true);
64660 function computedTitle(includeChangeCount) {
64661 var baseTitle = context.documentTitleBase() || "iD";
64665 var selected = context.selectedIDs().filter(function(id2) {
64666 return context.hasEntity(id2);
64668 if (selected.length) {
64669 var firstLabel = utilDisplayLabel(context.entity(selected[0]), context.graph());
64670 if (selected.length > 1) {
64671 contextual = _t("title.labeled_and_more", {
64672 labeled: firstLabel,
64673 count: selected.length - 1
64676 contextual = firstLabel;
64678 titleID = "context";
64680 if (includeChangeCount) {
64681 changeCount = context.history().difference().summary().length;
64682 if (changeCount > 0) {
64683 titleID = contextual ? "changes_context" : "changes";
64687 return _t("title.format." + titleID, {
64688 changes: changeCount,
64690 context: contextual
64695 function updateTitle(includeChangeCount) {
64696 if (!context.setsDocumentTitle()) return;
64697 var newTitle = computedTitle(includeChangeCount);
64698 if (document.title !== newTitle) {
64699 document.title = newTitle;
64702 function updateHashIfNeeded() {
64703 if (context.inIntro()) return;
64704 var latestHash = computedHash();
64705 if (_cachedHash !== latestHash) {
64706 _cachedHash = latestHash;
64707 window.history.replaceState(null, "", latestHash);
64710 /* includeChangeCount */
64712 const q3 = utilStringQs(latestHash);
64714 corePreferences("map-location", q3.map);
64718 var _throttledUpdate = throttle_default(updateHashIfNeeded, 500);
64719 var _throttledUpdateTitle = throttle_default(function() {
64722 /* includeChangeCount */
64725 function hashchange() {
64726 if (window.location.hash === _cachedHash) return;
64727 _cachedHash = window.location.hash;
64728 var q3 = utilStringQs(_cachedHash);
64729 var mapArgs = (q3.map || "").split("/").map(Number);
64730 if (mapArgs.length < 3 || mapArgs.some(isNaN)) {
64731 updateHashIfNeeded();
64733 if (_cachedHash === computedHash()) return;
64734 var mode = context.mode();
64735 context.map().centerZoom([mapArgs[2], Math.min(_latitudeLimit, Math.max(-_latitudeLimit, mapArgs[1]))], mapArgs[0]);
64736 if (q3.id && mode) {
64737 var ids = q3.id.split(",").filter(function(id2) {
64738 return context.hasEntity(id2) || id2.startsWith("note/");
64740 if (ids.length && ["browse", "select-note", "select"].includes(mode.id)) {
64741 if (ids.length === 1 && ids[0].startsWith("note/")) {
64742 context.enter(modeSelectNote(context, ids[0]));
64743 } else if (!utilArrayIdentical(mode.selectedIDs(), ids)) {
64744 context.enter(modeSelect(context, ids));
64749 var center = context.map().center();
64750 var dist = geoSphericalDistance(center, [mapArgs[2], mapArgs[1]]);
64752 if (mode && mode.id.match(/^draw/) !== null && dist > maxdist) {
64753 context.enter(modeBrowse(context));
64758 function behavior() {
64759 context.map().on("move.behaviorHash", _throttledUpdate);
64760 context.history().on("change.behaviorHash", _throttledUpdateTitle);
64761 context.on("enter.behaviorHash", _throttledUpdate);
64762 select_default2(window).on("hashchange.behaviorHash", hashchange);
64763 var q3 = utilStringQs(window.location.hash);
64765 const selectIds = q3.id.split(",");
64766 if (selectIds.length === 1 && selectIds[0].startsWith("note/")) {
64767 const noteId = selectIds[0].split("/")[1];
64768 context.moveToNote(noteId, !q3.map);
64770 context.zoomToEntities(
64771 // convert ids to short form id: node/123 -> n123
64772 selectIds.map((id2) => id2.replace(/([nwr])[^/]*\//, "$1")),
64777 if (q3.walkthrough === "true") {
64778 behavior.startWalkthrough = true;
64781 behavior.hadLocation = true;
64782 } else if (!q3.id && corePreferences("map-location")) {
64783 const mapArgs = corePreferences("map-location").split("/").map(Number);
64784 context.map().centerZoom([mapArgs[2], Math.min(_latitudeLimit, Math.max(-_latitudeLimit, mapArgs[1]))], mapArgs[0]);
64785 updateHashIfNeeded();
64786 behavior.hadLocation = true;
64789 updateTitle(false);
64791 behavior.off = function() {
64792 _throttledUpdate.cancel();
64793 _throttledUpdateTitle.cancel();
64794 context.map().on("move.behaviorHash", null);
64795 context.on("enter.behaviorHash", null);
64796 select_default2(window).on("hashchange.behaviorHash", null);
64797 window.location.hash = "";
64801 var init_hash = __esm({
64802 "modules/behavior/hash.js"() {
64811 init_utilDisplayLabel();
64813 init_preferences();
64817 // modules/behavior/index.js
64818 var behavior_exports = {};
64819 __export(behavior_exports, {
64820 behaviorAddWay: () => behaviorAddWay,
64821 behaviorBreathe: () => behaviorBreathe,
64822 behaviorDrag: () => behaviorDrag,
64823 behaviorDraw: () => behaviorDraw,
64824 behaviorDrawWay: () => behaviorDrawWay,
64825 behaviorEdit: () => behaviorEdit,
64826 behaviorHash: () => behaviorHash,
64827 behaviorHover: () => behaviorHover,
64828 behaviorLasso: () => behaviorLasso,
64829 behaviorOperation: () => behaviorOperation,
64830 behaviorPaste: () => behaviorPaste,
64831 behaviorSelect: () => behaviorSelect
64833 var init_behavior = __esm({
64834 "modules/behavior/index.js"() {
64851 // modules/ui/account.js
64852 var account_exports = {};
64853 __export(account_exports, {
64854 uiAccount: () => uiAccount
64856 function uiAccount(context) {
64857 const osm = context.connection();
64858 function updateUserDetails(selection2) {
64860 if (!osm.authenticated()) {
64861 render(selection2, null);
64863 osm.userDetails((err, user) => {
64864 if (err && err.status === 401) {
64867 render(selection2, user);
64871 function render(selection2, user) {
64872 let userInfo = selection2.select(".userInfo");
64873 let loginLogout = selection2.select(".loginLogout");
64875 userInfo.html("").classed("hide", false);
64876 let userLink = userInfo.append("a").attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
64877 if (user.image_url) {
64878 userLink.append("img").attr("class", "icon pre-text user-icon").attr("src", user.image_url);
64880 userLink.call(svgIcon("#iD-icon-avatar", "pre-text light"));
64882 userLink.append("span").attr("class", "label").text(user.display_name);
64883 loginLogout.classed("hide", false).select("a").text(_t("logout")).on("click", (e3) => {
64884 e3.preventDefault();
64886 osm.authenticate(void 0, { switchUser: true });
64889 userInfo.html("").classed("hide", true);
64890 loginLogout.classed("hide", false).select("a").text(_t("login")).on("click", (e3) => {
64891 e3.preventDefault();
64892 osm.authenticate();
64896 return function(selection2) {
64898 selection2.append("li").attr("class", "userInfo").classed("hide", true);
64899 selection2.append("li").attr("class", "loginLogout").classed("hide", true).append("a").attr("href", "#");
64900 osm.on("change.account", () => updateUserDetails(selection2));
64901 updateUserDetails(selection2);
64904 var init_account = __esm({
64905 "modules/ui/account.js"() {
64912 // modules/ui/attribution.js
64913 var attribution_exports = {};
64914 __export(attribution_exports, {
64915 uiAttribution: () => uiAttribution
64917 function uiAttribution(context) {
64918 let _selection = select_default2(null);
64919 function render(selection2, data, klass) {
64920 let div = selection2.selectAll(`.${klass}`).data([0]);
64921 div = div.enter().append("div").attr("class", klass).merge(div);
64922 let attributions = div.selectAll(".attribution").data(data, (d4) => d4.id);
64923 attributions.exit().remove();
64924 attributions = attributions.enter().append("span").attr("class", "attribution").each((d4, i3, nodes) => {
64925 let attribution = select_default2(nodes[i3]);
64926 if (d4.terms_html) {
64927 attribution.html(d4.terms_html);
64930 if (d4.terms_url) {
64931 attribution = attribution.append("a").attr("href", d4.terms_url).attr("target", "_blank");
64933 const sourceID = d4.id.replace(/\./g, "<TX_DOT>");
64934 const terms_text = _t(
64935 `imagery.${sourceID}.attribution.text`,
64936 { default: d4.terms_text || d4.id || d4.name() }
64938 if (d4.icon && !d4.overlay) {
64939 attribution.append("img").attr("class", "source-image").attr("src", d4.icon);
64941 attribution.append("span").attr("class", "attribution-text").text(terms_text);
64942 }).merge(attributions);
64943 let copyright = attributions.selectAll(".copyright-notice").data((d4) => {
64944 let notice = d4.copyrightNotices(context.map().zoom(), context.map().extent());
64945 return notice ? [notice] : [];
64947 copyright.exit().remove();
64948 copyright = copyright.enter().append("span").attr("class", "copyright-notice").merge(copyright);
64949 copyright.text(String);
64951 function update() {
64952 let baselayer = context.background().baseLayerSource();
64953 _selection.call(render, baselayer ? [baselayer] : [], "base-layer-attribution");
64954 const z3 = context.map().zoom();
64955 let overlays = context.background().overlayLayerSources() || [];
64956 _selection.call(render, overlays.filter((s2) => s2.validZoom(z3)), "overlay-layer-attribution");
64958 return function(selection2) {
64959 _selection = selection2;
64960 context.background().on("change.attribution", update);
64961 context.map().on("move.attribution", throttle_default(update, 400, { leading: false }));
64965 var init_attribution = __esm({
64966 "modules/ui/attribution.js"() {
64974 // modules/ui/contributors.js
64975 var contributors_exports = {};
64976 __export(contributors_exports, {
64977 uiContributors: () => uiContributors
64979 function uiContributors(context) {
64980 var osm = context.connection(), debouncedUpdate = debounce_default(function() {
64982 }, 1e3), limit = 4, hidden = false, wrap2 = select_default2(null);
64983 function update() {
64985 var users = {}, entities = context.history().intersects(context.map().extent());
64986 entities.forEach(function(entity) {
64987 if (entity && entity.user) users[entity.user] = true;
64989 var u2 = Object.keys(users), subset = u2.slice(0, u2.length > limit ? limit - 1 : limit);
64990 wrap2.html("").call(svgIcon("#iD-icon-nearby", "pre-text light"));
64991 var userList = select_default2(document.createElement("span"));
64992 userList.selectAll().data(subset).enter().append("a").attr("class", "user-link").attr("href", function(d4) {
64993 return osm.userURL(d4);
64994 }).attr("target", "_blank").text(String);
64995 if (u2.length > limit) {
64996 var count = select_default2(document.createElement("span"));
64997 var othersNum = u2.length - limit + 1;
64998 count.append("a").attr("target", "_blank").attr("href", function() {
64999 return osm.changesetsURL(context.map().center(), context.map().zoom());
65000 }).text(othersNum);
65001 wrap2.append("span").html(_t.html("contributors.truncated_list", { n: othersNum, users: { html: userList.html() }, count: { html: count.html() } }));
65003 wrap2.append("span").html(_t.html("contributors.list", { users: { html: userList.html() } }));
65007 wrap2.transition().style("opacity", 0);
65008 } else if (hidden) {
65009 wrap2.transition().style("opacity", 1);
65012 return function(selection2) {
65014 wrap2 = selection2;
65016 osm.on("loaded.contributors", debouncedUpdate);
65017 context.map().on("move.contributors", debouncedUpdate);
65020 var init_contributors = __esm({
65021 "modules/ui/contributors.js"() {
65030 // modules/ui/edit_menu.js
65031 var edit_menu_exports = {};
65032 __export(edit_menu_exports, {
65033 uiEditMenu: () => uiEditMenu
65035 function uiEditMenu(context) {
65036 var dispatch14 = dispatch_default("toggled");
65037 var _menu = select_default2(null);
65038 var _operations = [];
65039 var _anchorLoc = [0, 0];
65040 var _anchorLocLonLat = [0, 0];
65041 var _triggerType = "";
65042 var _vpTopMargin = 85;
65043 var _vpBottomMargin = 45;
65044 var _vpSideMargin = 35;
65045 var _menuTop = false;
65048 var _verticalPadding = 4;
65049 var _tooltipWidth = 210;
65050 var _menuSideMargin = 10;
65051 var _tooltips = [];
65052 var editMenu = function(selection2) {
65053 var isTouchMenu = _triggerType.includes("touch") || _triggerType.includes("pen");
65054 var ops = _operations.filter(function(op) {
65055 return !isTouchMenu || !op.mouseOnly;
65057 if (!ops.length) return;
65059 _menuTop = isTouchMenu;
65060 var showLabels = isTouchMenu;
65061 var buttonHeight = showLabels ? 32 : 34;
65063 _menuWidth = 52 + Math.min(120, 6 * Math.max.apply(Math, ops.map(function(op) {
65064 return op.title.length;
65069 _menuHeight = _verticalPadding * 2 + ops.length * buttonHeight;
65070 _menu = selection2.append("div").attr("class", "edit-menu").classed("touch-menu", isTouchMenu).style("padding", _verticalPadding + "px 0");
65071 var buttons = _menu.selectAll(".edit-menu-item").data(ops);
65072 var buttonsEnter = buttons.enter().append("button").attr("class", function(d4) {
65073 return "edit-menu-item edit-menu-item-" + d4.id;
65074 }).style("height", buttonHeight + "px").on("click", click).on("pointerup", pointerup).on("pointerdown mousedown", function pointerdown(d3_event) {
65075 d3_event.stopPropagation();
65076 }).on("mouseenter.highlight", function(d3_event, d4) {
65077 if (!d4.relatedEntityIds || select_default2(this).classed("disabled")) return;
65078 utilHighlightEntities(d4.relatedEntityIds(), true, context);
65079 }).on("mouseleave.highlight", function(d3_event, d4) {
65080 if (!d4.relatedEntityIds) return;
65081 utilHighlightEntities(d4.relatedEntityIds(), false, context);
65083 buttonsEnter.each(function(d4) {
65084 var tooltip = uiTooltip().heading(() => d4.title).title(d4.tooltip).keys([d4.keys[0]]);
65085 _tooltips.push(tooltip);
65086 select_default2(this).call(tooltip).append("div").attr("class", "icon-wrap").call(svgIcon(d4.icon && d4.icon() || "#iD-operation-" + d4.id, "operation"));
65089 buttonsEnter.append("span").attr("class", "label").each(function(d4) {
65090 select_default2(this).call(d4.title);
65093 buttonsEnter.merge(buttons).classed("disabled", function(d4) {
65094 return d4.disabled();
65097 var initialScale = context.projection.scale();
65098 context.map().on("move.edit-menu", function() {
65099 if (initialScale !== context.projection.scale()) {
65102 }).on("drawn.edit-menu", function(info) {
65103 if (info.full) updatePosition();
65105 var lastPointerUpType;
65106 function pointerup(d3_event) {
65107 lastPointerUpType = d3_event.pointerType;
65109 function click(d3_event, operation2) {
65110 d3_event.stopPropagation();
65111 if (operation2.relatedEntityIds) {
65112 utilHighlightEntities(operation2.relatedEntityIds(), false, context);
65114 if (operation2.disabled()) {
65115 if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
65116 context.ui().flash.duration(4e3).iconName("#iD-operation-" + operation2.id).iconClass("operation disabled").label(operation2.tooltip())();
65119 if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
65120 context.ui().flash.duration(2e3).iconName("#iD-operation-" + operation2.id).iconClass("operation").label(operation2.annotation() || operation2.title)();
65125 lastPointerUpType = null;
65127 dispatch14.call("toggled", this, true);
65129 function updatePosition() {
65130 if (!_menu || _menu.empty()) return;
65131 var anchorLoc = context.projection(_anchorLocLonLat);
65132 var viewport = context.surfaceRect();
65133 if (anchorLoc[0] < 0 || anchorLoc[0] > viewport.width || anchorLoc[1] < 0 || anchorLoc[1] > viewport.height) {
65137 var menuLeft = displayOnLeft(viewport);
65138 var offset = [0, 0];
65139 offset[0] = menuLeft ? -1 * (_menuSideMargin + _menuWidth) : _menuSideMargin;
65141 if (anchorLoc[1] - _menuHeight < _vpTopMargin) {
65142 offset[1] = -anchorLoc[1] + _vpTopMargin;
65144 offset[1] = -_menuHeight;
65147 if (anchorLoc[1] + _menuHeight > viewport.height - _vpBottomMargin) {
65148 offset[1] = -anchorLoc[1] - _menuHeight + viewport.height - _vpBottomMargin;
65153 var origin = geoVecAdd(anchorLoc, offset);
65154 var _verticalOffset = parseFloat(utilGetDimensions(select_default2(".top-toolbar-wrap"))[1]);
65155 origin[1] -= _verticalOffset;
65156 _menu.style("left", origin[0] + "px").style("top", origin[1] + "px");
65157 var tooltipSide = tooltipPosition(viewport, menuLeft);
65158 _tooltips.forEach(function(tooltip) {
65159 tooltip.placement(tooltipSide);
65161 function displayOnLeft(viewport2) {
65162 if (_mainLocalizer.textDirection() === "ltr") {
65163 if (anchorLoc[0] + _menuSideMargin + _menuWidth > viewport2.width - _vpSideMargin) {
65168 if (anchorLoc[0] - _menuSideMargin - _menuWidth < _vpSideMargin) {
65174 function tooltipPosition(viewport2, menuLeft2) {
65175 if (_mainLocalizer.textDirection() === "ltr") {
65179 if (anchorLoc[0] + _menuSideMargin + _menuWidth + _tooltipWidth > viewport2.width - _vpSideMargin) {
65187 if (anchorLoc[0] - _menuSideMargin - _menuWidth - _tooltipWidth < _vpSideMargin) {
65194 editMenu.close = function() {
65195 context.map().on("move.edit-menu", null).on("drawn.edit-menu", null);
65198 dispatch14.call("toggled", this, false);
65200 editMenu.anchorLoc = function(val) {
65201 if (!arguments.length) return _anchorLoc;
65203 _anchorLocLonLat = context.projection.invert(_anchorLoc);
65206 editMenu.triggerType = function(val) {
65207 if (!arguments.length) return _triggerType;
65208 _triggerType = val;
65211 editMenu.operations = function(val) {
65212 if (!arguments.length) return _operations;
65216 return utilRebind(editMenu, dispatch14, "on");
65218 var init_edit_menu = __esm({
65219 "modules/ui/edit_menu.js"() {
65233 // modules/ui/feature_info.js
65234 var feature_info_exports = {};
65235 __export(feature_info_exports, {
65236 uiFeatureInfo: () => uiFeatureInfo
65238 function uiFeatureInfo(context) {
65239 function update(selection2) {
65240 var features = context.features();
65241 var stats = features.stats();
65243 var hiddenList = features.hidden().map(function(k2) {
65245 count += stats[k2];
65246 return _t.append("inspector.title_count", {
65247 title: _t("feature." + k2 + ".description"),
65252 }).filter(Boolean);
65253 selection2.text("");
65254 if (hiddenList.length) {
65255 var tooltipBehavior = uiTooltip().placement("top").title(function() {
65256 return (selection3) => {
65257 hiddenList.forEach((hiddenFeature) => {
65258 selection3.append("div").call(hiddenFeature);
65262 selection2.append("a").attr("class", "chip").attr("href", "#").call(_t.append("feature_info.hidden_warning", { count })).call(tooltipBehavior).on("click", function(d3_event) {
65263 tooltipBehavior.hide();
65264 d3_event.preventDefault();
65265 context.ui().togglePanes(context.container().select(".map-panes .map-data-pane"));
65268 selection2.classed("hide", !hiddenList.length);
65270 return function(selection2) {
65271 update(selection2);
65272 context.features().on("change.feature_info", function() {
65273 update(selection2);
65277 var init_feature_info = __esm({
65278 "modules/ui/feature_info.js"() {
65285 // modules/ui/flash.js
65286 var flash_exports = {};
65287 __export(flash_exports, {
65288 uiFlash: () => uiFlash
65290 function uiFlash(context) {
65292 var _duration = 2e3;
65293 var _iconName = "#iD-icon-no";
65294 var _iconClass = "disabled";
65295 var _label = (s2) => s2.text("");
65298 _flashTimer.stop();
65300 context.container().select(".main-footer-wrap").classed("footer-hide", true).classed("footer-show", false);
65301 context.container().select(".flash-wrap").classed("footer-hide", false).classed("footer-show", true);
65302 var content = context.container().select(".flash-wrap").selectAll(".flash-content").data([0]);
65303 var contentEnter = content.enter().append("div").attr("class", "flash-content");
65304 var iconEnter = contentEnter.append("svg").attr("class", "flash-icon icon").append("g").attr("transform", "translate(10,10)");
65305 iconEnter.append("circle").attr("r", 9);
65306 iconEnter.append("use").attr("transform", "translate(-7,-7)").attr("width", "14").attr("height", "14");
65307 contentEnter.append("div").attr("class", "flash-text");
65308 content = content.merge(contentEnter);
65309 content.selectAll(".flash-icon").attr("class", "icon flash-icon " + (_iconClass || ""));
65310 content.selectAll(".flash-icon use").attr("xlink:href", _iconName);
65311 content.selectAll(".flash-text").attr("class", "flash-text").call(_label);
65312 _flashTimer = timeout_default(function() {
65313 _flashTimer = null;
65314 context.container().select(".main-footer-wrap").classed("footer-hide", false).classed("footer-show", true);
65315 context.container().select(".flash-wrap").classed("footer-hide", true).classed("footer-show", false);
65319 flash.duration = function(_3) {
65320 if (!arguments.length) return _duration;
65324 flash.label = function(_3) {
65325 if (!arguments.length) return _label;
65326 if (typeof _3 !== "function") {
65327 _label = (selection2) => selection2.text(_3);
65329 _label = (selection2) => selection2.text("").call(_3);
65333 flash.iconName = function(_3) {
65334 if (!arguments.length) return _iconName;
65338 flash.iconClass = function(_3) {
65339 if (!arguments.length) return _iconClass;
65345 var init_flash = __esm({
65346 "modules/ui/flash.js"() {
65352 // modules/ui/full_screen.js
65353 var full_screen_exports = {};
65354 __export(full_screen_exports, {
65355 uiFullScreen: () => uiFullScreen
65357 function uiFullScreen(context) {
65358 var element = context.container().node();
65359 function getFullScreenFn() {
65360 if (element.requestFullscreen) {
65361 return element.requestFullscreen;
65362 } else if (element.msRequestFullscreen) {
65363 return element.msRequestFullscreen;
65364 } else if (element.mozRequestFullScreen) {
65365 return element.mozRequestFullScreen;
65366 } else if (element.webkitRequestFullscreen) {
65367 return element.webkitRequestFullscreen;
65370 function getExitFullScreenFn() {
65371 if (document.exitFullscreen) {
65372 return document.exitFullscreen;
65373 } else if (document.msExitFullscreen) {
65374 return document.msExitFullscreen;
65375 } else if (document.mozCancelFullScreen) {
65376 return document.mozCancelFullScreen;
65377 } else if (document.webkitExitFullscreen) {
65378 return document.webkitExitFullscreen;
65381 function isFullScreen() {
65382 return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
65384 function isSupported() {
65385 return !!getFullScreenFn();
65387 function fullScreen(d3_event) {
65388 d3_event.preventDefault();
65389 if (!isFullScreen()) {
65390 getFullScreenFn().apply(element);
65392 getExitFullScreenFn().apply(document);
65395 return function() {
65396 if (!isSupported()) return;
65397 var detected = utilDetect();
65398 var keys2 = detected.os === "mac" ? [uiCmd("\u2303\u2318F"), "f11"] : ["f11"];
65399 context.keybinding().on(keys2, fullScreen);
65402 var init_full_screen = __esm({
65403 "modules/ui/full_screen.js"() {
65410 // modules/ui/geolocate.js
65411 var geolocate_exports2 = {};
65412 __export(geolocate_exports2, {
65413 uiGeolocate: () => uiGeolocate
65415 function uiGeolocate(context) {
65416 var _geolocationOptions = {
65417 // prioritize speed and power usage over precision
65418 enableHighAccuracy: false,
65419 // don't hang indefinitely getting the location
65423 var _locating = uiLoading(context).message(_t.html("geolocate.locating")).blocking(true);
65424 var _layer = context.layers().layer("geolocate");
65428 var _button = select_default2(null);
65430 if (context.inIntro()) return;
65431 if (!_layer.enabled() && !_locating.isShown()) {
65432 _timeoutID = setTimeout(
65437 context.container().call(_locating);
65438 navigator.geolocation.getCurrentPosition(success, error, _geolocationOptions);
65441 _layer.enabled(null, false);
65442 updateButtonState();
65445 function zoomTo() {
65446 context.enter(modeBrowse(context));
65447 var map2 = context.map();
65448 _layer.enabled(_position, true);
65449 updateButtonState();
65450 map2.centerZoomEase(_extent.center(), Math.min(20, map2.extentZoom(_extent)));
65452 function success(geolocation) {
65453 _position = geolocation;
65454 var coords = _position.coords;
65455 _extent = geoExtent([coords.longitude, coords.latitude]).padByMeters(coords.accuracy);
65463 context.ui().flash.label(_t.append("geolocate.location_unavailable")).iconName("#iD-icon-geolocate")();
65467 function finish() {
65470 clearTimeout(_timeoutID);
65472 _timeoutID = void 0;
65474 function updateButtonState() {
65475 _button.classed("active", _layer.enabled());
65476 _button.attr("aria-pressed", _layer.enabled());
65478 return function(selection2) {
65479 if (!navigator.geolocation || !navigator.geolocation.getCurrentPosition) return;
65480 _button = selection2.append("button").on("click", click).attr("aria-pressed", false).call(svgIcon("#iD-icon-geolocate", "light")).call(
65481 uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(() => _t.append("geolocate.title"))
65485 var init_geolocate2 = __esm({
65486 "modules/ui/geolocate.js"() {
65498 // modules/ui/panels/background.js
65499 var background_exports = {};
65500 __export(background_exports, {
65501 uiPanelBackground: () => uiPanelBackground
65503 function uiPanelBackground(context) {
65504 const background = context.background();
65505 let _currSource = null;
65506 let _metadata = {};
65507 const _metadataKeys = [
65515 var debouncedRedraw = debounce_default(redraw, 250);
65516 function redraw(selection2) {
65517 var source = background.baseLayerSource();
65518 if (!source) return;
65519 if ((_currSource == null ? void 0 : _currSource.id) !== source.id) {
65520 _currSource = source;
65523 selection2.text("");
65524 var list = selection2.append("ul").attr("class", "background-info");
65525 list.append("li").call(_currSource.label());
65526 _metadataKeys.forEach(function(k2) {
65527 list.append("li").attr("class", "background-info-list-" + k2).classed("hide", !_metadata[k2]).call(_t.append("info_panels.background." + k2, { suffix: ":" })).append("span").attr("class", "background-info-span-" + k2).text(_metadata[k2]);
65529 debouncedGetMetadata(selection2);
65530 var toggleTiles = context.getDebug("tile") ? "hide_tiles" : "show_tiles";
65531 selection2.append("a").call(_t.append("info_panels.background." + toggleTiles)).attr("href", "#").attr("class", "button button-toggle-tiles").on("click", function(d3_event) {
65532 d3_event.preventDefault();
65533 context.setDebug("tile", !context.getDebug("tile"));
65534 selection2.call(redraw);
65537 var debouncedGetMetadata = debounce_default(getMetadata, 250);
65538 function getMetadata(selection2) {
65539 var tile = context.container().select(".layer-background img.tile-center");
65540 if (tile.empty()) return;
65541 var sourceId = _currSource.id;
65542 var d4 = tile.datum();
65543 var zoom = d4 && d4.length >= 3 && d4[2] || Math.floor(context.map().zoom());
65544 var center = context.map().center();
65545 _metadata.zoom = String(zoom);
65546 selection2.selectAll(".background-info-list-zoom").classed("hide", false).selectAll(".background-info-span-zoom").text(_metadata.zoom);
65547 if (!d4 || !d4.length >= 3) return;
65548 background.baseLayerSource().getMetadata(center, d4, function(err, result) {
65549 if (err || _currSource.id !== sourceId) return;
65550 var vintage = result.vintage;
65551 _metadata.vintage = vintage && vintage.range || _t("info_panels.background.unknown");
65552 selection2.selectAll(".background-info-list-vintage").classed("hide", false).selectAll(".background-info-span-vintage").text(_metadata.vintage);
65553 _metadataKeys.forEach(function(k2) {
65554 if (k2 === "zoom" || k2 === "vintage") return;
65555 var val = result[k2];
65556 _metadata[k2] = val;
65557 selection2.selectAll(".background-info-list-" + k2).classed("hide", !val).selectAll(".background-info-span-" + k2).text(val);
65561 var panel = function(selection2) {
65562 selection2.call(redraw);
65563 context.map().on("drawn.info-background", function() {
65564 selection2.call(debouncedRedraw);
65565 }).on("move.info-background", function() {
65566 selection2.call(debouncedGetMetadata);
65569 panel.off = function() {
65570 context.map().on("drawn.info-background", null).on("move.info-background", null);
65572 panel.id = "background";
65573 panel.label = _t.append("info_panels.background.title");
65574 panel.key = _t("info_panels.background.key");
65577 var init_background = __esm({
65578 "modules/ui/panels/background.js"() {
65585 // modules/ui/panels/history.js
65586 var history_exports2 = {};
65587 __export(history_exports2, {
65588 uiPanelHistory: () => uiPanelHistory
65590 function uiPanelHistory(context) {
65592 function displayTimestamp(timestamp) {
65593 if (!timestamp) return _t("info_panels.history.unknown");
65602 var d4 = new Date(timestamp);
65603 if (isNaN(d4.getTime())) return _t("info_panels.history.unknown");
65604 return d4.toLocaleString(_mainLocalizer.localeCode(), options);
65606 function displayUser(selection2, userName) {
65608 selection2.append("span").call(_t.append("info_panels.history.unknown"));
65611 selection2.append("span").attr("class", "user-name").text(userName);
65612 var links = selection2.append("div").attr("class", "links");
65614 links.append("a").attr("class", "user-osm-link").attr("href", osm.userURL(userName)).attr("target", "_blank").call(_t.append("info_panels.history.profile_link"));
65616 links.append("a").attr("class", "user-hdyc-link").attr("href", "https://hdyc.neis-one.org/?" + userName).attr("target", "_blank").attr("tabindex", -1).text("HDYC");
65618 function displayChangeset(selection2, changeset) {
65620 selection2.append("span").call(_t.append("info_panels.history.unknown"));
65623 selection2.append("span").attr("class", "changeset-id").text(changeset);
65624 var links = selection2.append("div").attr("class", "links");
65626 links.append("a").attr("class", "changeset-osm-link").attr("href", osm.changesetURL(changeset)).attr("target", "_blank").call(_t.append("info_panels.history.changeset_link"));
65628 links.append("a").attr("class", "changeset-osmcha-link").attr("href", "https://osmcha.org/changesets/" + changeset).attr("target", "_blank").text("OSMCha");
65629 links.append("a").attr("class", "changeset-achavi-link").attr("href", "https://overpass-api.de/achavi/?changeset=" + changeset).attr("target", "_blank").text("Achavi");
65631 function redraw(selection2) {
65632 var selectedNoteID = context.selectedNoteID();
65633 osm = context.connection();
65634 var selected, note, entity;
65635 if (selectedNoteID && osm) {
65636 selected = [_t.html("note.note") + " " + selectedNoteID];
65637 note = osm.getNote(selectedNoteID);
65639 selected = context.selectedIDs().filter(function(e3) {
65640 return context.hasEntity(e3);
65642 if (selected.length) {
65643 entity = context.entity(selected[0]);
65646 var singular = selected.length === 1 ? selected[0] : null;
65647 selection2.html("");
65649 selection2.append("h4").attr("class", "history-heading").html(singular);
65651 selection2.append("h4").attr("class", "history-heading").call(_t.append("info_panels.selected", { n: selected.length }));
65653 if (!singular) return;
65655 selection2.call(redrawEntity, entity);
65657 selection2.call(redrawNote, note);
65660 function redrawNote(selection2, note) {
65661 if (!note || note.isNew()) {
65662 selection2.append("div").call(_t.append("info_panels.history.note_no_history"));
65665 var list = selection2.append("ul");
65666 list.append("li").call(_t.append("info_panels.history.note_comments", { suffix: ":" })).append("span").text(note.comments.length);
65667 if (note.comments.length) {
65668 list.append("li").call(_t.append("info_panels.history.note_created_date", { suffix: ":" })).append("span").text(displayTimestamp(note.comments[0].date));
65669 list.append("li").call(_t.append("info_panels.history.note_created_user", { suffix: ":" })).call(displayUser, note.comments[0].user);
65672 selection2.append("a").attr("class", "view-history-on-osm").attr("target", "_blank").attr("href", osm.noteURL(note)).call(svgIcon("#iD-icon-out-link", "inline")).append("span").call(_t.append("info_panels.history.note_link_text"));
65675 function redrawEntity(selection2, entity) {
65676 if (!entity || entity.isNew()) {
65677 selection2.append("div").call(_t.append("info_panels.history.no_history"));
65680 var links = selection2.append("div").attr("class", "links");
65682 links.append("a").attr("class", "view-history-on-osm").attr("href", osm.historyURL(entity)).attr("target", "_blank").call(_t.append("info_panels.history.history_link"));
65684 links.append("a").attr("class", "pewu-history-viewer-link").attr("href", "https://pewu.github.io/osm-history/#/" + entity.type + "/" + entity.osmId()).attr("target", "_blank").attr("tabindex", -1).text("PeWu");
65685 var list = selection2.append("ul");
65686 list.append("li").call(_t.append("info_panels.history.version", { suffix: ":" })).append("span").text(entity.version);
65687 list.append("li").call(_t.append("info_panels.history.last_edit", { suffix: ":" })).append("span").text(displayTimestamp(entity.timestamp));
65688 list.append("li").call(_t.append("info_panels.history.edited_by", { suffix: ":" })).call(displayUser, entity.user);
65689 list.append("li").call(_t.append("info_panels.history.changeset", { suffix: ":" })).call(displayChangeset, entity.changeset);
65691 var panel = function(selection2) {
65692 selection2.call(redraw);
65693 context.map().on("drawn.info-history", function() {
65694 selection2.call(redraw);
65696 context.on("enter.info-history", function() {
65697 selection2.call(redraw);
65700 panel.off = function() {
65701 context.map().on("drawn.info-history", null);
65702 context.on("enter.info-history", null);
65704 panel.id = "history";
65705 panel.label = _t.append("info_panels.history.title");
65706 panel.key = _t("info_panels.history.key");
65709 var init_history2 = __esm({
65710 "modules/ui/panels/history.js"() {
65717 // modules/ui/panels/location.js
65718 var location_exports = {};
65719 __export(location_exports, {
65720 uiPanelLocation: () => uiPanelLocation
65722 function uiPanelLocation(context) {
65723 var currLocation = "";
65724 function redraw(selection2) {
65725 selection2.html("");
65726 var list = selection2.append("ul");
65727 var coord2 = context.map().mouseCoordinates();
65728 if (coord2.some(isNaN)) {
65729 coord2 = context.map().center();
65731 list.append("li").text(dmsCoordinatePair(coord2)).append("li").text(decimalCoordinatePair(coord2));
65732 selection2.append("div").attr("class", "location-info").text(currLocation || " ");
65733 debouncedGetLocation(selection2, coord2);
65735 var debouncedGetLocation = debounce_default(getLocation, 250);
65736 function getLocation(selection2, coord2) {
65737 if (!services.geocoder) {
65738 currLocation = _t("info_panels.location.unknown_location");
65739 selection2.selectAll(".location-info").text(currLocation);
65741 services.geocoder.reverse(coord2, function(err, result) {
65742 currLocation = result ? result.display_name : _t("info_panels.location.unknown_location");
65743 selection2.selectAll(".location-info").text(currLocation);
65747 var panel = function(selection2) {
65748 selection2.call(redraw);
65749 context.surface().on(("PointerEvent" in window ? "pointer" : "mouse") + "move.info-location", function() {
65750 selection2.call(redraw);
65753 panel.off = function() {
65754 context.surface().on(".info-location", null);
65756 panel.id = "location";
65757 panel.label = _t.append("info_panels.location.title");
65758 panel.key = _t("info_panels.location.key");
65761 var init_location = __esm({
65762 "modules/ui/panels/location.js"() {
65771 // modules/ui/panels/measurement.js
65772 var measurement_exports = {};
65773 __export(measurement_exports, {
65774 uiPanelMeasurement: () => uiPanelMeasurement
65776 function uiPanelMeasurement(context) {
65777 function radiansToMeters(r2) {
65778 return r2 * 63710071809e-4;
65780 function steradiansToSqmeters(r2) {
65781 return r2 / (4 * Math.PI) * 510065621724e3;
65783 function toLineString(feature3) {
65784 if (feature3.type === "LineString") return feature3;
65785 var result = { type: "LineString", coordinates: [] };
65786 if (feature3.type === "Polygon") {
65787 result.coordinates = feature3.coordinates[0];
65788 } else if (feature3.type === "MultiPolygon") {
65789 result.coordinates = feature3.coordinates[0][0];
65793 var _isImperial = !_mainLocalizer.usesMetric();
65794 function redraw(selection2) {
65795 var graph = context.graph();
65796 var selectedNoteID = context.selectedNoteID();
65797 var osm = services.osm;
65798 var localeCode = _mainLocalizer.localeCode();
65800 var center, location, centroid;
65801 var closed, geometry;
65802 var totalNodeCount, length2 = 0, area = 0, distance;
65803 if (selectedNoteID && osm) {
65804 var note = osm.getNote(selectedNoteID);
65805 heading = _t.html("note.note") + " " + selectedNoteID;
65806 location = note.loc;
65809 var selectedIDs = context.selectedIDs().filter(function(id2) {
65810 return context.hasEntity(id2);
65812 var selected = selectedIDs.map(function(id2) {
65813 return context.entity(id2);
65815 heading = selected.length === 1 ? selected[0].id : _t.html("info_panels.selected", { n: selected.length });
65816 if (selected.length) {
65817 var extent = geoExtent();
65818 for (var i3 in selected) {
65819 var entity = selected[i3];
65820 extent._extend(entity.extent(graph));
65821 geometry = entity.geometry(graph);
65822 if (geometry === "line" || geometry === "area") {
65823 closed = entity.type === "relation" || entity.isClosed() && !entity.isDegenerate();
65824 var feature3 = entity.asGeoJSON(graph);
65825 length2 += radiansToMeters(length_default(toLineString(feature3)));
65826 centroid = path_default(context.projection).centroid(entity.asGeoJSON(graph));
65827 centroid = centroid && context.projection.invert(centroid);
65828 if (!centroid || !isFinite(centroid[0]) || !isFinite(centroid[1])) {
65829 centroid = entity.extent(graph).center();
65832 area += steradiansToSqmeters(entity.area(graph));
65836 if (selected.length > 1) {
65841 if (selected.length === 2 && selected[0].type === "node" && selected[1].type === "node") {
65842 distance = geoSphericalDistance(selected[0].loc, selected[1].loc);
65844 if (selected.length === 1 && selected[0].type === "node") {
65845 location = selected[0].loc;
65847 totalNodeCount = utilGetAllNodes(selectedIDs, context.graph()).length;
65849 if (!location && !centroid) {
65850 center = extent.center();
65854 selection2.html("");
65856 selection2.append("h4").attr("class", "measurement-heading").html(heading);
65858 var list = selection2.append("ul");
65861 list.append("li").call(_t.append("info_panels.measurement.geometry", { suffix: ":" })).append("span").html(
65862 closed ? _t.html("info_panels.measurement.closed_" + geometry) : _t.html("geometry." + geometry)
65865 if (totalNodeCount) {
65866 list.append("li").call(_t.append("info_panels.measurement.node_count", { suffix: ":" })).append("span").text(totalNodeCount.toLocaleString(localeCode));
65869 list.append("li").call(_t.append("info_panels.measurement.area", { suffix: ":" })).append("span").text(displayArea(area, _isImperial));
65872 list.append("li").call(_t.append("info_panels.measurement." + (closed ? "perimeter" : "length"), { suffix: ":" })).append("span").text(displayLength(length2, _isImperial));
65874 if (typeof distance === "number") {
65875 list.append("li").call(_t.append("info_panels.measurement.distance", { suffix: ":" })).append("span").text(displayLength(distance, _isImperial));
65878 coordItem = list.append("li").call(_t.append("info_panels.measurement.location", { suffix: ":" }));
65879 coordItem.append("span").text(dmsCoordinatePair(location));
65880 coordItem.append("span").text(decimalCoordinatePair(location));
65883 coordItem = list.append("li").call(_t.append("info_panels.measurement.centroid", { suffix: ":" }));
65884 coordItem.append("span").text(dmsCoordinatePair(centroid));
65885 coordItem.append("span").text(decimalCoordinatePair(centroid));
65888 coordItem = list.append("li").call(_t.append("info_panels.measurement.center", { suffix: ":" }));
65889 coordItem.append("span").text(dmsCoordinatePair(center));
65890 coordItem.append("span").text(decimalCoordinatePair(center));
65892 if (length2 || area || typeof distance === "number") {
65893 var toggle = _isImperial ? "imperial" : "metric";
65894 selection2.append("a").call(_t.append("info_panels.measurement." + toggle)).attr("href", "#").attr("class", "button button-toggle-units").on("click", function(d3_event) {
65895 d3_event.preventDefault();
65896 _isImperial = !_isImperial;
65897 selection2.call(redraw);
65901 var panel = function(selection2) {
65902 selection2.call(redraw);
65903 context.map().on("drawn.info-measurement", function() {
65904 selection2.call(redraw);
65906 context.on("enter.info-measurement", function() {
65907 selection2.call(redraw);
65910 panel.off = function() {
65911 context.map().on("drawn.info-measurement", null);
65912 context.on("enter.info-measurement", null);
65914 panel.id = "measurement";
65915 panel.label = _t.append("info_panels.measurement.title");
65916 panel.key = _t("info_panels.measurement.key");
65919 var init_measurement = __esm({
65920 "modules/ui/panels/measurement.js"() {
65931 // modules/ui/panels/index.js
65932 var panels_exports = {};
65933 __export(panels_exports, {
65934 uiInfoPanels: () => uiInfoPanels,
65935 uiPanelBackground: () => uiPanelBackground,
65936 uiPanelHistory: () => uiPanelHistory,
65937 uiPanelLocation: () => uiPanelLocation,
65938 uiPanelMeasurement: () => uiPanelMeasurement
65941 var init_panels = __esm({
65942 "modules/ui/panels/index.js"() {
65947 init_measurement();
65951 init_measurement();
65953 background: uiPanelBackground,
65954 history: uiPanelHistory,
65955 location: uiPanelLocation,
65956 measurement: uiPanelMeasurement
65961 // modules/ui/info.js
65962 var info_exports = {};
65963 __export(info_exports, {
65964 uiInfo: () => uiInfo
65966 function uiInfo(context) {
65967 var ids = Object.keys(uiInfoPanels);
65968 var wasActive = ["measurement"];
65971 ids.forEach(function(k2) {
65973 panels[k2] = uiInfoPanels[k2](context);
65974 active[k2] = false;
65977 function info(selection2) {
65978 function redraw() {
65979 var activeids = ids.filter(function(k2) {
65982 var containers = infoPanels.selectAll(".panel-container").data(activeids, function(k2) {
65985 containers.exit().style("opacity", 1).transition().duration(200).style("opacity", 0).on("end", function(d4) {
65986 select_default2(this).call(panels[d4].off).remove();
65988 var enter = containers.enter().append("div").attr("class", function(d4) {
65989 return "fillD2 panel-container panel-container-" + d4;
65991 enter.style("opacity", 0).transition().duration(200).style("opacity", 1);
65992 var title = enter.append("div").attr("class", "panel-title fillD2");
65993 title.append("h3").each(function(d4) {
65994 return panels[d4].label(select_default2(this));
65996 title.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function(d3_event, d4) {
65997 d3_event.stopImmediatePropagation();
65998 d3_event.preventDefault();
66000 }).call(svgIcon("#iD-icon-close"));
66001 enter.append("div").attr("class", function(d4) {
66002 return "panel-content panel-content-" + d4;
66004 infoPanels.selectAll(".panel-content").each(function(d4) {
66005 select_default2(this).call(panels[d4]);
66008 info.toggle = function(which) {
66009 var activeids = ids.filter(function(k2) {
66013 active[which] = !active[which];
66014 if (activeids.length === 1 && activeids[0] === which) {
66015 wasActive = [which];
66017 context.container().select("." + which + "-panel-toggle-item").classed("active", active[which]).select("input").property("checked", active[which]);
66019 if (activeids.length) {
66020 wasActive = activeids;
66021 activeids.forEach(function(k2) {
66022 active[k2] = false;
66025 wasActive.forEach(function(k2) {
66032 var infoPanels = selection2.selectAll(".info-panels").data([0]);
66033 infoPanels = infoPanels.enter().append("div").attr("class", "info-panels").merge(infoPanels);
66035 context.keybinding().on(uiCmd("\u2318" + _t("info_panels.key")), function(d3_event) {
66036 if (d3_event.shiftKey) return;
66037 d3_event.stopImmediatePropagation();
66038 d3_event.preventDefault();
66041 ids.forEach(function(k2) {
66042 var key = _t("info_panels." + k2 + ".key", { default: null });
66044 context.keybinding().on(uiCmd("\u2318\u21E7" + key), function(d3_event) {
66045 d3_event.stopImmediatePropagation();
66046 d3_event.preventDefault();
66053 var init_info = __esm({
66054 "modules/ui/info.js"() {
66064 // modules/ui/curtain.js
66065 var curtain_exports = {};
66066 __export(curtain_exports, {
66067 uiCurtain: () => uiCurtain
66069 function uiCurtain(containerNode) {
66070 var surface = select_default2(null), tooltip = select_default2(null), darkness = select_default2(null);
66071 function curtain(selection2) {
66072 surface = selection2.append("svg").attr("class", "curtain").style("top", 0).style("left", 0);
66073 darkness = surface.append("path").attr("x", 0).attr("y", 0).attr("class", "curtain-darkness");
66074 select_default2(window).on("resize.curtain", resize);
66075 tooltip = selection2.append("div").attr("class", "tooltip");
66076 tooltip.append("div").attr("class", "popover-arrow");
66077 tooltip.append("div").attr("class", "popover-inner");
66079 function resize() {
66080 surface.attr("width", containerNode.clientWidth).attr("height", containerNode.clientHeight);
66081 curtain.cut(darkness.datum());
66084 curtain.reveal = function(box, html2, options) {
66085 options = options || {};
66086 if (typeof box === "string") {
66087 box = select_default2(box).node();
66089 if (box && box.getBoundingClientRect) {
66090 box = copyBox(box.getBoundingClientRect());
66093 var containerRect = containerNode.getBoundingClientRect();
66094 box.top -= containerRect.top;
66095 box.left -= containerRect.left;
66097 if (box && options.padding) {
66098 box.top -= options.padding;
66099 box.left -= options.padding;
66100 box.bottom += options.padding;
66101 box.right += options.padding;
66102 box.height += options.padding * 2;
66103 box.width += options.padding * 2;
66106 if (options.tooltipBox) {
66107 tooltipBox = options.tooltipBox;
66108 if (typeof tooltipBox === "string") {
66109 tooltipBox = select_default2(tooltipBox).node();
66111 if (tooltipBox && tooltipBox.getBoundingClientRect) {
66112 tooltipBox = copyBox(tooltipBox.getBoundingClientRect());
66117 if (tooltipBox && html2) {
66118 if (html2.indexOf("**") !== -1) {
66119 if (html2.indexOf("<span") === 0) {
66120 html2 = html2.replace(/^(<span.*?>)(.+?)(\*\*)/, "$1<span>$2</span>$3");
66122 html2 = html2.replace(/^(.+?)(\*\*)/, "<span>$1</span>$2");
66124 html2 = html2.replace(/\*\*(.*?)\*\*/g, '<span class="instruction">$1</span>');
66126 html2 = html2.replace(/\*(.*?)\*/g, "<em>$1</em>");
66127 html2 = html2.replace(/\{br\}/g, "<br/><br/>");
66128 if (options.buttonText && options.buttonCallback) {
66129 html2 += '<div class="button-section"><button href="#" class="button action">' + options.buttonText + "</button></div>";
66131 var classes = "curtain-tooltip popover tooltip arrowed in " + (options.tooltipClass || "");
66132 tooltip.classed(classes, true).selectAll(".popover-inner").html(html2);
66133 if (options.buttonText && options.buttonCallback) {
66134 var button = tooltip.selectAll(".button-section .button.action");
66135 button.on("click", function(d3_event) {
66136 d3_event.preventDefault();
66137 options.buttonCallback();
66140 var tip = copyBox(tooltip.node().getBoundingClientRect()), w3 = containerNode.clientWidth, h3 = containerNode.clientHeight, tooltipWidth = 200, tooltipArrow = 5, side, pos;
66141 if (options.tooltipClass === "intro-mouse") {
66144 if (tooltipBox.top + tooltipBox.height > h3) {
66145 tooltipBox.height -= tooltipBox.top + tooltipBox.height - h3;
66147 if (tooltipBox.left + tooltipBox.width > w3) {
66148 tooltipBox.width -= tooltipBox.left + tooltipBox.width - w3;
66150 const onLeftOrRightEdge = tooltipBox.left + tooltipBox.width / 2 > w3 - 100 || tooltipBox.left + tooltipBox.width / 2 < 100;
66151 if (tooltipBox.top + tooltipBox.height < 100 && !onLeftOrRightEdge) {
66154 tooltipBox.left + tooltipBox.width / 2 - tip.width / 2,
66155 tooltipBox.top + tooltipBox.height
66157 } else if (tooltipBox.top > h3 - 140 && !onLeftOrRightEdge) {
66160 tooltipBox.left + tooltipBox.width / 2 - tip.width / 2,
66161 tooltipBox.top - tip.height
66164 var tipY = tooltipBox.top + tooltipBox.height / 2 - tip.height / 2;
66165 if (_mainLocalizer.textDirection() === "rtl") {
66166 if (tooltipBox.left - tooltipWidth - tooltipArrow < 70) {
66168 pos = [tooltipBox.left + tooltipBox.width + tooltipArrow, tipY];
66171 pos = [tooltipBox.left - tooltipWidth - tooltipArrow, tipY];
66174 if (tooltipBox.left + tooltipBox.width + tooltipArrow + tooltipWidth > w3 - 70) {
66176 pos = [tooltipBox.left - tooltipWidth - tooltipArrow, tipY];
66179 pos = [tooltipBox.left + tooltipBox.width + tooltipArrow, tipY];
66183 if (options.duration !== 0 || !tooltip.classed(side)) {
66184 tooltip.call(uiToggle(true));
66186 tooltip.style("top", pos[1] + "px").style("left", pos[0] + "px").attr("class", classes + " " + side);
66188 if (side === "left" || side === "right") {
66190 shiftY = 60 - pos[1];
66191 } else if (pos[1] + tip.height > h3 - 100) {
66192 shiftY = h3 - pos[1] - tip.height - 100;
66195 tooltip.selectAll(".popover-inner").style("top", shiftY + "px");
66197 tooltip.classed("in", false).call(uiToggle(false));
66199 curtain.cut(box, options.duration);
66202 curtain.cut = function(datum2, duration) {
66203 darkness.datum(datum2).interrupt();
66205 if (duration === 0) {
66206 selection2 = darkness;
66208 selection2 = darkness.transition().duration(duration || 600).ease(linear2);
66210 selection2.attr("d", function(d4) {
66211 var containerWidth = containerNode.clientWidth;
66212 var containerHeight = containerNode.clientHeight;
66213 var string = "M 0,0 L 0," + containerHeight + " L " + containerWidth + "," + containerHeight + "L" + containerWidth + ",0 Z";
66214 if (!d4) return string;
66215 return string + "M" + d4.left + "," + d4.top + "L" + d4.left + "," + (d4.top + d4.height) + "L" + (d4.left + d4.width) + "," + (d4.top + d4.height) + "L" + (d4.left + d4.width) + "," + d4.top + "Z";
66218 curtain.remove = function() {
66221 select_default2(window).on("resize.curtain", null);
66223 function copyBox(src) {
66227 bottom: src.bottom,
66235 var init_curtain = __esm({
66236 "modules/ui/curtain.js"() {
66245 // modules/ui/intro/welcome.js
66246 var welcome_exports = {};
66247 __export(welcome_exports, {
66248 uiIntroWelcome: () => uiIntroWelcome
66250 function uiIntroWelcome(context, reveal) {
66251 var dispatch14 = dispatch_default("done");
66253 title: "intro.welcome.title"
66255 function welcome() {
66256 context.map().centerZoom([-85.63591, 41.94285], 19);
66258 ".intro-nav-wrap .chapter-welcome",
66259 helpHtml("intro.welcome.welcome"),
66260 { buttonText: _t.html("intro.ok"), buttonCallback: practice }
66263 function practice() {
66265 ".intro-nav-wrap .chapter-welcome",
66266 helpHtml("intro.welcome.practice"),
66267 { buttonText: _t.html("intro.ok"), buttonCallback: words }
66272 ".intro-nav-wrap .chapter-welcome",
66273 helpHtml("intro.welcome.words"),
66274 { buttonText: _t.html("intro.ok"), buttonCallback: chapters }
66277 function chapters() {
66278 dispatch14.call("done");
66280 ".intro-nav-wrap .chapter-navigation",
66281 helpHtml("intro.welcome.chapters", { next: _t("intro.navigation.title") })
66284 chapter.enter = function() {
66287 chapter.exit = function() {
66288 context.container().select(".curtain-tooltip.intro-mouse").selectAll(".counter").remove();
66290 chapter.restart = function() {
66294 return utilRebind(chapter, dispatch14, "on");
66296 var init_welcome = __esm({
66297 "modules/ui/intro/welcome.js"() {
66306 // modules/ui/intro/navigation.js
66307 var navigation_exports = {};
66308 __export(navigation_exports, {
66309 uiIntroNavigation: () => uiIntroNavigation
66311 function uiIntroNavigation(context, reveal) {
66312 var dispatch14 = dispatch_default("done");
66314 var hallId = "n2061";
66315 var townHall = [-85.63591, 41.94285];
66316 var springStreetId = "w397";
66317 var springStreetEndId = "n1834";
66318 var springStreet = [-85.63582, 41.94255];
66319 var onewayField = _mainPresetIndex.field("oneway");
66320 var maxspeedField = _mainPresetIndex.field("maxspeed");
66322 title: "intro.navigation.title"
66324 function timeout2(f2, t2) {
66325 timeouts.push(window.setTimeout(f2, t2));
66327 function eventCancel(d3_event) {
66328 d3_event.stopPropagation();
66329 d3_event.preventDefault();
66331 function isTownHallSelected() {
66332 var ids = context.selectedIDs();
66333 return ids.length === 1 && ids[0] === hallId;
66335 function dragMap() {
66336 context.enter(modeBrowse(context));
66337 context.history().reset("initial");
66338 var msec = transitionTime(townHall, context.map().center());
66340 reveal(null, null, { duration: 0 });
66342 context.map().centerZoomEase(townHall, 19, msec);
66343 timeout2(function() {
66344 var centerStart = context.map().center();
66345 var textId = context.lastPointerType() === "mouse" ? "drag" : "drag_touch";
66346 var dragString = helpHtml("intro.navigation.map_info") + "{br}" + helpHtml("intro.navigation." + textId);
66347 reveal(".main-map .surface", dragString);
66348 context.map().on("drawn.intro", function() {
66349 reveal(".main-map .surface", dragString, { duration: 0 });
66351 context.map().on("move.intro", function() {
66352 var centerNow = context.map().center();
66353 if (centerStart[0] !== centerNow[0] || centerStart[1] !== centerNow[1]) {
66354 context.map().on("move.intro", null);
66355 timeout2(function() {
66356 continueTo(zoomMap);
66361 function continueTo(nextStep) {
66362 context.map().on("move.intro drawn.intro", null);
66366 function zoomMap() {
66367 var zoomStart = context.map().zoom();
66368 var textId = context.lastPointerType() === "mouse" ? "zoom" : "zoom_touch";
66369 var zoomString = helpHtml("intro.navigation." + textId);
66370 reveal(".main-map .surface", zoomString);
66371 context.map().on("drawn.intro", function() {
66372 reveal(".main-map .surface", zoomString, { duration: 0 });
66374 context.map().on("move.intro", function() {
66375 if (context.map().zoom() !== zoomStart) {
66376 context.map().on("move.intro", null);
66377 timeout2(function() {
66378 continueTo(features);
66382 function continueTo(nextStep) {
66383 context.map().on("move.intro drawn.intro", null);
66387 function features() {
66388 var onClick = function() {
66389 continueTo(pointsLinesAreas);
66392 ".main-map .surface",
66393 helpHtml("intro.navigation.features"),
66394 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66396 context.map().on("drawn.intro", function() {
66398 ".main-map .surface",
66399 helpHtml("intro.navigation.features"),
66400 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66403 function continueTo(nextStep) {
66404 context.map().on("drawn.intro", null);
66408 function pointsLinesAreas() {
66409 var onClick = function() {
66410 continueTo(nodesWays);
66413 ".main-map .surface",
66414 helpHtml("intro.navigation.points_lines_areas"),
66415 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66417 context.map().on("drawn.intro", function() {
66419 ".main-map .surface",
66420 helpHtml("intro.navigation.points_lines_areas"),
66421 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66424 function continueTo(nextStep) {
66425 context.map().on("drawn.intro", null);
66429 function nodesWays() {
66430 var onClick = function() {
66431 continueTo(clickTownHall);
66434 ".main-map .surface",
66435 helpHtml("intro.navigation.nodes_ways"),
66436 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66438 context.map().on("drawn.intro", function() {
66440 ".main-map .surface",
66441 helpHtml("intro.navigation.nodes_ways"),
66442 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66445 function continueTo(nextStep) {
66446 context.map().on("drawn.intro", null);
66450 function clickTownHall() {
66451 context.enter(modeBrowse(context));
66452 context.history().reset("initial");
66453 var entity = context.hasEntity(hallId);
66454 if (!entity) return;
66455 reveal(null, null, { duration: 0 });
66456 context.map().centerZoomEase(entity.loc, 19, 500);
66457 timeout2(function() {
66458 var entity2 = context.hasEntity(hallId);
66459 if (!entity2) return;
66460 var box = pointBox(entity2.loc, context);
66461 var textId = context.lastPointerType() === "mouse" ? "click_townhall" : "tap_townhall";
66462 reveal(box, helpHtml("intro.navigation." + textId));
66463 context.map().on("move.intro drawn.intro", function() {
66464 var entity3 = context.hasEntity(hallId);
66465 if (!entity3) return;
66466 var box2 = pointBox(entity3.loc, context);
66467 reveal(box2, helpHtml("intro.navigation." + textId), { duration: 0 });
66469 context.on("enter.intro", function() {
66470 if (isTownHallSelected()) continueTo(selectedTownHall);
66473 context.history().on("change.intro", function() {
66474 if (!context.hasEntity(hallId)) {
66475 continueTo(clickTownHall);
66478 function continueTo(nextStep) {
66479 context.on("enter.intro", null);
66480 context.map().on("move.intro drawn.intro", null);
66481 context.history().on("change.intro", null);
66485 function selectedTownHall() {
66486 if (!isTownHallSelected()) return clickTownHall();
66487 var entity = context.hasEntity(hallId);
66488 if (!entity) return clickTownHall();
66489 var box = pointBox(entity.loc, context);
66490 var onClick = function() {
66491 continueTo(editorTownHall);
66495 helpHtml("intro.navigation.selected_townhall"),
66496 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66498 context.map().on("move.intro drawn.intro", function() {
66499 var entity2 = context.hasEntity(hallId);
66500 if (!entity2) return;
66501 var box2 = pointBox(entity2.loc, context);
66504 helpHtml("intro.navigation.selected_townhall"),
66505 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66508 context.history().on("change.intro", function() {
66509 if (!context.hasEntity(hallId)) {
66510 continueTo(clickTownHall);
66513 function continueTo(nextStep) {
66514 context.map().on("move.intro drawn.intro", null);
66515 context.history().on("change.intro", null);
66519 function editorTownHall() {
66520 if (!isTownHallSelected()) return clickTownHall();
66521 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
66522 var onClick = function() {
66523 continueTo(presetTownHall);
66526 ".entity-editor-pane",
66527 helpHtml("intro.navigation.editor_townhall"),
66528 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66530 context.on("exit.intro", function() {
66531 continueTo(clickTownHall);
66533 context.history().on("change.intro", function() {
66534 if (!context.hasEntity(hallId)) {
66535 continueTo(clickTownHall);
66538 function continueTo(nextStep) {
66539 context.on("exit.intro", null);
66540 context.history().on("change.intro", null);
66541 context.container().select(".inspector-wrap").on("wheel.intro", null);
66545 function presetTownHall() {
66546 if (!isTownHallSelected()) return clickTownHall();
66547 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
66548 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
66549 var entity = context.entity(context.selectedIDs()[0]);
66550 var preset = _mainPresetIndex.match(entity, context.graph());
66551 var onClick = function() {
66552 continueTo(fieldsTownHall);
66555 ".entity-editor-pane .section-feature-type",
66556 helpHtml("intro.navigation.preset_townhall", { preset: preset.name() }),
66557 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66559 context.on("exit.intro", function() {
66560 continueTo(clickTownHall);
66562 context.history().on("change.intro", function() {
66563 if (!context.hasEntity(hallId)) {
66564 continueTo(clickTownHall);
66567 function continueTo(nextStep) {
66568 context.on("exit.intro", null);
66569 context.history().on("change.intro", null);
66570 context.container().select(".inspector-wrap").on("wheel.intro", null);
66574 function fieldsTownHall() {
66575 if (!isTownHallSelected()) return clickTownHall();
66576 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
66577 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
66578 var onClick = function() {
66579 continueTo(closeTownHall);
66582 ".entity-editor-pane .section-preset-fields",
66583 helpHtml("intro.navigation.fields_townhall"),
66584 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66586 context.on("exit.intro", function() {
66587 continueTo(clickTownHall);
66589 context.history().on("change.intro", function() {
66590 if (!context.hasEntity(hallId)) {
66591 continueTo(clickTownHall);
66594 function continueTo(nextStep) {
66595 context.on("exit.intro", null);
66596 context.history().on("change.intro", null);
66597 context.container().select(".inspector-wrap").on("wheel.intro", null);
66601 function closeTownHall() {
66602 if (!isTownHallSelected()) return clickTownHall();
66603 var selector = ".entity-editor-pane button.close svg use";
66604 var href = select_default2(selector).attr("href") || "#iD-icon-close";
66606 ".entity-editor-pane",
66607 helpHtml("intro.navigation.close_townhall", { button: { html: icon(href, "inline") } })
66609 context.on("exit.intro", function() {
66610 continueTo(searchStreet);
66612 context.history().on("change.intro", function() {
66613 var selector2 = ".entity-editor-pane button.close svg use";
66614 var href2 = select_default2(selector2).attr("href") || "#iD-icon-close";
66616 ".entity-editor-pane",
66617 helpHtml("intro.navigation.close_townhall", { button: { html: icon(href2, "inline") } }),
66621 function continueTo(nextStep) {
66622 context.on("exit.intro", null);
66623 context.history().on("change.intro", null);
66627 function searchStreet() {
66628 context.enter(modeBrowse(context));
66629 context.history().reset("initial");
66630 var msec = transitionTime(springStreet, context.map().center());
66632 reveal(null, null, { duration: 0 });
66634 context.map().centerZoomEase(springStreet, 19, msec);
66635 timeout2(function() {
66637 ".search-header input",
66638 helpHtml("intro.navigation.search_street", { name: _t("intro.graph.name.spring-street") })
66640 context.container().select(".search-header input").on("keyup.intro", checkSearchResult);
66643 function checkSearchResult() {
66644 var first = context.container().select(".feature-list-item:nth-child(0n+2)");
66645 var firstName = first.select(".entity-name");
66646 var name = _t("intro.graph.name.spring-street");
66647 if (!firstName.empty() && firstName.html() === name) {
66650 helpHtml("intro.navigation.choose_street", { name }),
66653 context.on("exit.intro", function() {
66654 continueTo(selectedStreet);
66656 context.container().select(".search-header input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
66658 function continueTo(nextStep) {
66659 context.on("exit.intro", null);
66660 context.container().select(".search-header input").on("keydown.intro", null).on("keyup.intro", null);
66664 function selectedStreet() {
66665 if (!context.hasEntity(springStreetEndId) || !context.hasEntity(springStreetId)) {
66666 return searchStreet();
66668 var onClick = function() {
66669 continueTo(editorStreet);
66671 var entity = context.entity(springStreetEndId);
66672 var box = pointBox(entity.loc, context);
66676 helpHtml("intro.navigation.selected_street", { name: _t("intro.graph.name.spring-street") }),
66677 { duration: 600, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66679 timeout2(function() {
66680 context.map().on("move.intro drawn.intro", function() {
66681 var entity2 = context.hasEntity(springStreetEndId);
66682 if (!entity2) return;
66683 var box2 = pointBox(entity2.loc, context);
66687 helpHtml("intro.navigation.selected_street", { name: _t("intro.graph.name.spring-street") }),
66688 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
66692 context.on("enter.intro", function(mode) {
66693 if (!context.hasEntity(springStreetId)) {
66694 return continueTo(searchStreet);
66696 var ids = context.selectedIDs();
66697 if (mode.id !== "select" || !ids.length || ids[0] !== springStreetId) {
66698 context.enter(modeSelect(context, [springStreetId]));
66701 context.history().on("change.intro", function() {
66702 if (!context.hasEntity(springStreetEndId) || !context.hasEntity(springStreetId)) {
66703 timeout2(function() {
66704 continueTo(searchStreet);
66708 function continueTo(nextStep) {
66709 context.map().on("move.intro drawn.intro", null);
66710 context.on("enter.intro", null);
66711 context.history().on("change.intro", null);
66715 function editorStreet() {
66716 var selector = ".entity-editor-pane button.close svg use";
66717 var href = select_default2(selector).attr("href") || "#iD-icon-close";
66718 reveal(".entity-editor-pane", helpHtml("intro.navigation.street_different_fields") + "{br}" + helpHtml("intro.navigation.editor_street", {
66719 button: { html: icon(href, "inline") },
66720 field1: onewayField.title(),
66721 field2: maxspeedField.title()
66723 context.on("exit.intro", function() {
66726 context.history().on("change.intro", function() {
66727 var selector2 = ".entity-editor-pane button.close svg use";
66728 var href2 = select_default2(selector2).attr("href") || "#iD-icon-close";
66730 ".entity-editor-pane",
66731 helpHtml("intro.navigation.street_different_fields") + "{br}" + helpHtml("intro.navigation.editor_street", {
66732 button: { html: icon(href2, "inline") },
66733 field1: onewayField.title(),
66734 field2: maxspeedField.title()
66739 function continueTo(nextStep) {
66740 context.on("exit.intro", null);
66741 context.history().on("change.intro", null);
66746 dispatch14.call("done");
66749 helpHtml("intro.navigation.play", { next: _t("intro.points.title") }),
66751 tooltipBox: ".intro-nav-wrap .chapter-point",
66752 buttonText: _t.html("intro.ok"),
66753 buttonCallback: function() {
66754 reveal(".ideditor");
66759 chapter.enter = function() {
66762 chapter.exit = function() {
66763 timeouts.forEach(window.clearTimeout);
66764 context.on("enter.intro exit.intro", null);
66765 context.map().on("move.intro drawn.intro", null);
66766 context.history().on("change.intro", null);
66767 context.container().select(".inspector-wrap").on("wheel.intro", null);
66768 context.container().select(".search-header input").on("keydown.intro keyup.intro", null);
66770 chapter.restart = function() {
66774 return utilRebind(chapter, dispatch14, "on");
66776 var init_navigation = __esm({
66777 "modules/ui/intro/navigation.js"() {
66790 // modules/ui/intro/point.js
66791 var point_exports = {};
66792 __export(point_exports, {
66793 uiIntroPoint: () => uiIntroPoint
66795 function uiIntroPoint(context, reveal) {
66796 var dispatch14 = dispatch_default("done");
66798 var intersection2 = [-85.63279, 41.94394];
66799 var building = [-85.632422, 41.944045];
66800 var cafePreset = _mainPresetIndex.item("amenity/cafe");
66801 var _pointID = null;
66803 title: "intro.points.title"
66805 function timeout2(f2, t2) {
66806 timeouts.push(window.setTimeout(f2, t2));
66808 function eventCancel(d3_event) {
66809 d3_event.stopPropagation();
66810 d3_event.preventDefault();
66812 function addPoint() {
66813 context.enter(modeBrowse(context));
66814 context.history().reset("initial");
66815 var msec = transitionTime(intersection2, context.map().center());
66817 reveal(null, null, { duration: 0 });
66819 context.map().centerZoomEase(intersection2, 19, msec);
66820 timeout2(function() {
66821 var tooltip = reveal(
66822 "button.add-point",
66823 helpHtml("intro.points.points_info") + "{br}" + helpHtml("intro.points.add_point")
66826 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-points");
66827 context.on("enter.intro", function(mode) {
66828 if (mode.id !== "add-point") return;
66829 continueTo(placePoint);
66832 function continueTo(nextStep) {
66833 context.on("enter.intro", null);
66837 function placePoint() {
66838 if (context.mode().id !== "add-point") {
66839 return chapter.restart();
66841 var pointBox2 = pad2(building, 150, context);
66842 var textId = context.lastPointerType() === "mouse" ? "place_point" : "place_point_touch";
66843 reveal(pointBox2, helpHtml("intro.points." + textId));
66844 context.map().on("move.intro drawn.intro", function() {
66845 pointBox2 = pad2(building, 150, context);
66846 reveal(pointBox2, helpHtml("intro.points." + textId), { duration: 0 });
66848 context.on("enter.intro", function(mode) {
66849 if (mode.id !== "select") return chapter.restart();
66850 _pointID = context.mode().selectedIDs()[0];
66851 if (context.graph().geometry(_pointID) === "vertex") {
66852 context.map().on("move.intro drawn.intro", null);
66853 context.on("enter.intro", null);
66854 reveal(pointBox2, helpHtml("intro.points.place_point_error"), {
66855 buttonText: _t.html("intro.ok"),
66856 buttonCallback: function() {
66857 return chapter.restart();
66861 continueTo(searchPreset);
66864 function continueTo(nextStep) {
66865 context.map().on("move.intro drawn.intro", null);
66866 context.on("enter.intro", null);
66870 function searchPreset() {
66871 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
66874 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
66875 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
66877 ".preset-search-input",
66878 helpHtml("intro.points.search_cafe", { preset: cafePreset.name() })
66880 context.on("enter.intro", function(mode) {
66881 if (!_pointID || !context.hasEntity(_pointID)) {
66882 return continueTo(addPoint);
66884 var ids = context.selectedIDs();
66885 if (mode.id !== "select" || !ids.length || ids[0] !== _pointID) {
66886 context.enter(modeSelect(context, [_pointID]));
66887 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
66888 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
66890 ".preset-search-input",
66891 helpHtml("intro.points.search_cafe", { preset: cafePreset.name() })
66893 context.history().on("change.intro", null);
66896 function checkPresetSearch() {
66897 var first = context.container().select(".preset-list-item:first-child");
66898 if (first.classed("preset-amenity-cafe")) {
66899 context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
66901 first.select(".preset-list-button").node(),
66902 helpHtml("intro.points.choose_cafe", { preset: cafePreset.name() }),
66905 context.history().on("change.intro", function() {
66906 continueTo(aboutFeatureEditor);
66910 function continueTo(nextStep) {
66911 context.on("enter.intro", null);
66912 context.history().on("change.intro", null);
66913 context.container().select(".inspector-wrap").on("wheel.intro", null);
66914 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
66918 function aboutFeatureEditor() {
66919 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
66922 timeout2(function() {
66923 reveal(".entity-editor-pane", helpHtml("intro.points.feature_editor"), {
66924 tooltipClass: "intro-points-describe",
66925 buttonText: _t.html("intro.ok"),
66926 buttonCallback: function() {
66927 continueTo(addName);
66931 context.on("exit.intro", function() {
66932 continueTo(reselectPoint);
66934 function continueTo(nextStep) {
66935 context.on("exit.intro", null);
66939 function addName() {
66940 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
66943 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
66944 var addNameString = helpHtml("intro.points.fields_info") + "{br}" + helpHtml("intro.points.add_name") + "{br}" + helpHtml("intro.points.add_reminder");
66945 timeout2(function() {
66946 var entity = context.entity(_pointID);
66947 if (entity.tags.name) {
66948 var tooltip = reveal(".entity-editor-pane", addNameString, {
66949 tooltipClass: "intro-points-describe",
66950 buttonText: _t.html("intro.ok"),
66951 buttonCallback: function() {
66952 continueTo(addCloseEditor);
66955 tooltip.select(".instruction").style("display", "none");
66958 ".entity-editor-pane",
66960 { tooltipClass: "intro-points-describe" }
66964 context.history().on("change.intro", function() {
66965 continueTo(addCloseEditor);
66967 context.on("exit.intro", function() {
66968 continueTo(reselectPoint);
66970 function continueTo(nextStep) {
66971 context.on("exit.intro", null);
66972 context.history().on("change.intro", null);
66976 function addCloseEditor() {
66977 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
66978 var selector = ".entity-editor-pane button.close svg use";
66979 var href = select_default2(selector).attr("href") || "#iD-icon-close";
66980 context.on("exit.intro", function() {
66981 continueTo(reselectPoint);
66984 ".entity-editor-pane",
66985 helpHtml("intro.points.add_close", { button: { html: icon(href, "inline") } })
66987 function continueTo(nextStep) {
66988 context.on("exit.intro", null);
66992 function reselectPoint() {
66993 if (!_pointID) return chapter.restart();
66994 var entity = context.hasEntity(_pointID);
66995 if (!entity) return chapter.restart();
66996 var oldPreset = _mainPresetIndex.match(entity, context.graph());
66997 context.replace(actionChangePreset(_pointID, oldPreset, cafePreset));
66998 context.enter(modeBrowse(context));
66999 var msec = transitionTime(entity.loc, context.map().center());
67001 reveal(null, null, { duration: 0 });
67003 context.map().centerEase(entity.loc, msec);
67004 timeout2(function() {
67005 var box = pointBox(entity.loc, context);
67006 reveal(box, helpHtml("intro.points.reselect"), { duration: 600 });
67007 timeout2(function() {
67008 context.map().on("move.intro drawn.intro", function() {
67009 var entity2 = context.hasEntity(_pointID);
67010 if (!entity2) return chapter.restart();
67011 var box2 = pointBox(entity2.loc, context);
67012 reveal(box2, helpHtml("intro.points.reselect"), { duration: 0 });
67015 context.on("enter.intro", function(mode) {
67016 if (mode.id !== "select") return;
67017 continueTo(updatePoint);
67020 function continueTo(nextStep) {
67021 context.map().on("move.intro drawn.intro", null);
67022 context.on("enter.intro", null);
67026 function updatePoint() {
67027 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
67028 return continueTo(reselectPoint);
67030 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
67031 context.on("exit.intro", function() {
67032 continueTo(reselectPoint);
67034 context.history().on("change.intro", function() {
67035 continueTo(updateCloseEditor);
67037 timeout2(function() {
67039 ".entity-editor-pane",
67040 helpHtml("intro.points.update"),
67041 { tooltipClass: "intro-points-describe" }
67044 function continueTo(nextStep) {
67045 context.on("exit.intro", null);
67046 context.history().on("change.intro", null);
67050 function updateCloseEditor() {
67051 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
67052 return continueTo(reselectPoint);
67054 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
67055 context.on("exit.intro", function() {
67056 continueTo(rightClickPoint);
67058 timeout2(function() {
67060 ".entity-editor-pane",
67061 helpHtml("intro.points.update_close", { button: { html: icon("#iD-icon-close", "inline") } })
67064 function continueTo(nextStep) {
67065 context.on("exit.intro", null);
67069 function rightClickPoint() {
67070 if (!_pointID) return chapter.restart();
67071 var entity = context.hasEntity(_pointID);
67072 if (!entity) return chapter.restart();
67073 context.enter(modeBrowse(context));
67074 var box = pointBox(entity.loc, context);
67075 var textId = context.lastPointerType() === "mouse" ? "rightclick" : "edit_menu_touch";
67076 reveal(box, helpHtml("intro.points." + textId), { duration: 600 });
67077 timeout2(function() {
67078 context.map().on("move.intro", function() {
67079 var entity2 = context.hasEntity(_pointID);
67080 if (!entity2) return chapter.restart();
67081 var box2 = pointBox(entity2.loc, context);
67082 reveal(box2, helpHtml("intro.points." + textId), { duration: 0 });
67085 context.on("enter.intro", function(mode) {
67086 if (mode.id !== "select") return;
67087 var ids = context.selectedIDs();
67088 if (ids.length !== 1 || ids[0] !== _pointID) return;
67089 timeout2(function() {
67090 var node = selectMenuItem(context, "delete").node();
67092 continueTo(enterDelete);
67095 function continueTo(nextStep) {
67096 context.on("enter.intro", null);
67097 context.map().on("move.intro", null);
67101 function enterDelete() {
67102 if (!_pointID) return chapter.restart();
67103 var entity = context.hasEntity(_pointID);
67104 if (!entity) return chapter.restart();
67105 var node = selectMenuItem(context, "delete").node();
67107 return continueTo(rightClickPoint);
67111 helpHtml("intro.points.delete"),
67114 timeout2(function() {
67115 context.map().on("move.intro", function() {
67116 if (selectMenuItem(context, "delete").empty()) {
67117 return continueTo(rightClickPoint);
67121 helpHtml("intro.points.delete"),
67122 { duration: 0, padding: 50 }
67126 context.on("exit.intro", function() {
67127 if (!_pointID) return chapter.restart();
67128 var entity2 = context.hasEntity(_pointID);
67129 if (entity2) return continueTo(rightClickPoint);
67131 context.history().on("change.intro", function(changed) {
67132 if (changed.deleted().length) {
67136 function continueTo(nextStep) {
67137 context.map().on("move.intro", null);
67138 context.history().on("change.intro", null);
67139 context.on("exit.intro", null);
67144 context.history().on("change.intro", function() {
67148 ".top-toolbar button.undo-button",
67149 helpHtml("intro.points.undo")
67151 function continueTo(nextStep) {
67152 context.history().on("change.intro", null);
67157 dispatch14.call("done");
67160 helpHtml("intro.points.play", { next: _t("intro.areas.title") }),
67162 tooltipBox: ".intro-nav-wrap .chapter-area",
67163 buttonText: _t.html("intro.ok"),
67164 buttonCallback: function() {
67165 reveal(".ideditor");
67170 chapter.enter = function() {
67173 chapter.exit = function() {
67174 timeouts.forEach(window.clearTimeout);
67175 context.on("enter.intro exit.intro", null);
67176 context.map().on("move.intro drawn.intro", null);
67177 context.history().on("change.intro", null);
67178 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
67179 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
67181 chapter.restart = function() {
67185 return utilRebind(chapter, dispatch14, "on");
67187 var init_point = __esm({
67188 "modules/ui/intro/point.js"() {
67194 init_change_preset();
67202 // modules/ui/intro/area.js
67203 var area_exports = {};
67204 __export(area_exports, {
67205 uiIntroArea: () => uiIntroArea
67207 function uiIntroArea(context, reveal) {
67208 var dispatch14 = dispatch_default("done");
67209 var playground = [-85.63552, 41.94159];
67210 var playgroundPreset = _mainPresetIndex.item("leisure/playground");
67211 var nameField = _mainPresetIndex.field("name");
67212 var descriptionField = _mainPresetIndex.field("description");
67216 title: "intro.areas.title"
67218 function timeout2(f2, t2) {
67219 timeouts.push(window.setTimeout(f2, t2));
67221 function eventCancel(d3_event) {
67222 d3_event.stopPropagation();
67223 d3_event.preventDefault();
67225 function revealPlayground(center, text, options) {
67226 var padding = 180 * Math.pow(2, context.map().zoom() - 19.5);
67227 var box = pad2(center, padding, context);
67228 reveal(box, text, options);
67230 function addArea() {
67231 context.enter(modeBrowse(context));
67232 context.history().reset("initial");
67234 var msec = transitionTime(playground, context.map().center());
67236 reveal(null, null, { duration: 0 });
67238 context.map().centerZoomEase(playground, 19, msec);
67239 timeout2(function() {
67240 var tooltip = reveal(
67242 helpHtml("intro.areas.add_playground")
67244 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-areas");
67245 context.on("enter.intro", function(mode) {
67246 if (mode.id !== "add-area") return;
67247 continueTo(startPlayground);
67250 function continueTo(nextStep) {
67251 context.on("enter.intro", null);
67255 function startPlayground() {
67256 if (context.mode().id !== "add-area") {
67257 return chapter.restart();
67260 context.map().zoomEase(19.5, 500);
67261 timeout2(function() {
67262 var textId = context.lastPointerType() === "mouse" ? "starting_node_click" : "starting_node_tap";
67263 var startDrawString = helpHtml("intro.areas.start_playground") + helpHtml("intro.areas." + textId);
67269 timeout2(function() {
67270 context.map().on("move.intro drawn.intro", function() {
67277 context.on("enter.intro", function(mode) {
67278 if (mode.id !== "draw-area") return chapter.restart();
67279 continueTo(continuePlayground);
67283 function continueTo(nextStep) {
67284 context.map().on("move.intro drawn.intro", null);
67285 context.on("enter.intro", null);
67289 function continuePlayground() {
67290 if (context.mode().id !== "draw-area") {
67291 return chapter.restart();
67296 helpHtml("intro.areas.continue_playground"),
67299 timeout2(function() {
67300 context.map().on("move.intro drawn.intro", function() {
67303 helpHtml("intro.areas.continue_playground"),
67308 context.on("enter.intro", function(mode) {
67309 if (mode.id === "draw-area") {
67310 var entity = context.hasEntity(context.selectedIDs()[0]);
67311 if (entity && entity.nodes.length >= 6) {
67312 return continueTo(finishPlayground);
67316 } else if (mode.id === "select") {
67317 _areaID = context.selectedIDs()[0];
67318 return continueTo(searchPresets);
67320 return chapter.restart();
67323 function continueTo(nextStep) {
67324 context.map().on("move.intro drawn.intro", null);
67325 context.on("enter.intro", null);
67329 function finishPlayground() {
67330 if (context.mode().id !== "draw-area") {
67331 return chapter.restart();
67334 var finishString = helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.areas.finish_playground");
67340 timeout2(function() {
67341 context.map().on("move.intro drawn.intro", function() {
67349 context.on("enter.intro", function(mode) {
67350 if (mode.id === "draw-area") {
67352 } else if (mode.id === "select") {
67353 _areaID = context.selectedIDs()[0];
67354 return continueTo(searchPresets);
67356 return chapter.restart();
67359 function continueTo(nextStep) {
67360 context.map().on("move.intro drawn.intro", null);
67361 context.on("enter.intro", null);
67365 function searchPresets() {
67366 if (!_areaID || !context.hasEntity(_areaID)) {
67369 var ids = context.selectedIDs();
67370 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
67371 context.enter(modeSelect(context, [_areaID]));
67373 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
67374 timeout2(function() {
67375 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
67376 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
67378 ".preset-search-input",
67379 helpHtml("intro.areas.search_playground", { preset: playgroundPreset.name() })
67382 context.on("enter.intro", function(mode) {
67383 if (!_areaID || !context.hasEntity(_areaID)) {
67384 return continueTo(addArea);
67386 var ids2 = context.selectedIDs();
67387 if (mode.id !== "select" || !ids2.length || ids2[0] !== _areaID) {
67388 context.enter(modeSelect(context, [_areaID]));
67389 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
67390 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
67391 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
67393 ".preset-search-input",
67394 helpHtml("intro.areas.search_playground", { preset: playgroundPreset.name() })
67396 context.history().on("change.intro", null);
67399 function checkPresetSearch() {
67400 var first = context.container().select(".preset-list-item:first-child");
67401 if (first.classed("preset-leisure-playground")) {
67403 first.select(".preset-list-button").node(),
67404 helpHtml("intro.areas.choose_playground", { preset: playgroundPreset.name() }),
67407 context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
67408 context.history().on("change.intro", function() {
67409 continueTo(clickAddField);
67413 function continueTo(nextStep) {
67414 context.container().select(".inspector-wrap").on("wheel.intro", null);
67415 context.on("enter.intro", null);
67416 context.history().on("change.intro", null);
67417 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
67421 function clickAddField() {
67422 if (!_areaID || !context.hasEntity(_areaID)) {
67425 var ids = context.selectedIDs();
67426 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
67427 return searchPresets();
67429 if (!context.container().select(".form-field-description").empty()) {
67430 return continueTo(describePlayground);
67432 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
67433 timeout2(function() {
67434 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
67435 var entity = context.entity(_areaID);
67436 if (entity.tags.description) {
67437 return continueTo(play);
67439 var box = context.container().select(".more-fields").node().getBoundingClientRect();
67440 if (box.top > 300) {
67441 var pane = context.container().select(".entity-editor-pane .inspector-body");
67442 var start2 = pane.node().scrollTop;
67443 var end = start2 + (box.top - 300);
67444 pane.transition().duration(250).tween("scroll.inspector", function() {
67446 var i3 = number_default(start2, end);
67447 return function(t2) {
67448 node.scrollTop = i3(t2);
67452 timeout2(function() {
67454 ".more-fields .combobox-input",
67455 helpHtml("intro.areas.add_field", {
67456 name: nameField.title(),
67457 description: descriptionField.title()
67461 context.container().select(".more-fields .combobox-input").on("click.intro", function() {
67463 watcher = window.setInterval(function() {
67464 if (!context.container().select("div.combobox").empty()) {
67465 window.clearInterval(watcher);
67466 continueTo(chooseDescriptionField);
67472 context.on("exit.intro", function() {
67473 return continueTo(searchPresets);
67475 function continueTo(nextStep) {
67476 context.container().select(".inspector-wrap").on("wheel.intro", null);
67477 context.container().select(".more-fields .combobox-input").on("click.intro", null);
67478 context.on("exit.intro", null);
67482 function chooseDescriptionField() {
67483 if (!_areaID || !context.hasEntity(_areaID)) {
67486 var ids = context.selectedIDs();
67487 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
67488 return searchPresets();
67490 if (!context.container().select(".form-field-description").empty()) {
67491 return continueTo(describePlayground);
67493 if (context.container().select("div.combobox").empty()) {
67494 return continueTo(clickAddField);
67497 watcher = window.setInterval(function() {
67498 if (context.container().select("div.combobox").empty()) {
67499 window.clearInterval(watcher);
67500 timeout2(function() {
67501 if (context.container().select(".form-field-description").empty()) {
67502 continueTo(retryChooseDescription);
67504 continueTo(describePlayground);
67511 helpHtml("intro.areas.choose_field", { field: descriptionField.title() }),
67514 context.on("exit.intro", function() {
67515 return continueTo(searchPresets);
67517 function continueTo(nextStep) {
67518 if (watcher) window.clearInterval(watcher);
67519 context.on("exit.intro", null);
67523 function describePlayground() {
67524 if (!_areaID || !context.hasEntity(_areaID)) {
67527 var ids = context.selectedIDs();
67528 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
67529 return searchPresets();
67531 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
67532 if (context.container().select(".form-field-description").empty()) {
67533 return continueTo(retryChooseDescription);
67535 context.on("exit.intro", function() {
67539 ".entity-editor-pane",
67540 helpHtml("intro.areas.describe_playground", { button: { html: icon("#iD-icon-close", "inline") } }),
67543 function continueTo(nextStep) {
67544 context.on("exit.intro", null);
67548 function retryChooseDescription() {
67549 if (!_areaID || !context.hasEntity(_areaID)) {
67552 var ids = context.selectedIDs();
67553 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
67554 return searchPresets();
67556 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
67558 ".entity-editor-pane",
67559 helpHtml("intro.areas.retry_add_field", { field: descriptionField.title() }),
67561 buttonText: _t.html("intro.ok"),
67562 buttonCallback: function() {
67563 continueTo(clickAddField);
67567 context.on("exit.intro", function() {
67568 return continueTo(searchPresets);
67570 function continueTo(nextStep) {
67571 context.on("exit.intro", null);
67576 dispatch14.call("done");
67579 helpHtml("intro.areas.play", { next: _t("intro.lines.title") }),
67581 tooltipBox: ".intro-nav-wrap .chapter-line",
67582 buttonText: _t.html("intro.ok"),
67583 buttonCallback: function() {
67584 reveal(".ideditor");
67589 chapter.enter = function() {
67592 chapter.exit = function() {
67593 timeouts.forEach(window.clearTimeout);
67594 context.on("enter.intro exit.intro", null);
67595 context.map().on("move.intro drawn.intro", null);
67596 context.history().on("change.intro", null);
67597 context.container().select(".inspector-wrap").on("wheel.intro", null);
67598 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
67599 context.container().select(".more-fields .combobox-input").on("click.intro", null);
67601 chapter.restart = function() {
67605 return utilRebind(chapter, dispatch14, "on");
67607 var init_area4 = __esm({
67608 "modules/ui/intro/area.js"() {
67621 // modules/ui/intro/line.js
67622 var line_exports = {};
67623 __export(line_exports, {
67624 uiIntroLine: () => uiIntroLine
67626 function uiIntroLine(context, reveal) {
67627 var dispatch14 = dispatch_default("done");
67629 var _tulipRoadID = null;
67630 var flowerRoadID = "w646";
67631 var tulipRoadStart = [-85.6297754121684, 41.95805253325314];
67632 var tulipRoadMidpoint = [-85.62975395449628, 41.95787501510204];
67633 var tulipRoadIntersection = [-85.62974496187628, 41.95742515554585];
67634 var roadCategory = _mainPresetIndex.item("category-road_minor");
67635 var residentialPreset = _mainPresetIndex.item("highway/residential");
67636 var woodRoadID = "w525";
67637 var woodRoadEndID = "n2862";
67638 var woodRoadAddNode = [-85.62390110349587, 41.95397111462291];
67639 var woodRoadDragEndpoint = [-85.623867390213, 41.95466987786487];
67640 var woodRoadDragMidpoint = [-85.62386254803509, 41.95430395953872];
67641 var washingtonStreetID = "w522";
67642 var twelfthAvenueID = "w1";
67643 var eleventhAvenueEndID = "n3550";
67644 var twelfthAvenueEndID = "n5";
67645 var _washingtonSegmentID = null;
67646 var eleventhAvenueEnd = context.entity(eleventhAvenueEndID).loc;
67647 var twelfthAvenueEnd = context.entity(twelfthAvenueEndID).loc;
67648 var deleteLinesLoc = [-85.6219395542764, 41.95228033922477];
67649 var twelfthAvenue = [-85.62219310052491, 41.952505413152956];
67651 title: "intro.lines.title"
67653 function timeout2(f2, t2) {
67654 timeouts.push(window.setTimeout(f2, t2));
67656 function eventCancel(d3_event) {
67657 d3_event.stopPropagation();
67658 d3_event.preventDefault();
67660 function addLine() {
67661 context.enter(modeBrowse(context));
67662 context.history().reset("initial");
67663 var msec = transitionTime(tulipRoadStart, context.map().center());
67665 reveal(null, null, { duration: 0 });
67667 context.map().centerZoomEase(tulipRoadStart, 18.5, msec);
67668 timeout2(function() {
67669 var tooltip = reveal(
67671 helpHtml("intro.lines.add_line")
67673 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-lines");
67674 context.on("enter.intro", function(mode) {
67675 if (mode.id !== "add-line") return;
67676 continueTo(startLine);
67679 function continueTo(nextStep) {
67680 context.on("enter.intro", null);
67684 function startLine() {
67685 if (context.mode().id !== "add-line") return chapter.restart();
67686 _tulipRoadID = null;
67687 var padding = 70 * Math.pow(2, context.map().zoom() - 18);
67688 var box = pad2(tulipRoadStart, padding, context);
67689 box.height = box.height + 100;
67690 var textId = context.lastPointerType() === "mouse" ? "start_line" : "start_line_tap";
67691 var startLineString = helpHtml("intro.lines.missing_road") + "{br}" + helpHtml("intro.lines.line_draw_info") + helpHtml("intro.lines." + textId);
67692 reveal(box, startLineString);
67693 context.map().on("move.intro drawn.intro", function() {
67694 padding = 70 * Math.pow(2, context.map().zoom() - 18);
67695 box = pad2(tulipRoadStart, padding, context);
67696 box.height = box.height + 100;
67697 reveal(box, startLineString, { duration: 0 });
67699 context.on("enter.intro", function(mode) {
67700 if (mode.id !== "draw-line") return chapter.restart();
67701 continueTo(drawLine);
67703 function continueTo(nextStep) {
67704 context.map().on("move.intro drawn.intro", null);
67705 context.on("enter.intro", null);
67709 function drawLine() {
67710 if (context.mode().id !== "draw-line") return chapter.restart();
67711 _tulipRoadID = context.mode().selectedIDs()[0];
67712 context.map().centerEase(tulipRoadMidpoint, 500);
67713 timeout2(function() {
67714 var padding = 200 * Math.pow(2, context.map().zoom() - 18.5);
67715 var box = pad2(tulipRoadMidpoint, padding, context);
67716 box.height = box.height * 2;
67719 helpHtml("intro.lines.intersect", { name: _t("intro.graph.name.flower-street") })
67721 context.map().on("move.intro drawn.intro", function() {
67722 padding = 200 * Math.pow(2, context.map().zoom() - 18.5);
67723 box = pad2(tulipRoadMidpoint, padding, context);
67724 box.height = box.height * 2;
67727 helpHtml("intro.lines.intersect", { name: _t("intro.graph.name.flower-street") }),
67732 context.history().on("change.intro", function() {
67733 if (isLineConnected()) {
67734 continueTo(continueLine);
67737 context.on("enter.intro", function(mode) {
67738 if (mode.id === "draw-line") {
67740 } else if (mode.id === "select") {
67741 continueTo(retryIntersect);
67744 return chapter.restart();
67747 function continueTo(nextStep) {
67748 context.map().on("move.intro drawn.intro", null);
67749 context.history().on("change.intro", null);
67750 context.on("enter.intro", null);
67754 function isLineConnected() {
67755 var entity = _tulipRoadID && context.hasEntity(_tulipRoadID);
67756 if (!entity) return false;
67757 var drawNodes = context.graph().childNodes(entity);
67758 return drawNodes.some(function(node) {
67759 return context.graph().parentWays(node).some(function(parent2) {
67760 return parent2.id === flowerRoadID;
67764 function retryIntersect() {
67765 select_default2(window).on("pointerdown.intro mousedown.intro", eventCancel, true);
67766 var box = pad2(tulipRoadIntersection, 80, context);
67769 helpHtml("intro.lines.retry_intersect", { name: _t("intro.graph.name.flower-street") })
67771 timeout2(chapter.restart, 3e3);
67773 function continueLine() {
67774 if (context.mode().id !== "draw-line") return chapter.restart();
67775 var entity = _tulipRoadID && context.hasEntity(_tulipRoadID);
67776 if (!entity) return chapter.restart();
67777 context.map().centerEase(tulipRoadIntersection, 500);
67778 var continueLineText = helpHtml("intro.lines.continue_line") + "{br}" + helpHtml("intro.lines.finish_line_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.lines.finish_road");
67779 reveal(".main-map .surface", continueLineText);
67780 context.on("enter.intro", function(mode) {
67781 if (mode.id === "draw-line") {
67783 } else if (mode.id === "select") {
67784 return continueTo(chooseCategoryRoad);
67786 return chapter.restart();
67789 function continueTo(nextStep) {
67790 context.on("enter.intro", null);
67794 function chooseCategoryRoad() {
67795 if (context.mode().id !== "select") return chapter.restart();
67796 context.on("exit.intro", function() {
67797 return chapter.restart();
67799 var button = context.container().select(".preset-category-road_minor .preset-list-button");
67800 if (button.empty()) return chapter.restart();
67801 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
67802 timeout2(function() {
67803 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
67806 helpHtml("intro.lines.choose_category_road", { category: roadCategory.name() })
67808 button.on("click.intro", function() {
67809 continueTo(choosePresetResidential);
67812 function continueTo(nextStep) {
67813 context.container().select(".inspector-wrap").on("wheel.intro", null);
67814 context.container().select(".preset-list-button").on("click.intro", null);
67815 context.on("exit.intro", null);
67819 function choosePresetResidential() {
67820 if (context.mode().id !== "select") return chapter.restart();
67821 context.on("exit.intro", function() {
67822 return chapter.restart();
67824 var subgrid = context.container().select(".preset-category-road_minor .subgrid");
67825 if (subgrid.empty()) return chapter.restart();
67826 subgrid.selectAll(":not(.preset-highway-residential) .preset-list-button").on("click.intro", function() {
67827 continueTo(retryPresetResidential);
67829 subgrid.selectAll(".preset-highway-residential .preset-list-button").on("click.intro", function() {
67830 continueTo(nameRoad);
67832 timeout2(function() {
67835 helpHtml("intro.lines.choose_preset_residential", { preset: residentialPreset.name() }),
67836 { tooltipBox: ".preset-highway-residential .preset-list-button", duration: 300 }
67839 function continueTo(nextStep) {
67840 context.container().select(".preset-list-button").on("click.intro", null);
67841 context.on("exit.intro", null);
67845 function retryPresetResidential() {
67846 if (context.mode().id !== "select") return chapter.restart();
67847 context.on("exit.intro", function() {
67848 return chapter.restart();
67850 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
67851 timeout2(function() {
67852 var button = context.container().select(".entity-editor-pane .preset-list-button");
67855 helpHtml("intro.lines.retry_preset_residential", { preset: residentialPreset.name() })
67857 button.on("click.intro", function() {
67858 continueTo(chooseCategoryRoad);
67861 function continueTo(nextStep) {
67862 context.container().select(".inspector-wrap").on("wheel.intro", null);
67863 context.container().select(".preset-list-button").on("click.intro", null);
67864 context.on("exit.intro", null);
67868 function nameRoad() {
67869 context.on("exit.intro", function() {
67870 continueTo(didNameRoad);
67872 timeout2(function() {
67874 ".entity-editor-pane",
67875 helpHtml("intro.lines.name_road", { button: { html: icon("#iD-icon-close", "inline") } }),
67876 { tooltipClass: "intro-lines-name_road" }
67879 function continueTo(nextStep) {
67880 context.on("exit.intro", null);
67884 function didNameRoad() {
67885 context.history().checkpoint("doneAddLine");
67886 timeout2(function() {
67887 reveal(".main-map .surface", helpHtml("intro.lines.did_name_road"), {
67888 buttonText: _t.html("intro.ok"),
67889 buttonCallback: function() {
67890 continueTo(updateLine);
67894 function continueTo(nextStep) {
67898 function updateLine() {
67899 context.history().reset("doneAddLine");
67900 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
67901 return chapter.restart();
67903 var msec = transitionTime(woodRoadDragMidpoint, context.map().center());
67905 reveal(null, null, { duration: 0 });
67907 context.map().centerZoomEase(woodRoadDragMidpoint, 19, msec);
67908 timeout2(function() {
67909 var padding = 250 * Math.pow(2, context.map().zoom() - 19);
67910 var box = pad2(woodRoadDragMidpoint, padding, context);
67911 var advance = function() {
67912 continueTo(addNode);
67916 helpHtml("intro.lines.update_line"),
67917 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
67919 context.map().on("move.intro drawn.intro", function() {
67920 var padding2 = 250 * Math.pow(2, context.map().zoom() - 19);
67921 var box2 = pad2(woodRoadDragMidpoint, padding2, context);
67924 helpHtml("intro.lines.update_line"),
67925 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
67929 function continueTo(nextStep) {
67930 context.map().on("move.intro drawn.intro", null);
67934 function addNode() {
67935 context.history().reset("doneAddLine");
67936 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
67937 return chapter.restart();
67939 var padding = 40 * Math.pow(2, context.map().zoom() - 19);
67940 var box = pad2(woodRoadAddNode, padding, context);
67941 var addNodeString = helpHtml("intro.lines.add_node" + (context.lastPointerType() === "mouse" ? "" : "_touch"));
67942 reveal(box, addNodeString);
67943 context.map().on("move.intro drawn.intro", function() {
67944 var padding2 = 40 * Math.pow(2, context.map().zoom() - 19);
67945 var box2 = pad2(woodRoadAddNode, padding2, context);
67946 reveal(box2, addNodeString, { duration: 0 });
67948 context.history().on("change.intro", function(changed) {
67949 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
67950 return continueTo(updateLine);
67952 if (changed.created().length === 1) {
67953 timeout2(function() {
67954 continueTo(startDragEndpoint);
67958 context.on("enter.intro", function(mode) {
67959 if (mode.id !== "select") {
67960 continueTo(updateLine);
67963 function continueTo(nextStep) {
67964 context.map().on("move.intro drawn.intro", null);
67965 context.history().on("change.intro", null);
67966 context.on("enter.intro", null);
67970 function startDragEndpoint() {
67971 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
67972 return continueTo(updateLine);
67974 var padding = 100 * Math.pow(2, context.map().zoom() - 19);
67975 var box = pad2(woodRoadDragEndpoint, padding, context);
67976 var startDragString = helpHtml("intro.lines.start_drag_endpoint" + (context.lastPointerType() === "mouse" ? "" : "_touch")) + helpHtml("intro.lines.drag_to_intersection");
67977 reveal(box, startDragString);
67978 context.map().on("move.intro drawn.intro", function() {
67979 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
67980 return continueTo(updateLine);
67982 var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
67983 var box2 = pad2(woodRoadDragEndpoint, padding2, context);
67984 reveal(box2, startDragString, { duration: 0 });
67985 var entity = context.entity(woodRoadEndID);
67986 if (geoSphericalDistance(entity.loc, woodRoadDragEndpoint) <= 4) {
67987 continueTo(finishDragEndpoint);
67990 function continueTo(nextStep) {
67991 context.map().on("move.intro drawn.intro", null);
67995 function finishDragEndpoint() {
67996 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
67997 return continueTo(updateLine);
67999 var padding = 100 * Math.pow(2, context.map().zoom() - 19);
68000 var box = pad2(woodRoadDragEndpoint, padding, context);
68001 var finishDragString = helpHtml("intro.lines.spot_looks_good") + helpHtml("intro.lines.finish_drag_endpoint" + (context.lastPointerType() === "mouse" ? "" : "_touch"));
68002 reveal(box, finishDragString);
68003 context.map().on("move.intro drawn.intro", function() {
68004 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
68005 return continueTo(updateLine);
68007 var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
68008 var box2 = pad2(woodRoadDragEndpoint, padding2, context);
68009 reveal(box2, finishDragString, { duration: 0 });
68010 var entity = context.entity(woodRoadEndID);
68011 if (geoSphericalDistance(entity.loc, woodRoadDragEndpoint) > 4) {
68012 continueTo(startDragEndpoint);
68015 context.on("enter.intro", function() {
68016 continueTo(startDragMidpoint);
68018 function continueTo(nextStep) {
68019 context.map().on("move.intro drawn.intro", null);
68020 context.on("enter.intro", null);
68024 function startDragMidpoint() {
68025 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
68026 return continueTo(updateLine);
68028 if (context.selectedIDs().indexOf(woodRoadID) === -1) {
68029 context.enter(modeSelect(context, [woodRoadID]));
68031 var padding = 80 * Math.pow(2, context.map().zoom() - 19);
68032 var box = pad2(woodRoadDragMidpoint, padding, context);
68033 reveal(box, helpHtml("intro.lines.start_drag_midpoint"));
68034 context.map().on("move.intro drawn.intro", function() {
68035 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
68036 return continueTo(updateLine);
68038 var padding2 = 80 * Math.pow(2, context.map().zoom() - 19);
68039 var box2 = pad2(woodRoadDragMidpoint, padding2, context);
68040 reveal(box2, helpHtml("intro.lines.start_drag_midpoint"), { duration: 0 });
68042 context.history().on("change.intro", function(changed) {
68043 if (changed.created().length === 1) {
68044 continueTo(continueDragMidpoint);
68047 context.on("enter.intro", function(mode) {
68048 if (mode.id !== "select") {
68049 context.enter(modeSelect(context, [woodRoadID]));
68052 function continueTo(nextStep) {
68053 context.map().on("move.intro drawn.intro", null);
68054 context.history().on("change.intro", null);
68055 context.on("enter.intro", null);
68059 function continueDragMidpoint() {
68060 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
68061 return continueTo(updateLine);
68063 var padding = 100 * Math.pow(2, context.map().zoom() - 19);
68064 var box = pad2(woodRoadDragEndpoint, padding, context);
68066 var advance = function() {
68067 context.history().checkpoint("doneUpdateLine");
68068 continueTo(deleteLines);
68072 helpHtml("intro.lines.continue_drag_midpoint"),
68073 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
68075 context.map().on("move.intro drawn.intro", function() {
68076 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
68077 return continueTo(updateLine);
68079 var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
68080 var box2 = pad2(woodRoadDragEndpoint, padding2, context);
68081 box2.height += 400;
68084 helpHtml("intro.lines.continue_drag_midpoint"),
68085 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
68088 function continueTo(nextStep) {
68089 context.map().on("move.intro drawn.intro", null);
68093 function deleteLines() {
68094 context.history().reset("doneUpdateLine");
68095 context.enter(modeBrowse(context));
68096 if (!context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
68097 return chapter.restart();
68099 var msec = transitionTime(deleteLinesLoc, context.map().center());
68101 reveal(null, null, { duration: 0 });
68103 context.map().centerZoomEase(deleteLinesLoc, 18, msec);
68104 timeout2(function() {
68105 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
68106 var box = pad2(deleteLinesLoc, padding, context);
68109 var advance = function() {
68110 continueTo(rightClickIntersection);
68114 helpHtml("intro.lines.delete_lines", { street: _t("intro.graph.name.12th-avenue") }),
68115 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
68117 context.map().on("move.intro drawn.intro", function() {
68118 var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
68119 var box2 = pad2(deleteLinesLoc, padding2, context);
68121 box2.height += 400;
68124 helpHtml("intro.lines.delete_lines", { street: _t("intro.graph.name.12th-avenue") }),
68125 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
68128 context.history().on("change.intro", function() {
68129 timeout2(function() {
68130 continueTo(deleteLines);
68134 function continueTo(nextStep) {
68135 context.map().on("move.intro drawn.intro", null);
68136 context.history().on("change.intro", null);
68140 function rightClickIntersection() {
68141 context.history().reset("doneUpdateLine");
68142 context.enter(modeBrowse(context));
68143 context.map().centerZoomEase(eleventhAvenueEnd, 18, 500);
68144 var rightClickString = helpHtml("intro.lines.split_street", {
68145 street1: _t("intro.graph.name.11th-avenue"),
68146 street2: _t("intro.graph.name.washington-street")
68147 }) + helpHtml("intro.lines." + (context.lastPointerType() === "mouse" ? "rightclick_intersection" : "edit_menu_intersection_touch"));
68148 timeout2(function() {
68149 var padding = 60 * Math.pow(2, context.map().zoom() - 18);
68150 var box = pad2(eleventhAvenueEnd, padding, context);
68151 reveal(box, rightClickString);
68152 context.map().on("move.intro drawn.intro", function() {
68153 var padding2 = 60 * Math.pow(2, context.map().zoom() - 18);
68154 var box2 = pad2(eleventhAvenueEnd, padding2, context);
68161 context.on("enter.intro", function(mode) {
68162 if (mode.id !== "select") return;
68163 var ids = context.selectedIDs();
68164 if (ids.length !== 1 || ids[0] !== eleventhAvenueEndID) return;
68165 timeout2(function() {
68166 var node = selectMenuItem(context, "split").node();
68168 continueTo(splitIntersection);
68171 context.history().on("change.intro", function() {
68172 timeout2(function() {
68173 continueTo(deleteLines);
68177 function continueTo(nextStep) {
68178 context.map().on("move.intro drawn.intro", null);
68179 context.on("enter.intro", null);
68180 context.history().on("change.intro", null);
68184 function splitIntersection() {
68185 if (!context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
68186 return continueTo(deleteLines);
68188 var node = selectMenuItem(context, "split").node();
68190 return continueTo(rightClickIntersection);
68192 var wasChanged = false;
68193 _washingtonSegmentID = null;
68197 "intro.lines.split_intersection",
68198 { street: _t("intro.graph.name.washington-street") }
68202 context.map().on("move.intro drawn.intro", function() {
68203 var node2 = selectMenuItem(context, "split").node();
68204 if (!wasChanged && !node2) {
68205 return continueTo(rightClickIntersection);
68210 "intro.lines.split_intersection",
68211 { street: _t("intro.graph.name.washington-street") }
68213 { duration: 0, padding: 50 }
68216 context.history().on("change.intro", function(changed) {
68218 timeout2(function() {
68219 if (context.history().undoAnnotation() === _t("operations.split.annotation.line", { n: 1 })) {
68220 _washingtonSegmentID = changed.created()[0].id;
68221 continueTo(didSplit);
68223 _washingtonSegmentID = null;
68224 continueTo(retrySplit);
68228 function continueTo(nextStep) {
68229 context.map().on("move.intro drawn.intro", null);
68230 context.history().on("change.intro", null);
68234 function retrySplit() {
68235 context.enter(modeBrowse(context));
68236 context.map().centerZoomEase(eleventhAvenueEnd, 18, 500);
68237 var advance = function() {
68238 continueTo(rightClickIntersection);
68240 var padding = 60 * Math.pow(2, context.map().zoom() - 18);
68241 var box = pad2(eleventhAvenueEnd, padding, context);
68244 helpHtml("intro.lines.retry_split"),
68245 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
68247 context.map().on("move.intro drawn.intro", function() {
68248 var padding2 = 60 * Math.pow(2, context.map().zoom() - 18);
68249 var box2 = pad2(eleventhAvenueEnd, padding2, context);
68252 helpHtml("intro.lines.retry_split"),
68253 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
68256 function continueTo(nextStep) {
68257 context.map().on("move.intro drawn.intro", null);
68261 function didSplit() {
68262 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
68263 return continueTo(rightClickIntersection);
68265 var ids = context.selectedIDs();
68266 var string = "intro.lines.did_split_" + (ids.length > 1 ? "multi" : "single");
68267 var street = _t("intro.graph.name.washington-street");
68268 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
68269 var box = pad2(twelfthAvenue, padding, context);
68270 box.width = box.width / 2;
68273 helpHtml(string, { street1: street, street2: street }),
68276 timeout2(function() {
68277 context.map().centerZoomEase(twelfthAvenue, 18, 500);
68278 context.map().on("move.intro drawn.intro", function() {
68279 var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
68280 var box2 = pad2(twelfthAvenue, padding2, context);
68281 box2.width = box2.width / 2;
68284 helpHtml(string, { street1: street, street2: street }),
68289 context.on("enter.intro", function() {
68290 var ids2 = context.selectedIDs();
68291 if (ids2.length === 1 && ids2[0] === _washingtonSegmentID) {
68292 continueTo(multiSelect2);
68295 context.history().on("change.intro", function() {
68296 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
68297 return continueTo(rightClickIntersection);
68300 function continueTo(nextStep) {
68301 context.map().on("move.intro drawn.intro", null);
68302 context.on("enter.intro", null);
68303 context.history().on("change.intro", null);
68307 function multiSelect2() {
68308 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
68309 return continueTo(rightClickIntersection);
68311 var ids = context.selectedIDs();
68312 var hasWashington = ids.indexOf(_washingtonSegmentID) !== -1;
68313 var hasTwelfth = ids.indexOf(twelfthAvenueID) !== -1;
68314 if (hasWashington && hasTwelfth) {
68315 return continueTo(multiRightClick);
68316 } else if (!hasWashington && !hasTwelfth) {
68317 return continueTo(didSplit);
68319 context.map().centerZoomEase(twelfthAvenue, 18, 500);
68320 timeout2(function() {
68321 var selected, other, padding, box;
68322 if (hasWashington) {
68323 selected = _t("intro.graph.name.washington-street");
68324 other = _t("intro.graph.name.12th-avenue");
68325 padding = 60 * Math.pow(2, context.map().zoom() - 18);
68326 box = pad2(twelfthAvenueEnd, padding, context);
68329 selected = _t("intro.graph.name.12th-avenue");
68330 other = _t("intro.graph.name.washington-street");
68331 padding = 200 * Math.pow(2, context.map().zoom() - 18);
68332 box = pad2(twelfthAvenue, padding, context);
68338 "intro.lines.multi_select",
68339 { selected, other1: other }
68340 ) + " " + helpHtml(
68341 "intro.lines.add_to_selection_" + (context.lastPointerType() === "mouse" ? "click" : "touch"),
68342 { selected, other2: other }
68345 context.map().on("move.intro drawn.intro", function() {
68346 if (hasWashington) {
68347 selected = _t("intro.graph.name.washington-street");
68348 other = _t("intro.graph.name.12th-avenue");
68349 padding = 60 * Math.pow(2, context.map().zoom() - 18);
68350 box = pad2(twelfthAvenueEnd, padding, context);
68353 selected = _t("intro.graph.name.12th-avenue");
68354 other = _t("intro.graph.name.washington-street");
68355 padding = 200 * Math.pow(2, context.map().zoom() - 18);
68356 box = pad2(twelfthAvenue, padding, context);
68362 "intro.lines.multi_select",
68363 { selected, other1: other }
68364 ) + " " + helpHtml(
68365 "intro.lines.add_to_selection_" + (context.lastPointerType() === "mouse" ? "click" : "touch"),
68366 { selected, other2: other }
68371 context.on("enter.intro", function() {
68372 continueTo(multiSelect2);
68374 context.history().on("change.intro", function() {
68375 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
68376 return continueTo(rightClickIntersection);
68380 function continueTo(nextStep) {
68381 context.map().on("move.intro drawn.intro", null);
68382 context.on("enter.intro", null);
68383 context.history().on("change.intro", null);
68387 function multiRightClick() {
68388 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
68389 return continueTo(rightClickIntersection);
68391 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
68392 var box = pad2(twelfthAvenue, padding, context);
68393 var rightClickString = helpHtml("intro.lines.multi_select_success") + helpHtml("intro.lines.multi_" + (context.lastPointerType() === "mouse" ? "rightclick" : "edit_menu_touch"));
68394 reveal(box, rightClickString);
68395 context.map().on("move.intro drawn.intro", function() {
68396 var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
68397 var box2 = pad2(twelfthAvenue, padding2, context);
68398 reveal(box2, rightClickString, { duration: 0 });
68400 context.ui().editMenu().on("toggled.intro", function(open) {
68402 timeout2(function() {
68403 var ids = context.selectedIDs();
68404 if (ids.length === 2 && ids.indexOf(twelfthAvenueID) !== -1 && ids.indexOf(_washingtonSegmentID) !== -1) {
68405 var node = selectMenuItem(context, "delete").node();
68407 continueTo(multiDelete);
68408 } else if (ids.length === 1 && ids.indexOf(_washingtonSegmentID) !== -1) {
68409 return continueTo(multiSelect2);
68411 return continueTo(didSplit);
68415 context.history().on("change.intro", function() {
68416 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
68417 return continueTo(rightClickIntersection);
68420 function continueTo(nextStep) {
68421 context.map().on("move.intro drawn.intro", null);
68422 context.ui().editMenu().on("toggled.intro", null);
68423 context.history().on("change.intro", null);
68427 function multiDelete() {
68428 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
68429 return continueTo(rightClickIntersection);
68431 var node = selectMenuItem(context, "delete").node();
68432 if (!node) return continueTo(multiRightClick);
68435 helpHtml("intro.lines.multi_delete"),
68438 context.map().on("move.intro drawn.intro", function() {
68441 helpHtml("intro.lines.multi_delete"),
68442 { duration: 0, padding: 50 }
68445 context.on("exit.intro", function() {
68446 if (context.hasEntity(_washingtonSegmentID) || context.hasEntity(twelfthAvenueID)) {
68447 return continueTo(multiSelect2);
68450 context.history().on("change.intro", function() {
68451 if (context.hasEntity(_washingtonSegmentID) || context.hasEntity(twelfthAvenueID)) {
68452 continueTo(retryDelete);
68457 function continueTo(nextStep) {
68458 context.map().on("move.intro drawn.intro", null);
68459 context.on("exit.intro", null);
68460 context.history().on("change.intro", null);
68464 function retryDelete() {
68465 context.enter(modeBrowse(context));
68466 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
68467 var box = pad2(twelfthAvenue, padding, context);
68468 reveal(box, helpHtml("intro.lines.retry_delete"), {
68469 buttonText: _t.html("intro.ok"),
68470 buttonCallback: function() {
68471 continueTo(multiSelect2);
68474 function continueTo(nextStep) {
68479 dispatch14.call("done");
68482 helpHtml("intro.lines.play", { next: _t("intro.buildings.title") }),
68484 tooltipBox: ".intro-nav-wrap .chapter-building",
68485 buttonText: _t.html("intro.ok"),
68486 buttonCallback: function() {
68487 reveal(".ideditor");
68492 chapter.enter = function() {
68495 chapter.exit = function() {
68496 timeouts.forEach(window.clearTimeout);
68497 select_default2(window).on("pointerdown.intro mousedown.intro", null, true);
68498 context.on("enter.intro exit.intro", null);
68499 context.map().on("move.intro drawn.intro", null);
68500 context.history().on("change.intro", null);
68501 context.container().select(".inspector-wrap").on("wheel.intro", null);
68502 context.container().select(".preset-list-button").on("click.intro", null);
68504 chapter.restart = function() {
68508 return utilRebind(chapter, dispatch14, "on");
68510 var init_line2 = __esm({
68511 "modules/ui/intro/line.js"() {
68525 // modules/ui/intro/building.js
68526 var building_exports = {};
68527 __export(building_exports, {
68528 uiIntroBuilding: () => uiIntroBuilding
68530 function uiIntroBuilding(context, reveal) {
68531 var dispatch14 = dispatch_default("done");
68532 var house = [-85.62815, 41.95638];
68533 var tank = [-85.62732, 41.95347];
68534 var buildingCatetory = _mainPresetIndex.item("category-building");
68535 var housePreset = _mainPresetIndex.item("building/house");
68536 var tankPreset = _mainPresetIndex.item("man_made/storage_tank");
68538 var _houseID = null;
68539 var _tankID = null;
68541 title: "intro.buildings.title"
68543 function timeout2(f2, t2) {
68544 timeouts.push(window.setTimeout(f2, t2));
68546 function eventCancel(d3_event) {
68547 d3_event.stopPropagation();
68548 d3_event.preventDefault();
68550 function revealHouse(center, text, options) {
68551 var padding = 160 * Math.pow(2, context.map().zoom() - 20);
68552 var box = pad2(center, padding, context);
68553 reveal(box, text, options);
68555 function revealTank(center, text, options) {
68556 var padding = 190 * Math.pow(2, context.map().zoom() - 19.5);
68557 var box = pad2(center, padding, context);
68558 reveal(box, text, options);
68560 function addHouse() {
68561 context.enter(modeBrowse(context));
68562 context.history().reset("initial");
68564 var msec = transitionTime(house, context.map().center());
68566 reveal(null, null, { duration: 0 });
68568 context.map().centerZoomEase(house, 19, msec);
68569 timeout2(function() {
68570 var tooltip = reveal(
68572 helpHtml("intro.buildings.add_building")
68574 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-buildings");
68575 context.on("enter.intro", function(mode) {
68576 if (mode.id !== "add-area") return;
68577 continueTo(startHouse);
68580 function continueTo(nextStep) {
68581 context.on("enter.intro", null);
68585 function startHouse() {
68586 if (context.mode().id !== "add-area") {
68587 return continueTo(addHouse);
68590 context.map().zoomEase(20, 500);
68591 timeout2(function() {
68592 var startString = helpHtml("intro.buildings.start_building") + helpHtml("intro.buildings.building_corner_" + (context.lastPointerType() === "mouse" ? "click" : "tap"));
68593 revealHouse(house, startString);
68594 context.map().on("move.intro drawn.intro", function() {
68595 revealHouse(house, startString, { duration: 0 });
68597 context.on("enter.intro", function(mode) {
68598 if (mode.id !== "draw-area") return chapter.restart();
68599 continueTo(continueHouse);
68602 function continueTo(nextStep) {
68603 context.map().on("move.intro drawn.intro", null);
68604 context.on("enter.intro", null);
68608 function continueHouse() {
68609 if (context.mode().id !== "draw-area") {
68610 return continueTo(addHouse);
68613 var continueString = helpHtml("intro.buildings.continue_building") + "{br}" + helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.buildings.finish_building");
68614 revealHouse(house, continueString);
68615 context.map().on("move.intro drawn.intro", function() {
68616 revealHouse(house, continueString, { duration: 0 });
68618 context.on("enter.intro", function(mode) {
68619 if (mode.id === "draw-area") {
68621 } else if (mode.id === "select") {
68622 var graph = context.graph();
68623 var way = context.entity(context.selectedIDs()[0]);
68624 var nodes = graph.childNodes(way);
68625 var points = utilArrayUniq(nodes).map(function(n3) {
68626 return context.projection(n3.loc);
68628 if (isMostlySquare(points)) {
68630 return continueTo(chooseCategoryBuilding);
68632 return continueTo(retryHouse);
68635 return chapter.restart();
68638 function continueTo(nextStep) {
68639 context.map().on("move.intro drawn.intro", null);
68640 context.on("enter.intro", null);
68644 function retryHouse() {
68645 var onClick = function() {
68646 continueTo(addHouse);
68650 helpHtml("intro.buildings.retry_building"),
68651 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
68653 context.map().on("move.intro drawn.intro", function() {
68656 helpHtml("intro.buildings.retry_building"),
68657 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
68660 function continueTo(nextStep) {
68661 context.map().on("move.intro drawn.intro", null);
68665 function chooseCategoryBuilding() {
68666 if (!_houseID || !context.hasEntity(_houseID)) {
68669 var ids = context.selectedIDs();
68670 if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
68671 context.enter(modeSelect(context, [_houseID]));
68673 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
68674 timeout2(function() {
68675 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
68676 var button = context.container().select(".preset-category-building .preset-list-button");
68679 helpHtml("intro.buildings.choose_category_building", { category: buildingCatetory.name() })
68681 button.on("click.intro", function() {
68682 button.on("click.intro", null);
68683 continueTo(choosePresetHouse);
68686 context.on("enter.intro", function(mode) {
68687 if (!_houseID || !context.hasEntity(_houseID)) {
68688 return continueTo(addHouse);
68690 var ids2 = context.selectedIDs();
68691 if (mode.id !== "select" || !ids2.length || ids2[0] !== _houseID) {
68692 return continueTo(chooseCategoryBuilding);
68695 function continueTo(nextStep) {
68696 context.container().select(".inspector-wrap").on("wheel.intro", null);
68697 context.container().select(".preset-list-button").on("click.intro", null);
68698 context.on("enter.intro", null);
68702 function choosePresetHouse() {
68703 if (!_houseID || !context.hasEntity(_houseID)) {
68706 var ids = context.selectedIDs();
68707 if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
68708 context.enter(modeSelect(context, [_houseID]));
68710 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
68711 timeout2(function() {
68712 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
68713 var button = context.container().select(".preset-building-house .preset-list-button");
68716 helpHtml("intro.buildings.choose_preset_house", { preset: housePreset.name() }),
68719 button.on("click.intro", function() {
68720 button.on("click.intro", null);
68721 continueTo(closeEditorHouse);
68724 context.on("enter.intro", function(mode) {
68725 if (!_houseID || !context.hasEntity(_houseID)) {
68726 return continueTo(addHouse);
68728 var ids2 = context.selectedIDs();
68729 if (mode.id !== "select" || !ids2.length || ids2[0] !== _houseID) {
68730 return continueTo(chooseCategoryBuilding);
68733 function continueTo(nextStep) {
68734 context.container().select(".inspector-wrap").on("wheel.intro", null);
68735 context.container().select(".preset-list-button").on("click.intro", null);
68736 context.on("enter.intro", null);
68740 function closeEditorHouse() {
68741 if (!_houseID || !context.hasEntity(_houseID)) {
68744 var ids = context.selectedIDs();
68745 if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
68746 context.enter(modeSelect(context, [_houseID]));
68748 context.history().checkpoint("hasHouse");
68749 context.on("exit.intro", function() {
68750 continueTo(rightClickHouse);
68752 timeout2(function() {
68754 ".entity-editor-pane",
68755 helpHtml("intro.buildings.close", { button: { html: icon("#iD-icon-close", "inline") } })
68758 function continueTo(nextStep) {
68759 context.on("exit.intro", null);
68763 function rightClickHouse() {
68764 if (!_houseID) return chapter.restart();
68765 context.enter(modeBrowse(context));
68766 context.history().reset("hasHouse");
68767 var zoom = context.map().zoom();
68771 context.map().centerZoomEase(house, zoom, 500);
68772 context.on("enter.intro", function(mode) {
68773 if (mode.id !== "select") return;
68774 var ids = context.selectedIDs();
68775 if (ids.length !== 1 || ids[0] !== _houseID) return;
68776 timeout2(function() {
68777 var node = selectMenuItem(context, "orthogonalize").node();
68779 continueTo(clickSquare);
68782 context.map().on("move.intro drawn.intro", function() {
68783 var rightclickString = helpHtml("intro.buildings." + (context.lastPointerType() === "mouse" ? "rightclick_building" : "edit_menu_building_touch"));
68784 revealHouse(house, rightclickString, { duration: 0 });
68786 context.history().on("change.intro", function() {
68787 continueTo(rightClickHouse);
68789 function continueTo(nextStep) {
68790 context.on("enter.intro", null);
68791 context.map().on("move.intro drawn.intro", null);
68792 context.history().on("change.intro", null);
68796 function clickSquare() {
68797 if (!_houseID) return chapter.restart();
68798 var entity = context.hasEntity(_houseID);
68799 if (!entity) return continueTo(rightClickHouse);
68800 var node = selectMenuItem(context, "orthogonalize").node();
68802 return continueTo(rightClickHouse);
68804 var wasChanged = false;
68807 helpHtml("intro.buildings.square_building"),
68810 context.on("enter.intro", function(mode) {
68811 if (mode.id === "browse") {
68812 continueTo(rightClickHouse);
68813 } else if (mode.id === "move" || mode.id === "rotate") {
68814 continueTo(retryClickSquare);
68817 context.map().on("move.intro", function() {
68818 var node2 = selectMenuItem(context, "orthogonalize").node();
68819 if (!wasChanged && !node2) {
68820 return continueTo(rightClickHouse);
68824 helpHtml("intro.buildings.square_building"),
68825 { duration: 0, padding: 50 }
68828 context.history().on("change.intro", function() {
68830 context.history().on("change.intro", null);
68831 timeout2(function() {
68832 if (context.history().undoAnnotation() === _t("operations.orthogonalize.annotation.feature", { n: 1 })) {
68833 continueTo(doneSquare);
68835 continueTo(retryClickSquare);
68839 function continueTo(nextStep) {
68840 context.on("enter.intro", null);
68841 context.map().on("move.intro", null);
68842 context.history().on("change.intro", null);
68846 function retryClickSquare() {
68847 context.enter(modeBrowse(context));
68848 revealHouse(house, helpHtml("intro.buildings.retry_square"), {
68849 buttonText: _t.html("intro.ok"),
68850 buttonCallback: function() {
68851 continueTo(rightClickHouse);
68854 function continueTo(nextStep) {
68858 function doneSquare() {
68859 context.history().checkpoint("doneSquare");
68860 revealHouse(house, helpHtml("intro.buildings.done_square"), {
68861 buttonText: _t.html("intro.ok"),
68862 buttonCallback: function() {
68863 continueTo(addTank);
68866 function continueTo(nextStep) {
68870 function addTank() {
68871 context.enter(modeBrowse(context));
68872 context.history().reset("doneSquare");
68874 var msec = transitionTime(tank, context.map().center());
68876 reveal(null, null, { duration: 0 });
68878 context.map().centerZoomEase(tank, 19.5, msec);
68879 timeout2(function() {
68882 helpHtml("intro.buildings.add_tank")
68884 context.on("enter.intro", function(mode) {
68885 if (mode.id !== "add-area") return;
68886 continueTo(startTank);
68889 function continueTo(nextStep) {
68890 context.on("enter.intro", null);
68894 function startTank() {
68895 if (context.mode().id !== "add-area") {
68896 return continueTo(addTank);
68899 timeout2(function() {
68900 var startString = helpHtml("intro.buildings.start_tank") + helpHtml("intro.buildings.tank_edge_" + (context.lastPointerType() === "mouse" ? "click" : "tap"));
68901 revealTank(tank, startString);
68902 context.map().on("move.intro drawn.intro", function() {
68903 revealTank(tank, startString, { duration: 0 });
68905 context.on("enter.intro", function(mode) {
68906 if (mode.id !== "draw-area") return chapter.restart();
68907 continueTo(continueTank);
68910 function continueTo(nextStep) {
68911 context.map().on("move.intro drawn.intro", null);
68912 context.on("enter.intro", null);
68916 function continueTank() {
68917 if (context.mode().id !== "draw-area") {
68918 return continueTo(addTank);
68921 var continueString = helpHtml("intro.buildings.continue_tank") + "{br}" + helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.buildings.finish_tank");
68922 revealTank(tank, continueString);
68923 context.map().on("move.intro drawn.intro", function() {
68924 revealTank(tank, continueString, { duration: 0 });
68926 context.on("enter.intro", function(mode) {
68927 if (mode.id === "draw-area") {
68929 } else if (mode.id === "select") {
68930 _tankID = context.selectedIDs()[0];
68931 return continueTo(searchPresetTank);
68933 return continueTo(addTank);
68936 function continueTo(nextStep) {
68937 context.map().on("move.intro drawn.intro", null);
68938 context.on("enter.intro", null);
68942 function searchPresetTank() {
68943 if (!_tankID || !context.hasEntity(_tankID)) {
68946 var ids = context.selectedIDs();
68947 if (context.mode().id !== "select" || !ids.length || ids[0] !== _tankID) {
68948 context.enter(modeSelect(context, [_tankID]));
68950 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
68951 timeout2(function() {
68952 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
68953 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
68955 ".preset-search-input",
68956 helpHtml("intro.buildings.search_tank", { preset: tankPreset.name() })
68959 context.on("enter.intro", function(mode) {
68960 if (!_tankID || !context.hasEntity(_tankID)) {
68961 return continueTo(addTank);
68963 var ids2 = context.selectedIDs();
68964 if (mode.id !== "select" || !ids2.length || ids2[0] !== _tankID) {
68965 context.enter(modeSelect(context, [_tankID]));
68966 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
68967 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
68968 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
68970 ".preset-search-input",
68971 helpHtml("intro.buildings.search_tank", { preset: tankPreset.name() })
68973 context.history().on("change.intro", null);
68976 function checkPresetSearch() {
68977 var first = context.container().select(".preset-list-item:first-child");
68978 if (first.classed("preset-man_made-storage_tank")) {
68980 first.select(".preset-list-button").node(),
68981 helpHtml("intro.buildings.choose_tank", { preset: tankPreset.name() }),
68984 context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
68985 context.history().on("change.intro", function() {
68986 continueTo(closeEditorTank);
68990 function continueTo(nextStep) {
68991 context.container().select(".inspector-wrap").on("wheel.intro", null);
68992 context.on("enter.intro", null);
68993 context.history().on("change.intro", null);
68994 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
68998 function closeEditorTank() {
68999 if (!_tankID || !context.hasEntity(_tankID)) {
69002 var ids = context.selectedIDs();
69003 if (context.mode().id !== "select" || !ids.length || ids[0] !== _tankID) {
69004 context.enter(modeSelect(context, [_tankID]));
69006 context.history().checkpoint("hasTank");
69007 context.on("exit.intro", function() {
69008 continueTo(rightClickTank);
69010 timeout2(function() {
69012 ".entity-editor-pane",
69013 helpHtml("intro.buildings.close", { button: { html: icon("#iD-icon-close", "inline") } })
69016 function continueTo(nextStep) {
69017 context.on("exit.intro", null);
69021 function rightClickTank() {
69022 if (!_tankID) return continueTo(addTank);
69023 context.enter(modeBrowse(context));
69024 context.history().reset("hasTank");
69025 context.map().centerEase(tank, 500);
69026 timeout2(function() {
69027 context.on("enter.intro", function(mode) {
69028 if (mode.id !== "select") return;
69029 var ids = context.selectedIDs();
69030 if (ids.length !== 1 || ids[0] !== _tankID) return;
69031 timeout2(function() {
69032 var node = selectMenuItem(context, "circularize").node();
69034 continueTo(clickCircle);
69037 var rightclickString = helpHtml("intro.buildings." + (context.lastPointerType() === "mouse" ? "rightclick_tank" : "edit_menu_tank_touch"));
69038 revealTank(tank, rightclickString);
69039 context.map().on("move.intro drawn.intro", function() {
69040 revealTank(tank, rightclickString, { duration: 0 });
69042 context.history().on("change.intro", function() {
69043 continueTo(rightClickTank);
69046 function continueTo(nextStep) {
69047 context.on("enter.intro", null);
69048 context.map().on("move.intro drawn.intro", null);
69049 context.history().on("change.intro", null);
69053 function clickCircle() {
69054 if (!_tankID) return chapter.restart();
69055 var entity = context.hasEntity(_tankID);
69056 if (!entity) return continueTo(rightClickTank);
69057 var node = selectMenuItem(context, "circularize").node();
69059 return continueTo(rightClickTank);
69061 var wasChanged = false;
69064 helpHtml("intro.buildings.circle_tank"),
69067 context.on("enter.intro", function(mode) {
69068 if (mode.id === "browse") {
69069 continueTo(rightClickTank);
69070 } else if (mode.id === "move" || mode.id === "rotate") {
69071 continueTo(retryClickCircle);
69074 context.map().on("move.intro", function() {
69075 var node2 = selectMenuItem(context, "circularize").node();
69076 if (!wasChanged && !node2) {
69077 return continueTo(rightClickTank);
69081 helpHtml("intro.buildings.circle_tank"),
69082 { duration: 0, padding: 50 }
69085 context.history().on("change.intro", function() {
69087 context.history().on("change.intro", null);
69088 timeout2(function() {
69089 if (context.history().undoAnnotation() === _t("operations.circularize.annotation.feature", { n: 1 })) {
69092 continueTo(retryClickCircle);
69096 function continueTo(nextStep) {
69097 context.on("enter.intro", null);
69098 context.map().on("move.intro", null);
69099 context.history().on("change.intro", null);
69103 function retryClickCircle() {
69104 context.enter(modeBrowse(context));
69105 revealTank(tank, helpHtml("intro.buildings.retry_circle"), {
69106 buttonText: _t.html("intro.ok"),
69107 buttonCallback: function() {
69108 continueTo(rightClickTank);
69111 function continueTo(nextStep) {
69116 dispatch14.call("done");
69119 helpHtml("intro.buildings.play", { next: _t("intro.startediting.title") }),
69121 tooltipBox: ".intro-nav-wrap .chapter-startEditing",
69122 buttonText: _t.html("intro.ok"),
69123 buttonCallback: function() {
69124 reveal(".ideditor");
69129 chapter.enter = function() {
69132 chapter.exit = function() {
69133 timeouts.forEach(window.clearTimeout);
69134 context.on("enter.intro exit.intro", null);
69135 context.map().on("move.intro drawn.intro", null);
69136 context.history().on("change.intro", null);
69137 context.container().select(".inspector-wrap").on("wheel.intro", null);
69138 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
69139 context.container().select(".more-fields .combobox-input").on("click.intro", null);
69141 chapter.restart = function() {
69145 return utilRebind(chapter, dispatch14, "on");
69147 var init_building = __esm({
69148 "modules/ui/intro/building.js"() {
69160 // modules/ui/intro/start_editing.js
69161 var start_editing_exports = {};
69162 __export(start_editing_exports, {
69163 uiIntroStartEditing: () => uiIntroStartEditing
69165 function uiIntroStartEditing(context, reveal) {
69166 var dispatch14 = dispatch_default("done", "startEditing");
69167 var modalSelection = select_default2(null);
69169 title: "intro.startediting.title"
69171 function showHelp() {
69173 ".map-control.help-control",
69174 helpHtml("intro.startediting.help"),
69176 buttonText: _t.html("intro.ok"),
69177 buttonCallback: function() {
69183 function shortcuts() {
69185 ".map-control.help-control",
69186 helpHtml("intro.startediting.shortcuts"),
69188 buttonText: _t.html("intro.ok"),
69189 buttonCallback: function() {
69195 function showSave() {
69196 context.container().selectAll(".shaded").remove();
69198 ".top-toolbar button.save",
69199 helpHtml("intro.startediting.save"),
69201 buttonText: _t.html("intro.ok"),
69202 buttonCallback: function() {
69208 function showStart() {
69209 context.container().selectAll(".shaded").remove();
69210 modalSelection = uiModal(context.container());
69211 modalSelection.select(".modal").attr("class", "modal-splash modal");
69212 modalSelection.selectAll(".close").remove();
69213 var startbutton = modalSelection.select(".content").attr("class", "fillL").append("button").attr("class", "modal-section huge-modal-button").on("click", function() {
69214 modalSelection.remove();
69216 startbutton.append("svg").attr("class", "illustration").append("use").attr("xlink:href", "#iD-logo-walkthrough");
69217 startbutton.append("h2").call(_t.append("intro.startediting.start"));
69218 dispatch14.call("startEditing");
69220 chapter.enter = function() {
69223 chapter.exit = function() {
69224 modalSelection.remove();
69225 context.container().selectAll(".shaded").remove();
69227 return utilRebind(chapter, dispatch14, "on");
69229 var init_start_editing = __esm({
69230 "modules/ui/intro/start_editing.js"() {
69241 // modules/ui/intro/intro.js
69242 var intro_exports = {};
69243 __export(intro_exports, {
69244 uiIntro: () => uiIntro
69246 function uiIntro(context) {
69247 const INTRO_IMAGERY = "Bing";
69248 let _introGraph = {};
69250 function intro(selection2) {
69251 _mainFileFetcher.get("intro_graph").then((dataIntroGraph) => {
69252 for (let id2 in dataIntroGraph) {
69253 if (!_introGraph[id2]) {
69254 _introGraph[id2] = osmEntity(localize(dataIntroGraph[id2]));
69257 selection2.call(startIntro);
69258 }).catch(function() {
69261 function startIntro(selection2) {
69262 context.enter(modeBrowse(context));
69263 let osm = context.connection();
69264 let history = context.history().toJSON();
69265 let hash2 = window.location.hash;
69266 let center = context.map().center();
69267 let zoom = context.map().zoom();
69268 let background = context.background().baseLayerSource();
69269 let overlays = context.background().overlayLayerSources();
69270 let opacity = context.container().selectAll(".main-map .layer-background").style("opacity");
69271 let caches = osm && osm.caches();
69272 let baseEntities = context.history().graph().base().entities;
69273 context.ui().sidebar.expand();
69274 context.container().selectAll("button.sidebar-toggle").classed("disabled", true);
69275 context.inIntro(true);
69277 osm.toggle(false).reset();
69279 context.history().reset();
69280 context.history().merge(Object.values(coreGraph().load(_introGraph).entities));
69281 context.history().checkpoint("initial");
69282 let imagery = context.background().findSource(INTRO_IMAGERY);
69284 context.background().baseLayerSource(imagery);
69286 context.background().bing();
69288 overlays.forEach((d4) => context.background().toggleOverlayLayer(d4));
69289 let layers = context.layers();
69290 layers.all().forEach((item) => {
69291 if (typeof item.layer.enabled === "function") {
69292 item.layer.enabled(item.id === "osm");
69295 context.container().selectAll(".main-map .layer-background").style("opacity", 1);
69296 let curtain = uiCurtain(context.container().node());
69297 selection2.call(curtain);
69298 corePreferences("walkthrough_started", "yes");
69299 let storedProgress = corePreferences("walkthrough_progress") || "";
69300 let progress = storedProgress.split(";").filter(Boolean);
69301 let chapters = chapterFlow.map((chapter, i3) => {
69302 let s2 = chapterUi[chapter](context, curtain.reveal).on("done", () => {
69303 buttons.filter((d4) => d4.title === s2.title).classed("finished", true);
69304 if (i3 < chapterFlow.length - 1) {
69305 const next = chapterFlow[i3 + 1];
69306 context.container().select(`button.chapter-${next}`).classed("next", true);
69308 progress.push(chapter);
69309 corePreferences("walkthrough_progress", utilArrayUniq(progress).join(";"));
69313 chapters[chapters.length - 1].on("startEditing", () => {
69314 progress.push("startEditing");
69315 corePreferences("walkthrough_progress", utilArrayUniq(progress).join(";"));
69316 let incomplete = utilArrayDifference(chapterFlow, progress);
69317 if (!incomplete.length) {
69318 corePreferences("walkthrough_completed", "yes");
69322 context.container().selectAll(".main-map .layer-background").style("opacity", opacity);
69323 context.container().selectAll("button.sidebar-toggle").classed("disabled", false);
69325 osm.toggle(true).reset().caches(caches);
69327 context.history().reset().merge(Object.values(baseEntities));
69328 context.background().baseLayerSource(background);
69329 overlays.forEach((d4) => context.background().toggleOverlayLayer(d4));
69331 context.history().fromJSON(history, false);
69333 context.map().centerZoom(center, zoom);
69334 window.history.replaceState(null, "", hash2);
69335 context.inIntro(false);
69337 let navwrap = selection2.append("div").attr("class", "intro-nav-wrap fillD");
69338 navwrap.append("svg").attr("class", "intro-nav-wrap-logo").append("use").attr("xlink:href", "#iD-logo-walkthrough");
69339 let buttonwrap = navwrap.append("div").attr("class", "joined").selectAll("button.chapter");
69340 let buttons = buttonwrap.data(chapters).enter().append("button").attr("class", (d4, i3) => `chapter chapter-${chapterFlow[i3]}`).on("click", enterChapter);
69341 buttons.append("span").html((d4) => _t.html(d4.title));
69342 buttons.append("span").attr("class", "status").call(svgIcon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward", "inline"));
69343 enterChapter(null, chapters[0]);
69344 function enterChapter(d3_event, newChapter) {
69345 if (_currChapter) {
69346 _currChapter.exit();
69348 context.enter(modeBrowse(context));
69349 _currChapter = newChapter;
69350 _currChapter.enter();
69351 buttons.classed("next", false).classed("active", (d4) => d4.title === _currChapter.title);
69356 var chapterUi, chapterFlow;
69357 var init_intro = __esm({
69358 "modules/ui/intro/intro.js"() {
69362 init_preferences();
69363 init_file_fetcher();
69376 init_start_editing();
69378 welcome: uiIntroWelcome,
69379 navigation: uiIntroNavigation,
69380 point: uiIntroPoint,
69383 building: uiIntroBuilding,
69384 startEditing: uiIntroStartEditing
69398 // modules/ui/intro/index.js
69399 var intro_exports2 = {};
69400 __export(intro_exports2, {
69401 uiIntro: () => uiIntro
69403 var init_intro2 = __esm({
69404 "modules/ui/intro/index.js"() {
69410 // modules/ui/issues_info.js
69411 var issues_info_exports = {};
69412 __export(issues_info_exports, {
69413 uiIssuesInfo: () => uiIssuesInfo
69415 function uiIssuesInfo(context) {
69416 var warningsItem = {
69419 iconID: "iD-icon-alert",
69420 descriptionID: "issues.warnings_and_errors"
69422 var resolvedItem = {
69425 iconID: "iD-icon-apply",
69426 descriptionID: "issues.user_resolved_issues"
69428 function update(selection2) {
69429 var shownItems = [];
69430 var liveIssues = context.validator().getIssues({
69431 what: corePreferences("validate-what") || "edited",
69432 where: corePreferences("validate-where") || "all"
69433 }).filter((issue) => issue.severity !== "suggestion");
69434 if (liveIssues.length) {
69435 warningsItem.count = liveIssues.length;
69436 shownItems.push(warningsItem);
69438 if (corePreferences("validate-what") === "all") {
69439 var resolvedIssues = context.validator().getResolvedIssues();
69440 if (resolvedIssues.length) {
69441 resolvedItem.count = resolvedIssues.length;
69442 shownItems.push(resolvedItem);
69445 var chips = selection2.selectAll(".chip").data(shownItems, function(d4) {
69448 chips.exit().remove();
69449 var enter = chips.enter().append("a").attr("class", function(d4) {
69450 return "chip " + d4.id + "-count";
69451 }).attr("href", "#").each(function(d4) {
69452 var chipSelection = select_default2(this);
69453 var tooltipBehavior = uiTooltip().placement("top").title(() => _t.append(d4.descriptionID));
69454 chipSelection.call(tooltipBehavior).on("click", function(d3_event) {
69455 d3_event.preventDefault();
69456 tooltipBehavior.hide(select_default2(this));
69457 context.ui().togglePanes(context.container().select(".map-panes .issues-pane"));
69459 chipSelection.call(svgIcon("#" + d4.iconID));
69461 enter.append("span").attr("class", "count");
69462 enter.merge(chips).selectAll("span.count").text(function(d4) {
69463 return d4.count.toString();
69466 return function(selection2) {
69467 update(selection2);
69468 context.validator().on("validated.infobox", function() {
69469 update(selection2);
69473 var init_issues_info = __esm({
69474 "modules/ui/issues_info.js"() {
69477 init_preferences();
69484 // modules/util/IntervalTasksQueue.js
69485 var IntervalTasksQueue_exports = {};
69486 __export(IntervalTasksQueue_exports, {
69487 IntervalTasksQueue: () => IntervalTasksQueue
69489 var IntervalTasksQueue;
69490 var init_IntervalTasksQueue = __esm({
69491 "modules/util/IntervalTasksQueue.js"() {
69493 IntervalTasksQueue = class {
69495 * Interval in milliseconds inside which only 1 task can execute.
69496 * e.g. if interval is 200ms, and 5 async tasks are unqueued,
69497 * they will complete in ~1s if not cleared
69498 * @param {number} intervalInMs
69500 constructor(intervalInMs) {
69501 this.intervalInMs = intervalInMs;
69502 this.pendingHandles = [];
69506 let taskTimeout = this.time;
69507 this.time += this.intervalInMs;
69508 this.pendingHandles.push(setTimeout(() => {
69509 this.time -= this.intervalInMs;
69514 this.pendingHandles.forEach((timeoutHandle) => {
69515 clearTimeout(timeoutHandle);
69517 this.pendingHandles = [];
69524 // modules/renderer/background_source.js
69525 var background_source_exports = {};
69526 __export(background_source_exports, {
69527 rendererBackgroundSource: () => rendererBackgroundSource
69529 function localeDateString(s2) {
69530 if (!s2) return null;
69531 var options = { day: "numeric", month: "short", year: "numeric" };
69532 var d4 = new Date(s2);
69533 if (isNaN(d4.getTime())) return null;
69534 return d4.toLocaleDateString(_mainLocalizer.localeCode(), options);
69536 function vintageRange(vintage) {
69538 if (vintage.start || vintage.end) {
69539 s2 = vintage.start || "?";
69540 if (vintage.start !== vintage.end) {
69541 s2 += " - " + (vintage.end || "?");
69546 function rendererBackgroundSource(data) {
69547 var source = Object.assign({}, data);
69548 var _offset = [0, 0];
69549 var _name = source.name;
69550 var _description = source.description;
69551 var _best = !!source.best;
69552 var _template = source.encrypted ? utilAesDecrypt(source.template) : source.template;
69553 source.tileSize = data.tileSize || 256;
69554 source.zoomExtent = data.zoomExtent || [0, 22];
69555 source.overzoom = data.overzoom !== false;
69556 source.offset = function(val) {
69557 if (!arguments.length) return _offset;
69561 source.nudge = function(val, zoomlevel) {
69562 _offset[0] += val[0] / Math.pow(2, zoomlevel);
69563 _offset[1] += val[1] / Math.pow(2, zoomlevel);
69566 source.name = function() {
69567 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
69568 return _t("imagery." + id_safe + ".name", { default: escape_default(_name) });
69570 source.label = function() {
69571 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
69572 return _t.append("imagery." + id_safe + ".name", { default: escape_default(_name) });
69574 source.hasDescription = function() {
69575 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
69576 var descriptionText = _mainLocalizer.tInfo("imagery." + id_safe + ".description", { default: escape_default(_description) }).text;
69577 return descriptionText !== "";
69579 source.description = function() {
69580 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
69581 return _t.append("imagery." + id_safe + ".description", { default: escape_default(_description) });
69583 source.best = function() {
69586 source.area = function() {
69587 if (!data.polygon) return Number.MAX_VALUE;
69588 var area = area_default2({ type: "MultiPolygon", coordinates: [data.polygon] });
69589 return isNaN(area) ? 0 : area;
69591 source.imageryUsed = function() {
69592 return _name || source.id;
69594 source.template = function(val) {
69595 if (!arguments.length) return _template;
69596 if (source.id === "custom" || source.id === "Bing") {
69601 source.url = function(coord2) {
69602 var result = _template.replace(/#[\s\S]*/u, "");
69603 if (result === "") return result;
69604 if (!source.type || source.id === "custom") {
69605 if (/SERVICE=WMS|\{(proj|wkid|bbox)\}/.test(result)) {
69606 source.type = "wms";
69607 source.projection = "EPSG:3857";
69608 } else if (/\{(x|y)\}/.test(result)) {
69609 source.type = "tms";
69610 } else if (/\{u\}/.test(result)) {
69611 source.type = "bing";
69614 if (source.type === "wms") {
69615 var tileToProjectedCoords = (function(x2, y3, z3) {
69616 var zoomSize = Math.pow(2, z3);
69617 var lon = x2 / zoomSize * Math.PI * 2 - Math.PI;
69618 var lat = Math.atan(Math.sinh(Math.PI * (1 - 2 * y3 / zoomSize)));
69619 switch (source.projection) {
69622 x: lon * 180 / Math.PI,
69623 y: lat * 180 / Math.PI
69626 var mercCoords = mercatorRaw(lon, lat);
69628 x: 2003750834e-2 / Math.PI * mercCoords[0],
69629 y: 2003750834e-2 / Math.PI * mercCoords[1]
69633 var tileSize = source.tileSize;
69634 var projection2 = source.projection;
69635 var minXmaxY = tileToProjectedCoords(coord2[0], coord2[1], coord2[2]);
69636 var maxXminY = tileToProjectedCoords(coord2[0] + 1, coord2[1] + 1, coord2[2]);
69637 result = result.replace(/\{(\w+)\}/g, function(token, key) {
69643 return projection2;
69645 return projection2.replace(/^EPSG:/, "");
69647 if (projection2 === "EPSG:4326" && // The CRS parameter implies version 1.3 (prior versions use SRS)
69648 /VERSION=1.3|CRS={proj}/.test(source.template().toUpperCase())) {
69649 return maxXminY.y + "," + minXmaxY.x + "," + minXmaxY.y + "," + maxXminY.x;
69651 return minXmaxY.x + "," + maxXminY.y + "," + maxXminY.x + "," + minXmaxY.y;
69665 } else if (source.type === "tms") {
69666 result = result.replace("{x}", coord2[0]).replace("{y}", coord2[1]).replace(/\{[t-]y\}/, Math.pow(2, coord2[2]) - coord2[1] - 1).replace(/\{z(oom)?\}/, coord2[2]).replace(/\{@2x\}|\{r\}/, isRetina ? "@2x" : "");
69667 } else if (source.type === "bing") {
69668 result = result.replace("{u}", function() {
69670 for (var zoom = coord2[2]; zoom > 0; zoom--) {
69672 var mask = 1 << zoom - 1;
69673 if ((coord2[0] & mask) !== 0) b3++;
69674 if ((coord2[1] & mask) !== 0) b3 += 2;
69675 u2 += b3.toString();
69680 result = result.replace(/\{switch:([^}]+)\}/, function(s2, r2) {
69681 var subdomains = r2.split(",");
69682 return subdomains[(coord2[0] + coord2[1]) % subdomains.length];
69686 source.validZoom = function(z3, underzoom) {
69687 if (underzoom === void 0) underzoom = 0;
69688 return source.zoomExtent[0] - underzoom <= z3 && (source.overzoom || source.zoomExtent[1] > z3);
69690 source.isLocatorOverlay = function() {
69691 return source.id === "mapbox_locator_overlay";
69693 source.isHidden = function() {
69694 return source.id === "DigitalGlobe-Premium-vintage" || source.id === "DigitalGlobe-Standard-vintage";
69696 source.copyrightNotices = function() {
69698 source.getMetadata = function(center, tileCoord, callback) {
69700 start: localeDateString(source.startDate),
69701 end: localeDateString(source.endDate)
69703 vintage.range = vintageRange(vintage);
69704 var metadata = { vintage };
69705 callback(null, metadata);
69710 var init_background_source = __esm({
69711 "modules/renderer/background_source.js"() {
69720 init_IntervalTasksQueue();
69721 isRetina = window.devicePixelRatio && window.devicePixelRatio >= 2;
69722 (_a3 = window.matchMedia) == null ? void 0 : _a3.call(window, `
69723 (-webkit-min-device-pixel-ratio: 2), /* Safari */
69724 (min-resolution: 2dppx), /* standard */
69725 (min-resolution: 192dpi) /* fallback */
69726 `).addListener(function() {
69727 isRetina = window.devicePixelRatio && window.devicePixelRatio >= 2;
69729 rendererBackgroundSource.Bing = function(data, dispatch14) {
69730 data.template = "https://ecn.t{switch:0,1,2,3}.tiles.virtualearth.net/tiles/a{u}.jpeg?g=1&pr=odbl&n=z";
69731 var bing = rendererBackgroundSource(data);
69732 var key = utilAesDecrypt("5c875730b09c6b422433e807e1ff060b6536c791dbfffcffc4c6b18a1bdba1f14593d151adb50e19e1be1ab19aef813bf135d0f103475e5c724dec94389e45d0");
69733 const strictParam = "n";
69734 var url = "https://dev.virtualearth.net/REST/v1/Imagery/Metadata/AerialOSM?include=ImageryProviders&uriScheme=https&key=" + key;
69737 var providers = [];
69738 var taskQueue = new IntervalTasksQueue(250);
69739 var metadataLastZoom = -1;
69740 json_default(url).then(function(json) {
69741 let imageryResource = json.resourceSets[0].resources[0];
69742 let template = imageryResource.imageUrl;
69743 let subDomains = imageryResource.imageUrlSubdomains;
69744 let subDomainNumbers = subDomains.map((subDomain) => {
69745 return subDomain.substring(1);
69747 template = template.replace("{subdomain}", `t{switch:${subDomainNumbers}}`).replace("{quadkey}", "{u}");
69748 if (!new URLSearchParams(template).has(strictParam)) {
69749 template += `&${strictParam}=z`;
69751 bing.template(template);
69752 providers = imageryResource.imageryProviders.map(function(provider) {
69754 attribution: provider.attribution,
69755 areas: provider.coverageAreas.map(function(area) {
69757 zoom: [area.zoomMin, area.zoomMax],
69758 extent: geoExtent([area.bbox[1], area.bbox[0]], [area.bbox[3], area.bbox[2]])
69763 dispatch14.call("change");
69764 }).catch(function() {
69766 bing.copyrightNotices = function(zoom, extent) {
69767 zoom = Math.min(zoom, 21);
69768 return providers.filter(function(provider) {
69769 return provider.areas.some(function(area) {
69770 return extent.intersects(area.extent) && area.zoom[0] <= zoom && area.zoom[1] >= zoom;
69772 }).map(function(provider) {
69773 return provider.attribution;
69776 bing.getMetadata = function(center, tileCoord, callback) {
69777 var tileID = tileCoord.slice(0, 3).join("/");
69778 var zoom = Math.min(tileCoord[2], 21);
69779 var centerPoint = center[1] + "," + center[0];
69780 var url2 = "https://dev.virtualearth.net/REST/v1/Imagery/BasicMetadata/AerialOSM/" + centerPoint + "?zl=" + zoom + "&key=" + key;
69781 if (inflight[tileID]) return;
69782 if (!cache[tileID]) {
69783 cache[tileID] = {};
69785 if (cache[tileID] && cache[tileID].metadata) {
69786 return callback(null, cache[tileID].metadata);
69788 inflight[tileID] = true;
69789 if (metadataLastZoom !== tileCoord[2]) {
69790 metadataLastZoom = tileCoord[2];
69793 taskQueue.enqueue(() => {
69794 json_default(url2).then(function(result) {
69795 delete inflight[tileID];
69797 throw new Error("Unknown Error");
69800 start: localeDateString(result.resourceSets[0].resources[0].vintageStart),
69801 end: localeDateString(result.resourceSets[0].resources[0].vintageEnd)
69803 vintage.range = vintageRange(vintage);
69804 var metadata = { vintage };
69805 cache[tileID].metadata = metadata;
69806 if (callback) callback(null, metadata);
69807 }).catch(function(err) {
69808 delete inflight[tileID];
69809 if (callback) callback(err.message);
69813 bing.terms_url = "https://blog.openstreetmap.org/2010/11/30/microsoft-imagery-details";
69816 rendererBackgroundSource.Esri = function(data) {
69817 if (data.template.match(/blankTile/) === null) {
69818 data.template = data.template + "?blankTile=false";
69820 var esri = rendererBackgroundSource(data);
69824 esri.fetchTilemap = function(center) {
69825 if (_prevCenter && geoSphericalDistance(center, _prevCenter) < 5e3) return;
69826 _prevCenter = center;
69828 var dummyUrl = esri.url([1, 2, 3]);
69829 var x2 = Math.floor((center[0] + 180) / 360 * Math.pow(2, z3));
69830 var y3 = Math.floor((1 - Math.log(Math.tan(center[1] * Math.PI / 180) + 1 / Math.cos(center[1] * Math.PI / 180)) / Math.PI) / 2 * Math.pow(2, z3));
69831 var tilemapUrl = dummyUrl.replace(/tile\/[0-9]+\/[0-9]+\/[0-9]+\?blankTile=false/, "tilemap") + "/" + z3 + "/" + y3 + "/" + x2 + "/8/8";
69832 json_default(tilemapUrl).then(function(tilemap) {
69834 throw new Error("Unknown Error");
69836 var hasTiles = true;
69837 for (var i3 = 0; i3 < tilemap.data.length; i3++) {
69838 if (!tilemap.data[i3]) {
69843 esri.zoomExtent[1] = hasTiles ? 22 : 19;
69844 }).catch(function() {
69847 esri.getMetadata = function(center, tileCoord, callback) {
69848 if (esri.id !== "EsriWorldImagery") {
69849 return callback(null, {});
69851 var tileID = tileCoord.slice(0, 3).join("/");
69852 var zoom = Math.min(tileCoord[2], esri.zoomExtent[1]);
69853 var centerPoint = center[0] + "," + center[1];
69854 var unknown = _t("info_panels.background.unknown");
69857 if (inflight[tileID]) return;
69858 var url = "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/4/query";
69859 url += "?returnGeometry=false&geometry=" + centerPoint + "&inSR=4326&geometryType=esriGeometryPoint&outFields=*&f=json";
69860 if (!cache[tileID]) {
69861 cache[tileID] = {};
69863 if (cache[tileID] && cache[tileID].metadata) {
69864 return callback(null, cache[tileID].metadata);
69866 inflight[tileID] = true;
69867 json_default(url).then(function(result) {
69868 delete inflight[tileID];
69869 result = result.features.map((f2) => f2.attributes).filter((a2) => a2.MinMapLevel <= zoom && a2.MaxMapLevel >= zoom)[0];
69871 throw new Error("Unknown Error");
69872 } else if (result.features && result.features.length < 1) {
69873 throw new Error("No Results");
69874 } else if (result.error && result.error.message) {
69875 throw new Error(result.error.message);
69877 var captureDate = localeDateString(result.SRC_DATE2);
69879 start: captureDate,
69885 source: clean2(result.NICE_NAME),
69886 description: clean2(result.NICE_DESC),
69887 resolution: clean2(+Number(result.SRC_RES).toFixed(4)),
69888 accuracy: clean2(+Number(result.SRC_ACC).toFixed(4))
69890 if (isFinite(metadata.resolution)) {
69891 metadata.resolution += " m";
69893 if (isFinite(metadata.accuracy)) {
69894 metadata.accuracy += " m";
69896 cache[tileID].metadata = metadata;
69897 if (callback) callback(null, metadata);
69898 }).catch(function(err) {
69899 delete inflight[tileID];
69900 if (callback) callback(err.message);
69902 function clean2(val) {
69903 return String(val).trim() || unknown;
69908 rendererBackgroundSource.None = function() {
69909 var source = rendererBackgroundSource({ id: "none", template: "" });
69910 source.name = function() {
69911 return _t("background.none");
69913 source.label = function() {
69914 return _t.append("background.none");
69916 source.imageryUsed = function() {
69919 source.area = function() {
69924 rendererBackgroundSource.Custom = function(template) {
69925 var source = rendererBackgroundSource({ id: "custom", template });
69926 source.name = function() {
69927 return _t("background.custom");
69929 source.label = function() {
69930 return _t.append("background.custom");
69932 source.imageryUsed = function() {
69933 var cleaned = source.template();
69934 if (cleaned.indexOf("?") !== -1) {
69935 var parts = cleaned.split("?", 2);
69936 var qs = utilStringQs(parts[1]);
69937 ["access_token", "connectId", "token", "Signature"].forEach(function(param) {
69939 qs[param] = "{apikey}";
69942 cleaned = parts[0] + "?" + utilQsString(qs, true);
69944 cleaned = cleaned.replace(/token\/(\w+)/, "token/{apikey}").replace(/key=(\w+)/, "key={apikey}");
69945 return "Custom (" + cleaned + " )";
69947 source.area = function() {
69955 // node_modules/@turf/meta/dist/esm/index.js
69956 function coordEach(geojson, callback, excludeWrapCoord) {
69957 if (geojson === null) return;
69958 var j3, k2, l4, geometry, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type2 = geojson.type, isFeatureCollection = type2 === "FeatureCollection", isFeature = type2 === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
69959 for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
69960 geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
69961 isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
69962 stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
69963 for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
69964 var multiFeatureIndex = 0;
69965 var geometryIndex = 0;
69966 geometry = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
69967 if (geometry === null) continue;
69968 coords = geometry.coordinates;
69969 var geomType = geometry.type;
69970 wrapShrink = excludeWrapCoord && (geomType === "Polygon" || geomType === "MultiPolygon") ? 1 : 0;
69971 switch (geomType) {
69984 multiFeatureIndex++;
69988 for (j3 = 0; j3 < coords.length; j3++) {
69998 if (geomType === "MultiPoint") multiFeatureIndex++;
70000 if (geomType === "LineString") multiFeatureIndex++;
70003 case "MultiLineString":
70004 for (j3 = 0; j3 < coords.length; j3++) {
70005 for (k2 = 0; k2 < coords[j3].length - wrapShrink; k2++) {
70016 if (geomType === "MultiLineString") multiFeatureIndex++;
70017 if (geomType === "Polygon") geometryIndex++;
70019 if (geomType === "Polygon") multiFeatureIndex++;
70021 case "MultiPolygon":
70022 for (j3 = 0; j3 < coords.length; j3++) {
70024 for (k2 = 0; k2 < coords[j3].length; k2++) {
70025 for (l4 = 0; l4 < coords[j3][k2].length - wrapShrink; l4++) {
70027 coords[j3][k2][l4],
70038 multiFeatureIndex++;
70041 case "GeometryCollection":
70042 for (j3 = 0; j3 < geometry.geometries.length; j3++)
70043 if (coordEach(geometry.geometries[j3], callback, excludeWrapCoord) === false)
70047 throw new Error("Unknown Geometry Type");
70052 var init_esm6 = __esm({
70053 "node_modules/@turf/meta/dist/esm/index.js"() {
70057 // node_modules/@turf/bbox/dist/esm/index.js
70058 function bbox(geojson, options = {}) {
70059 if (geojson.bbox != null && true !== options.recompute) {
70060 return geojson.bbox;
70062 const result = [Infinity, Infinity, -Infinity, -Infinity];
70063 coordEach(geojson, (coord2) => {
70064 if (result[0] > coord2[0]) {
70065 result[0] = coord2[0];
70067 if (result[1] > coord2[1]) {
70068 result[1] = coord2[1];
70070 if (result[2] < coord2[0]) {
70071 result[2] = coord2[0];
70073 if (result[3] < coord2[1]) {
70074 result[3] = coord2[1];
70079 var turf_bbox_default;
70080 var init_esm7 = __esm({
70081 "node_modules/@turf/bbox/dist/esm/index.js"() {
70083 turf_bbox_default = bbox;
70087 // modules/renderer/tile_layer.js
70088 var tile_layer_exports = {};
70089 __export(tile_layer_exports, {
70090 rendererTileLayer: () => rendererTileLayer
70092 function rendererTileLayer(context) {
70093 var transformProp = utilPrefixCSSProperty("Transform");
70094 var tiler8 = utilTiler();
70095 var _tileSize = 256;
70101 var _underzoom = 0;
70102 function tileSizeAtZoom(d4, z3) {
70103 return d4.tileSize * Math.pow(2, z3 - d4[2]) / d4.tileSize;
70105 function atZoom(t2, distance) {
70106 var power = Math.pow(2, distance);
70108 Math.floor(t2[0] * power),
70109 Math.floor(t2[1] * power),
70113 function lookUp(d4) {
70114 for (var up = -1; up > -d4[2]; up--) {
70115 var tile = atZoom(d4, up);
70116 if (_cache5[_source.url(tile)] !== false) {
70121 function uniqueBy(a2, n3) {
70124 for (var i3 = 0; i3 < a2.length; i3++) {
70125 if (seen[a2[i3][n3]] === void 0) {
70127 seen[a2[i3][n3]] = true;
70132 function addSource(d4) {
70133 d4.url = _source.url(d4);
70134 d4.tileSize = _tileSize;
70135 d4.source = _source;
70138 function background(selection2) {
70139 _zoom = geoScaleToZoom(_projection.scale(), _tileSize);
70143 _source.offset()[0] * Math.pow(2, _zoom),
70144 _source.offset()[1] * Math.pow(2, _zoom)
70147 pixelOffset = [0, 0];
70149 tiler8.scale(_projection.scale() * 2 * Math.PI).translate([
70150 _projection.translate()[0] + pixelOffset[0],
70151 _projection.translate()[1] + pixelOffset[1]
70154 _projection.scale() * Math.PI - _projection.translate()[0],
70155 _projection.scale() * Math.PI - _projection.translate()[1]
70157 render(selection2);
70159 function render(selection2) {
70160 if (!_source) return;
70162 var showDebug = context.getDebug("tile") && !_source.overlay;
70163 if (_source.validZoom(_zoom, _underzoom)) {
70164 tiler8.skipNullIsland(!!_source.overlay);
70165 tiler8().forEach(function(d4) {
70167 if (d4.url === "") return;
70168 if (typeof d4.url !== "string") return;
70170 if (_cache5[d4.url] === false && lookUp(d4)) {
70171 requests.push(addSource(lookUp(d4)));
70174 requests = uniqueBy(requests, "url").filter(function(r2) {
70175 return _cache5[r2.url] !== false;
70178 function load(d3_event, d4) {
70179 _cache5[d4.url] = true;
70180 select_default2(this).on("error", null).on("load", null);
70181 render(selection2);
70183 function error(d3_event, d4) {
70184 _cache5[d4.url] = false;
70185 select_default2(this).on("error", null).on("load", null).remove();
70186 render(selection2);
70188 function imageTransform(d4) {
70189 var ts = d4.tileSize * Math.pow(2, _zoom - d4[2]);
70190 var scale = tileSizeAtZoom(d4, _zoom);
70191 return "translate(" + ((d4[0] * ts + d4.source.offset()[0] * Math.pow(2, _zoom)) * _tileSize / d4.tileSize - _tileOrigin[0]) + "px," + ((d4[1] * ts + d4.source.offset()[1] * Math.pow(2, _zoom)) * _tileSize / d4.tileSize - _tileOrigin[1]) + "px) scale(" + scale * _tileSize / d4.tileSize + "," + scale * _tileSize / d4.tileSize + ")";
70193 function tileCenter(d4) {
70194 var ts = d4.tileSize * Math.pow(2, _zoom - d4[2]);
70196 d4[0] * ts - _tileOrigin[0] + ts / 2,
70197 d4[1] * ts - _tileOrigin[1] + ts / 2
70200 function debugTransform(d4) {
70201 var coord2 = tileCenter(d4);
70202 return "translate(" + coord2[0] + "px," + coord2[1] + "px)";
70204 var dims = tiler8.size();
70205 var mapCenter = [dims[0] / 2, dims[1] / 2];
70206 var minDist = Math.max(dims[0], dims[1]);
70208 requests.forEach(function(d4) {
70209 var c2 = tileCenter(d4);
70210 var dist = geoVecLength(c2, mapCenter);
70211 if (dist < minDist) {
70216 var image = selection2.selectAll("img").data(requests, function(d4) {
70219 image.exit().style(transformProp, imageTransform).classed("tile-removing", true).classed("tile-center", false).on("transitionend", function() {
70220 const tile = select_default2(this);
70221 if (tile.classed("tile-removing")) {
70225 image.enter().append("img").attr("class", "tile").attr("alt", "").attr("draggable", "false").style("width", _tileSize + "px").style("height", _tileSize + "px").attr("src", function(d4) {
70227 }).on("error", error).on("load", load).merge(image).style(transformProp, imageTransform).classed("tile-debug", showDebug).classed("tile-removing", false).classed("tile-center", function(d4) {
70228 return d4 === nearCenter;
70229 }).sort((a2, b3) => a2[2] - b3[2]);
70230 var debug2 = selection2.selectAll(".tile-label-debug").data(showDebug ? requests : [], function(d4) {
70233 debug2.exit().remove();
70235 var debugEnter = debug2.enter().append("div").attr("class", "tile-label-debug");
70236 debugEnter.append("div").attr("class", "tile-label-debug-coord");
70237 debugEnter.append("div").attr("class", "tile-label-debug-vintage");
70238 debug2 = debug2.merge(debugEnter);
70239 debug2.style(transformProp, debugTransform);
70240 debug2.selectAll(".tile-label-debug-coord").text(function(d4) {
70241 return d4[2] + " / " + d4[0] + " / " + d4[1];
70243 debug2.selectAll(".tile-label-debug-vintage").each(function(d4) {
70244 var span = select_default2(this);
70245 var center = context.projection.invert(tileCenter(d4));
70246 _source.getMetadata(center, d4, function(err, result) {
70247 if (result && result.vintage && result.vintage.range) {
70248 span.text(result.vintage.range);
70251 span.call(_t.append("info_panels.background.vintage"));
70252 span.append("span").text(": ");
70253 span.call(_t.append("info_panels.background.unknown"));
70259 background.projection = function(val) {
70260 if (!arguments.length) return _projection;
70264 background.dimensions = function(val) {
70265 if (!arguments.length) return tiler8.size();
70269 background.source = function(val) {
70270 if (!arguments.length) return _source;
70272 _tileSize = _source.tileSize;
70274 tiler8.tileSize(_source.tileSize).zoomExtent(_source.zoomExtent);
70277 background.underzoom = function(amount) {
70278 if (!arguments.length) return _underzoom;
70279 _underzoom = amount;
70284 var init_tile_layer = __esm({
70285 "modules/renderer/tile_layer.js"() {
70294 // modules/renderer/background.js
70295 var background_exports2 = {};
70296 __export(background_exports2, {
70297 rendererBackground: () => rendererBackground
70299 function rendererBackground(context) {
70300 const dispatch14 = dispatch_default("change");
70301 const baseLayer = rendererTileLayer(context).projection(context.projection);
70302 let _checkedBlocklists = [];
70303 let _isValid = true;
70304 let _overlayLayers = [];
70305 let _brightness = 1;
70307 let _saturation = 1;
70308 let _sharpness = 1;
70309 function ensureImageryIndex() {
70310 return _mainFileFetcher.get("imagery").then((sources) => {
70311 if (_imageryIndex) return _imageryIndex;
70316 const features = sources.map((source) => {
70317 if (!source.polygon) return null;
70318 const rings = source.polygon.map((ring) => [ring]);
70321 properties: { id: source.id },
70322 geometry: { type: "MultiPolygon", coordinates: rings }
70324 _imageryIndex.features[source.id] = feature3;
70326 }).filter(Boolean);
70327 _imageryIndex.query = (0, import_which_polygon4.default)({ type: "FeatureCollection", features });
70328 _imageryIndex.backgrounds = sources.map((source) => {
70329 if (source.type === "bing") {
70330 return rendererBackgroundSource.Bing(source, dispatch14);
70331 } else if (/^EsriWorldImagery/.test(source.id)) {
70332 return rendererBackgroundSource.Esri(source);
70334 return rendererBackgroundSource(source);
70337 _imageryIndex.backgrounds.unshift(rendererBackgroundSource.None());
70338 let template = corePreferences("background-custom-template") || "";
70339 const custom = rendererBackgroundSource.Custom(template);
70340 _imageryIndex.backgrounds.unshift(custom);
70341 return _imageryIndex;
70344 function background(selection2) {
70345 const currSource = baseLayer.source();
70346 if (context.map().zoom() > 18) {
70347 if (currSource && /^EsriWorldImagery/.test(currSource.id)) {
70348 const center = context.map().center();
70349 currSource.fetchTilemap(center);
70352 const sources = background.sources(context.map().extent());
70353 const wasValid = _isValid;
70354 _isValid = !!sources.filter((d4) => d4 === currSource).length;
70355 if (wasValid !== _isValid) {
70356 background.updateImagery();
70358 let baseFilter = "";
70359 if (_brightness !== 1) {
70360 baseFilter += ` brightness(${_brightness})`;
70362 if (_contrast !== 1) {
70363 baseFilter += ` contrast(${_contrast})`;
70365 if (_saturation !== 1) {
70366 baseFilter += ` saturate(${_saturation})`;
70368 if (_sharpness < 1) {
70369 const blur = number_default(0.5, 5)(1 - _sharpness);
70370 baseFilter += ` blur(${blur}px)`;
70372 let base = selection2.selectAll(".layer-background").data([0]);
70373 base = base.enter().insert("div", ".layer-data").attr("class", "layer layer-background").merge(base);
70374 base.style("filter", baseFilter || null);
70375 let imagery = base.selectAll(".layer-imagery").data([0]);
70376 imagery.enter().append("div").attr("class", "layer layer-imagery").merge(imagery).call(baseLayer);
70377 let maskFilter = "";
70378 let mixBlendMode = "";
70379 if (_sharpness > 1) {
70380 mixBlendMode = "overlay";
70381 maskFilter = "saturate(0) blur(3px) invert(1)";
70382 let contrast = _sharpness - 1;
70383 maskFilter += ` contrast(${contrast})`;
70384 let brightness = number_default(1, 0.85)(_sharpness - 1);
70385 maskFilter += ` brightness(${brightness})`;
70387 let mask = base.selectAll(".layer-unsharp-mask").data(_sharpness > 1 ? [0] : []);
70388 mask.exit().remove();
70389 mask.enter().append("div").attr("class", "layer layer-mask layer-unsharp-mask").merge(mask).call(baseLayer).style("filter", maskFilter || null).style("mix-blend-mode", mixBlendMode || null);
70390 let overlays = selection2.selectAll(".layer-overlay").data(_overlayLayers, (d4) => d4.source().name());
70391 overlays.exit().remove();
70392 overlays.enter().insert("div", ".layer-data").attr("class", "layer layer-overlay").merge(overlays).each((layer, i3, nodes) => select_default2(nodes[i3]).call(layer));
70394 background.updateImagery = function() {
70395 let currSource = baseLayer.source();
70396 if (context.inIntro() || !currSource) return;
70397 let o2 = _overlayLayers.filter((d4) => !d4.source().isLocatorOverlay() && !d4.source().isHidden()).map((d4) => d4.source().id).join(",");
70398 const meters = geoOffsetToMeters(currSource.offset());
70399 const EPSILON = 0.01;
70400 const x2 = +meters[0].toFixed(2);
70401 const y3 = +meters[1].toFixed(2);
70402 let hash2 = utilStringQs(window.location.hash);
70403 let id2 = currSource.id;
70404 if (id2 === "custom") {
70405 id2 = `custom:${currSource.template()}`;
70408 hash2.background = id2;
70410 delete hash2.background;
70413 hash2.overlays = o2;
70415 delete hash2.overlays;
70417 if (Math.abs(x2) > EPSILON || Math.abs(y3) > EPSILON) {
70418 hash2.offset = `${x2},${y3}`;
70420 delete hash2.offset;
70422 window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
70423 let imageryUsed = [];
70424 let photoOverlaysUsed = [];
70425 const currUsed = currSource.imageryUsed();
70426 if (currUsed && _isValid) {
70427 imageryUsed.push(currUsed);
70429 _overlayLayers.filter((d4) => !d4.source().isLocatorOverlay() && !d4.source().isHidden()).forEach((d4) => imageryUsed.push(d4.source().imageryUsed()));
70430 const dataLayer = context.layers().layer("data");
70431 if (dataLayer && dataLayer.enabled() && dataLayer.hasData()) {
70432 imageryUsed.push(dataLayer.getSrc());
70434 const photoOverlayLayers = {
70435 streetside: "Bing Streetside",
70436 mapillary: "Mapillary Images",
70437 "mapillary-map-features": "Mapillary Map Features",
70438 "mapillary-signs": "Mapillary Signs",
70439 kartaview: "KartaView Images",
70440 vegbilder: "Norwegian Road Administration Images",
70441 mapilio: "Mapilio Images",
70442 panoramax: "Panoramax Images"
70444 for (let layerID in photoOverlayLayers) {
70445 const layer = context.layers().layer(layerID);
70446 if (layer && layer.enabled()) {
70447 photoOverlaysUsed.push(layerID);
70448 imageryUsed.push(photoOverlayLayers[layerID]);
70451 context.history().imageryUsed(imageryUsed);
70452 context.history().photoOverlaysUsed(photoOverlaysUsed);
70454 background.sources = (extent, zoom, includeCurrent) => {
70455 if (!_imageryIndex) return [];
70457 (_imageryIndex.query.bbox(extent.rectangle(), true) || []).forEach((d4) => visible[d4.id] = true);
70458 const currSource = baseLayer.source();
70459 const osm = context.connection();
70460 const blocklists = osm && osm.imageryBlocklists() || [];
70461 const blocklistChanged = blocklists.length !== _checkedBlocklists.length || blocklists.some((regex, index) => String(regex) !== _checkedBlocklists[index]);
70462 if (blocklistChanged) {
70463 _imageryIndex.backgrounds.forEach((source) => {
70464 source.isBlocked = blocklists.some((regex) => regex.test(source.template()));
70466 _checkedBlocklists = blocklists.map((regex) => String(regex));
70468 return _imageryIndex.backgrounds.filter((source) => {
70469 if (includeCurrent && currSource === source) return true;
70470 if (source.isBlocked) return false;
70471 if (!source.polygon) return true;
70472 if (zoom && zoom < 6) return false;
70473 return visible[source.id];
70476 background.dimensions = (val) => {
70478 baseLayer.dimensions(val);
70479 _overlayLayers.forEach((layer) => layer.dimensions(val));
70481 background.baseLayerSource = function(d4) {
70482 if (!arguments.length) return baseLayer.source();
70483 const osm = context.connection();
70484 if (!osm) return background;
70485 const blocklists = osm.imageryBlocklists();
70486 const template = d4.template();
70490 for (let i3 = 0; i3 < blocklists.length; i3++) {
70491 regex = blocklists[i3];
70492 fail = regex.test(template);
70497 regex = /.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/;
70498 fail = regex.test(template);
70500 baseLayer.source(!fail ? d4 : background.findSource("none"));
70501 dispatch14.call("change");
70502 background.updateImagery();
70505 background.findSource = (id2) => {
70506 if (!id2 || !_imageryIndex) return null;
70507 return _imageryIndex.backgrounds.find((d4) => d4.id && d4.id === id2);
70509 background.bing = () => {
70510 background.baseLayerSource(background.findSource("Bing"));
70512 background.showsLayer = (d4) => {
70513 const currSource = baseLayer.source();
70514 if (!d4 || !currSource) return false;
70515 return d4.id === currSource.id || _overlayLayers.some((layer) => d4.id === layer.source().id);
70517 background.overlayLayerSources = () => {
70518 return _overlayLayers.map((layer) => layer.source());
70520 background.toggleOverlayLayer = (d4) => {
70522 for (let i3 = 0; i3 < _overlayLayers.length; i3++) {
70523 layer = _overlayLayers[i3];
70524 if (layer.source() === d4) {
70525 _overlayLayers.splice(i3, 1);
70526 dispatch14.call("change");
70527 background.updateImagery();
70531 layer = rendererTileLayer(context).source(d4).projection(context.projection).dimensions(
70532 baseLayer.dimensions()
70534 _overlayLayers.push(layer);
70535 dispatch14.call("change");
70536 background.updateImagery();
70538 background.nudge = (d4, zoom) => {
70539 const currSource = baseLayer.source();
70541 currSource.nudge(d4, zoom);
70542 dispatch14.call("change");
70543 background.updateImagery();
70547 background.offset = function(d4) {
70548 const currSource = baseLayer.source();
70549 if (!arguments.length) {
70550 return currSource && currSource.offset() || [0, 0];
70553 currSource.offset(d4);
70554 dispatch14.call("change");
70555 background.updateImagery();
70559 background.brightness = function(d4) {
70560 if (!arguments.length) return _brightness;
70562 if (context.mode()) dispatch14.call("change");
70565 background.contrast = function(d4) {
70566 if (!arguments.length) return _contrast;
70568 if (context.mode()) dispatch14.call("change");
70571 background.saturation = function(d4) {
70572 if (!arguments.length) return _saturation;
70574 if (context.mode()) dispatch14.call("change");
70577 background.sharpness = function(d4) {
70578 if (!arguments.length) return _sharpness;
70580 if (context.mode()) dispatch14.call("change");
70584 background.ensureLoaded = () => {
70585 if (_loadPromise) return _loadPromise;
70586 return _loadPromise = ensureImageryIndex();
70588 background.init = () => {
70589 const loadPromise = background.ensureLoaded();
70590 const hash2 = utilStringQs(window.location.hash);
70591 const requestedBackground = hash2.background || hash2.layer;
70592 const lastUsedBackground = corePreferences("background-last-used");
70593 return loadPromise.then((imageryIndex) => {
70594 const extent = context.map().extent();
70595 const validBackgrounds = background.sources(extent).filter((d4) => d4.id !== "none" && d4.id !== "custom");
70596 const first = validBackgrounds.length && validBackgrounds[0];
70597 const isLastUsedValid = !!validBackgrounds.find((d4) => d4.id && d4.id === lastUsedBackground);
70599 if (!requestedBackground && extent) {
70600 const viewArea = extent.area();
70601 best = validBackgrounds.find((s2) => {
70602 if (!s2.best() || s2.overlay) return false;
70603 let bbox2 = turf_bbox_default(turf_bbox_clip_default(
70604 { type: "MultiPolygon", coordinates: [s2.polygon || [extent.polygon()]] },
70607 let area = geoExtent(bbox2.slice(0, 2), bbox2.slice(2, 4)).area();
70608 return area / viewArea > 0.5;
70611 if (requestedBackground && requestedBackground.indexOf("custom:") === 0) {
70612 const template = requestedBackground.replace(/^custom:/, "");
70613 const custom = background.findSource("custom");
70614 background.baseLayerSource(custom.template(template));
70615 corePreferences("background-custom-template", template);
70617 background.baseLayerSource(
70618 background.findSource(requestedBackground) || best || isLastUsedValid && background.findSource(lastUsedBackground) || background.findSource("Bing") || first || background.findSource("none")
70621 const locator = imageryIndex.backgrounds.find((d4) => d4.overlay && d4.default);
70623 background.toggleOverlayLayer(locator);
70625 const overlays = (hash2.overlays || "").split(",");
70626 overlays.forEach((overlay) => {
70627 overlay = background.findSource(overlay);
70629 background.toggleOverlayLayer(overlay);
70633 const gpx2 = context.layers().layer("data");
70635 gpx2.url(hash2.gpx, ".gpx");
70638 if (hash2.offset) {
70639 const offset = hash2.offset.replace(/;/g, ",").split(",").map((n3) => !isNaN(n3) && n3);
70640 if (offset.length === 2) {
70641 background.offset(geoMetersToOffset(offset));
70644 }).catch((err) => {
70645 console.error(err);
70648 return utilRebind(background, dispatch14, "on");
70650 var import_which_polygon4, _imageryIndex;
70651 var init_background2 = __esm({
70652 "modules/renderer/background.js"() {
70659 import_which_polygon4 = __toESM(require_which_polygon(), 1);
70660 init_preferences();
70661 init_file_fetcher();
70663 init_background_source();
70667 _imageryIndex = null;
70671 // modules/renderer/features.js
70672 var features_exports = {};
70673 __export(features_exports, {
70674 rendererFeatures: () => rendererFeatures
70676 function rendererFeatures(context) {
70677 var dispatch14 = dispatch_default("change", "redraw");
70678 const features = {};
70679 var _deferred2 = /* @__PURE__ */ new Set();
70680 var traffic_roads = {
70682 "motorway_link": true,
70684 "trunk_link": true,
70686 "primary_link": true,
70688 "secondary_link": true,
70690 "tertiary_link": true,
70691 "residential": true,
70692 "unclassified": true,
70693 "living_street": true,
70696 var service_roads = {
70710 var _cullFactor = 1;
70716 var _forceVisible = {};
70717 function update() {
70718 const hash2 = utilStringQs(window.location.hash);
70719 const disabled = features.disabled();
70720 if (disabled.length) {
70721 hash2.disable_features = disabled.join(",");
70723 delete hash2.disable_features;
70725 window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
70726 corePreferences("disabled-features", disabled.join(","));
70727 _hidden = features.hidden();
70728 dispatch14.call("change");
70729 dispatch14.call("redraw");
70731 function defineRule(k2, filter2, max3) {
70732 var isEnabled = true;
70736 enabled: isEnabled,
70737 // whether the user wants it enabled..
70739 currentMax: max3 || Infinity,
70740 defaultMax: max3 || Infinity,
70741 enable: function() {
70742 this.enabled = true;
70743 this.currentMax = this.defaultMax;
70745 disable: function() {
70746 this.enabled = false;
70747 this.currentMax = 0;
70749 hidden: function() {
70750 return this.count === 0 && !this.enabled || this.count > this.currentMax * _cullFactor;
70752 autoHidden: function() {
70753 return this.hidden() && this.currentMax > 0;
70759 (tags, geometry) => geometry === "point" && isAddressPoint(tags),
70764 (tags, geometry) => geometry === "point" && !isAddressPoint(tags, geometry),
70767 defineRule("traffic_roads", function isTrafficRoad(tags) {
70768 return traffic_roads[tags.highway];
70770 defineRule("service_roads", function isServiceRoad(tags) {
70771 return service_roads[tags.highway];
70773 defineRule("paths", function isPath(tags) {
70774 return paths[tags.highway];
70776 defineRule("buildings", function isBuilding(tags) {
70777 return !!tags.building && tags.building !== "no" || tags.parking === "multi-storey" || tags.parking === "sheds" || tags.parking === "carports" || tags.parking === "garage_boxes";
70779 defineRule("building_parts", function isBuildingPart(tags) {
70780 return !!tags["building:part"];
70782 defineRule("indoor", function isIndoor(tags) {
70783 return !!tags.indoor && tags.indoor !== "no" || !!tags.indoormark && tags.indoormark !== "no";
70785 defineRule("landuse", function isLanduse(tags, geometry) {
70786 if (geometry !== "area") return false;
70787 let hasLanduseTag = false;
70788 for (const key in osmLanduseTags) {
70789 if (osmLanduseTags[key] === true && tags[key] || osmLanduseTags[key][tags[key]] === true) {
70790 hasLanduseTag = true;
70793 return hasLanduseTag && !_rules.buildings.filter(tags) && !_rules.building_parts.filter(tags) && !_rules.indoor.filter(tags) && !_rules.water.filter(tags) && !_rules.pistes.filter(tags);
70795 defineRule("boundaries", function isBoundary(tags, geometry) {
70796 return (geometry === "line" && !!tags.boundary || geometry === "relation" && tags.type === "boundary") && !(traffic_roads[tags.highway] || service_roads[tags.highway] || paths[tags.highway] || tags.waterway || tags.railway || tags.landuse || tags.natural || tags.building || tags.power);
70798 defineRule("water", function isWater(tags) {
70799 return !!tags.waterway || tags.natural === "water" || tags.natural === "coastline" || tags.natural === "bay" || tags.landuse === "pond" || tags.landuse === "basin" || tags.landuse === "reservoir" || tags.landuse === "salt_pond";
70801 defineRule("rail", function isRail(tags) {
70802 return (!!tags.railway || tags.landuse === "railway") && !(traffic_roads[tags.highway] || service_roads[tags.highway] || paths[tags.highway]);
70804 defineRule("pistes", function isPiste(tags) {
70805 return tags["piste:type"];
70807 defineRule("aerialways", function isAerialways(tags) {
70808 return !!(tags == null ? void 0 : tags.aerialway) && tags.aerialway !== "yes" && tags.aerialway !== "station";
70810 defineRule("power", function isPower(tags) {
70811 return !!tags.power;
70813 defineRule("past_future", function isPastFuture(tags) {
70814 if (traffic_roads[tags.highway] || service_roads[tags.highway] || paths[tags.highway]) {
70817 const keys2 = Object.keys(tags);
70818 for (const key of keys2) {
70819 if (osmLifecyclePrefixes[tags[key]]) return true;
70820 const parts = key.split(":");
70821 if (parts.length === 1) continue;
70822 const prefix = parts[0];
70823 if (osmLifecyclePrefixes[prefix]) return true;
70827 defineRule("others", function isOther(tags, geometry) {
70828 return geometry === "line" || geometry === "area";
70830 features.features = function() {
70833 features.keys = function() {
70836 features.enabled = function(k2) {
70837 if (!arguments.length) {
70838 return _keys.filter(function(k3) {
70839 return _rules[k3].enabled;
70842 return _rules[k2] && _rules[k2].enabled;
70844 features.disabled = function(k2) {
70845 if (!arguments.length) {
70846 return _keys.filter(function(k3) {
70847 return !_rules[k3].enabled;
70850 return _rules[k2] && !_rules[k2].enabled;
70852 features.hidden = function(k2) {
70854 if (!arguments.length) {
70855 return _keys.filter(function(k3) {
70856 return _rules[k3].hidden();
70859 return (_a4 = _rules[k2]) == null ? void 0 : _a4.hidden();
70861 features.autoHidden = function(k2) {
70862 if (!arguments.length) {
70863 return _keys.filter(function(k3) {
70864 return _rules[k3].autoHidden();
70867 return _rules[k2] && _rules[k2].autoHidden();
70869 features.enable = function(k2) {
70870 if (_rules[k2] && !_rules[k2].enabled) {
70871 _rules[k2].enable();
70875 features.enableAll = function() {
70876 var didEnable = false;
70877 for (var k2 in _rules) {
70878 if (!_rules[k2].enabled) {
70880 _rules[k2].enable();
70883 if (didEnable) update();
70885 features.disable = function(k2) {
70886 if (_rules[k2] && _rules[k2].enabled) {
70887 _rules[k2].disable();
70891 features.disableAll = function() {
70892 var didDisable = false;
70893 for (var k2 in _rules) {
70894 if (_rules[k2].enabled) {
70896 _rules[k2].disable();
70899 if (didDisable) update();
70901 features.toggle = function(k2) {
70904 return f2.enabled ? f2.disable() : f2.enable();
70909 features.resetStats = function() {
70910 for (var i3 = 0; i3 < _keys.length; i3++) {
70911 _rules[_keys[i3]].count = 0;
70913 dispatch14.call("change");
70915 features.gatherStats = function(d4, resolver, dimensions) {
70916 var needsRedraw = false;
70917 var types = utilArrayGroupBy(d4, "type");
70918 var entities = [].concat(types.relation || [], types.way || [], types.node || []);
70919 var currHidden, geometry, matches, i3, j3;
70920 for (i3 = 0; i3 < _keys.length; i3++) {
70921 _rules[_keys[i3]].count = 0;
70923 _cullFactor = dimensions[0] * dimensions[1] / 1e6;
70924 for (i3 = 0; i3 < entities.length; i3++) {
70925 geometry = entities[i3].geometry(resolver);
70926 matches = Object.keys(features.getMatches(entities[i3], resolver, geometry));
70927 for (j3 = 0; j3 < matches.length; j3++) {
70928 _rules[matches[j3]].count++;
70931 currHidden = features.hidden();
70932 if (currHidden !== _hidden) {
70933 _hidden = currHidden;
70934 needsRedraw = true;
70935 dispatch14.call("change");
70937 return needsRedraw;
70939 features.stats = function() {
70940 for (var i3 = 0; i3 < _keys.length; i3++) {
70941 _stats[_keys[i3]] = _rules[_keys[i3]].count;
70945 features.clear = function(d4) {
70946 for (var i3 = 0; i3 < d4.length; i3++) {
70947 features.clearEntity(d4[i3]);
70950 features.clearEntity = function(entity) {
70951 delete _cache5[osmEntity.key(entity)];
70952 for (const key in _cache5) {
70953 if (_cache5[key].parents) {
70954 for (const parent2 of _cache5[key].parents) {
70955 if (parent2.id === entity.id) {
70956 delete _cache5[key];
70963 features.reset = function() {
70964 Array.from(_deferred2).forEach(function(handle) {
70965 window.cancelIdleCallback(handle);
70966 _deferred2.delete(handle);
70970 function relationShouldBeChecked(relation) {
70971 return relation.tags.type === "boundary";
70973 features.getMatches = function(entity, resolver, geometry) {
70974 if (geometry === "vertex" || geometry === "relation" && !relationShouldBeChecked(entity)) return {};
70975 var ent = osmEntity.key(entity);
70976 if (!_cache5[ent]) {
70979 if (!_cache5[ent].matches) {
70981 var hasMatch = false;
70982 for (var i3 = 0; i3 < _keys.length; i3++) {
70983 if (_keys[i3] === "others") {
70984 if (hasMatch) continue;
70985 if (entity.type === "way") {
70986 var parents = features.getParents(entity, resolver, geometry);
70987 if (parents.length === 1 && parents[0].isMultipolygon() || // 2b. or belongs only to boundary relations
70988 parents.length > 0 && parents.every(function(parent2) {
70989 return parent2.tags.type === "boundary";
70991 var pkey = osmEntity.key(parents[0]);
70992 if (_cache5[pkey] && _cache5[pkey].matches) {
70993 matches = Object.assign({}, _cache5[pkey].matches);
70999 if (_rules[_keys[i3]].filter(entity.tags, geometry)) {
71000 matches[_keys[i3]] = hasMatch = true;
71003 _cache5[ent].matches = matches;
71005 return _cache5[ent].matches;
71007 features.getParents = function(entity, resolver, geometry) {
71008 if (geometry === "point") return [];
71009 const ent = osmEntity.key(entity);
71010 if (!_cache5[ent]) {
71013 if (!_cache5[ent].parents) {
71015 if (geometry === "vertex") {
71016 parents = resolver.parentWays(entity);
71018 parents = resolver.parentRelations(entity);
71020 _cache5[ent].parents = parents;
71022 return _cache5[ent].parents;
71024 features.isHiddenPreset = function(preset, geometry) {
71025 if (!_hidden.length) return false;
71026 if (!preset.tags) return false;
71027 var test = preset.setTags({}, geometry);
71028 for (var key in _rules) {
71029 if (_rules[key].filter(test, geometry)) {
71030 if (_hidden.indexOf(key) !== -1) {
71038 features.isHiddenFeature = function(entity, resolver, geometry) {
71039 if (!_hidden.length) return false;
71040 if (!entity.version) return false;
71041 if (_forceVisible[entity.id]) return false;
71042 var matches = Object.keys(features.getMatches(entity, resolver, geometry));
71043 return matches.length && matches.every(function(k2) {
71044 return features.hidden(k2);
71047 features.isHiddenChild = function(entity, resolver, geometry) {
71048 if (!_hidden.length) return false;
71049 if (!entity.version || geometry === "point") return false;
71050 if (_forceVisible[entity.id]) return false;
71051 var parents = features.getParents(entity, resolver, geometry);
71052 if (!parents.length) return false;
71053 for (var i3 = 0; i3 < parents.length; i3++) {
71054 if (!features.isHidden(parents[i3], resolver, parents[i3].geometry(resolver))) {
71060 features.hasHiddenConnections = function(entity, resolver) {
71061 if (!_hidden.length) return false;
71062 var childNodes, connections;
71063 if (entity.type === "midpoint") {
71064 childNodes = [resolver.entity(entity.edge[0]), resolver.entity(entity.edge[1])];
71067 childNodes = entity.nodes ? resolver.childNodes(entity) : [];
71068 connections = features.getParents(entity, resolver, entity.geometry(resolver));
71070 connections = childNodes.reduce(function(result, e3) {
71071 return resolver.isShared(e3) ? utilArrayUnion(result, resolver.parentWays(e3)) : result;
71073 return connections.some(function(e3) {
71074 return features.isHidden(e3, resolver, e3.geometry(resolver));
71077 features.isHidden = function(entity, resolver, geometry) {
71078 if (!_hidden.length) return false;
71079 if (!entity.version) return false;
71080 var fn = geometry === "vertex" ? features.isHiddenChild : features.isHiddenFeature;
71081 return fn(entity, resolver, geometry);
71083 features.filter = function(d4, resolver) {
71084 if (!_hidden.length) return d4;
71086 for (var i3 = 0; i3 < d4.length; i3++) {
71087 var entity = d4[i3];
71088 if (!features.isHidden(entity, resolver, entity.geometry(resolver))) {
71089 result.push(entity);
71094 features.forceVisible = function(entityIDs) {
71095 if (!arguments.length) return Object.keys(_forceVisible);
71096 _forceVisible = {};
71097 for (var i3 = 0; i3 < entityIDs.length; i3++) {
71098 _forceVisible[entityIDs[i3]] = true;
71099 var entity = context.hasEntity(entityIDs[i3]);
71100 if (entity && entity.type === "relation") {
71101 for (var j3 in entity.members) {
71102 _forceVisible[entity.members[j3].id] = true;
71108 features.init = function() {
71109 var storage = corePreferences("disabled-features");
71111 var storageDisabled = storage.replace(/;/g, ",").split(",");
71112 storageDisabled.forEach(features.disable);
71114 var hash2 = utilStringQs(window.location.hash);
71115 if (hash2.disable_features) {
71116 var hashDisabled = hash2.disable_features.replace(/;/g, ",").split(",");
71117 hashDisabled.forEach(features.disable);
71120 context.history().on("merge.features", function(newEntities) {
71121 if (!newEntities) return;
71122 var handle = window.requestIdleCallback(function() {
71123 var graph = context.graph();
71124 var types = utilArrayGroupBy(newEntities, "type");
71125 var entities = [].concat(types.relation || [], types.way || [], types.node || []);
71126 for (var i3 = 0; i3 < entities.length; i3++) {
71127 var geometry = entities[i3].geometry(graph);
71128 features.getMatches(entities[i3], graph, geometry);
71131 _deferred2.add(handle);
71133 return utilRebind(features, dispatch14, "on");
71135 var init_features = __esm({
71136 "modules/renderer/features.js"() {
71139 init_preferences();
71148 // modules/util/bind_once.js
71149 var bind_once_exports = {};
71150 __export(bind_once_exports, {
71151 utilBindOnce: () => utilBindOnce
71153 function utilBindOnce(target, type2, listener, capture) {
71154 var typeOnce = type2 + ".once";
71156 target.on(typeOnce, null);
71157 listener.apply(this, arguments);
71159 target.on(typeOnce, one2, capture);
71162 var init_bind_once = __esm({
71163 "modules/util/bind_once.js"() {
71168 // modules/util/zoom_pan.js
71169 var zoom_pan_exports = {};
71170 __export(zoom_pan_exports, {
71171 utilZoomPan: () => utilZoomPan
71173 function defaultFilter3(d3_event) {
71174 return !d3_event.ctrlKey && !d3_event.button;
71176 function defaultExtent2() {
71178 if (e3 instanceof SVGElement) {
71179 e3 = e3.ownerSVGElement || e3;
71180 if (e3.hasAttribute("viewBox")) {
71181 e3 = e3.viewBox.baseVal;
71182 return [[e3.x, e3.y], [e3.x + e3.width, e3.y + e3.height]];
71184 return [[0, 0], [e3.width.baseVal.value, e3.height.baseVal.value]];
71186 return [[0, 0], [e3.clientWidth, e3.clientHeight]];
71188 function defaultWheelDelta2(d3_event) {
71189 return -d3_event.deltaY * (d3_event.deltaMode === 1 ? 0.05 : d3_event.deltaMode ? 1 : 2e-3);
71191 function defaultConstrain2(transform2, extent, translateExtent) {
71192 var dx0 = transform2.invertX(extent[0][0]) - translateExtent[0][0], dx1 = transform2.invertX(extent[1][0]) - translateExtent[1][0], dy0 = transform2.invertY(extent[0][1]) - translateExtent[0][1], dy1 = transform2.invertY(extent[1][1]) - translateExtent[1][1];
71193 return transform2.translate(
71194 dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
71195 dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
71198 function utilZoomPan() {
71199 var filter2 = defaultFilter3, extent = defaultExtent2, constrain = defaultConstrain2, wheelDelta = defaultWheelDelta2, scaleExtent = [0, Infinity], translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], interpolate = zoom_default, dispatch14 = dispatch_default("start", "zoom", "end"), _wheelDelay = 150, _transform = identity2, _activeGesture;
71200 function zoom(selection2) {
71201 selection2.on("pointerdown.zoom", pointerdown).on("wheel.zoom", wheeled).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
71202 select_default2(window).on("pointermove.zoompan", pointermove).on("pointerup.zoompan pointercancel.zoompan", pointerup);
71204 zoom.transform = function(collection, transform2, point) {
71205 var selection2 = collection.selection ? collection.selection() : collection;
71206 if (collection !== selection2) {
71207 schedule(collection, transform2, point);
71209 selection2.interrupt().each(function() {
71210 gesture(this, arguments).start(null).zoom(null, null, typeof transform2 === "function" ? transform2.apply(this, arguments) : transform2).end(null);
71214 zoom.scaleBy = function(selection2, k2, p2) {
71215 zoom.scaleTo(selection2, function() {
71216 var k0 = _transform.k, k1 = typeof k2 === "function" ? k2.apply(this, arguments) : k2;
71220 zoom.scaleTo = function(selection2, k2, p2) {
71221 zoom.transform(selection2, function() {
71222 var e3 = extent.apply(this, arguments), t02 = _transform, p02 = !p2 ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2, p1 = t02.invert(p02), k1 = typeof k2 === "function" ? k2.apply(this, arguments) : k2;
71223 return constrain(translate(scale(t02, k1), p02, p1), e3, translateExtent);
71226 zoom.translateBy = function(selection2, x2, y3) {
71227 zoom.transform(selection2, function() {
71228 return constrain(_transform.translate(
71229 typeof x2 === "function" ? x2.apply(this, arguments) : x2,
71230 typeof y3 === "function" ? y3.apply(this, arguments) : y3
71231 ), extent.apply(this, arguments), translateExtent);
71234 zoom.translateTo = function(selection2, x2, y3, p2) {
71235 zoom.transform(selection2, function() {
71236 var e3 = extent.apply(this, arguments), t2 = _transform, p02 = !p2 ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2;
71237 return constrain(identity2.translate(p02[0], p02[1]).scale(t2.k).translate(
71238 typeof x2 === "function" ? -x2.apply(this, arguments) : -x2,
71239 typeof y3 === "function" ? -y3.apply(this, arguments) : -y3
71240 ), e3, translateExtent);
71243 function scale(transform2, k2) {
71244 k2 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k2));
71245 return k2 === transform2.k ? transform2 : new Transform(k2, transform2.x, transform2.y);
71247 function translate(transform2, p02, p1) {
71248 var x2 = p02[0] - p1[0] * transform2.k, y3 = p02[1] - p1[1] * transform2.k;
71249 return x2 === transform2.x && y3 === transform2.y ? transform2 : new Transform(transform2.k, x2, y3);
71251 function centroid(extent2) {
71252 return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
71254 function schedule(transition2, transform2, point) {
71255 transition2.on("start.zoom", function() {
71256 gesture(this, arguments).start(null);
71257 }).on("interrupt.zoom end.zoom", function() {
71258 gesture(this, arguments).end(null);
71259 }).tween("zoom", function() {
71260 var that = this, args = arguments, g3 = gesture(that, args), e3 = extent.apply(that, args), p2 = !point ? centroid(e3) : typeof point === "function" ? point.apply(that, args) : point, w3 = Math.max(e3[1][0] - e3[0][0], e3[1][1] - e3[0][1]), a2 = _transform, b3 = typeof transform2 === "function" ? transform2.apply(that, args) : transform2, i3 = interpolate(a2.invert(p2).concat(w3 / a2.k), b3.invert(p2).concat(w3 / b3.k));
71261 return function(t2) {
71266 var k2 = w3 / l4[2];
71267 t2 = new Transform(k2, p2[0] - l4[0] * k2, p2[1] - l4[1] * k2);
71269 g3.zoom(null, null, t2);
71273 function gesture(that, args, clean2) {
71274 return !clean2 && _activeGesture || new Gesture(that, args);
71276 function Gesture(that, args) {
71280 this.extent = extent.apply(that, args);
71282 Gesture.prototype = {
71283 start: function(d3_event) {
71284 if (++this.active === 1) {
71285 _activeGesture = this;
71286 dispatch14.call("start", this, d3_event);
71290 zoom: function(d3_event, key, transform2) {
71291 if (this.mouse && key !== "mouse") this.mouse[1] = transform2.invert(this.mouse[0]);
71292 if (this.pointer0 && key !== "touch") this.pointer0[1] = transform2.invert(this.pointer0[0]);
71293 if (this.pointer1 && key !== "touch") this.pointer1[1] = transform2.invert(this.pointer1[0]);
71294 _transform = transform2;
71295 dispatch14.call("zoom", this, d3_event, key, transform2);
71298 end: function(d3_event) {
71299 if (--this.active === 0) {
71300 _activeGesture = null;
71301 dispatch14.call("end", this, d3_event);
71306 function wheeled(d3_event) {
71307 if (!filter2.apply(this, arguments)) return;
71308 var g3 = gesture(this, arguments), t2 = _transform, k2 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t2.k * Math.pow(2, wheelDelta.apply(this, arguments)))), p2 = utilFastMouse(this)(d3_event);
71310 if (g3.mouse[0][0] !== p2[0] || g3.mouse[0][1] !== p2[1]) {
71311 g3.mouse[1] = t2.invert(g3.mouse[0] = p2);
71313 clearTimeout(g3.wheel);
71315 g3.mouse = [p2, t2.invert(p2)];
71316 interrupt_default(this);
71317 g3.start(d3_event);
71319 d3_event.preventDefault();
71320 d3_event.stopImmediatePropagation();
71321 g3.wheel = setTimeout(wheelidled, _wheelDelay);
71322 g3.zoom(d3_event, "mouse", constrain(translate(scale(t2, k2), g3.mouse[0], g3.mouse[1]), g3.extent, translateExtent));
71323 function wheelidled() {
71328 var _downPointerIDs = /* @__PURE__ */ new Set();
71329 var _pointerLocGetter;
71330 function pointerdown(d3_event) {
71331 _downPointerIDs.add(d3_event.pointerId);
71332 if (!filter2.apply(this, arguments)) return;
71333 var g3 = gesture(this, arguments, _downPointerIDs.size === 1);
71335 d3_event.stopImmediatePropagation();
71336 _pointerLocGetter = utilFastMouse(this);
71337 var loc = _pointerLocGetter(d3_event);
71338 var p2 = [loc, _transform.invert(loc), d3_event.pointerId];
71339 if (!g3.pointer0) {
71342 } else if (!g3.pointer1 && g3.pointer0[2] !== p2[2]) {
71346 interrupt_default(this);
71347 g3.start(d3_event);
71350 function pointermove(d3_event) {
71351 if (!_downPointerIDs.has(d3_event.pointerId)) return;
71352 if (!_activeGesture || !_pointerLocGetter) return;
71353 var g3 = gesture(this, arguments);
71354 var isPointer0 = g3.pointer0 && g3.pointer0[2] === d3_event.pointerId;
71355 var isPointer1 = !isPointer0 && g3.pointer1 && g3.pointer1[2] === d3_event.pointerId;
71356 if ((isPointer0 || isPointer1) && "buttons" in d3_event && !d3_event.buttons) {
71357 if (g3.pointer0) _downPointerIDs.delete(g3.pointer0[2]);
71358 if (g3.pointer1) _downPointerIDs.delete(g3.pointer1[2]);
71362 d3_event.preventDefault();
71363 d3_event.stopImmediatePropagation();
71364 var loc = _pointerLocGetter(d3_event);
71366 if (isPointer0) g3.pointer0[0] = loc;
71367 else if (isPointer1) g3.pointer1[0] = loc;
71370 var p02 = g3.pointer0[0], l0 = g3.pointer0[1], p1 = g3.pointer1[0], l1 = g3.pointer1[1], dp = (dp = p1[0] - p02[0]) * dp + (dp = p1[1] - p02[1]) * dp, dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
71371 t2 = scale(t2, Math.sqrt(dp / dl));
71372 p2 = [(p02[0] + p1[0]) / 2, (p02[1] + p1[1]) / 2];
71373 l4 = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
71374 } else if (g3.pointer0) {
71375 p2 = g3.pointer0[0];
71376 l4 = g3.pointer0[1];
71380 g3.zoom(d3_event, "touch", constrain(translate(t2, p2, l4), g3.extent, translateExtent));
71382 function pointerup(d3_event) {
71383 if (!_downPointerIDs.has(d3_event.pointerId)) return;
71384 _downPointerIDs.delete(d3_event.pointerId);
71385 if (!_activeGesture) return;
71386 var g3 = gesture(this, arguments);
71387 d3_event.stopImmediatePropagation();
71388 if (g3.pointer0 && g3.pointer0[2] === d3_event.pointerId) delete g3.pointer0;
71389 else if (g3.pointer1 && g3.pointer1[2] === d3_event.pointerId) delete g3.pointer1;
71390 if (g3.pointer1 && !g3.pointer0) {
71391 g3.pointer0 = g3.pointer1;
71392 delete g3.pointer1;
71395 g3.pointer0[1] = _transform.invert(g3.pointer0[0]);
71400 zoom.wheelDelta = function(_3) {
71401 return arguments.length ? (wheelDelta = utilFunctor(+_3), zoom) : wheelDelta;
71403 zoom.filter = function(_3) {
71404 return arguments.length ? (filter2 = utilFunctor(!!_3), zoom) : filter2;
71406 zoom.extent = function(_3) {
71407 return arguments.length ? (extent = utilFunctor([[+_3[0][0], +_3[0][1]], [+_3[1][0], +_3[1][1]]]), zoom) : extent;
71409 zoom.scaleExtent = function(_3) {
71410 return arguments.length ? (scaleExtent[0] = +_3[0], scaleExtent[1] = +_3[1], zoom) : [scaleExtent[0], scaleExtent[1]];
71412 zoom.translateExtent = function(_3) {
71413 return arguments.length ? (translateExtent[0][0] = +_3[0][0], translateExtent[1][0] = +_3[1][0], translateExtent[0][1] = +_3[0][1], translateExtent[1][1] = +_3[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];
71415 zoom.constrain = function(_3) {
71416 return arguments.length ? (constrain = _3, zoom) : constrain;
71418 zoom.interpolate = function(_3) {
71419 return arguments.length ? (interpolate = _3, zoom) : interpolate;
71421 zoom._transform = function(_3) {
71422 return arguments.length ? (_transform = _3, zoom) : _transform;
71424 return utilRebind(zoom, dispatch14, "on");
71426 var init_zoom_pan = __esm({
71427 "modules/util/zoom_pan.js"() {
71440 // modules/util/double_up.js
71441 var double_up_exports = {};
71442 __export(double_up_exports, {
71443 utilDoubleUp: () => utilDoubleUp
71445 function utilDoubleUp() {
71446 var dispatch14 = dispatch_default("doubleUp");
71447 var _maxTimespan = 500;
71448 var _maxDistance = 20;
71450 function pointerIsValidFor(loc) {
71451 return (/* @__PURE__ */ new Date()).getTime() - _pointer.startTime <= _maxTimespan && // all pointer events must occur within a small distance of the first pointerdown
71452 geoVecLength(_pointer.startLoc, loc) <= _maxDistance;
71454 function pointerdown(d3_event) {
71455 if (d3_event.ctrlKey || d3_event.button === 2) return;
71456 var loc = [d3_event.clientX, d3_event.clientY];
71457 if (_pointer && !pointerIsValidFor(loc)) {
71463 startTime: (/* @__PURE__ */ new Date()).getTime(),
71465 pointerId: d3_event.pointerId
71468 _pointer.pointerId = d3_event.pointerId;
71471 function pointerup(d3_event) {
71472 if (d3_event.ctrlKey || d3_event.button === 2) return;
71473 if (!_pointer || _pointer.pointerId !== d3_event.pointerId) return;
71474 _pointer.upCount += 1;
71475 if (_pointer.upCount === 2) {
71476 var loc = [d3_event.clientX, d3_event.clientY];
71477 if (pointerIsValidFor(loc)) {
71478 var locInThis = utilFastMouse(this)(d3_event);
71479 dispatch14.call("doubleUp", this, d3_event, locInThis);
71484 function doubleUp(selection2) {
71485 if ("PointerEvent" in window) {
71486 selection2.on("pointerdown.doubleUp", pointerdown).on("pointerup.doubleUp", pointerup);
71488 selection2.on("dblclick.doubleUp", function(d3_event) {
71489 dispatch14.call("doubleUp", this, d3_event, utilFastMouse(this)(d3_event));
71493 doubleUp.off = function(selection2) {
71494 selection2.on("pointerdown.doubleUp", null).on("pointerup.doubleUp", null).on("dblclick.doubleUp", null);
71496 return utilRebind(doubleUp, dispatch14, "on");
71498 var init_double_up = __esm({
71499 "modules/util/double_up.js"() {
71508 // modules/renderer/map.js
71509 var map_exports = {};
71510 __export(map_exports, {
71511 rendererMap: () => rendererMap
71513 function rendererMap(context) {
71514 var dispatch14 = dispatch_default(
71517 "crossEditableZoom",
71519 "changeHighlighting",
71522 var projection2 = context.projection;
71523 var curtainProjection = context.curtainProjection;
71531 var _selection = select_default2(null);
71532 var supersurface = select_default2(null);
71533 var wrapper = select_default2(null);
71534 var surface = select_default2(null);
71535 var _dimensions = [1, 1];
71536 var _dblClickZoomEnabled = true;
71537 var _redrawEnabled = true;
71538 var _gestureTransformStart;
71539 var _transformStart = projection2.transform();
71540 var _transformLast;
71541 var _isTransformed = false;
71543 var _getMouseCoords;
71544 var _lastPointerEvent;
71545 var _lastWithinEditableZoom;
71546 var _pointerDown = false;
71547 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
71548 var _zoomerPannerFunction = "PointerEvent" in window ? utilZoomPan : zoom_default2;
71549 var _zoomerPanner = _zoomerPannerFunction().scaleExtent([kMin, kMax]).interpolate(value_default).filter(zoomEventFilter).on("zoom.map", zoomPan2).on("start.map", function(d3_event) {
71550 _pointerDown = d3_event && (d3_event.type === "pointerdown" || d3_event.sourceEvent && d3_event.sourceEvent.type === "pointerdown");
71551 }).on("end.map", function() {
71552 _pointerDown = false;
71554 var _doubleUpHandler = utilDoubleUp();
71555 var scheduleRedraw = throttle_default(redraw, 750);
71556 function cancelPendingRedraw() {
71557 scheduleRedraw.cancel();
71559 function map2(selection2) {
71560 _selection = selection2;
71561 context.on("change.map", immediateRedraw);
71562 var osm = context.connection();
71564 osm.on("change.map", immediateRedraw);
71566 function didUndoOrRedo(targetTransform) {
71567 var mode = context.mode().id;
71568 if (mode !== "browse" && mode !== "select") return;
71569 if (targetTransform) {
71570 map2.transformEase(targetTransform);
71573 context.history().on("merge.map", function() {
71575 }).on("change.map", immediateRedraw).on("undone.map", function(stack, fromStack) {
71576 didUndoOrRedo(fromStack.transform);
71577 }).on("redone.map", function(stack) {
71578 didUndoOrRedo(stack.transform);
71580 context.background().on("change.map", immediateRedraw);
71581 context.features().on("redraw.map", immediateRedraw);
71582 drawLayers.on("change.map", function() {
71583 context.background().updateImagery();
71586 selection2.on("wheel.map mousewheel.map", function(d3_event) {
71587 d3_event.preventDefault();
71588 }).call(_zoomerPanner).call(_zoomerPanner.transform, projection2.transform()).on("dblclick.zoom", null);
71589 map2.supersurface = supersurface = selection2.append("div").attr("class", "supersurface").call(utilSetTransform, 0, 0);
71590 wrapper = supersurface.append("div").attr("class", "layer layer-data");
71591 map2.surface = surface = wrapper.call(drawLayers).selectAll(".surface");
71592 surface.call(drawLabels.observe).call(_doubleUpHandler).on(_pointerPrefix + "down.zoom", function(d3_event) {
71593 _lastPointerEvent = d3_event;
71594 if (d3_event.button === 2) {
71595 d3_event.stopPropagation();
71597 }, true).on(_pointerPrefix + "up.zoom", function(d3_event) {
71598 _lastPointerEvent = d3_event;
71599 if (resetTransform()) {
71602 }).on(_pointerPrefix + "move.map", function(d3_event) {
71603 _lastPointerEvent = d3_event;
71604 }).on(_pointerPrefix + "over.vertices", function(d3_event) {
71605 if (map2.editableDataEnabled() && !_isTransformed) {
71606 var hover = d3_event.target.__data__;
71607 surface.call(drawVertices.drawHover, context.graph(), hover, map2.extent());
71608 dispatch14.call("drawn", this, { full: false });
71610 }).on(_pointerPrefix + "out.vertices", function(d3_event) {
71611 if (map2.editableDataEnabled() && !_isTransformed) {
71612 var hover = d3_event.relatedTarget && d3_event.relatedTarget.__data__;
71613 surface.call(drawVertices.drawHover, context.graph(), hover, map2.extent());
71614 dispatch14.call("drawn", this, { full: false });
71617 var detected = utilDetect();
71618 if ("GestureEvent" in window && // Listening for gesture events on iOS 13.4+ breaks double-tapping,
71619 // but we only need to do this on desktop Safari anyway. – #7694
71620 !detected.isMobileWebKit) {
71621 surface.on("gesturestart.surface", function(d3_event) {
71622 d3_event.preventDefault();
71623 _gestureTransformStart = projection2.transform();
71624 }).on("gesturechange.surface", gestureChange);
71627 _doubleUpHandler.on("doubleUp.map", function(d3_event, p02) {
71628 if (!_dblClickZoomEnabled) return;
71629 if (typeof d3_event.target.__data__ === "object" && // or area fills
71630 !select_default2(d3_event.target).classed("fill")) return;
71631 var zoomOut2 = d3_event.shiftKey;
71632 var t2 = projection2.transform();
71633 var p1 = t2.invert(p02);
71634 t2 = t2.scale(zoomOut2 ? 0.5 : 2);
71635 t2.x = p02[0] - p1[0] * t2.k;
71636 t2.y = p02[1] - p1[1] * t2.k;
71637 map2.transformEase(t2);
71639 context.on("enter.map", function() {
71640 if (!map2.editableDataEnabled(
71642 /* skip zoom check */
71644 if (_isTransformed) return;
71645 var graph = context.graph();
71646 var selectedAndParents = {};
71647 context.selectedIDs().forEach(function(id2) {
71648 var entity = graph.hasEntity(id2);
71650 selectedAndParents[entity.id] = entity;
71651 if (entity.type === "node") {
71652 graph.parentWays(entity).forEach(function(parent2) {
71653 selectedAndParents[parent2.id] = parent2;
71658 var data = Object.values(selectedAndParents);
71659 var filter2 = function(d4) {
71660 return d4.id in selectedAndParents;
71662 data = context.features().filter(data, graph);
71663 surface.call(drawVertices.drawSelected, graph, map2.extent()).call(drawLines, graph, data, filter2).call(drawAreas, graph, data, filter2).call(drawMidpoints, graph, data, filter2, map2.trimmedExtent());
71664 dispatch14.call("drawn", this, { full: false });
71667 map2.dimensions(utilGetDimensions(selection2));
71669 function zoomEventFilter(d3_event) {
71670 if (d3_event.type === "mousedown") {
71671 var hasOrphan = false;
71672 var listeners = window.__on;
71673 for (var i3 = 0; i3 < listeners.length; i3++) {
71674 var listener = listeners[i3];
71675 if (listener.name === "zoom" && listener.type === "mouseup") {
71681 var event = window.CustomEvent;
71683 event = new event("mouseup");
71685 event = window.document.createEvent("Event");
71686 event.initEvent("mouseup", false, false);
71688 event.view = window;
71689 window.dispatchEvent(event);
71692 return d3_event.button !== 2;
71694 function pxCenter() {
71695 return [_dimensions[0] / 2, _dimensions[1] / 2];
71697 function drawEditable(difference2, extent) {
71698 var mode = context.mode();
71699 var graph = context.graph();
71700 var features = context.features();
71701 var all = context.history().intersects(map2.extent());
71702 var fullRedraw = false;
71706 var applyFeatureLayerFilters = true;
71707 if (map2.isInWideSelection()) {
71709 utilEntityAndDeepMemberIDs(mode.selectedIDs(), context.graph()).forEach(function(id2) {
71710 var entity = context.hasEntity(id2);
71711 if (entity) data.push(entity);
71714 filter2 = utilFunctor(true);
71715 applyFeatureLayerFilters = false;
71716 } else if (difference2) {
71717 var complete = difference2.complete(map2.extent());
71718 data = Object.values(complete).filter(Boolean);
71719 set4 = new Set(Object.keys(complete));
71720 filter2 = function(d4) {
71721 return set4.has(d4.id);
71723 features.clear(data);
71725 if (features.gatherStats(all, graph, _dimensions)) {
71729 data = context.history().intersects(map2.extent().intersection(extent));
71730 set4 = new Set(data.map(function(entity) {
71733 filter2 = function(d4) {
71734 return set4.has(d4.id);
71739 filter2 = utilFunctor(true);
71742 if (applyFeatureLayerFilters) {
71743 data = features.filter(data, graph);
71745 context.features().resetStats();
71747 if (mode && mode.id === "select") {
71748 surface.call(drawVertices.drawSelected, graph, map2.extent());
71750 surface.call(drawVertices, graph, data, filter2, map2.extent(), fullRedraw).call(drawLines, graph, data, filter2).call(drawAreas, graph, data, filter2).call(drawMidpoints, graph, data, filter2, map2.trimmedExtent()).call(drawPoints, graph, data, filter2).call(drawLabels, graph, data, filter2, _dimensions, fullRedraw);
71751 dispatch14.call("drawn", this, { full: true });
71753 map2.init = function() {
71754 drawLayers = svgLayers(projection2, context);
71755 drawPoints = svgPoints(projection2, context);
71756 drawVertices = svgVertices(projection2, context);
71757 drawLines = svgLines(projection2, context);
71758 drawAreas = svgAreas(projection2, context);
71759 drawMidpoints = svgMidpoints(projection2, context);
71760 drawLabels = svgLabels(projection2, context);
71762 function editOff() {
71763 context.features().resetStats();
71764 surface.selectAll(".layer-osm *").remove();
71765 surface.selectAll(".layer-touch:not(.markers) *").remove();
71769 "select-note": true,
71770 "select-data": true,
71771 "select-error": true
71773 var mode = context.mode();
71774 if (mode && !allowed[mode.id]) {
71775 context.enter(modeBrowse(context));
71777 dispatch14.call("drawn", this, { full: true });
71779 function gestureChange(d3_event) {
71781 e3.preventDefault();
71784 // dummy values to ignore in zoomPan
71786 // dummy values to ignore in zoomPan
71787 clientX: e3.clientX,
71788 clientY: e3.clientY,
71789 screenX: e3.screenX,
71790 screenY: e3.screenY,
71794 var e22 = new WheelEvent("wheel", props);
71795 e22._scale = e3.scale;
71796 e22._rotation = e3.rotation;
71797 _selection.node().dispatchEvent(e22);
71799 function zoomPan2(event, key, transform2) {
71800 var source = event && event.sourceEvent || event;
71801 var eventTransform = transform2 || event && event.transform;
71802 var x2 = eventTransform.x;
71803 var y3 = eventTransform.y;
71804 var k2 = eventTransform.k;
71805 if (source && source.type === "wheel") {
71806 if (_pointerDown) return;
71807 var detected = utilDetect();
71808 var dX = source.deltaX;
71809 var dY = source.deltaY;
71814 if (source.deltaMode === 1) {
71815 var lines = Math.abs(source.deltaY);
71816 var sign2 = source.deltaY > 0 ? 1 : -1;
71817 dY = sign2 * clamp_default(
71824 t02 = _isTransformed ? _transformLast : _transformStart;
71825 p02 = _getMouseCoords(source);
71826 p1 = t02.invert(p02);
71827 k22 = t02.k * Math.pow(2, -dY / 500);
71828 k22 = clamp_default(k22, kMin, kMax);
71829 x22 = p02[0] - p1[0] * k22;
71830 y22 = p02[1] - p1[1] * k22;
71831 } else if (source._scale) {
71832 t02 = _gestureTransformStart;
71833 p02 = _getMouseCoords(source);
71834 p1 = t02.invert(p02);
71835 k22 = t02.k * source._scale;
71836 k22 = clamp_default(k22, kMin, kMax);
71837 x22 = p02[0] - p1[0] * k22;
71838 y22 = p02[1] - p1[1] * k22;
71839 } else if (source.ctrlKey && !isInteger(dY)) {
71841 t02 = _isTransformed ? _transformLast : _transformStart;
71842 p02 = _getMouseCoords(source);
71843 p1 = t02.invert(p02);
71844 k22 = t02.k * Math.pow(2, -dY / 500);
71845 k22 = clamp_default(k22, kMin, kMax);
71846 x22 = p02[0] - p1[0] * k22;
71847 y22 = p02[1] - p1[1] * k22;
71848 } else if ((source.altKey || source.shiftKey) && isInteger(dY)) {
71849 t02 = _isTransformed ? _transformLast : _transformStart;
71850 p02 = _getMouseCoords(source);
71851 p1 = t02.invert(p02);
71852 k22 = t02.k * Math.pow(2, -dY / 500);
71853 k22 = clamp_default(k22, kMin, kMax);
71854 x22 = p02[0] - p1[0] * k22;
71855 y22 = p02[1] - p1[1] * k22;
71856 } else if (detected.os === "mac" && detected.browser !== "Firefox" && !source.ctrlKey && isInteger(dX) && isInteger(dY)) {
71857 p1 = projection2.translate();
71860 k22 = projection2.scale();
71861 k22 = clamp_default(k22, kMin, kMax);
71863 if (x22 !== x2 || y22 !== y3 || k22 !== k2) {
71867 eventTransform = identity2.translate(x22, y22).scale(k22);
71868 if (_zoomerPanner._transform) {
71869 _zoomerPanner._transform(eventTransform);
71871 _selection.node().__zoom = eventTransform;
71875 if (_transformStart.x === x2 && _transformStart.y === y3 && _transformStart.k === k2) {
71878 if (geoScaleToZoom(k2, TILESIZE) < _minzoom) {
71879 surface.interrupt();
71880 dispatch14.call("hitMinZoom", this, map2);
71881 setCenterZoom(map2.center(), context.minEditableZoom(), 0, true);
71883 dispatch14.call("move", this, map2);
71886 projection2.transform(eventTransform);
71887 var withinEditableZoom = map2.withinEditableZoom();
71888 if (_lastWithinEditableZoom !== withinEditableZoom) {
71889 if (_lastWithinEditableZoom !== void 0) {
71890 dispatch14.call("crossEditableZoom", this, withinEditableZoom);
71892 _lastWithinEditableZoom = withinEditableZoom;
71894 var scale = k2 / _transformStart.k;
71895 var tX = (x2 / scale - _transformStart.x) * scale;
71896 var tY = (y3 / scale - _transformStart.y) * scale;
71897 if (context.inIntro()) {
71898 curtainProjection.transform({
71905 _lastPointerEvent = event;
71907 _isTransformed = true;
71908 _transformLast = eventTransform;
71909 utilSetTransform(supersurface, tX, tY, scale);
71911 dispatch14.call("move", this, map2);
71912 function isInteger(val) {
71913 return typeof val === "number" && isFinite(val) && Math.floor(val) === val;
71916 function resetTransform() {
71917 if (!_isTransformed) return false;
71918 utilSetTransform(supersurface, 0, 0);
71919 _isTransformed = false;
71920 if (context.inIntro()) {
71921 curtainProjection.transform(projection2.transform());
71925 function redraw(difference2, extent) {
71926 if (typeof window === "undefined") return;
71927 if (surface.empty() || !_redrawEnabled) return;
71928 if (resetTransform()) {
71929 difference2 = extent = void 0;
71931 var zoom = map2.zoom();
71932 var z3 = String(~~zoom);
71933 if (surface.attr("data-zoom") !== z3) {
71934 surface.attr("data-zoom", z3);
71936 var lat = map2.center()[1];
71937 var lowzoom = linear3().domain([-60, 0, 60]).range([17, 18.5, 17]).clamp(true);
71938 surface.classed("low-zoom", zoom <= lowzoom(lat));
71939 if (!difference2) {
71940 supersurface.call(context.background());
71941 wrapper.call(drawLayers);
71943 if (map2.editableDataEnabled() || map2.isInWideSelection()) {
71944 context.loadTiles(projection2);
71945 drawEditable(difference2, extent);
71949 _transformStart = projection2.transform();
71952 var immediateRedraw = function(difference2, extent) {
71953 if (!difference2 && !extent) cancelPendingRedraw();
71954 redraw(difference2, extent);
71956 map2.lastPointerEvent = function() {
71957 return _lastPointerEvent;
71959 map2.mouse = function(d3_event) {
71960 var event = d3_event || _lastPointerEvent;
71963 while (s2 = event.sourceEvent) {
71966 return _getMouseCoords(event);
71970 map2.mouseCoordinates = function() {
71971 var coord2 = map2.mouse() || pxCenter();
71972 return projection2.invert(coord2);
71974 map2.dblclickZoomEnable = function(val) {
71975 if (!arguments.length) return _dblClickZoomEnabled;
71976 _dblClickZoomEnabled = val;
71979 map2.redrawEnable = function(val) {
71980 if (!arguments.length) return _redrawEnabled;
71981 _redrawEnabled = val;
71984 map2.isTransformed = function() {
71985 return _isTransformed;
71987 function setTransform(t2, duration, force) {
71988 var t3 = projection2.transform();
71989 if (!force && t2.k === t3.k && t2.x === t3.x && t2.y === t3.y) return false;
71991 _selection.transition().duration(duration).on("start", function() {
71993 }).call(_zoomerPanner.transform, identity2.translate(t2.x, t2.y).scale(t2.k));
71995 projection2.transform(t2);
71996 _transformStart = t2;
71997 _selection.call(_zoomerPanner.transform, _transformStart);
72001 function setCenterZoom(loc2, z22, duration, force) {
72002 var c2 = map2.center();
72003 var z3 = map2.zoom();
72004 if (loc2[0] === c2[0] && loc2[1] === c2[1] && z22 === z3 && !force) return false;
72005 var proj = geoRawMercator().transform(projection2.transform());
72006 var k2 = clamp_default(geoZoomToScale(z22, TILESIZE), kMin, kMax);
72008 var t2 = proj.translate();
72009 var point = proj(loc2);
72010 var center = pxCenter();
72011 t2[0] += center[0] - point[0];
72012 t2[1] += center[1] - point[1];
72013 return setTransform(identity2.translate(t2[0], t2[1]).scale(k2), duration, force);
72015 map2.pan = function(delta, duration) {
72016 var t2 = projection2.translate();
72017 var k2 = projection2.scale();
72021 _selection.transition().duration(duration).on("start", function() {
72023 }).call(_zoomerPanner.transform, identity2.translate(t2[0], t2[1]).scale(k2));
72025 projection2.translate(t2);
72026 _transformStart = projection2.transform();
72027 _selection.call(_zoomerPanner.transform, _transformStart);
72028 dispatch14.call("move", this, map2);
72033 map2.dimensions = function(val) {
72034 if (!arguments.length) return _dimensions;
72036 drawLayers.dimensions(_dimensions);
72037 context.background().dimensions(_dimensions);
72038 projection2.clipExtent([[0, 0], _dimensions]);
72039 _getMouseCoords = utilFastMouse(supersurface.node());
72043 function zoomIn(delta) {
72044 setCenterZoom(map2.center(), Math.trunc(map2.zoom() + 0.45) + delta, 150, true);
72046 function zoomOut(delta) {
72047 setCenterZoom(map2.center(), Math.ceil(map2.zoom() - 0.45) - delta, 150, true);
72049 map2.zoomIn = function() {
72052 map2.zoomInFurther = function() {
72055 map2.canZoomIn = function() {
72056 return map2.zoom() < maxZoom;
72058 map2.zoomOut = function() {
72061 map2.zoomOutFurther = function() {
72064 map2.canZoomOut = function() {
72065 return map2.zoom() > minZoom4;
72067 map2.center = function(loc2) {
72068 if (!arguments.length) {
72069 return projection2.invert(pxCenter());
72071 if (setCenterZoom(loc2, map2.zoom())) {
72072 dispatch14.call("move", this, map2);
72077 function trimmedCenter(loc, zoom) {
72078 var offset = [paneWidth() / 2, (footerHeight() - toolbarHeight()) / 2];
72079 var proj = geoRawMercator().transform(projection2.transform());
72080 proj.scale(geoZoomToScale(zoom, TILESIZE));
72081 var locPx = proj(loc);
72082 var offsetLocPx = [locPx[0] + offset[0], locPx[1] + offset[1]];
72083 var offsetLoc = proj.invert(offsetLocPx);
72087 function paneWidth() {
72088 const openPane = context.container().select(".map-panes .map-pane.shown");
72089 if (!openPane.empty()) {
72090 return openPane.node().offsetWidth;
72095 function toolbarHeight() {
72096 const toolbar = context.container().select(".top-toolbar");
72097 return toolbar.node().offsetHeight;
72100 function footerHeight() {
72101 const footer = context.container().select(".map-footer-bar");
72102 return footer.node().offsetHeight;
72104 map2.zoom = function(z22) {
72105 if (!arguments.length) {
72106 return Math.max(geoScaleToZoom(projection2.scale(), TILESIZE), 0);
72108 if (z22 < _minzoom) {
72109 surface.interrupt();
72110 dispatch14.call("hitMinZoom", this, map2);
72111 z22 = context.minEditableZoom();
72113 if (setCenterZoom(map2.center(), z22)) {
72114 dispatch14.call("move", this, map2);
72119 map2.centerZoom = function(loc2, z22) {
72120 if (setCenterZoom(loc2, z22)) {
72121 dispatch14.call("move", this, map2);
72126 map2.zoomTo = function(what) {
72127 return map2.zoomToEase(what, 0);
72129 map2.centerEase = function(loc2, duration) {
72130 duration = duration || 250;
72131 setCenterZoom(loc2, map2.zoom(), duration);
72134 map2.zoomEase = function(z22, duration) {
72135 duration = duration || 250;
72136 setCenterZoom(map2.center(), z22, duration, false);
72139 map2.centerZoomEase = function(loc2, z22, duration) {
72140 duration = duration || 250;
72141 setCenterZoom(loc2, z22, duration, false);
72144 map2.transformEase = function(t2, duration) {
72145 duration = duration || 250;
72154 map2.zoomToEase = function(what, duration) {
72156 if (what instanceof geoExtent) {
72159 if (!isArray_default(what)) what = [what];
72160 extent = what.map((entity) => entity.extent(context.graph())).reduce((a2, b3) => a2.extend(b3));
72162 if (!isFinite(extent.area())) return map2;
72163 var z3 = clamp_default(map2.trimmedExtentZoom(extent), 0, 20);
72164 const loc = trimmedCenter(extent.center(), z3);
72165 if (duration === 0) {
72166 return map2.centerZoom(loc, z3);
72168 return map2.centerZoomEase(loc, z3, duration);
72171 map2.startEase = function() {
72172 utilBindOnce(surface, _pointerPrefix + "down.ease", function() {
72177 map2.cancelEase = function() {
72178 _selection.interrupt();
72181 map2.extent = function(val) {
72182 if (!arguments.length) {
72183 return new geoExtent(
72184 projection2.invert([0, _dimensions[1]]),
72185 projection2.invert([_dimensions[0], 0])
72188 var extent = geoExtent(val);
72189 map2.centerZoom(extent.center(), map2.extentZoom(extent));
72192 map2.trimmedExtent = function(val) {
72193 if (!arguments.length) {
72197 return new geoExtent(
72198 projection2.invert([pad3, _dimensions[1] - footerY - pad3]),
72199 projection2.invert([_dimensions[0] - pad3, headerY + pad3])
72202 var extent = geoExtent(val);
72203 map2.centerZoom(extent.center(), map2.trimmedExtentZoom(extent));
72206 function calcExtentZoom(extent, dim) {
72207 var tl = projection2([extent[0][0], extent[1][1]]);
72208 var br = projection2([extent[1][0], extent[0][1]]);
72209 var hFactor = (br[0] - tl[0]) / dim[0];
72210 var vFactor = (br[1] - tl[1]) / dim[1];
72211 var hZoomDiff = Math.log(Math.abs(hFactor)) / Math.LN2;
72212 var vZoomDiff = Math.log(Math.abs(vFactor)) / Math.LN2;
72213 var newZoom = map2.zoom() - Math.max(hZoomDiff, vZoomDiff);
72216 map2.extentZoom = function(val) {
72217 return calcExtentZoom(geoExtent(val), _dimensions);
72219 map2.trimmedExtentZoom = function(val) {
72222 _dimensions[0] - trim - paneWidth(),
72223 _dimensions[1] - trim - toolbarHeight() - footerHeight()
72225 return calcExtentZoom(geoExtent(val), trimmed);
72227 map2.withinEditableZoom = function() {
72228 return map2.zoom() >= context.minEditableZoom();
72230 map2.isInWideSelection = function() {
72231 return !map2.withinEditableZoom() && context.selectedIDs().length;
72233 map2.editableDataEnabled = function(skipZoomCheck) {
72234 var layer = context.layers().layer("osm");
72235 if (!layer || !layer.enabled()) return false;
72236 return skipZoomCheck || map2.withinEditableZoom();
72238 map2.notesEditable = function() {
72239 var layer = context.layers().layer("notes");
72240 if (!layer || !layer.enabled()) return false;
72241 return map2.withinEditableZoom();
72243 map2.minzoom = function(val) {
72244 if (!arguments.length) return _minzoom;
72248 map2.toggleHighlightEdited = function() {
72249 surface.classed("highlight-edited", !surface.classed("highlight-edited"));
72251 dispatch14.call("changeHighlighting", this);
72253 map2.areaFillOptions = ["wireframe", "partial", "full"];
72254 map2.activeAreaFill = function(val) {
72255 if (!arguments.length) return corePreferences("area-fill") || "partial";
72256 corePreferences("area-fill", val);
72257 if (val !== "wireframe") {
72258 corePreferences("area-fill-toggle", val);
72262 dispatch14.call("changeAreaFill", this);
72265 map2.toggleWireframe = function() {
72266 var activeFill = map2.activeAreaFill();
72267 if (activeFill === "wireframe") {
72268 activeFill = corePreferences("area-fill-toggle") || "partial";
72270 activeFill = "wireframe";
72272 map2.activeAreaFill(activeFill);
72274 function updateAreaFill() {
72275 var activeFill = map2.activeAreaFill();
72276 map2.areaFillOptions.forEach(function(opt) {
72277 surface.classed("fill-" + opt, Boolean(opt === activeFill));
72280 map2.layers = () => drawLayers;
72281 map2.doubleUpHandler = function() {
72282 return _doubleUpHandler;
72284 return utilRebind(map2, dispatch14, "on");
72286 var TILESIZE, minZoom4, maxZoom, kMin, kMax;
72287 var init_map = __esm({
72288 "modules/renderer/map.js"() {
72296 init_preferences();
72311 kMin = geoZoomToScale(minZoom4, TILESIZE);
72312 kMax = geoZoomToScale(maxZoom, TILESIZE);
72316 // modules/renderer/photos.js
72317 var photos_exports = {};
72318 __export(photos_exports, {
72319 rendererPhotos: () => rendererPhotos
72321 function rendererPhotos(context) {
72322 var dispatch14 = dispatch_default("change");
72323 var _layerIDs = ["streetside", "mapillary", "mapillary-map-features", "mapillary-signs", "kartaview", "mapilio", "vegbilder", "panoramax"];
72324 var _allPhotoTypes = ["flat", "panoramic"];
72325 var _shownPhotoTypes = _allPhotoTypes.slice();
72326 var _dateFilters = ["fromDate", "toDate"];
72330 function photos() {
72332 function updateStorage() {
72333 var hash2 = utilStringQs(window.location.hash);
72334 var enabled = context.layers().all().filter(function(d4) {
72335 return _layerIDs.indexOf(d4.id) !== -1 && d4.layer && d4.layer.supported() && d4.layer.enabled();
72336 }).map(function(d4) {
72339 if (enabled.length) {
72340 hash2.photo_overlay = enabled.join(",");
72342 delete hash2.photo_overlay;
72344 window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
72346 photos.overlayLayerIDs = function() {
72349 photos.allPhotoTypes = function() {
72350 return _allPhotoTypes;
72352 photos.dateFilters = function() {
72353 return _dateFilters;
72355 photos.dateFilterValue = function(val) {
72356 return val === _dateFilters[0] ? _fromDate : _toDate;
72358 photos.setDateFilter = function(type2, val, updateUrl) {
72359 var date = val && new Date(val);
72360 if (date && !isNaN(date)) {
72361 val = date.toISOString().slice(0, 10);
72365 if (type2 === _dateFilters[0]) {
72367 if (_fromDate && _toDate && new Date(_toDate) < new Date(_fromDate)) {
72368 _toDate = _fromDate;
72371 if (type2 === _dateFilters[1]) {
72373 if (_fromDate && _toDate && new Date(_toDate) < new Date(_fromDate)) {
72374 _fromDate = _toDate;
72377 dispatch14.call("change", this);
72380 if (_fromDate || _toDate) {
72381 rangeString = (_fromDate || "") + "_" + (_toDate || "");
72383 setUrlFilterValue("photo_dates", rangeString);
72386 photos.setUsernameFilter = function(val, updateUrl) {
72387 if (val && typeof val === "string") val = val.replace(/;/g, ",").split(",");
72389 val = val.map((d4) => d4.trim()).filter(Boolean);
72395 dispatch14.call("change", this);
72399 hashString = _usernames.join(",");
72401 setUrlFilterValue("photo_username", hashString);
72404 photos.togglePhotoType = function(val, updateUrl) {
72405 var index = _shownPhotoTypes.indexOf(val);
72406 if (index !== -1) {
72407 _shownPhotoTypes.splice(index, 1);
72409 _shownPhotoTypes.push(val);
72413 if (_shownPhotoTypes) {
72414 hashString = _shownPhotoTypes.join(",");
72416 setUrlFilterValue("photo_type", hashString);
72418 dispatch14.call("change", this);
72421 function setUrlFilterValue(property, val) {
72422 const hash2 = utilStringQs(window.location.hash);
72424 if (hash2[property] === val) return;
72425 hash2[property] = val;
72427 if (!(property in hash2)) return;
72428 delete hash2[property];
72430 window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
72432 function showsLayer(id2) {
72433 var layer = context.layers().layer(id2);
72434 return layer && layer.supported() && layer.enabled();
72436 photos.shouldFilterDateBySlider = function() {
72437 return showsLayer("mapillary") || showsLayer("kartaview") || showsLayer("mapilio") || showsLayer("streetside") || showsLayer("vegbilder") || showsLayer("panoramax");
72439 photos.shouldFilterByPhotoType = function() {
72440 return showsLayer("mapillary") || showsLayer("streetside") && showsLayer("kartaview") || showsLayer("vegbilder") || showsLayer("panoramax");
72442 photos.shouldFilterByUsername = function() {
72443 return !showsLayer("mapillary") && showsLayer("kartaview") && !showsLayer("streetside") || showsLayer("panoramax");
72445 photos.showsPhotoType = function(val) {
72446 if (!photos.shouldFilterByPhotoType()) return true;
72447 return _shownPhotoTypes.indexOf(val) !== -1;
72449 photos.showsFlat = function() {
72450 return photos.showsPhotoType("flat");
72452 photos.showsPanoramic = function() {
72453 return photos.showsPhotoType("panoramic");
72455 photos.fromDate = function() {
72458 photos.toDate = function() {
72461 photos.usernames = function() {
72464 photos.init = function() {
72465 var hash2 = utilStringQs(window.location.hash);
72467 if (hash2.photo_dates) {
72468 parts = /^(.*)[–_](.*)$/g.exec(hash2.photo_dates.trim());
72469 this.setDateFilter("fromDate", parts && parts.length >= 2 && parts[1], false);
72470 this.setDateFilter("toDate", parts && parts.length >= 3 && parts[2], false);
72472 if (hash2.photo_username) {
72473 this.setUsernameFilter(hash2.photo_username, false);
72475 if (hash2.photo_type) {
72476 parts = hash2.photo_type.replace(/;/g, ",").split(",");
72477 _allPhotoTypes.forEach((d4) => {
72478 if (!parts.includes(d4)) this.togglePhotoType(d4, false);
72481 if (hash2.photo_overlay) {
72482 var hashOverlayIDs = hash2.photo_overlay.replace(/;/g, ",").split(",");
72483 hashOverlayIDs.forEach(function(id2) {
72484 if (id2 === "openstreetcam") id2 = "kartaview";
72485 var layer2 = _layerIDs.indexOf(id2) !== -1 && context.layers().layer(id2);
72486 if (layer2 && !layer2.enabled()) layer2.enabled(true);
72490 var photoIds = hash2.photo.replace(/;/g, ",").split(",");
72491 var photoId = photoIds.length && photoIds[0].trim();
72492 var results = /(.*)\/(.*)/g.exec(photoId);
72493 if (results && results.length >= 3) {
72494 var serviceId = results[1];
72495 if (serviceId === "openstreetcam") serviceId = "kartaview";
72496 var photoKey = results[2];
72497 var service = services[serviceId];
72498 if (service && service.ensureViewerLoaded) {
72499 var layer = _layerIDs.indexOf(serviceId) !== -1 && context.layers().layer(serviceId);
72500 if (layer && !layer.enabled()) layer.enabled(true);
72501 var baselineTime = Date.now();
72502 service.on("loadedImages.rendererPhotos", function() {
72503 if (Date.now() - baselineTime > 45e3) {
72504 service.on("loadedImages.rendererPhotos", null);
72507 if (!service.cachedImage(photoKey)) return;
72508 service.on("loadedImages.rendererPhotos", null);
72509 service.ensureViewerLoaded(context).then(function() {
72510 service.selectImage(context, photoKey).showViewer(context);
72516 context.layers().on("change.rendererPhotos", updateStorage);
72518 return utilRebind(photos, dispatch14, "on");
72520 var init_photos = __esm({
72521 "modules/renderer/photos.js"() {
72530 // modules/renderer/index.js
72531 var renderer_exports = {};
72532 __export(renderer_exports, {
72533 rendererBackground: () => rendererBackground,
72534 rendererBackgroundSource: () => rendererBackgroundSource,
72535 rendererFeatures: () => rendererFeatures,
72536 rendererMap: () => rendererMap,
72537 rendererPhotos: () => rendererPhotos,
72538 rendererTileLayer: () => rendererTileLayer
72540 var init_renderer = __esm({
72541 "modules/renderer/index.js"() {
72543 init_background_source();
72544 init_background2();
72552 // modules/ui/map_in_map.js
72553 var map_in_map_exports = {};
72554 __export(map_in_map_exports, {
72555 uiMapInMap: () => uiMapInMap
72557 function uiMapInMap(context) {
72558 function mapInMap(selection2) {
72559 var backgroundLayer = rendererTileLayer(context).underzoom(2);
72560 var overlayLayers = {};
72561 var projection2 = geoRawMercator();
72562 var dataLayer = svgData(projection2, context).showLabels(false);
72563 var debugLayer = svgDebug(projection2, context);
72564 var zoom = zoom_default2().scaleExtent([geoZoomToScale(0.5), geoZoomToScale(24)]).on("start", zoomStarted).on("zoom", zoomed).on("end", zoomEnded);
72565 var wrap2 = select_default2(null);
72566 var tiles = select_default2(null);
72567 var viewport = select_default2(null);
72568 var _isTransformed = false;
72569 var _isHidden = true;
72570 var _skipEvents = false;
72571 var _gesture = null;
72578 function zoomStarted() {
72579 if (_skipEvents) return;
72580 _tStart = _tCurr = projection2.transform();
72583 function zoomed(d3_event) {
72584 if (_skipEvents) return;
72585 var x2 = d3_event.transform.x;
72586 var y3 = d3_event.transform.y;
72587 var k2 = d3_event.transform.k;
72588 var isZooming = k2 !== _tStart.k;
72589 var isPanning = x2 !== _tStart.x || y3 !== _tStart.y;
72590 if (!isZooming && !isPanning) {
72594 _gesture = isZooming ? "zoom" : "pan";
72596 var tMini = projection2.transform();
72598 if (_gesture === "zoom") {
72599 scale = k2 / tMini.k;
72600 tX = (_cMini[0] / scale - _cMini[0]) * scale;
72601 tY = (_cMini[1] / scale - _cMini[1]) * scale;
72608 utilSetTransform(tiles, tX, tY, scale);
72609 utilSetTransform(viewport, 0, 0, scale);
72610 _isTransformed = true;
72611 _tCurr = identity2.translate(x2, y3).scale(k2);
72612 var zMain = geoScaleToZoom(context.projection.scale());
72613 var zMini = geoScaleToZoom(k2);
72614 _zDiff = zMain - zMini;
72617 function zoomEnded() {
72618 if (_skipEvents) return;
72619 if (_gesture !== "pan") return;
72620 updateProjection();
72622 context.map().center(projection2.invert(_cMini));
72624 function updateProjection() {
72625 var loc = context.map().center();
72626 var tMain = context.projection.transform();
72627 var zMain = geoScaleToZoom(tMain.k);
72628 var zMini = Math.max(zMain - _zDiff, 0.5);
72629 var kMini = geoZoomToScale(zMini);
72630 projection2.translate([tMain.x, tMain.y]).scale(kMini);
72631 var point = projection2(loc);
72632 var mouse = _gesture === "pan" ? geoVecSubtract([_tCurr.x, _tCurr.y], [_tStart.x, _tStart.y]) : [0, 0];
72633 var xMini = _cMini[0] - point[0] + tMain.x + mouse[0];
72634 var yMini = _cMini[1] - point[1] + tMain.y + mouse[1];
72635 projection2.translate([xMini, yMini]).clipExtent([[0, 0], _dMini]);
72636 _tCurr = projection2.transform();
72637 if (_isTransformed) {
72638 utilSetTransform(tiles, 0, 0);
72639 utilSetTransform(viewport, 0, 0);
72640 _isTransformed = false;
72642 zoom.scaleExtent([geoZoomToScale(0.5), geoZoomToScale(zMain - 3)]);
72643 _skipEvents = true;
72644 wrap2.call(zoom.transform, _tCurr);
72645 _skipEvents = false;
72647 function redraw() {
72648 clearTimeout(_timeoutID);
72649 if (_isHidden) return;
72650 updateProjection();
72651 var zMini = geoScaleToZoom(projection2.scale());
72652 tiles = wrap2.selectAll(".map-in-map-tiles").data([0]);
72653 tiles = tiles.enter().append("div").attr("class", "map-in-map-tiles").merge(tiles);
72654 backgroundLayer.source(context.background().baseLayerSource()).projection(projection2).dimensions(_dMini);
72655 var background = tiles.selectAll(".map-in-map-background").data([0]);
72656 background.enter().append("div").attr("class", "map-in-map-background").merge(background).call(backgroundLayer);
72657 var overlaySources = context.background().overlayLayerSources();
72658 var activeOverlayLayers = [];
72659 for (var i3 = 0; i3 < overlaySources.length; i3++) {
72660 if (overlaySources[i3].validZoom(zMini)) {
72661 if (!overlayLayers[i3]) overlayLayers[i3] = rendererTileLayer(context);
72662 activeOverlayLayers.push(overlayLayers[i3].source(overlaySources[i3]).projection(projection2).dimensions(_dMini));
72665 var overlay = tiles.selectAll(".map-in-map-overlay").data([0]);
72666 overlay = overlay.enter().append("div").attr("class", "map-in-map-overlay").merge(overlay);
72667 var overlays = overlay.selectAll("div").data(activeOverlayLayers, function(d4) {
72668 return d4.source().name();
72670 overlays.exit().remove();
72671 overlays = overlays.enter().append("div").merge(overlays).each(function(layer) {
72672 select_default2(this).call(layer);
72674 var dataLayers = tiles.selectAll(".map-in-map-data").data([0]);
72675 dataLayers.exit().remove();
72676 dataLayers = dataLayers.enter().append("svg").attr("class", "map-in-map-data").merge(dataLayers).call(dataLayer).call(debugLayer);
72677 if (_gesture !== "pan") {
72678 var getPath = path_default(projection2);
72679 var bbox2 = { type: "Polygon", coordinates: [context.map().extent().polygon()] };
72680 viewport = wrap2.selectAll(".map-in-map-viewport").data([0]);
72681 viewport = viewport.enter().append("svg").attr("class", "map-in-map-viewport").merge(viewport);
72682 var path = viewport.selectAll(".map-in-map-bbox").data([bbox2]);
72683 path.enter().append("path").attr("class", "map-in-map-bbox").merge(path).attr("d", getPath).classed("thick", function(d4) {
72684 return getPath.area(d4) < 30;
72688 function queueRedraw() {
72689 clearTimeout(_timeoutID);
72690 _timeoutID = setTimeout(function() {
72694 function toggle(d3_event) {
72695 if (d3_event) d3_event.preventDefault();
72696 _isHidden = !_isHidden;
72697 context.container().select(".minimap-toggle-item").classed("active", !_isHidden).select("input").property("checked", !_isHidden);
72699 wrap2.style("display", "block").style("opacity", "1").transition().duration(200).style("opacity", "0").on("end", function() {
72700 selection2.selectAll(".map-in-map").style("display", "none");
72703 wrap2.style("display", "block").style("opacity", "0").transition().duration(200).style("opacity", "1").on("end", function() {
72708 uiMapInMap.toggle = toggle;
72709 wrap2 = selection2.selectAll(".map-in-map").data([0]);
72710 wrap2 = wrap2.enter().append("div").attr("class", "map-in-map").style("display", _isHidden ? "none" : "block").call(zoom).on("dblclick.zoom", null).merge(wrap2);
72711 _dMini = [200, 150];
72712 _cMini = geoVecScale(_dMini, 0.5);
72713 context.map().on("drawn.map-in-map", function(drawn) {
72714 if (drawn.full === true) {
72719 context.keybinding().on(_t("background.minimap.key"), toggle);
72723 var init_map_in_map = __esm({
72724 "modules/ui/map_in_map.js"() {
72737 // modules/ui/notice.js
72738 var notice_exports = {};
72739 __export(notice_exports, {
72740 uiNotice: () => uiNotice
72742 function uiNotice(context) {
72743 return function(selection2) {
72744 var div = selection2.append("div").attr("class", "notice");
72745 var button = div.append("button").attr("class", "zoom-to notice fillD").on("click", function() {
72746 context.map().zoomEase(context.minEditableZoom());
72747 }).on("wheel", function(d3_event) {
72748 var e22 = new WheelEvent(d3_event.type, d3_event);
72749 context.surface().node().dispatchEvent(e22);
72751 button.call(svgIcon("#iD-icon-plus", "pre-text")).append("span").attr("class", "label").call(_t.append("zoom_in_edit"));
72752 function disableTooHigh() {
72753 var canEdit = context.map().zoom() >= context.minEditableZoom();
72754 div.style("display", canEdit ? "none" : "block");
72756 context.map().on("move.notice", debounce_default(disableTooHigh, 500));
72760 var init_notice = __esm({
72761 "modules/ui/notice.js"() {
72769 // modules/ui/photoviewer.js
72770 var photoviewer_exports = {};
72771 __export(photoviewer_exports, {
72772 uiPhotoviewer: () => uiPhotoviewer
72774 function uiPhotoviewer(context) {
72775 var dispatch14 = dispatch_default("resize");
72776 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
72777 const addPhotoIdButton = /* @__PURE__ */ new Set(["mapillary", "panoramax"]);
72778 function photoviewer(selection2) {
72779 selection2.append("button").attr("class", "thumb-hide").attr("title", _t("icons.close")).on("click", function() {
72780 for (const service of Object.values(services)) {
72781 if (typeof service.hideViewer === "function") {
72782 service.hideViewer(context);
72785 }).append("div").call(svgIcon("#iD-icon-close"));
72786 function preventDefault(d3_event) {
72787 d3_event.preventDefault();
72789 selection2.append("button").attr("class", "resize-handle-xy").on("touchstart touchdown touchend", preventDefault).on(
72790 _pointerPrefix + "down",
72791 buildResizeListener(selection2, "resize", dispatch14, { resizeOnX: true, resizeOnY: true })
72793 selection2.append("button").attr("class", "resize-handle-x").on("touchstart touchdown touchend", preventDefault).on(
72794 _pointerPrefix + "down",
72795 buildResizeListener(selection2, "resize", dispatch14, { resizeOnX: true })
72797 selection2.append("button").attr("class", "resize-handle-y").on("touchstart touchdown touchend", preventDefault).on(
72798 _pointerPrefix + "down",
72799 buildResizeListener(selection2, "resize", dispatch14, { resizeOnY: true })
72801 context.features().on("change.setPhotoFromViewer", function() {
72802 setPhotoTagButton();
72804 context.history().on("change.setPhotoFromViewer", function() {
72805 setPhotoTagButton();
72807 function setPhotoTagButton() {
72808 const service = getServiceId();
72809 const isActiveForService = addPhotoIdButton.has(service) && services[service].isViewerOpen() && layerEnabled(service) && context.mode().id === "select";
72810 renderAddPhotoIdButton(service, isActiveForService);
72811 function layerEnabled(which) {
72812 const layers = context.layers();
72813 const layer = layers.layer(which);
72814 return layer.enabled();
72816 function getServiceId() {
72817 for (const serviceId in services) {
72818 const service2 = services[serviceId];
72819 if (typeof service2.isViewerOpen === "function") {
72820 if (service2.isViewerOpen()) {
72827 function renderAddPhotoIdButton(service2, shouldDisplay) {
72828 const button = selection2.selectAll(".set-photo-from-viewer").data(shouldDisplay ? [0] : []);
72829 button.exit().remove();
72830 const buttonEnter = button.enter().append("button").attr("class", "set-photo-from-viewer").call(svgIcon("#fas-eye-dropper")).call(
72831 uiTooltip().title(() => _t.append("inspector.set_photo_from_viewer.enable")).placement("right")
72833 buttonEnter.select(".tooltip").classed("dark", true).style("width", "300px");
72834 buttonEnter.merge(button).on("click", function(e3) {
72835 e3.preventDefault();
72836 e3.stopPropagation();
72837 const activeServiceId = getServiceId();
72838 const image = services[activeServiceId].getActiveImage();
72839 const action = (graph2) => context.selectedIDs().reduce((graph3, entityID) => {
72840 const tags = graph3.entity(entityID).tags;
72841 const action2 = actionChangeTags(entityID, { ...tags, [activeServiceId]: image.id });
72842 return action2(graph3);
72844 const annotation = _t("operations.change_tags.annotation");
72845 context.perform(action, annotation);
72846 buttonDisable("already_set");
72848 if (service2 === "panoramax") {
72849 const panoramaxControls = selection2.select(".panoramax-wrapper .pnlm-zoom-controls.pnlm-controls");
72850 panoramaxControls.style("margin-top", shouldDisplay ? "36px" : "6px");
72852 if (!shouldDisplay) return;
72853 const activeImage = services[service2].getActiveImage();
72854 const graph = context.graph();
72855 const entities = context.selectedIDs().map((id2) => graph.hasEntity(id2)).filter(Boolean);
72856 if (entities.map((entity) => entity.tags[service2]).every((value) => value === (activeImage == null ? void 0 : activeImage.id))) {
72857 buttonDisable("already_set");
72858 } else if (activeImage && entities.map((entity) => entity.extent(context.graph()).center()).every((loc) => geoSphericalDistance(loc, activeImage.loc) > 100)) {
72859 buttonDisable("too_far");
72861 buttonDisable(false);
72864 function buttonDisable(reason) {
72865 const disabled = reason !== false;
72866 const button = selection2.selectAll(".set-photo-from-viewer").data([0]);
72867 button.attr("disabled", disabled ? "true" : null);
72868 button.classed("disabled", disabled);
72869 button.call(uiTooltip().destroyAny);
72872 uiTooltip().title(() => _t.append(`inspector.set_photo_from_viewer.disable.${reason}`)).placement("right")
72876 uiTooltip().title(() => _t.append("inspector.set_photo_from_viewer.enable")).placement("right")
72879 button.select(".tooltip").classed("dark", true).style("width", "300px");
72882 function buildResizeListener(target, eventName, dispatch15, options) {
72883 var resizeOnX = !!options.resizeOnX;
72884 var resizeOnY = !!options.resizeOnY;
72885 var minHeight = options.minHeight || 240;
72886 var minWidth = options.minWidth || 320;
72892 function startResize(d3_event) {
72893 if (pointerId !== (d3_event.pointerId || "mouse")) return;
72894 d3_event.preventDefault();
72895 d3_event.stopPropagation();
72896 var mapSize = context.map().dimensions();
72898 var mapWidth = mapSize[0];
72899 const viewerMargin = parseInt(select_default2(".photoviewer").style("margin-left"), 10);
72900 var newWidth = clamp_default(startWidth + d3_event.clientX - startX, minWidth, mapWidth - viewerMargin * 2);
72901 target.style("width", newWidth + "px");
72904 const menuHeight = utilGetDimensions(select_default2(".top-toolbar"))[1] + utilGetDimensions(select_default2(".map-footer"))[1];
72905 const viewerMargin = parseInt(select_default2(".photoviewer").style("margin-bottom"), 10);
72906 var maxHeight = mapSize[1] - menuHeight - viewerMargin * 2;
72907 var newHeight = clamp_default(startHeight + startY - d3_event.clientY, minHeight, maxHeight);
72908 target.style("height", newHeight + "px");
72910 dispatch15.call(eventName, target, subtractPadding(utilGetDimensions(target, true), target));
72912 function stopResize(d3_event) {
72913 if (pointerId !== (d3_event.pointerId || "mouse")) return;
72914 d3_event.preventDefault();
72915 d3_event.stopPropagation();
72916 select_default2(window).on("." + eventName, null);
72918 return function initResize(d3_event) {
72919 d3_event.preventDefault();
72920 d3_event.stopPropagation();
72921 pointerId = d3_event.pointerId || "mouse";
72922 startX = d3_event.clientX;
72923 startY = d3_event.clientY;
72924 var targetRect = target.node().getBoundingClientRect();
72925 startWidth = targetRect.width;
72926 startHeight = targetRect.height;
72927 select_default2(window).on(_pointerPrefix + "move." + eventName, startResize, false).on(_pointerPrefix + "up." + eventName, stopResize, false);
72928 if (_pointerPrefix === "pointer") {
72929 select_default2(window).on("pointercancel." + eventName, stopResize, false);
72934 photoviewer.onMapResize = function() {
72935 var photoviewer2 = context.container().select(".photoviewer");
72936 var content = context.container().select(".main-content");
72937 var mapDimensions = utilGetDimensions(content, true);
72938 const menuHeight = utilGetDimensions(select_default2(".top-toolbar"))[1] + utilGetDimensions(select_default2(".map-footer"))[1];
72939 const viewerMargin = parseInt(select_default2(".photoviewer").style("margin-bottom"), 10);
72940 var photoDimensions = utilGetDimensions(photoviewer2, true);
72941 if (photoDimensions[0] > mapDimensions[0] || photoDimensions[1] > mapDimensions[1] - menuHeight - viewerMargin * 2) {
72942 var setPhotoDimensions = [
72943 Math.min(photoDimensions[0], mapDimensions[0]),
72944 Math.min(photoDimensions[1], mapDimensions[1] - menuHeight - viewerMargin * 2)
72946 photoviewer2.style("width", setPhotoDimensions[0] + "px").style("height", setPhotoDimensions[1] + "px");
72947 dispatch14.call("resize", photoviewer2, subtractPadding(setPhotoDimensions, photoviewer2));
72950 function subtractPadding(dimensions, selection2) {
72952 dimensions[0] - parseFloat(selection2.style("padding-left")) - parseFloat(selection2.style("padding-right")),
72953 dimensions[1] - parseFloat(selection2.style("padding-top")) - parseFloat(selection2.style("padding-bottom"))
72956 return utilRebind(photoviewer, dispatch14, "on");
72958 var init_photoviewer = __esm({
72959 "modules/ui/photoviewer.js"() {
72975 // modules/ui/restore.js
72976 var restore_exports = {};
72977 __export(restore_exports, {
72978 uiRestore: () => uiRestore
72980 function uiRestore(context) {
72981 return function(selection2) {
72982 if (!context.history().hasRestorableChanges()) return;
72983 let modalSelection = uiModal(selection2, true);
72984 modalSelection.select(".modal").attr("class", "modal fillL");
72985 let introModal = modalSelection.select(".content");
72986 introModal.append("div").attr("class", "modal-section").append("h3").call(_t.append("restore.heading"));
72987 introModal.append("div").attr("class", "modal-section").append("p").call(_t.append("restore.description"));
72988 let buttonWrap = introModal.append("div").attr("class", "modal-actions");
72989 let restore = buttonWrap.append("button").attr("class", "restore").on("click", () => {
72990 context.history().restore();
72991 modalSelection.remove();
72993 restore.append("svg").attr("class", "logo logo-restore").append("use").attr("xlink:href", "#iD-logo-restore");
72994 restore.append("div").call(_t.append("restore.restore"));
72995 let reset = buttonWrap.append("button").attr("class", "reset").on("click", () => {
72996 context.history().clearSaved();
72997 modalSelection.remove();
72999 reset.append("svg").attr("class", "logo logo-reset").append("use").attr("xlink:href", "#iD-logo-reset");
73000 reset.append("div").call(_t.append("restore.reset"));
73001 restore.node().focus();
73004 var init_restore = __esm({
73005 "modules/ui/restore.js"() {
73012 // modules/ui/scale.js
73013 var scale_exports2 = {};
73014 __export(scale_exports2, {
73015 uiScale: () => uiScale
73017 function uiScale(context) {
73018 var projection2 = context.projection, isImperial = !_mainLocalizer.usesMetric(), maxLength = 180, tickHeight = 8;
73019 function scaleDefs(loc1, loc2) {
73020 var lat = (loc2[1] + loc1[1]) / 2, conversion = isImperial ? 3.28084 : 1, dist = geoLonToMeters(loc2[0] - loc1[0], lat) * conversion, scale = { dist: 0, px: 0, text: "" }, buckets, i3, val, dLon;
73022 buckets = [528e4, 528e3, 52800, 5280, 500, 50, 5, 1];
73024 buckets = [5e6, 5e5, 5e4, 5e3, 500, 50, 5, 1];
73026 for (i3 = 0; i3 < buckets.length; i3++) {
73029 scale.dist = Math.floor(dist / val) * val;
73032 scale.dist = +dist.toFixed(2);
73035 dLon = geoMetersToLon(scale.dist / conversion, lat);
73036 scale.px = Math.round(projection2([loc1[0] + dLon, loc1[1]])[0]);
73037 scale.text = displayLength(scale.dist / conversion, isImperial);
73040 function update(selection2) {
73041 var dims = context.map().dimensions(), loc1 = projection2.invert([0, dims[1]]), loc2 = projection2.invert([maxLength, dims[1]]), scale = scaleDefs(loc1, loc2);
73042 selection2.select(".scale-path").attr("d", "M0.5,0.5v" + tickHeight + "h" + scale.px + "v-" + tickHeight);
73043 selection2.select(".scale-text").style(_mainLocalizer.textDirection() === "ltr" ? "left" : "right", scale.px + 16 + "px").text(scale.text);
73045 return function(selection2) {
73046 function switchUnits() {
73047 isImperial = !isImperial;
73048 selection2.call(update);
73050 var scalegroup = selection2.append("svg").attr("class", "scale").on("click", switchUnits).append("g").attr("transform", "translate(10,11)");
73051 scalegroup.append("path").attr("class", "scale-path");
73052 selection2.append("div").attr("class", "scale-text");
73053 selection2.call(update);
73054 context.map().on("move.scale", function() {
73055 update(selection2);
73059 var init_scale2 = __esm({
73060 "modules/ui/scale.js"() {
73068 // modules/ui/shortcuts.js
73069 var shortcuts_exports = {};
73070 __export(shortcuts_exports, {
73071 uiShortcuts: () => uiShortcuts
73073 function uiShortcuts(context) {
73074 var detected = utilDetect();
73075 var _activeTab = 0;
73076 var _modalSelection;
73077 var _selection = select_default2(null);
73078 var _dataShortcuts;
73079 function shortcutsModal(_modalSelection2) {
73080 _modalSelection2.select(".modal").classed("modal-shortcuts", true);
73081 var content = _modalSelection2.select(".content");
73082 content.append("div").attr("class", "modal-section header").append("h2").call(_t.append("shortcuts.title"));
73083 _mainFileFetcher.get("shortcuts").then(function(data) {
73084 _dataShortcuts = data;
73085 content.call(render);
73086 }).catch(function() {
73089 function render(selection2) {
73090 if (!_dataShortcuts) return;
73091 var wrapper = selection2.selectAll(".wrapper").data([0]);
73092 var wrapperEnter = wrapper.enter().append("div").attr("class", "wrapper modal-section");
73093 var tabsBar = wrapperEnter.append("div").attr("class", "tabs-bar");
73094 var shortcutsList = wrapperEnter.append("div").attr("class", "shortcuts-list");
73095 wrapper = wrapper.merge(wrapperEnter);
73096 var tabs = tabsBar.selectAll(".tab").data(_dataShortcuts);
73097 var tabsEnter = tabs.enter().append("a").attr("class", "tab").attr("href", "#").on("click", function(d3_event, d4) {
73098 d3_event.preventDefault();
73099 var i3 = _dataShortcuts.indexOf(d4);
73101 render(selection2);
73103 tabsEnter.append("span").html(function(d4) {
73104 return _t.html(d4.text);
73106 wrapper.selectAll(".tab").classed("active", function(d4, i3) {
73107 return i3 === _activeTab;
73109 var shortcuts = shortcutsList.selectAll(".shortcut-tab").data(_dataShortcuts);
73110 var shortcutsEnter = shortcuts.enter().append("div").attr("class", function(d4) {
73111 return "shortcut-tab shortcut-tab-" + d4.tab;
73113 var columnsEnter = shortcutsEnter.selectAll(".shortcut-column").data(function(d4) {
73115 }).enter().append("table").attr("class", "shortcut-column");
73116 var rowsEnter = columnsEnter.selectAll(".shortcut-row").data(function(d4) {
73118 }).enter().append("tr").attr("class", "shortcut-row");
73119 var sectionRows = rowsEnter.filter(function(d4) {
73120 return !d4.shortcuts;
73122 sectionRows.append("td");
73123 sectionRows.append("td").attr("class", "shortcut-section").append("h3").html(function(d4) {
73124 return _t.html(d4.text);
73126 var shortcutRows = rowsEnter.filter(function(d4) {
73127 return d4.shortcuts;
73129 var shortcutKeys = shortcutRows.append("td").attr("class", "shortcut-keys");
73130 var modifierKeys = shortcutKeys.filter(function(d4) {
73131 return d4.modifiers;
73133 modifierKeys.selectAll("kbd.modifier").data(function(d4) {
73134 if (detected.os === "win" && d4.text === "shortcuts.editing.commands.redo") {
73136 } else if (detected.os !== "mac" && d4.text === "shortcuts.browsing.display_options.fullscreen") {
73139 return d4.modifiers;
73141 }).enter().each(function() {
73142 var selection3 = select_default2(this);
73143 selection3.append("kbd").attr("class", "modifier").text(function(d4) {
73144 return uiCmd.display(d4);
73146 selection3.append("span").text("+");
73148 shortcutKeys.selectAll("kbd.shortcut").data(function(d4) {
73149 var arr = d4.shortcuts;
73150 if (detected.os === "win" && d4.text === "shortcuts.editing.commands.redo") {
73152 } else if (detected.os !== "mac" && d4.text === "shortcuts.browsing.display_options.fullscreen") {
73155 arr = arr.map(function(s2) {
73156 return uiCmd.display(s2.indexOf(".") !== -1 ? _t(s2) : s2);
73158 return utilArrayUniq(arr).map(function(s2) {
73161 separator: d4.separator,
73165 }).enter().each(function(d4, i3, nodes) {
73166 var selection3 = select_default2(this);
73167 var click = d4.shortcut.toLowerCase().match(/(.*).click/);
73168 if (click && click[1]) {
73169 selection3.call(svgIcon("#iD-walkthrough-mouse-" + click[1], "operation"));
73170 } else if (d4.shortcut.toLowerCase() === "long-press") {
73171 selection3.call(svgIcon("#iD-walkthrough-longpress", "longpress operation"));
73172 } else if (d4.shortcut.toLowerCase() === "tap") {
73173 selection3.call(svgIcon("#iD-walkthrough-tap", "tap operation"));
73175 selection3.append("kbd").attr("class", "shortcut").text(function(d5) {
73176 return d5.shortcut;
73179 if (i3 < nodes.length - 1) {
73180 selection3.append("span").html(d4.separator || "\xA0" + _t.html("shortcuts.or") + "\xA0");
73181 } else if (i3 === nodes.length - 1 && d4.suffix) {
73182 selection3.append("span").text(d4.suffix);
73185 shortcutKeys.filter(function(d4) {
73187 }).each(function() {
73188 var selection3 = select_default2(this);
73189 selection3.append("span").text("+");
73190 selection3.append("span").attr("class", "gesture").html(function(d4) {
73191 return _t.html(d4.gesture);
73194 shortcutRows.append("td").attr("class", "shortcut-desc").html(function(d4) {
73195 return d4.text ? _t.html(d4.text) : "\xA0";
73197 wrapper.selectAll(".shortcut-tab").style("display", function(d4, i3) {
73198 return i3 === _activeTab ? "flex" : "none";
73201 return function(selection2, show) {
73202 _selection = selection2;
73204 _modalSelection = uiModal(selection2);
73205 _modalSelection.call(shortcutsModal);
73207 context.keybinding().on([_t("shortcuts.toggle.key"), "?"], function() {
73208 if (context.container().selectAll(".modal-shortcuts").size()) {
73209 if (_modalSelection) {
73210 _modalSelection.close();
73211 _modalSelection = null;
73214 _modalSelection = uiModal(_selection);
73215 _modalSelection.call(shortcutsModal);
73221 var init_shortcuts = __esm({
73222 "modules/ui/shortcuts.js"() {
73225 init_file_fetcher();
73235 // node_modules/@mapbox/sexagesimal/index.js
73236 var require_sexagesimal = __commonJS({
73237 "node_modules/@mapbox/sexagesimal/index.js"(exports2, module2) {
73238 module2.exports = element;
73239 module2.exports.pair = pair3;
73240 module2.exports.format = format2;
73241 module2.exports.formatPair = formatPair;
73242 module2.exports.coordToDMS = coordToDMS;
73243 function element(input, dims) {
73244 var result = search(input, dims);
73245 return result === null ? null : result.val;
73247 function formatPair(input) {
73248 return format2(input.lat, "lat") + " " + format2(input.lon, "lon");
73250 function format2(input, dim) {
73251 var dms = coordToDMS(input, dim);
73252 return dms.whole + "\xB0 " + (dms.minutes ? dms.minutes + "' " : "") + (dms.seconds ? dms.seconds + '" ' : "") + dms.dir;
73254 function coordToDMS(input, dim) {
73255 var dirs = { lat: ["N", "S"], lon: ["E", "W"] }[dim] || "";
73256 var dir = dirs[input >= 0 ? 0 : 1];
73257 var abs3 = Math.abs(input);
73258 var whole = Math.floor(abs3);
73259 var fraction = abs3 - whole;
73260 var fractionMinutes = fraction * 60;
73261 var minutes = Math.floor(fractionMinutes);
73262 var seconds = Math.floor((fractionMinutes - minutes) * 60);
73270 function search(input, dims) {
73271 if (!dims) dims = "NSEW";
73272 if (typeof input !== "string") return null;
73273 input = input.toUpperCase();
73274 var regex = /^[\s\,]*([NSEW])?\s*([\-|\—|\―]?[0-9.]+)[°º˚]?\s*(?:([0-9.]+)['’′‘]\s*)?(?:([0-9.]+)(?:''|"|”|″)\s*)?([NSEW])?/;
73275 var m3 = input.match(regex);
73276 if (!m3) return null;
73277 var matched = m3[0];
73279 if (m3[1] && m3[5]) {
73281 matched = matched.slice(0, -1);
73283 dim = m3[1] || m3[5];
73285 if (dim && dims.indexOf(dim) === -1) return null;
73286 var deg = m3[2] ? parseFloat(m3[2]) : 0;
73287 var min3 = m3[3] ? parseFloat(m3[3]) / 60 : 0;
73288 var sec = m3[4] ? parseFloat(m3[4]) / 3600 : 0;
73289 var sign2 = deg < 0 ? -1 : 1;
73290 if (dim === "S" || dim === "W") sign2 *= -1;
73292 val: (Math.abs(deg) + min3 + sec) * sign2,
73295 remain: input.slice(matched.length)
73298 function pair3(input, dims) {
73299 input = input.trim();
73300 var one2 = search(input, dims);
73301 if (!one2) return null;
73302 input = one2.remain.trim();
73303 var two = search(input, dims);
73304 if (!two || two.remain) return null;
73306 return swapdim(one2.val, two.val, one2.dim);
73308 return [one2.val, two.val];
73311 function swapdim(a2, b3, dim) {
73312 if (dim === "N" || dim === "S") return [a2, b3];
73313 if (dim === "W" || dim === "E") return [b3, a2];
73318 // modules/ui/feature_list.js
73319 var feature_list_exports = {};
73320 __export(feature_list_exports, {
73321 uiFeatureList: () => uiFeatureList
73323 function uiFeatureList(context) {
73324 var _geocodeResults;
73325 function featureList(selection2) {
73326 var header = selection2.append("div").attr("class", "header fillL");
73327 header.append("h2").call(_t.append("inspector.feature_list"));
73328 var searchWrap = selection2.append("div").attr("class", "search-header");
73329 searchWrap.call(svgIcon("#iD-icon-search", "pre-text"));
73330 var search = searchWrap.append("input").attr("placeholder", _t("inspector.search")).attr("type", "search").call(utilNoAuto).on("keypress", keypress).on("keydown", keydown).on("input", inputevent);
73331 var listWrap = selection2.append("div").attr("class", "inspector-body");
73332 var list = listWrap.append("div").attr("class", "feature-list");
73333 context.on("exit.feature-list", clearSearch);
73334 context.map().on("drawn.feature-list", mapDrawn);
73335 context.keybinding().on(uiCmd("\u2318F"), focusSearch);
73336 function focusSearch(d3_event) {
73337 var mode = context.mode() && context.mode().id;
73338 if (mode !== "browse") return;
73339 d3_event.preventDefault();
73340 search.node().focus();
73342 function keydown(d3_event) {
73343 if (d3_event.keyCode === 27) {
73344 search.node().blur();
73347 function keypress(d3_event) {
73348 var q3 = search.property("value"), items = list.selectAll(".feature-list-item");
73349 if (d3_event.keyCode === 13 && // ↩ Return
73350 q3.length && items.size()) {
73351 click(d3_event, items.datum());
73354 function inputevent() {
73355 _geocodeResults = void 0;
73358 function clearSearch() {
73359 search.property("value", "");
73362 function mapDrawn(e3) {
73367 function features() {
73368 var graph = context.graph();
73369 var visibleCenter = context.map().extent().center();
73370 var q3 = search.property("value").toLowerCase().trim();
73371 if (!q3) return [];
73372 const locationMatch = sexagesimal.pair(q3.toUpperCase()) || dmsMatcher(q3);
73373 const coordResult = [];
73374 if (locationMatch) {
73375 const latLon = [Number(locationMatch[0]), Number(locationMatch[1])];
73376 const lonLat = [latLon[1], latLon[0]];
73377 const isLatLonValid = latLon[0] >= -90 && latLon[0] <= 90 && latLon[1] >= -180 && latLon[1] <= 180;
73378 let isLonLatValid = lonLat[0] >= -90 && lonLat[0] <= 90 && lonLat[1] >= -180 && lonLat[1] <= 180;
73379 isLonLatValid && (isLonLatValid = !q3.match(/[NSEW]/i));
73380 isLonLatValid && (isLonLatValid = !locationMatch[2]);
73381 isLonLatValid && (isLonLatValid = lonLat[0] !== lonLat[1]);
73382 if (isLatLonValid) {
73384 id: latLon[0] + "/" + latLon[1],
73386 type: _t("inspector.location"),
73387 name: dmsCoordinatePair([latLon[1], latLon[0]]),
73389 zoom: locationMatch[2]
73392 if (isLonLatValid) {
73394 id: lonLat[0] + "/" + lonLat[1],
73396 type: _t("inspector.location"),
73397 name: dmsCoordinatePair([lonLat[1], lonLat[0]]),
73402 const idMatch = !locationMatch && q3.match(/(?:^|\W)(node|way|relation|note|[nwr])\W{0,2}0*([1-9]\d*)(?:\W|$)/i);
73403 const idResult = [];
73405 var elemType = idMatch[1] === "note" ? idMatch[1] : idMatch[1].charAt(0);
73406 var elemId = idMatch[2];
73408 id: elemType + elemId,
73409 geometry: elemType === "n" ? "point" : elemType === "w" ? "line" : elemType === "note" ? "note" : "relation",
73410 type: elemType === "n" ? _t("inspector.node") : elemType === "w" ? _t("inspector.way") : elemType === "note" ? _t("note.note") : _t("inspector.relation"),
73414 var allEntities = graph.entities;
73415 const localResults = [];
73416 for (var id2 in allEntities) {
73417 var entity = allEntities[id2];
73418 if (!entity) continue;
73419 var name = utilDisplayName(entity) || "";
73420 if (name.toLowerCase().indexOf(q3) < 0) continue;
73421 var matched = _mainPresetIndex.match(entity, graph);
73422 var type2 = matched && matched.name() || utilDisplayType(entity.id);
73423 var extent = entity.extent(graph);
73424 var distance = extent ? geoSphericalDistance(visibleCenter, extent.center()) : 0;
73425 localResults.push({
73428 geometry: entity.geometry(graph),
73433 if (localResults.length > 100) break;
73435 localResults.sort((a2, b3) => a2.distance - b3.distance);
73436 const geocodeResults = [];
73437 (_geocodeResults || []).forEach(function(d4) {
73438 if (d4.osm_type && d4.osm_id) {
73439 var id3 = osmEntity.id.fromOSM(d4.osm_type, d4.osm_id);
73441 tags[d4.class] = d4.type;
73442 var attrs = { id: id3, type: d4.osm_type, tags };
73443 if (d4.osm_type === "way") {
73444 attrs.nodes = ["a", "a"];
73446 var tempEntity = osmEntity(attrs);
73447 var tempGraph = coreGraph([tempEntity]);
73448 var matched2 = _mainPresetIndex.match(tempEntity, tempGraph);
73449 var type3 = matched2 && matched2.name() || utilDisplayType(id3);
73450 geocodeResults.push({
73452 geometry: tempEntity.geometry(tempGraph),
73454 name: d4.display_name,
73455 extent: new geoExtent(
73456 [Number(d4.boundingbox[3]), Number(d4.boundingbox[0])],
73457 [Number(d4.boundingbox[2]), Number(d4.boundingbox[1])]
73462 const extraResults = [];
73463 if (q3.match(/^[0-9]+$/)) {
73464 extraResults.push({
73467 type: _t("inspector.node"),
73470 extraResults.push({
73473 type: _t("inspector.way"),
73476 extraResults.push({
73478 geometry: "relation",
73479 type: _t("inspector.relation"),
73482 extraResults.push({
73485 type: _t("note.note"),
73489 return [...idResult, ...localResults, ...coordResult, ...geocodeResults, ...extraResults];
73491 function drawList() {
73492 var value = search.property("value");
73493 var results = features();
73494 list.classed("filtered", value.length);
73495 var resultsIndicator = list.selectAll(".no-results-item").data([0]).enter().append("button").property("disabled", true).attr("class", "no-results-item").call(svgIcon("#iD-icon-alert", "pre-text"));
73496 resultsIndicator.append("span").attr("class", "entity-name");
73497 list.selectAll(".no-results-item .entity-name").html("").call(_t.append("geocoder.no_results_worldwide"));
73498 if (services.geocoder) {
73499 list.selectAll(".geocode-item").data([0]).enter().append("button").attr("class", "geocode-item secondary-action").on("click", geocoderSearch).append("div").attr("class", "label").append("span").attr("class", "entity-name").call(_t.append("geocoder.search"));
73501 list.selectAll(".no-results-item").style("display", value.length && !results.length ? "block" : "none");
73502 list.selectAll(".geocode-item").style("display", value && _geocodeResults === void 0 ? "block" : "none");
73503 var items = list.selectAll(".feature-list-item").data(results, function(d4) {
73506 var enter = items.enter().insert("button", ".geocode-item").attr("class", "feature-list-item").on("pointerenter", mouseover).on("pointerleave", mouseout).on("focus", mouseover).on("blur", mouseout).on("click", click);
73507 var label = enter.append("div").attr("class", "label");
73508 label.each(function(d4) {
73509 select_default2(this).call(svgIcon("#iD-icon-" + d4.geometry, "pre-text"));
73511 label.append("span").attr("class", "entity-type").text(function(d4) {
73514 label.append("span").attr("class", "entity-name").classed("has-colour", (d4) => d4.entity && d4.entity.type === "relation" && d4.entity.tags.colour && isColourValid(d4.entity.tags.colour)).style("border-color", (d4) => d4.entity && d4.entity.type === "relation" && d4.entity.tags.colour).text(function(d4) {
73517 enter.style("opacity", 0).transition().style("opacity", 1);
73518 items.exit().each((d4) => mouseout(void 0, d4)).remove();
73519 items.merge(enter).order();
73521 function mouseover(d3_event, d4) {
73522 if (d4.location !== void 0) return;
73523 utilHighlightEntities([d4.id], true, context);
73525 function mouseout(d3_event, d4) {
73526 if (d4.location !== void 0) return;
73527 utilHighlightEntities([d4.id], false, context);
73529 function click(d3_event, d4) {
73530 d3_event.preventDefault();
73532 context.map().centerZoomEase([d4.location[1], d4.location[0]], d4.zoom || 19);
73533 } else if (d4.entity) {
73534 utilHighlightEntities([d4.id], false, context);
73535 context.enter(modeSelect(context, [d4.entity.id]));
73536 context.map().zoomToEase(d4.entity);
73537 } else if (d4.geometry === "note") {
73538 const noteId = d4.id.replace(/\D/g, "");
73539 context.moveToNote(noteId);
73541 context.zoomToEntity(d4.id);
73544 function geocoderSearch() {
73545 services.geocoder.search(search.property("value"), function(err, resp) {
73546 _geocodeResults = resp || [];
73551 return featureList;
73554 var init_feature_list = __esm({
73555 "modules/ui/feature_list.js"() {
73558 sexagesimal = __toESM(require_sexagesimal(), 1);
73575 // modules/ui/sections/entity_issues.js
73576 var entity_issues_exports = {};
73577 __export(entity_issues_exports, {
73578 uiSectionEntityIssues: () => uiSectionEntityIssues
73580 function uiSectionEntityIssues(context) {
73581 var preference = corePreferences("entity-issues.reference.expanded");
73582 var _expanded = preference === null ? true : preference === "true";
73583 var _entityIDs = [];
73585 var _activeIssueID;
73586 var section = uiSection("entity-issues", context).shouldDisplay(function() {
73587 return _issues.length > 0;
73588 }).label(function() {
73589 return _t.append("inspector.title_count", { title: _t("issues.list_title"), count: _issues.length });
73590 }).disclosureContent(renderDisclosureContent);
73591 context.validator().on("validated.entity_issues", function() {
73593 section.reRender();
73594 }).on("focusedIssue.entity_issues", function(issue) {
73595 makeActiveIssue(issue.id);
73597 function reloadIssues() {
73598 _issues = context.validator().getSharedEntityIssues(_entityIDs, { includeDisabledRules: true });
73600 function makeActiveIssue(issueID) {
73601 _activeIssueID = issueID;
73602 section.selection().selectAll(".issue-container").classed("active", function(d4) {
73603 return d4.id === _activeIssueID;
73606 function renderDisclosureContent(selection2) {
73607 selection2.classed("grouped-items-area", true);
73608 _activeIssueID = _issues.length > 0 ? _issues[0].id : null;
73609 var containers = selection2.selectAll(".issue-container").data(_issues, function(d4) {
73612 containers.exit().remove();
73613 var containersEnter = containers.enter().append("div").attr("class", "issue-container");
73614 var itemsEnter = containersEnter.append("div").attr("class", function(d4) {
73615 return "issue severity-" + d4.severity;
73616 }).on("mouseover.highlight", function(d3_event, d4) {
73617 var ids = d4.entityIds.filter(function(e3) {
73618 return _entityIDs.indexOf(e3) === -1;
73620 utilHighlightEntities(ids, true, context);
73621 }).on("mouseout.highlight", function(d3_event, d4) {
73622 var ids = d4.entityIds.filter(function(e3) {
73623 return _entityIDs.indexOf(e3) === -1;
73625 utilHighlightEntities(ids, false, context);
73627 var labelsEnter = itemsEnter.append("div").attr("class", "issue-label");
73628 var textEnter = labelsEnter.append("button").attr("class", "issue-text").on("click", function(d3_event, d4) {
73629 makeActiveIssue(d4.id);
73630 const extent = d4.extent(context.graph());
73632 context.map().zoomToEase(extent);
73635 textEnter.each(function(d4) {
73636 select_default2(this).call(svgIcon(validationIssue.ICONS[d4.severity], "issue-icon"));
73638 textEnter.append("span").attr("class", "issue-message");
73639 var infoButton = labelsEnter.append("button").attr("class", "issue-info-button").attr("title", _t("icons.information")).call(svgIcon("#iD-icon-inspect"));
73640 infoButton.on("click", function(d3_event) {
73641 d3_event.stopPropagation();
73642 d3_event.preventDefault();
73644 var container = select_default2(this.parentNode.parentNode.parentNode);
73645 var info = container.selectAll(".issue-info");
73646 var isExpanded = info.classed("expanded");
73647 _expanded = !isExpanded;
73648 corePreferences("entity-issues.reference.expanded", _expanded);
73650 info.transition().duration(200).style("max-height", "0px").style("opacity", "0").on("end", function() {
73651 info.classed("expanded", false);
73654 info.classed("expanded", true).transition().duration(200).style("max-height", "200px").style("opacity", "1").on("end", function() {
73655 info.style("max-height", null);
73659 itemsEnter.append("ul").attr("class", "issue-fix-list");
73660 containersEnter.append("div").attr("class", "issue-info" + (_expanded ? " expanded" : "")).style("max-height", _expanded ? null : "0").style("opacity", _expanded ? "1" : "0").each(function(d4) {
73661 if (typeof d4.reference === "function") {
73662 select_default2(this).call(d4.reference);
73664 select_default2(this).call(_t.append("inspector.no_documentation_key"));
73667 containers = containers.merge(containersEnter).classed("active", function(d4) {
73668 return d4.id === _activeIssueID;
73670 containers.selectAll(".issue-message").text("").each(function(d4) {
73671 return d4.message(context)(select_default2(this));
73673 var fixLists = containers.selectAll(".issue-fix-list");
73674 var fixes = fixLists.selectAll(".issue-fix-item").data(function(d4) {
73675 return d4.fixes ? d4.fixes(context) : [];
73679 fixes.exit().remove();
73680 var fixesEnter = fixes.enter().append("li").attr("class", "issue-fix-item");
73681 var buttons = fixesEnter.append("button").on("click", function(d3_event, d4) {
73682 if (select_default2(this).attr("disabled") || !d4.onClick) return;
73683 if (d4.issue.dateLastRanFix && /* @__PURE__ */ new Date() - d4.issue.dateLastRanFix < 1e3) return;
73684 d4.issue.dateLastRanFix = /* @__PURE__ */ new Date();
73685 utilHighlightEntities(d4.issue.entityIds.concat(d4.entityIds), false, context);
73686 new Promise(function(resolve, reject) {
73687 d4.onClick(context, resolve, reject);
73688 if (d4.onClick.length <= 1) {
73691 }).then(function() {
73692 context.validator().validate();
73694 }).on("mouseover.highlight", function(d3_event, d4) {
73695 utilHighlightEntities(d4.entityIds, true, context);
73696 }).on("mouseout.highlight", function(d3_event, d4) {
73697 utilHighlightEntities(d4.entityIds, false, context);
73699 buttons.each(function(d4) {
73700 var iconName = d4.icon || "iD-icon-wrench";
73701 if (iconName.startsWith("maki")) {
73704 select_default2(this).call(svgIcon("#" + iconName, "fix-icon"));
73706 buttons.append("span").attr("class", "fix-message").each(function(d4) {
73707 return d4.title(select_default2(this));
73709 fixesEnter.merge(fixes).selectAll("button").classed("actionable", function(d4) {
73711 }).attr("disabled", function(d4) {
73712 return d4.onClick ? null : "true";
73713 }).attr("title", function(d4) {
73714 if (d4.disabledReason) {
73715 return d4.disabledReason;
73720 section.entityIDs = function(val) {
73721 if (!arguments.length) return _entityIDs;
73722 if (!_entityIDs || !val || !utilArrayIdentical(_entityIDs, val)) {
73724 _activeIssueID = null;
73731 var init_entity_issues = __esm({
73732 "modules/ui/sections/entity_issues.js"() {
73735 init_preferences();
73745 // modules/ui/preset_icon.js
73746 var preset_icon_exports = {};
73747 __export(preset_icon_exports, {
73748 uiPresetIcon: () => uiPresetIcon
73750 function uiPresetIcon() {
73753 function presetIcon(selection2) {
73754 selection2.each(render);
73756 function getIcon(p2, geom) {
73757 if (p2.isFallback && p2.isFallback()) return geom === "vertex" ? "" : "iD-icon-" + p2.id;
73758 if (p2.icon) return p2.icon;
73759 if (geom === "line") return "iD-other-line";
73760 if (geom === "vertex") return "temaki-vertex";
73761 return "maki-marker-stroked";
73763 function renderPointBorder(container, drawPoint) {
73764 let pointBorder = container.selectAll(".preset-icon-point-border").data(drawPoint ? [0] : []);
73765 pointBorder.exit().remove();
73766 let pointBorderEnter = pointBorder.enter();
73769 pointBorderEnter.append("svg").attr("class", "preset-icon-fill preset-icon-point-border").attr("width", w3).attr("height", h3).attr("viewBox", `0 0 ${w3} ${h3}`).append("path").attr("transform", "translate(11.5, 8)").attr("d", "M 17,8 C 17,13 11,21 8.5,23.5 C 6,21 0,13 0,8 C 0,4 4,-0.5 8.5,-0.5 C 13,-0.5 17,4 17,8 z");
73770 pointBorder = pointBorderEnter.merge(pointBorder);
73772 function renderCategoryBorder(container, category) {
73773 let categoryBorder = container.selectAll(".preset-icon-category-border").data(category ? [0] : []);
73774 categoryBorder.exit().remove();
73775 let categoryBorderEnter = categoryBorder.enter();
73777 let svgEnter = categoryBorderEnter.append("svg").attr("class", "preset-icon-fill preset-icon-category-border").attr("width", d4).attr("height", d4).attr("viewBox", `0 0 ${d4} ${d4}`);
73778 svgEnter.append("path").attr("class", "area").attr("d", "M9.5,7.5 L25.5,7.5 L28.5,12.5 L49.5,12.5 C51.709139,12.5 53.5,14.290861 53.5,16.5 L53.5,43.5 C53.5,45.709139 51.709139,47.5 49.5,47.5 L10.5,47.5 C8.290861,47.5 6.5,45.709139 6.5,43.5 L6.5,12.5 L9.5,7.5 Z");
73779 categoryBorder = categoryBorderEnter.merge(categoryBorder);
73781 categoryBorder.selectAll("path").attr("class", `area ${category.id}`);
73784 function renderCircleFill(container, drawVertex) {
73785 let vertexFill = container.selectAll(".preset-icon-fill-vertex").data(drawVertex ? [0] : []);
73786 vertexFill.exit().remove();
73787 let vertexFillEnter = vertexFill.enter();
73791 vertexFillEnter.append("svg").attr("class", "preset-icon-fill preset-icon-fill-vertex").attr("width", w3).attr("height", h3).attr("viewBox", `0 0 ${w3} ${h3}`).append("circle").attr("cx", w3 / 2).attr("cy", h3 / 2).attr("r", d4 / 2);
73792 vertexFill = vertexFillEnter.merge(vertexFill);
73794 function renderSquareFill(container, drawArea, tagClasses) {
73795 let fill = container.selectAll(".preset-icon-fill-area").data(drawArea ? [0] : []);
73796 fill.exit().remove();
73797 let fillEnter = fill.enter();
73801 const l4 = d4 * 2 / 3;
73802 const c1 = (w3 - l4) / 2;
73803 const c2 = c1 + l4;
73804 fillEnter = fillEnter.append("svg").attr("class", "preset-icon-fill preset-icon-fill-area").attr("width", w3).attr("height", h3).attr("viewBox", `0 0 ${w3} ${h3}`);
73805 ["fill", "stroke"].forEach((klass) => {
73806 fillEnter.append("path").attr("d", `M${c1} ${c1} L${c1} ${c2} L${c2} ${c2} L${c2} ${c1} Z`).attr("class", `area ${klass}`);
73808 const rVertex = 2.5;
73809 [[c1, c1], [c1, c2], [c2, c2], [c2, c1]].forEach((point) => {
73810 fillEnter.append("circle").attr("class", "vertex").attr("cx", point[0]).attr("cy", point[1]).attr("r", rVertex);
73812 const rMidpoint = 1.25;
73813 [[c1, w3 / 2], [c2, w3 / 2], [h3 / 2, c1], [h3 / 2, c2]].forEach((point) => {
73814 fillEnter.append("circle").attr("class", "midpoint").attr("cx", point[0]).attr("cy", point[1]).attr("r", rMidpoint);
73816 fill = fillEnter.merge(fill);
73817 fill.selectAll("path.stroke").attr("class", `area stroke ${tagClasses}`);
73818 fill.selectAll("path.fill").attr("class", `area fill ${tagClasses}`);
73820 function renderLine(container, drawLine, tagClasses) {
73821 let line = container.selectAll(".preset-icon-line").data(drawLine ? [0] : []);
73822 line.exit().remove();
73823 let lineEnter = line.enter();
73827 const y3 = Math.round(d4 * 0.72);
73828 const l4 = Math.round(d4 * 0.6);
73830 const x12 = (w3 - l4) / 2;
73831 const x2 = x12 + l4;
73832 lineEnter = lineEnter.append("svg").attr("class", "preset-icon-line").attr("width", w3).attr("height", h3).attr("viewBox", `0 0 ${w3} ${h3}`);
73833 ["casing", "stroke"].forEach((klass) => {
73834 lineEnter.append("path").attr("d", `M${x12} ${y3} L${x2} ${y3}`).attr("class", `line ${klass}`);
73836 [[x12 - 1, y3], [x2 + 1, y3]].forEach((point) => {
73837 lineEnter.append("circle").attr("class", "vertex").attr("cx", point[0]).attr("cy", point[1]).attr("r", r2);
73839 line = lineEnter.merge(line);
73840 line.selectAll("path.stroke").attr("class", `line stroke ${tagClasses}`);
73841 line.selectAll("path.casing").attr("class", `line casing ${tagClasses}`);
73843 function renderRoute(container, drawRoute, p2) {
73844 let route = container.selectAll(".preset-icon-route").data(drawRoute ? [0] : []);
73845 route.exit().remove();
73846 let routeEnter = route.enter();
73850 const y12 = Math.round(d4 * 0.8);
73851 const y22 = Math.round(d4 * 0.68);
73852 const l4 = Math.round(d4 * 0.6);
73854 const x12 = (w3 - l4) / 2;
73855 const x2 = x12 + l4 / 3;
73856 const x3 = x2 + l4 / 3;
73857 const x4 = x3 + l4 / 3;
73858 routeEnter = routeEnter.append("svg").attr("class", "preset-icon-route").attr("width", w3).attr("height", h3).attr("viewBox", `0 0 ${w3} ${h3}`);
73859 ["casing", "stroke"].forEach((klass) => {
73860 routeEnter.append("path").attr("d", `M${x12} ${y12} L${x2} ${y22}`).attr("class", `segment0 line ${klass}`);
73861 routeEnter.append("path").attr("d", `M${x2} ${y22} L${x3} ${y12}`).attr("class", `segment1 line ${klass}`);
73862 routeEnter.append("path").attr("d", `M${x3} ${y12} L${x4} ${y22}`).attr("class", `segment2 line ${klass}`);
73864 [[x12, y12], [x2, y22], [x3, y12], [x4, y22]].forEach((point) => {
73865 routeEnter.append("circle").attr("class", "vertex").attr("cx", point[0]).attr("cy", point[1]).attr("r", r2);
73867 route = routeEnter.merge(route);
73869 let routeType = p2.tags.type === "waterway" ? "waterway" : p2.tags.route;
73870 const segmentPresetIDs = routeSegments[routeType];
73871 for (let i3 in segmentPresetIDs) {
73872 const segmentPreset = _mainPresetIndex.item(segmentPresetIDs[i3]);
73873 const segmentTagClasses = svgTagClasses().getClassesString(segmentPreset.tags, "");
73874 route.selectAll(`path.stroke.segment${i3}`).attr("class", `segment${i3} line stroke ${segmentTagClasses}`);
73875 route.selectAll(`path.casing.segment${i3}`).attr("class", `segment${i3} line casing ${segmentTagClasses}`);
73879 function renderSvgIcon(container, picon, geom, isFramed, category, tagClasses) {
73880 const isMaki = picon && /^maki-/.test(picon);
73881 const isTemaki = picon && /^temaki-/.test(picon);
73882 const isFa = picon && /^fa[srb]-/.test(picon);
73883 const isR\u00F6ntgen = picon && /^roentgen-/.test(picon);
73884 const isiDIcon = picon && !(isMaki || isTemaki || isFa || isR\u00F6ntgen);
73885 let icon2 = container.selectAll(".preset-icon").data(picon ? [0] : []);
73886 icon2.exit().remove();
73887 icon2 = icon2.enter().append("div").attr("class", "preset-icon").call(svgIcon("")).merge(icon2);
73888 icon2.attr("class", "preset-icon " + (geom ? geom + "-geom" : "")).classed("category", category).classed("framed", isFramed).classed("preset-icon-iD", isiDIcon);
73889 icon2.selectAll("svg").attr("class", "icon " + picon + " " + (!isiDIcon && geom !== "line" ? "" : tagClasses));
73890 icon2.selectAll("use").attr("href", "#" + picon);
73892 function renderImageIcon(container, imageURL) {
73893 let imageIcon = container.selectAll("img.image-icon").data(imageURL ? [0] : []);
73894 imageIcon.exit().remove();
73895 imageIcon = imageIcon.enter().append("img").attr("class", "image-icon").on("load", () => container.classed("showing-img", true)).on("error", () => container.classed("showing-img", false)).merge(imageIcon);
73896 imageIcon.attr("src", imageURL);
73898 const routeSegments = {
73899 bicycle: ["highway/cycleway", "highway/cycleway", "highway/cycleway"],
73900 bus: ["highway/unclassified", "highway/secondary", "highway/primary"],
73901 climbing: ["climbing/route", "climbing/route", "climbing/route"],
73902 trolleybus: ["highway/unclassified", "highway/secondary", "highway/primary"],
73903 detour: ["highway/tertiary", "highway/residential", "highway/unclassified"],
73904 ferry: ["route/ferry", "route/ferry", "route/ferry"],
73905 foot: ["highway/footway", "highway/footway", "highway/footway"],
73906 hiking: ["highway/path", "highway/path", "highway/path"],
73907 horse: ["highway/bridleway", "highway/bridleway", "highway/bridleway"],
73908 light_rail: ["railway/light_rail", "railway/light_rail", "railway/light_rail"],
73909 monorail: ["railway/monorail", "railway/monorail", "railway/monorail"],
73910 mtb: ["highway/path", "highway/track", "highway/bridleway"],
73911 pipeline: ["man_made/pipeline", "man_made/pipeline", "man_made/pipeline"],
73912 piste: ["piste/downhill", "piste/hike", "piste/nordic"],
73913 power: ["power/line", "power/line", "power/line"],
73914 road: ["highway/secondary", "highway/primary", "highway/trunk"],
73915 subway: ["railway/subway", "railway/subway", "railway/subway"],
73916 train: ["railway/rail", "railway/rail", "railway/rail"],
73917 tram: ["railway/tram", "railway/tram", "railway/tram"],
73918 railway: ["railway/rail", "railway/rail", "railway/rail"],
73919 waterway: ["waterway/stream", "waterway/stream", "waterway/stream"]
73921 function render() {
73922 let p2 = _preset.apply(this, arguments);
73923 let geom = _geometry ? _geometry.apply(this, arguments) : null;
73924 if (geom === "relation" && p2.tags && (p2.tags.type === "route" && p2.tags.route && routeSegments[p2.tags.route] || p2.tags.type === "waterway")) {
73927 const showThirdPartyIcons = corePreferences("preferences.privacy.thirdpartyicons") || "true";
73928 const isFallback = p2.isFallback && p2.isFallback();
73929 const imageURL = showThirdPartyIcons === "true" && p2.imageURL;
73930 const picon = getIcon(p2, geom);
73931 const isCategory = !p2.setTags;
73932 const drawPoint = false;
73933 const drawVertex = picon !== null && geom === "vertex";
73934 const drawLine = picon && geom === "line" && !isFallback && !isCategory;
73935 const drawArea = picon && geom === "area" && !isFallback && !isCategory;
73936 const drawRoute = picon && geom === "route";
73937 const isFramed = drawVertex || drawArea || drawLine || drawRoute || isCategory;
73938 let tags = !isCategory ? p2.setTags({}, geom) : {};
73939 for (let k2 in tags) {
73940 if (tags[k2] === "*") {
73944 let tagClasses = svgTagClasses().getClassesString(tags, "");
73945 let selection2 = select_default2(this);
73946 let container = selection2.selectAll(".preset-icon-container").data([0]);
73947 container = container.enter().append("div").attr("class", "preset-icon-container").merge(container);
73948 container.classed("showing-img", !!imageURL).classed("fallback", isFallback);
73949 renderCategoryBorder(container, isCategory && p2);
73950 renderPointBorder(container, drawPoint);
73951 renderCircleFill(container, drawVertex);
73952 renderSquareFill(container, drawArea, tagClasses);
73953 renderLine(container, drawLine, tagClasses);
73954 renderRoute(container, drawRoute, p2);
73955 renderSvgIcon(container, picon, geom, isFramed, isCategory, tagClasses);
73956 renderImageIcon(container, imageURL);
73958 presetIcon.preset = function(val) {
73959 if (!arguments.length) return _preset;
73960 _preset = utilFunctor(val);
73963 presetIcon.geometry = function(val) {
73964 if (!arguments.length) return _geometry;
73965 _geometry = utilFunctor(val);
73970 var init_preset_icon = __esm({
73971 "modules/ui/preset_icon.js"() {
73975 init_preferences();
73981 // modules/ui/sections/feature_type.js
73982 var feature_type_exports = {};
73983 __export(feature_type_exports, {
73984 uiSectionFeatureType: () => uiSectionFeatureType
73986 function uiSectionFeatureType(context) {
73987 var dispatch14 = dispatch_default("choose");
73988 var _entityIDs = [];
73991 var section = uiSection("feature-type", context).label(() => _t.append("inspector.feature_type")).disclosureContent(renderDisclosureContent);
73992 function renderDisclosureContent(selection2) {
73993 selection2.classed("preset-list-item", true);
73994 selection2.classed("mixed-types", _presets.length > 1);
73995 var presetButtonWrap = selection2.selectAll(".preset-list-button-wrap").data([0]).enter().append("div").attr("class", "preset-list-button-wrap");
73996 var presetButton = presetButtonWrap.append("button").attr("class", "preset-list-button preset-reset").call(
73997 uiTooltip().title(() => _t.append("inspector.back_tooltip")).placement("bottom")
73999 presetButton.append("div").attr("class", "preset-icon-container");
74000 presetButton.append("div").attr("class", "label").append("div").attr("class", "label-inner");
74001 presetButtonWrap.append("div").attr("class", "accessory-buttons");
74002 var tagReferenceBodyWrap = selection2.selectAll(".tag-reference-body-wrap").data([0]);
74003 tagReferenceBodyWrap = tagReferenceBodyWrap.enter().append("div").attr("class", "tag-reference-body-wrap").merge(tagReferenceBodyWrap);
74004 if (_tagReference) {
74005 selection2.selectAll(".preset-list-button-wrap .accessory-buttons").style("display", _presets.length === 1 ? null : "none").call(_tagReference.button);
74006 tagReferenceBodyWrap.style("display", _presets.length === 1 ? null : "none").call(_tagReference.body);
74008 selection2.selectAll(".preset-reset").on("click", function() {
74009 dispatch14.call("choose", this, _presets);
74010 }).on("pointerdown pointerup mousedown mouseup", function(d3_event) {
74011 d3_event.preventDefault();
74012 d3_event.stopPropagation();
74014 var geometries = entityGeometries();
74015 selection2.select(".preset-list-item button").call(
74016 uiPresetIcon().geometry(_presets.length === 1 ? geometries.length === 1 && geometries[0] : null).preset(_presets.length === 1 ? _presets[0] : _mainPresetIndex.item("point"))
74018 var names = _presets.length === 1 ? [
74019 _presets[0].nameLabel(),
74020 _presets[0].subtitleLabel()
74021 ].filter(Boolean) : [_t.append("inspector.multiple_types")];
74022 var label = selection2.select(".label-inner");
74023 var nameparts = label.selectAll(".namepart").data(names, (d4) => d4.stringId);
74024 nameparts.exit().remove();
74025 nameparts.enter().append("div").attr("class", "namepart").text("").each(function(d4) {
74026 d4(select_default2(this));
74029 section.entityIDs = function(val) {
74030 if (!arguments.length) return _entityIDs;
74034 section.presets = function(val) {
74035 if (!arguments.length) return _presets;
74036 if (!utilArrayIdentical(val, _presets)) {
74038 if (_presets.length === 1) {
74039 _tagReference = uiTagReference(_presets[0].reference(), context).showing(false);
74044 function entityGeometries() {
74046 for (var i3 in _entityIDs) {
74047 var geometry = context.graph().geometry(_entityIDs[i3]);
74048 if (!counts[geometry]) counts[geometry] = 0;
74049 counts[geometry] += 1;
74051 return Object.keys(counts).sort(function(geom1, geom2) {
74052 return counts[geom2] - counts[geom1];
74055 return utilRebind(section, dispatch14, "on");
74057 var init_feature_type = __esm({
74058 "modules/ui/sections/feature_type.js"() {
74067 init_preset_icon();
74069 init_tag_reference();
74073 // modules/ui/form_fields.js
74074 var form_fields_exports = {};
74075 __export(form_fields_exports, {
74076 uiFormFields: () => uiFormFields
74078 function uiFormFields(context) {
74079 var moreCombo = uiCombobox(context, "more-fields").minItems(1);
74080 var _fieldsArr = [];
74081 var _lastPlaceholder = "";
74084 function formFields(selection2) {
74085 var allowedFields = _fieldsArr.filter(function(field) {
74086 return field.isAllowed();
74088 var shown = allowedFields.filter(function(field) {
74089 return field.isShown();
74091 var notShown = allowedFields.filter(function(field) {
74092 return !field.isShown();
74093 }).sort(function(a2, b3) {
74094 return a2.universal === b3.universal ? 0 : a2.universal ? 1 : -1;
74096 var container = selection2.selectAll(".form-fields-container").data([0]);
74097 container = container.enter().append("div").attr("class", "form-fields-container " + (_klass || "")).merge(container);
74098 var fields = container.selectAll(".wrap-form-field").data(shown, function(d4) {
74099 return d4.id + (d4.entityIDs ? d4.entityIDs.join() : "");
74101 fields.exit().remove();
74102 var enter = fields.enter().append("div").attr("class", function(d4) {
74103 return "wrap-form-field wrap-form-field-" + d4.safeid;
74105 fields = fields.merge(enter);
74106 fields.order().each(function(d4) {
74107 select_default2(this).call(d4.render);
74110 var moreFields = notShown.map(function(field) {
74111 var title = field.title();
74112 titles.push(title);
74113 var terms = field.terms();
74114 if (field.key) terms.push(field.key);
74115 if (field.keys) terms = terms.concat(field.keys);
74117 display: field.label(),
74124 var placeholder = titles.slice(0, 3).join(", ") + (titles.length > 3 ? "\u2026" : "");
74125 var more = selection2.selectAll(".more-fields").data(_state === "hover" || moreFields.length === 0 ? [] : [0]);
74126 more.exit().remove();
74127 var moreEnter = more.enter().append("div").attr("class", "more-fields").append("label");
74128 moreEnter.append("span").call(_t.append("inspector.add_fields"));
74129 more = moreEnter.merge(more);
74130 var input = more.selectAll(".value").data([0]);
74131 input.exit().remove();
74132 input = input.enter().append("input").attr("class", "value").attr("type", "text").attr("placeholder", placeholder).call(utilNoAuto).merge(input);
74133 input.call(utilGetSetValue, "").call(
74134 moreCombo.data(moreFields).on("accept", function(d4) {
74136 var field = d4.field;
74138 selection2.call(formFields);
74142 if (_lastPlaceholder !== placeholder) {
74143 input.attr("placeholder", placeholder);
74144 _lastPlaceholder = placeholder;
74147 formFields.fieldsArr = function(val) {
74148 if (!arguments.length) return _fieldsArr;
74149 _fieldsArr = val || [];
74152 formFields.state = function(val) {
74153 if (!arguments.length) return _state;
74157 formFields.klass = function(val) {
74158 if (!arguments.length) return _klass;
74164 var init_form_fields = __esm({
74165 "modules/ui/form_fields.js"() {
74174 // modules/ui/sections/preset_fields.js
74175 var preset_fields_exports = {};
74176 __export(preset_fields_exports, {
74177 uiSectionPresetFields: () => uiSectionPresetFields
74179 function uiSectionPresetFields(context) {
74180 var section = uiSection("preset-fields", context).label(() => _t.append("inspector.fields")).disclosureContent(renderDisclosureContent);
74181 var dispatch14 = dispatch_default("change", "revert");
74182 var formFields = uiFormFields(context);
74188 function renderDisclosureContent(selection2) {
74190 var graph = context.graph();
74191 var geometries = Object.keys(_entityIDs.reduce(function(geoms, entityID) {
74192 geoms[graph.entity(entityID).geometry(graph)] = true;
74195 const loc = _entityIDs.reduce(function(extent, entityID) {
74196 var entity = context.graph().entity(entityID);
74197 return extent.extend(entity.extent(context.graph()));
74198 }, geoExtent()).center();
74199 var presetsManager = _mainPresetIndex;
74200 var allFields = [];
74201 var allMoreFields = [];
74202 var sharedTotalFields;
74203 _presets.forEach(function(preset) {
74204 var fields = preset.fields(loc);
74205 var moreFields = preset.moreFields(loc);
74206 allFields = utilArrayUnion(allFields, fields);
74207 allMoreFields = utilArrayUnion(allMoreFields, moreFields);
74208 if (!sharedTotalFields) {
74209 sharedTotalFields = utilArrayUnion(fields, moreFields);
74211 sharedTotalFields = sharedTotalFields.filter(function(field) {
74212 return fields.indexOf(field) !== -1 || moreFields.indexOf(field) !== -1;
74216 var sharedFields = allFields.filter(function(field) {
74217 return sharedTotalFields.indexOf(field) !== -1;
74219 var sharedMoreFields = allMoreFields.filter(function(field) {
74220 return sharedTotalFields.indexOf(field) !== -1;
74223 sharedFields.forEach(function(field) {
74224 if (field.matchAllGeometry(geometries)) {
74226 uiField(context, field, _entityIDs)
74230 var singularEntity = _entityIDs.length === 1 && graph.hasEntity(_entityIDs[0]);
74231 if (singularEntity && singularEntity.type === "node" && singularEntity.isHighwayIntersection(graph) && presetsManager.field("restrictions")) {
74233 uiField(context, presetsManager.field("restrictions"), _entityIDs)
74236 var additionalFields = utilArrayUnion(sharedMoreFields, presetsManager.universal());
74237 additionalFields.sort(function(field1, field2) {
74238 return field1.title().localeCompare(field2.title(), _mainLocalizer.localeCode());
74240 additionalFields.forEach(function(field) {
74241 if (sharedFields.indexOf(field) === -1 && field.matchAllGeometry(geometries)) {
74243 uiField(context, field, _entityIDs, { show: false })
74247 _fieldsArr.forEach(function(field) {
74248 field.on("change", function(t2, onInput) {
74249 dispatch14.call("change", field, _entityIDs, t2, onInput);
74250 }).on("revert", function(keys2) {
74251 dispatch14.call("revert", field, keys2);
74255 _fieldsArr.forEach(function(field) {
74256 field.state(_state).tags(_tags);
74259 formFields.fieldsArr(_fieldsArr).state(_state).klass("grouped-items-area")
74262 section.presets = function(val) {
74263 if (!arguments.length) return _presets;
74264 if (!_presets || !val || !utilArrayIdentical(_presets, val)) {
74270 section.state = function(val) {
74271 if (!arguments.length) return _state;
74275 section.tags = function(val) {
74276 if (!arguments.length) return _tags;
74280 section.entityIDs = function(val) {
74281 if (!arguments.length) return _entityIDs;
74282 if (!val || !_entityIDs || !utilArrayIdentical(_entityIDs, val)) {
74288 return utilRebind(section, dispatch14, "on");
74290 var init_preset_fields = __esm({
74291 "modules/ui/sections/preset_fields.js"() {
74300 init_form_fields();
74305 // modules/ui/sections/raw_member_editor.js
74306 var raw_member_editor_exports = {};
74307 __export(raw_member_editor_exports, {
74308 uiSectionRawMemberEditor: () => uiSectionRawMemberEditor
74310 function uiSectionRawMemberEditor(context) {
74311 var section = uiSection("raw-member-editor", context).shouldDisplay(function() {
74312 if (!_entityIDs || _entityIDs.length !== 1) return false;
74313 var entity = context.hasEntity(_entityIDs[0]);
74314 return entity && entity.type === "relation";
74315 }).label(function() {
74316 var entity = context.hasEntity(_entityIDs[0]);
74317 if (!entity) return "";
74318 var gt2 = entity.members.length > _maxMembers ? ">" : "";
74319 var count = gt2 + entity.members.slice(0, _maxMembers).length;
74320 return _t.append("inspector.title_count", { title: _t("inspector.members"), count });
74321 }).disclosureContent(renderDisclosureContent);
74322 var taginfo = services.taginfo;
74324 var _maxMembers = 1e3;
74325 function downloadMember(d3_event, d4) {
74326 d3_event.preventDefault();
74327 select_default2(this).classed("loading", true);
74328 context.loadEntity(d4.id, function() {
74329 section.reRender();
74332 function zoomToMember(d3_event, d4) {
74333 d3_event.preventDefault();
74334 var entity = context.entity(d4.id);
74335 context.map().zoomToEase(entity);
74336 utilHighlightEntities([d4.id], true, context);
74338 function selectMember(d3_event, d4) {
74339 d3_event.preventDefault();
74340 utilHighlightEntities([d4.id], false, context);
74341 var entity = context.entity(d4.id);
74342 var mapExtent = context.map().extent();
74343 if (!entity.intersects(mapExtent, context.graph())) {
74344 context.map().zoomToEase(entity);
74346 context.enter(modeSelect(context, [d4.id]));
74348 function changeRole(d3_event, d4) {
74349 var oldRole = d4.role;
74350 var newRole = context.cleanRelationRole(select_default2(this).property("value"));
74351 if (oldRole !== newRole) {
74352 var member = { id: d4.id, type: d4.type, role: newRole };
74354 actionChangeMember(d4.relation.id, member, d4.index),
74355 _t("operations.change_role.annotation", {
74359 context.validator().validate();
74362 function deleteMember(d3_event, d4) {
74363 utilHighlightEntities([d4.id], false, context);
74365 actionDeleteMember(d4.relation.id, d4.index),
74366 _t("operations.delete_member.annotation", {
74370 if (!context.hasEntity(d4.relation.id)) {
74371 context.enter(modeBrowse(context));
74373 context.validator().validate();
74376 function renderDisclosureContent(selection2) {
74377 var entityID = _entityIDs[0];
74378 var memberships = [];
74379 var entity = context.entity(entityID);
74380 entity.members.slice(0, _maxMembers).forEach(function(member, index) {
74387 member: context.hasEntity(member.id),
74388 domId: utilUniqueDomId(entityID + "-member-" + index)
74391 var list = selection2.selectAll(".member-list").data([0]);
74392 list = list.enter().append("ul").attr("class", "member-list").merge(list);
74393 var items = list.selectAll("li").data(memberships, function(d4) {
74394 return osmEntity.key(d4.relation) + "," + d4.index + "," + (d4.member ? osmEntity.key(d4.member) : "incomplete");
74396 items.exit().each(unbind).remove();
74397 var itemsEnter = items.enter().append("li").attr("class", "member-row form-field").classed("member-incomplete", function(d4) {
74400 itemsEnter.each(function(d4) {
74401 var item = select_default2(this);
74402 var label = item.append("label").attr("class", "field-label").attr("for", d4.domId);
74404 item.on("mouseover", function() {
74405 utilHighlightEntities([d4.id], true, context);
74406 }).on("mouseout", function() {
74407 utilHighlightEntities([d4.id], false, context);
74409 var labelLink = label.append("span").attr("class", "label-text").append("a").attr("href", "#").on("click", selectMember);
74410 labelLink.append("span").attr("class", "member-entity-type").text(function(d5) {
74411 var matched = _mainPresetIndex.match(d5.member, context.graph());
74412 return matched && matched.name() || utilDisplayType(d5.member.id);
74414 labelLink.append("span").attr("class", "member-entity-name").classed("has-colour", (d5) => d5.member.type === "relation" && d5.member.tags.colour && isColourValid(d5.member.tags.colour)).style("border-color", (d5) => d5.member.type === "relation" && d5.member.tags.colour).text(function(d5) {
74415 return utilDisplayName(d5.member);
74417 label.append("button").attr("title", _t("icons.remove")).attr("class", "remove member-delete").call(svgIcon("#iD-operation-delete"));
74418 label.append("button").attr("class", "member-zoom").attr("title", _t("icons.zoom_to")).call(svgIcon("#iD-icon-framed-dot", "monochrome")).on("click", zoomToMember);
74420 var labelText = label.append("span").attr("class", "label-text");
74421 labelText.append("span").attr("class", "member-entity-type").call(_t.append("inspector." + d4.type, { id: d4.id }));
74422 labelText.append("span").attr("class", "member-entity-name").call(_t.append("inspector.incomplete", { id: d4.id }));
74423 label.append("button").attr("class", "member-download").attr("title", _t("icons.download")).call(svgIcon("#iD-icon-load")).on("click", downloadMember);
74426 var wrapEnter = itemsEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
74427 wrapEnter.append("input").attr("class", "member-role").attr("id", function(d4) {
74429 }).property("type", "text").attr("placeholder", _t("inspector.role")).call(utilNoAuto);
74431 wrapEnter.each(bindTypeahead);
74433 items = items.merge(itemsEnter).order();
74434 items.select("input.member-role").property("value", function(d4) {
74436 }).on("blur", changeRole).on("change", changeRole);
74437 items.select("button.member-delete").on("click", deleteMember);
74438 var dragOrigin, targetIndex;
74440 drag_default().on("start", function(d3_event) {
74445 targetIndex = null;
74446 }).on("drag", function(d3_event) {
74447 var x2 = d3_event.x - dragOrigin.x, y3 = d3_event.y - dragOrigin.y;
74448 if (!select_default2(this).classed("dragging") && // don't display drag until dragging beyond a distance threshold
74449 Math.sqrt(Math.pow(x2, 2) + Math.pow(y3, 2)) <= 5) return;
74450 var index = items.nodes().indexOf(this);
74451 select_default2(this).classed("dragging", true);
74452 targetIndex = null;
74453 selection2.selectAll("li.member-row").style("transform", function(d22, index2) {
74454 var node = select_default2(this).node();
74455 if (index === index2) {
74456 return "translate(" + x2 + "px, " + y3 + "px)";
74457 } else if (index2 > index && d3_event.y > node.offsetTop) {
74458 if (targetIndex === null || index2 > targetIndex) {
74459 targetIndex = index2;
74461 return "translateY(-100%)";
74462 } else if (index2 < index && d3_event.y < node.offsetTop + node.offsetHeight) {
74463 if (targetIndex === null || index2 < targetIndex) {
74464 targetIndex = index2;
74466 return "translateY(100%)";
74470 }).on("end", function(d3_event, d4) {
74471 if (!select_default2(this).classed("dragging")) return;
74472 var index = items.nodes().indexOf(this);
74473 select_default2(this).classed("dragging", false);
74474 selection2.selectAll("li.member-row").style("transform", null);
74475 if (targetIndex !== null) {
74477 actionMoveMember(d4.relation.id, index, targetIndex),
74478 _t("operations.reorder_members.annotation")
74480 context.validator().validate();
74484 function bindTypeahead(d4) {
74485 var row = select_default2(this);
74486 var role = row.selectAll("input.member-role");
74487 var origValue = role.property("value");
74488 function sort(value, data) {
74489 var sameletter = [];
74491 for (var i3 = 0; i3 < data.length; i3++) {
74492 if (data[i3].value.substring(0, value.length) === value) {
74493 sameletter.push(data[i3]);
74495 other.push(data[i3]);
74498 return sameletter.concat(other);
74501 uiCombobox(context, "member-role").fetcher(function(role2, callback) {
74504 geometry = context.graph().geometry(d4.member.id);
74505 } else if (d4.type === "relation") {
74506 geometry = "relation";
74507 } else if (d4.type === "way") {
74510 geometry = "point";
74512 var rtype = entity.tags.type;
74515 rtype: rtype || "",
74518 }, function(err, data) {
74519 if (!err) callback(sort(role2, data));
74521 }).on("cancel", function() {
74522 role.property("value", origValue);
74526 function unbind() {
74527 var row = select_default2(this);
74528 row.selectAll("input.member-role").call(uiCombobox.off, context);
74531 section.entityIDs = function(val) {
74532 if (!arguments.length) return _entityIDs;
74538 var init_raw_member_editor = __esm({
74539 "modules/ui/sections/raw_member_editor.js"() {
74545 init_change_member();
74546 init_delete_member();
74547 init_move_member();
74560 // modules/ui/sections/raw_membership_editor.js
74561 var raw_membership_editor_exports = {};
74562 __export(raw_membership_editor_exports, {
74563 uiSectionRawMembershipEditor: () => uiSectionRawMembershipEditor
74565 function uiSectionRawMembershipEditor(context) {
74566 var section = uiSection("raw-membership-editor", context).shouldDisplay(function() {
74567 return _entityIDs && _entityIDs.length;
74568 }).label(function() {
74569 var parents = getSharedParentRelations();
74570 var gt2 = parents.length > _maxMemberships ? ">" : "";
74571 var count = gt2 + parents.slice(0, _maxMemberships).length;
74572 return _t.append("inspector.title_count", { title: _t("inspector.relations"), count });
74573 }).disclosureContent(renderDisclosureContent);
74574 var taginfo = services.taginfo;
74575 var nearbyCombo = uiCombobox(context, "parent-relation").minItems(1).fetcher(fetchNearbyRelations).itemsMouseEnter(function(d3_event, d4) {
74576 if (d4.relation) utilHighlightEntities([d4.relation.id], true, context);
74577 }).itemsMouseLeave(function(d3_event, d4) {
74578 if (d4.relation) utilHighlightEntities([d4.relation.id], false, context);
74580 var _inChange = false;
74581 var _entityIDs = [];
74583 var _maxMemberships = 1e3;
74584 const recentlyAdded = /* @__PURE__ */ new Set();
74585 function getSharedParentRelations() {
74587 for (var i3 = 0; i3 < _entityIDs.length; i3++) {
74588 var entity = context.graph().hasEntity(_entityIDs[i3]);
74589 if (!entity) continue;
74591 parents = context.graph().parentRelations(entity);
74593 parents = utilArrayIntersection(parents, context.graph().parentRelations(entity));
74595 if (!parents.length) break;
74599 function getMemberships() {
74600 var memberships = [];
74601 var relations = getSharedParentRelations().slice(0, _maxMemberships);
74602 var isMultiselect = _entityIDs.length > 1;
74603 var i3, relation, membership, index, member, indexedMember;
74604 for (i3 = 0; i3 < relations.length; i3++) {
74605 relation = relations[i3];
74609 hash: osmEntity.key(relation)
74611 for (index = 0; index < relation.members.length; index++) {
74612 member = relation.members[index];
74613 if (_entityIDs.indexOf(member.id) !== -1) {
74614 indexedMember = Object.assign({}, member, { index });
74615 membership.members.push(indexedMember);
74616 membership.hash += "," + index.toString();
74617 if (!isMultiselect) {
74618 memberships.push(membership);
74622 hash: osmEntity.key(relation)
74627 if (membership.members.length) memberships.push(membership);
74629 memberships.forEach(function(membership2) {
74630 membership2.domId = utilUniqueDomId("membership-" + membership2.relation.id);
74632 membership2.members.forEach(function(member2) {
74633 if (roles.indexOf(member2.role) === -1) roles.push(member2.role);
74635 membership2.role = roles.length === 1 ? roles[0] : roles;
74637 const existingRelations = memberships.filter((membership2) => !recentlyAdded.has(membership2.relation.id)).map((membership2) => ({
74639 // We only sort relations that were not added just now.
74640 // Sorting uses the same label as shown in the UI.
74641 // If the label is not unique, the relation ID ensures
74642 // that the sort order is still stable.
74644 baseDisplayValue(membership2.relation),
74645 membership2.relation.id
74647 })).sort((a2, b3) => {
74648 return a2._sortKey.localeCompare(
74650 _mainLocalizer.localeCodes(),
74654 const newlyAddedRelations = memberships.filter((membership2) => recentlyAdded.has(membership2.relation.id));
74656 // the sorted relations come first
74657 ...existingRelations,
74658 // then the ones that were just added from this panel
74659 ...newlyAddedRelations
74662 function selectRelation(d3_event, d4) {
74663 d3_event.preventDefault();
74664 utilHighlightEntities([d4.relation.id], false, context);
74665 context.enter(modeSelect(context, [d4.relation.id]));
74667 function zoomToRelation(d3_event, d4) {
74668 d3_event.preventDefault();
74669 var entity = context.entity(d4.relation.id);
74670 context.map().zoomToEase(entity);
74671 utilHighlightEntities([d4.relation.id], true, context);
74673 function changeRole(d3_event, d4) {
74674 if (d4 === 0) return;
74675 if (_inChange) return;
74676 var newRole = context.cleanRelationRole(select_default2(this).property("value"));
74677 if (!newRole.trim() && typeof d4.role !== "string") return;
74678 var membersToUpdate = d4.members.filter(function(member) {
74679 return member.role !== newRole;
74681 if (membersToUpdate.length) {
74684 function actionChangeMemberRoles(graph) {
74685 membersToUpdate.forEach(function(member) {
74686 var newMember = Object.assign({}, member, { role: newRole });
74687 delete newMember.index;
74688 graph = actionChangeMember(d4.relation.id, newMember, member.index)(graph);
74692 _t("operations.change_role.annotation", {
74693 n: membersToUpdate.length
74696 context.validator().validate();
74700 function addMembership(d4, role) {
74701 _showBlank = false;
74702 function actionAddMembers(relationId, ids, role2) {
74703 return function(graph) {
74704 for (var i3 in ids) {
74705 var member = { id: ids[i3], type: graph.entity(ids[i3]).type, role: role2 };
74706 graph = actionAddMember(relationId, member)(graph);
74712 recentlyAdded.add(d4.relation.id);
74714 actionAddMembers(d4.relation.id, _entityIDs, role),
74715 _t("operations.add_member.annotation", {
74716 n: _entityIDs.length
74719 context.validator().validate();
74721 var relation = osmRelation();
74723 actionAddEntity(relation),
74724 actionAddMembers(relation.id, _entityIDs, role),
74725 _t("operations.add.annotation.relation")
74727 context.enter(modeSelect(context, [relation.id]).newFeature(true));
74730 function downloadMembers(d3_event, d4) {
74731 d3_event.preventDefault();
74732 const button = select_default2(this);
74733 button.classed("loading", true);
74734 context.loadEntity(d4.relation.id, function() {
74735 section.reRender();
74738 function deleteMembership(d3_event, d4) {
74740 if (d4 === 0) return;
74741 utilHighlightEntities([d4.relation.id], false, context);
74742 var indexes = d4.members.map(function(member) {
74743 return member.index;
74746 actionDeleteMembers(d4.relation.id, indexes),
74747 _t("operations.delete_member.annotation", {
74748 n: _entityIDs.length
74751 context.validator().validate();
74753 function fetchNearbyRelations(q3, callback) {
74754 var newRelation = {
74756 value: _t("inspector.new_relation"),
74757 display: _t.append("inspector.new_relation")
74759 var entityID = _entityIDs[0];
74761 var graph = context.graph();
74762 function baseDisplayLabel(entity) {
74763 var matched = _mainPresetIndex.match(entity, graph);
74764 var presetName = matched && matched.name() || _t("inspector.relation");
74765 var entityName = utilDisplayName(entity) || "";
74766 return (selection2) => {
74767 selection2.append("b").text(presetName + " ");
74768 selection2.append("span").classed("has-colour", entity.tags.colour && isColourValid(entity.tags.colour)).style("border-color", entity.tags.colour).text(entityName);
74771 var explicitRelation = q3 && context.hasEntity(q3.toLowerCase());
74772 if (explicitRelation && explicitRelation.type === "relation" && explicitRelation.id !== entityID) {
74774 relation: explicitRelation,
74775 value: baseDisplayValue(explicitRelation) + " " + explicitRelation.id,
74776 display: baseDisplayLabel(explicitRelation)
74779 context.history().intersects(context.map().extent()).forEach(function(entity) {
74780 if (entity.type !== "relation" || entity.id === entityID) return;
74781 var value = baseDisplayValue(entity);
74782 if (q3 && (value + " " + entity.id).toLowerCase().indexOf(q3.toLowerCase()) === -1) return;
74786 display: baseDisplayLabel(entity)
74789 result.sort(function(a2, b3) {
74790 return osmRelation.creationOrder(a2.relation, b3.relation);
74792 Object.values(utilArrayGroupBy(result, "value")).filter((v3) => v3.length > 1).flat().forEach((obj) => obj.value += " " + obj.relation.id);
74794 result.forEach(function(obj) {
74795 obj.title = obj.value;
74797 result.unshift(newRelation);
74800 function baseDisplayValue(entity) {
74801 const graph = context.graph();
74802 var matched = _mainPresetIndex.match(entity, graph);
74803 var presetName = matched && matched.name() || _t("inspector.relation");
74804 var entityName = utilDisplayName(entity) || "";
74805 return presetName + " " + entityName;
74807 function renderDisclosureContent(selection2) {
74808 var memberships = getMemberships();
74809 var list = selection2.selectAll(".member-list").data([0]);
74810 list = list.enter().append("ul").attr("class", "member-list").merge(list);
74811 var items = list.selectAll("li.member-row-normal").data(memberships, function(d4) {
74814 items.exit().each(unbind).remove();
74815 var itemsEnter = items.enter().append("li").attr("class", "member-row member-row-normal form-field");
74816 itemsEnter.on("mouseover", function(d3_event, d4) {
74817 utilHighlightEntities([d4.relation.id], true, context);
74818 }).on("mouseout", function(d3_event, d4) {
74819 utilHighlightEntities([d4.relation.id], false, context);
74821 var labelEnter = itemsEnter.append("label").attr("class", "field-label").attr("for", function(d4) {
74824 var labelLink = labelEnter.append("span").attr("class", "label-text").append("a").attr("href", "#").on("click", selectRelation);
74825 labelLink.append("span").attr("class", "member-entity-type").text(function(d4) {
74826 var matched = _mainPresetIndex.match(d4.relation, context.graph());
74827 return matched && matched.name() || _t.html("inspector.relation");
74829 labelLink.append("span").attr("class", "member-entity-name").classed("has-colour", (d4) => d4.relation.tags.colour && isColourValid(d4.relation.tags.colour)).style("border-color", (d4) => d4.relation.tags.colour).text(function(d4) {
74830 const matched = _mainPresetIndex.match(d4.relation, context.graph());
74831 return utilDisplayName(d4.relation, matched.suggestion);
74833 labelEnter.append("button").attr("class", "members-download").attr("title", _t("icons.download")).call(svgIcon("#iD-icon-load")).on("click", downloadMembers);
74834 labelEnter.append("button").attr("class", "remove member-delete").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete")).on("click", deleteMembership);
74835 labelEnter.append("button").attr("class", "member-zoom").attr("title", _t("icons.zoom_to")).call(svgIcon("#iD-icon-framed-dot", "monochrome")).on("click", zoomToRelation);
74836 items = items.merge(itemsEnter);
74837 items.selectAll("button.members-download").classed("hide", (d4) => {
74838 const graph = context.graph();
74839 return d4.relation.members.every((m3) => graph.hasEntity(m3.id));
74841 const dupeLabels = new WeakSet(Object.values(
74842 utilArrayGroupBy(items.selectAll(".label-text").nodes(), "textContent")
74843 ).filter((v3) => v3.length > 1).flat());
74844 items.select(".label-text").each(function() {
74845 const label = select_default2(this);
74846 const entityName = label.select(".member-entity-name");
74847 if (dupeLabels.has(this)) {
74848 label.attr("title", (d4) => `${entityName.text()} ${d4.relation.id}`);
74850 label.attr("title", () => entityName.text());
74853 var wrapEnter = itemsEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
74854 wrapEnter.append("input").attr("class", "member-role").attr("id", function(d4) {
74856 }).property("type", "text").property("value", function(d4) {
74857 return typeof d4.role === "string" ? d4.role : "";
74858 }).attr("title", function(d4) {
74859 return Array.isArray(d4.role) ? d4.role.filter(Boolean).join("\n") : d4.role;
74860 }).attr("placeholder", function(d4) {
74861 return Array.isArray(d4.role) ? _t("inspector.multiple_roles") : _t("inspector.role");
74862 }).classed("mixed", function(d4) {
74863 return Array.isArray(d4.role);
74864 }).call(utilNoAuto).on("blur", changeRole).on("change", changeRole);
74866 wrapEnter.each(bindTypeahead);
74868 var newMembership = list.selectAll(".member-row-new").data(_showBlank ? [0] : []);
74869 newMembership.exit().remove();
74870 var newMembershipEnter = newMembership.enter().append("li").attr("class", "member-row member-row-new form-field");
74871 var newLabelEnter = newMembershipEnter.append("label").attr("class", "field-label");
74872 newLabelEnter.append("input").attr("placeholder", _t("inspector.choose_relation")).attr("type", "text").attr("class", "member-entity-input").call(utilNoAuto);
74873 newLabelEnter.append("button").attr("class", "remove member-delete").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete")).on("click", function() {
74874 list.selectAll(".member-row-new").remove();
74876 var newWrapEnter = newMembershipEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
74877 newWrapEnter.append("input").attr("class", "member-role").property("type", "text").attr("placeholder", _t("inspector.role")).call(utilNoAuto);
74878 newMembership = newMembership.merge(newMembershipEnter);
74879 newMembership.selectAll(".member-entity-input").on("blur", cancelEntity).call(
74880 nearbyCombo.on("accept", function(d4) {
74882 acceptEntity.call(this, d4);
74883 }).on("cancel", cancelEntity)
74885 var addRow = selection2.selectAll(".add-row").data([0]);
74886 var addRowEnter = addRow.enter().append("div").attr("class", "add-row");
74887 var addRelationButton = addRowEnter.append("button").attr("class", "add-relation").attr("aria-label", _t("inspector.add_to_relation"));
74888 addRelationButton.call(svgIcon("#iD-icon-plus", "light"));
74889 addRelationButton.call(uiTooltip().title(() => _t.append("inspector.add_to_relation")).placement(_mainLocalizer.textDirection() === "ltr" ? "right" : "left"));
74890 addRowEnter.append("div").attr("class", "space-value");
74891 addRowEnter.append("div").attr("class", "space-buttons");
74892 addRow = addRow.merge(addRowEnter);
74893 addRow.select(".add-relation").on("click", function() {
74895 section.reRender();
74896 list.selectAll(".member-entity-input").node().focus();
74898 function acceptEntity(d4) {
74903 if (d4.relation) utilHighlightEntities([d4.relation.id], false, context);
74904 var role = context.cleanRelationRole(list.selectAll(".member-row-new .member-role").property("value"));
74905 addMembership(d4, role);
74907 function cancelEntity() {
74908 var input = newMembership.selectAll(".member-entity-input");
74909 input.property("value", "");
74910 context.surface().selectAll(".highlighted").classed("highlighted", false);
74912 function bindTypeahead(d4) {
74913 var row = select_default2(this);
74914 var role = row.selectAll("input.member-role");
74915 var origValue = role.property("value");
74916 function sort(value, data) {
74917 var sameletter = [];
74919 for (var i3 = 0; i3 < data.length; i3++) {
74920 if (data[i3].value.substring(0, value.length) === value) {
74921 sameletter.push(data[i3]);
74923 other.push(data[i3]);
74926 return sameletter.concat(other);
74929 uiCombobox(context, "member-role").fetcher(function(role2, callback) {
74930 var rtype = d4.relation.tags.type;
74933 rtype: rtype || "",
74934 geometry: context.graph().geometry(_entityIDs[0]),
74936 }, function(err, data) {
74937 if (!err) callback(sort(role2, data));
74939 }).on("cancel", function() {
74940 role.property("value", origValue);
74944 function unbind() {
74945 var row = select_default2(this);
74946 row.selectAll("input.member-role").call(uiCombobox.off, context);
74949 section.entityIDs = function(val) {
74950 if (!arguments.length) return _entityIDs;
74951 const didChange = _entityIDs.join(",") !== val.join(",");
74953 _showBlank = false;
74955 recentlyAdded.clear();
74961 var init_raw_membership_editor = __esm({
74962 "modules/ui/sections/raw_membership_editor.js"() {
74969 init_change_member();
74970 init_delete_members();
74984 // modules/ui/sections/selection_list.js
74985 var selection_list_exports = {};
74986 __export(selection_list_exports, {
74987 uiSectionSelectionList: () => uiSectionSelectionList
74989 function uiSectionSelectionList(context) {
74990 var _selectedIDs = [];
74991 var section = uiSection("selected-features", context).shouldDisplay(function() {
74992 return _selectedIDs.length > 1;
74993 }).label(function() {
74994 return _t.append("inspector.title_count", { title: _t("inspector.features"), count: _selectedIDs.length });
74995 }).disclosureContent(renderDisclosureContent);
74996 context.history().on("change.selectionList", function(difference2) {
74998 section.reRender();
75001 section.entityIDs = function(val) {
75002 if (!arguments.length) return _selectedIDs;
75003 _selectedIDs = val;
75006 function selectEntity(d3_event, entity) {
75007 context.enter(modeSelect(context, [entity.id]));
75009 function deselectEntity(d3_event, entity) {
75010 var selectedIDs = _selectedIDs.slice();
75011 var index = selectedIDs.indexOf(entity.id);
75013 selectedIDs.splice(index, 1);
75014 context.enter(modeSelect(context, selectedIDs));
75017 function renderDisclosureContent(selection2) {
75018 var list = selection2.selectAll(".feature-list").data([0]);
75019 list = list.enter().append("ul").attr("class", "feature-list").merge(list);
75020 var entities = _selectedIDs.map(function(id2) {
75021 return context.hasEntity(id2);
75022 }).filter(Boolean);
75023 var items = list.selectAll(".feature-list-item").data(entities, osmEntity.key);
75024 items.exit().remove();
75025 var enter = items.enter().append("li").attr("class", "feature-list-item").each(function(d4) {
75026 select_default2(this).on("mouseover", function() {
75027 utilHighlightEntities([d4.id], true, context);
75028 }).on("mouseout", function() {
75029 utilHighlightEntities([d4.id], false, context);
75032 var label = enter.append("button").attr("class", "label").on("click", selectEntity);
75033 label.append("span").attr("class", "entity-geom-icon").call(svgIcon("", "pre-text"));
75034 label.append("span").attr("class", "entity-type");
75035 label.append("span").attr("class", "entity-name");
75036 enter.append("button").attr("class", "close").attr("title", _t("icons.deselect")).on("click", deselectEntity).call(svgIcon("#iD-icon-close"));
75037 items = items.merge(enter);
75038 items.selectAll(".entity-geom-icon use").attr("href", function() {
75039 var entity = this.parentNode.parentNode.__data__;
75040 return "#iD-icon-" + entity.geometry(context.graph());
75042 items.selectAll(".entity-type").text(function(entity) {
75043 return _mainPresetIndex.match(entity, context.graph()).name();
75045 items.selectAll(".entity-name").text(function(d4) {
75046 var entity = context.entity(d4.id);
75047 return utilDisplayName(entity);
75052 var init_selection_list = __esm({
75053 "modules/ui/sections/selection_list.js"() {
75066 // modules/ui/entity_editor.js
75067 var entity_editor_exports = {};
75068 __export(entity_editor_exports, {
75069 uiEntityEditor: () => uiEntityEditor
75071 function uiEntityEditor(context) {
75072 var dispatch14 = dispatch_default("choose");
75073 var _state = "select";
75074 var _coalesceChanges = false;
75075 var _modified = false;
75078 var _activePresets = [];
75081 function entityEditor(selection2) {
75082 var combinedTags = utilCombinedTags(_entityIDs, context.graph());
75083 var header = selection2.selectAll(".header").data([0]);
75084 var headerEnter = header.enter().append("div").attr("class", "header fillL");
75085 var direction = _mainLocalizer.textDirection() === "rtl" ? "forward" : "backward";
75086 headerEnter.append("button").attr("class", "preset-reset preset-choose").attr("title", _t("inspector.back_tooltip")).call(svgIcon(`#iD-icon-${direction}`));
75087 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
75088 context.enter(modeBrowse(context));
75089 }).call(svgIcon(_modified ? "#iD-icon-apply" : "#iD-icon-close"));
75090 headerEnter.append("h2");
75091 header = header.merge(headerEnter);
75092 header.selectAll("h2").text("").call(_entityIDs.length === 1 ? _t.append("inspector.edit") : _t.append("inspector.edit_features"));
75093 header.selectAll(".preset-reset").on("click", function() {
75094 dispatch14.call("choose", this, _activePresets);
75096 var body = selection2.selectAll(".inspector-body").data([0]);
75097 var bodyEnter = body.enter().append("div").attr("class", "entity-editor inspector-body sep-top");
75098 body = body.merge(bodyEnter);
75101 uiSectionSelectionList(context),
75102 uiSectionFeatureType(context).on("choose", function(presets) {
75103 dispatch14.call("choose", this, presets);
75105 uiSectionEntityIssues(context),
75106 uiSectionPresetFields(context).on("change", changeTags).on("revert", revertTags),
75107 uiSectionRawTagEditor("raw-tag-editor", context).on("change", changeTags),
75108 uiSectionRawMemberEditor(context),
75109 uiSectionRawMembershipEditor(context)
75112 _sections.forEach(function(section) {
75113 if (section.entityIDs) {
75114 section.entityIDs(_entityIDs);
75116 if (section.presets) {
75117 section.presets(_activePresets);
75119 if (section.tags) {
75120 section.tags(combinedTags);
75122 if (section.state) {
75123 section.state(_state);
75125 body.call(section.render);
75127 context.history().on("change.entity-editor", historyChanged);
75128 function historyChanged(difference2) {
75129 if (selection2.selectAll(".entity-editor").empty()) return;
75130 if (_state === "hide") return;
75131 var significant = !difference2 || difference2.didChange.properties || difference2.didChange.addition || difference2.didChange.deletion;
75132 if (!significant) return;
75133 _entityIDs = _entityIDs.filter(context.hasEntity);
75134 if (!_entityIDs.length) return;
75135 var priorActivePreset = _activePresets.length === 1 && _activePresets[0];
75136 loadActivePresets();
75137 var graph = context.graph();
75138 entityEditor.modified(_base !== graph);
75139 entityEditor(selection2);
75140 if (priorActivePreset && _activePresets.length === 1 && priorActivePreset !== _activePresets[0]) {
75141 context.container().selectAll(".entity-editor button.preset-reset .label").classed("flash-bg", true).on("animationend", function() {
75142 select_default2(this).classed("flash-bg", false);
75147 function changeTags(entityIDs, changed, onInput) {
75149 for (var i3 in entityIDs) {
75150 var entityID = entityIDs[i3];
75151 var entity = context.entity(entityID);
75152 var tags = Object.assign({}, entity.tags);
75153 if (typeof changed === "function") {
75154 tags = changed(tags);
75156 for (var k2 in changed) {
75158 var v3 = changed[k2];
75159 if (typeof v3 === "object") {
75160 tags[k2] = tags[v3.oldKey];
75161 } else if (v3 !== void 0 || tags.hasOwnProperty(k2)) {
75167 tags = utilCleanTags(tags);
75169 if (!(0, import_fast_deep_equal10.default)(entity.tags, tags)) {
75170 actions.push(actionChangeTags(entityID, tags));
75173 if (actions.length) {
75174 var combinedAction = function(graph) {
75175 actions.forEach(function(action) {
75176 graph = action(graph);
75180 var annotation = _t("operations.change_tags.annotation");
75181 if (_coalesceChanges) {
75182 context.replace(combinedAction, annotation);
75184 context.perform(combinedAction, annotation);
75186 _coalesceChanges = !!onInput;
75189 context.validator().validate();
75192 function revertTags(keys2) {
75194 for (var i3 in _entityIDs) {
75195 var entityID = _entityIDs[i3];
75196 var original = context.graph().base().entities[entityID];
75198 for (var j3 in keys2) {
75199 var key = keys2[j3];
75200 changed[key] = original ? original.tags[key] : void 0;
75202 var entity = context.entity(entityID);
75203 var tags = Object.assign({}, entity.tags);
75204 for (var k2 in changed) {
75206 var v3 = changed[k2];
75207 if (v3 !== void 0 || tags.hasOwnProperty(k2)) {
75211 tags = utilCleanTags(tags);
75212 if (!(0, import_fast_deep_equal10.default)(entity.tags, tags)) {
75213 actions.push(actionChangeTags(entityID, tags));
75216 if (actions.length) {
75217 var combinedAction = function(graph) {
75218 actions.forEach(function(action) {
75219 graph = action(graph);
75223 var annotation = _t("operations.change_tags.annotation");
75224 if (_coalesceChanges) {
75225 context.replace(combinedAction, annotation);
75227 context.perform(combinedAction, annotation);
75230 context.validator().validate();
75232 entityEditor.modified = function(val) {
75233 if (!arguments.length) return _modified;
75235 return entityEditor;
75237 entityEditor.state = function(val) {
75238 if (!arguments.length) return _state;
75240 return entityEditor;
75242 entityEditor.entityIDs = function(val) {
75243 if (!arguments.length) return _entityIDs;
75244 _base = context.graph();
75245 _coalesceChanges = false;
75246 if (val && _entityIDs && utilArrayIdentical(_entityIDs, val)) return entityEditor;
75248 loadActivePresets(true);
75249 return entityEditor.modified(false);
75251 entityEditor.newFeature = function(val) {
75252 if (!arguments.length) return _newFeature;
75254 return entityEditor;
75256 function loadActivePresets(isForNewSelection) {
75257 var graph = context.graph();
75259 for (var i3 in _entityIDs) {
75260 var entity = graph.hasEntity(_entityIDs[i3]);
75261 if (!entity) return;
75262 var match = _mainPresetIndex.match(entity, graph);
75263 if (!counts[match.id]) counts[match.id] = 0;
75264 counts[match.id] += 1;
75266 var matches = Object.keys(counts).sort(function(p1, p2) {
75267 return counts[p2] - counts[p1];
75268 }).map(function(pID) {
75269 return _mainPresetIndex.item(pID);
75271 if (!isForNewSelection) {
75272 var weakPreset = _activePresets.length === 1 && !_activePresets[0].isFallback() && Object.keys(_activePresets[0].addTags || {}).length === 0;
75273 if (weakPreset && matches.length === 1 && matches[0].isFallback()) return;
75275 entityEditor.presets(matches);
75277 entityEditor.presets = function(val) {
75278 if (!arguments.length) return _activePresets;
75279 if (!utilArrayIdentical(val, _activePresets)) {
75280 _activePresets = val;
75282 return entityEditor;
75284 return utilRebind(entityEditor, dispatch14, "on");
75286 var import_fast_deep_equal10;
75287 var init_entity_editor = __esm({
75288 "modules/ui/entity_editor.js"() {
75292 import_fast_deep_equal10 = __toESM(require_fast_deep_equal(), 1);
75295 init_change_tags();
75300 init_entity_issues();
75301 init_feature_type();
75302 init_preset_fields();
75303 init_raw_member_editor();
75304 init_raw_membership_editor();
75305 init_raw_tag_editor();
75306 init_selection_list();
75310 // modules/ui/preset_list.js
75311 var preset_list_exports = {};
75312 __export(preset_list_exports, {
75313 uiPresetList: () => uiPresetList
75315 function uiPresetList(context) {
75316 var dispatch14 = dispatch_default("cancel", "choose");
75319 var _currentPresets;
75320 var _autofocus = false;
75321 function presetList(selection2) {
75322 if (!_entityIDs) return;
75323 var presets = _mainPresetIndex.matchAllGeometry(entityGeometries());
75324 selection2.html("");
75325 var messagewrap = selection2.append("div").attr("class", "header fillL");
75326 var message = messagewrap.append("h2").call(_t.append("inspector.choose"));
75327 messagewrap.append("button").attr("class", "preset-choose").attr("title", _entityIDs.length === 1 ? _t("inspector.edit") : _t("inspector.edit_features")).on("click", function() {
75328 dispatch14.call("cancel", this);
75329 }).call(svgIcon("#iD-icon-close"));
75330 function initialKeydown(d3_event) {
75331 if (search.property("value").length === 0 && (d3_event.keyCode === utilKeybinding.keyCodes["\u232B"] || d3_event.keyCode === utilKeybinding.keyCodes["\u2326"])) {
75332 d3_event.preventDefault();
75333 d3_event.stopPropagation();
75334 operationDelete(context, _entityIDs)();
75335 } else if (search.property("value").length === 0 && (d3_event.ctrlKey || d3_event.metaKey) && d3_event.keyCode === utilKeybinding.keyCodes.z) {
75336 d3_event.preventDefault();
75337 d3_event.stopPropagation();
75339 } else if (!d3_event.ctrlKey && !d3_event.metaKey) {
75340 select_default2(this).on("keydown", keydown);
75341 keydown.call(this, d3_event);
75344 function keydown(d3_event) {
75345 if (d3_event.keyCode === utilKeybinding.keyCodes["\u2193"] && // if insertion point is at the end of the string
75346 search.node().selectionStart === search.property("value").length) {
75347 d3_event.preventDefault();
75348 d3_event.stopPropagation();
75349 var buttons = list.selectAll(".preset-list-button");
75350 if (!buttons.empty()) buttons.nodes()[0].focus();
75353 function keypress(d3_event) {
75354 var value = search.property("value");
75355 if (d3_event.keyCode === 13 && // ↩ Return
75357 list.selectAll(".preset-list-item:first-child").each(function(d4) {
75358 d4.choose.call(this);
75362 function inputevent() {
75363 var value = search.property("value");
75364 list.classed("filtered", value.length);
75365 var results, messageText;
75366 if (value.length) {
75367 results = presets.search(value, entityGeometries()[0], _currLoc);
75368 messageText = _t.html("inspector.results", {
75369 n: results.collection.length,
75373 var entityPresets2 = _entityIDs.map((entityID) => _mainPresetIndex.match(context.graph().entity(entityID), context.graph()));
75374 results = _mainPresetIndex.defaults(entityGeometries()[0], 36, !context.inIntro(), _currLoc, entityPresets2);
75375 messageText = _t.html("inspector.choose");
75377 list.call(drawList, results);
75378 message.html(messageText);
75380 var searchWrap = selection2.append("div").attr("class", "search-header");
75381 searchWrap.call(svgIcon("#iD-icon-search", "pre-text"));
75382 var search = searchWrap.append("input").attr("class", "preset-search-input").attr("placeholder", _t("inspector.search_feature_type")).attr("type", "search").call(utilNoAuto).on("keydown", initialKeydown).on("keypress", keypress).on("input", debounce_default(inputevent));
75384 search.node().focus();
75385 setTimeout(function() {
75386 search.node().focus();
75389 var listWrap = selection2.append("div").attr("class", "inspector-body");
75390 var entityPresets = _entityIDs.map((entityID) => _mainPresetIndex.match(context.graph().entity(entityID), context.graph()));
75391 var list = listWrap.append("div").attr("class", "preset-list").call(drawList, _mainPresetIndex.defaults(entityGeometries()[0], 36, !context.inIntro(), _currLoc, entityPresets));
75392 context.features().on("change.preset-list", updateForFeatureHiddenState);
75394 function drawList(list, presets) {
75395 presets = presets.matchAllGeometry(entityGeometries());
75396 var collection = presets.collection.reduce(function(collection2, preset) {
75397 if (!preset) return collection2;
75398 if (preset.members) {
75399 if (preset.members.collection.filter(function(preset2) {
75400 return preset2.addable();
75402 collection2.push(CategoryItem(preset));
75404 } else if (preset.addable()) {
75405 collection2.push(PresetItem(preset));
75407 return collection2;
75409 var items = list.selectChildren(".preset-list-item").data(collection, function(d4) {
75410 return d4.preset.id;
75413 items.exit().remove();
75414 items.enter().append("div").attr("class", function(item) {
75415 return "preset-list-item preset-" + item.preset.id.replace("/", "-");
75416 }).classed("current", function(item) {
75417 return _currentPresets.indexOf(item.preset) !== -1;
75418 }).each(function(item) {
75419 select_default2(this).call(item);
75420 }).style("opacity", 0).transition().style("opacity", 1);
75421 updateForFeatureHiddenState();
75423 function itemKeydown(d3_event) {
75424 var item = select_default2(this.closest(".preset-list-item"));
75425 var parentItem = select_default2(item.node().parentNode.closest(".preset-list-item"));
75426 if (d3_event.keyCode === utilKeybinding.keyCodes["\u2193"]) {
75427 d3_event.preventDefault();
75428 d3_event.stopPropagation();
75429 var nextItem = select_default2(item.node().nextElementSibling);
75430 if (nextItem.empty()) {
75431 if (!parentItem.empty()) {
75432 nextItem = select_default2(parentItem.node().nextElementSibling);
75434 } else if (select_default2(this).classed("expanded")) {
75435 nextItem = item.select(".subgrid .preset-list-item:first-child");
75437 if (!nextItem.empty()) {
75438 nextItem.select(".preset-list-button").node().focus();
75440 } else if (d3_event.keyCode === utilKeybinding.keyCodes["\u2191"]) {
75441 d3_event.preventDefault();
75442 d3_event.stopPropagation();
75443 var previousItem = select_default2(item.node().previousElementSibling);
75444 if (previousItem.empty()) {
75445 if (!parentItem.empty()) {
75446 previousItem = parentItem;
75448 } else if (previousItem.select(".preset-list-button").classed("expanded")) {
75449 previousItem = previousItem.select(".subgrid .preset-list-item:last-child");
75451 if (!previousItem.empty()) {
75452 previousItem.select(".preset-list-button").node().focus();
75454 var search = select_default2(this.closest(".preset-list-pane")).select(".preset-search-input");
75455 search.node().focus();
75457 } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2192" : "\u2190"]) {
75458 d3_event.preventDefault();
75459 d3_event.stopPropagation();
75460 if (!parentItem.empty()) {
75461 parentItem.select(".preset-list-button").node().focus();
75463 } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2190" : "\u2192"]) {
75464 d3_event.preventDefault();
75465 d3_event.stopPropagation();
75466 item.datum().choose.call(select_default2(this).node());
75469 function CategoryItem(preset) {
75470 var box, sublist, shown = false;
75471 function item(selection2) {
75472 var wrap2 = selection2.append("div").attr("class", "preset-list-button-wrap category");
75474 var isExpanded = select_default2(this).classed("expanded");
75475 var iconName = isExpanded ? _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward" : "#iD-icon-down";
75476 select_default2(this).classed("expanded", !isExpanded).attr("title", !isExpanded ? _t("icons.collapse") : _t("icons.expand"));
75477 select_default2(this).selectAll("div.label-inner svg.icon use").attr("href", iconName);
75480 var geometries = entityGeometries();
75481 var button = wrap2.append("button").attr("class", "preset-list-button").attr("title", _t("icons.expand")).classed("expanded", false).call(uiPresetIcon().geometry(geometries.length === 1 && geometries[0]).preset(preset)).on("click", click).on("keydown", function(d3_event) {
75482 if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2190" : "\u2192"]) {
75483 d3_event.preventDefault();
75484 d3_event.stopPropagation();
75485 if (!select_default2(this).classed("expanded")) {
75486 click.call(this, d3_event);
75488 } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2192" : "\u2190"]) {
75489 d3_event.preventDefault();
75490 d3_event.stopPropagation();
75491 if (select_default2(this).classed("expanded")) {
75492 click.call(this, d3_event);
75495 itemKeydown.call(this, d3_event);
75498 var label = button.append("div").attr("class", "label").append("div").attr("class", "label-inner");
75499 label.append("div").attr("class", "namepart").call(svgIcon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward", "inline")).append("span").call(preset.nameLabel()).append("span").text("\u2026");
75500 box = selection2.append("div").attr("class", "subgrid").style("max-height", "0px").style("opacity", 0);
75501 box.append("div").attr("class", "arrow");
75502 sublist = box.append("div").attr("class", "preset-list fillL3");
75504 item.choose = function() {
75505 if (!box || !sublist) return;
75508 box.transition().duration(200).style("opacity", "0").style("max-height", "0px").style("padding-bottom", "0px");
75511 var members = preset.members.matchAllGeometry(entityGeometries());
75512 sublist.call(drawList, members);
75513 box.transition().duration(200).style("opacity", "1").style("max-height", 200 + members.collection.length * 190 + "px").style("padding-bottom", "10px");
75516 item.preset = preset;
75519 function PresetItem(preset) {
75520 function item(selection2) {
75521 var wrap2 = selection2.append("div").attr("class", "preset-list-button-wrap");
75522 var geometries = entityGeometries();
75523 var button = wrap2.append("button").attr("class", "preset-list-button").call(uiPresetIcon().geometry(geometries.length === 1 && geometries[0]).preset(preset)).on("click", item.choose).on("keydown", itemKeydown);
75524 var label = button.append("div").attr("class", "label").append("div").attr("class", "label-inner");
75526 preset.nameLabel(),
75527 preset.subtitleLabel()
75529 label.selectAll(".namepart").data(nameparts, (d4) => d4.stringId).enter().append("div").attr("class", "namepart").text("").each(function(d4) {
75530 d4(select_default2(this));
75532 wrap2.call(item.reference.button);
75533 selection2.call(item.reference.body);
75535 item.choose = function() {
75536 if (select_default2(this).classed("disabled")) return;
75537 if (!context.inIntro()) {
75538 _mainPresetIndex.setMostRecent(preset, entityGeometries()[0]);
75542 for (var i3 in _entityIDs) {
75543 var entityID = _entityIDs[i3];
75544 var oldPreset = _mainPresetIndex.match(graph.entity(entityID), graph);
75545 graph = actionChangePreset(entityID, oldPreset, preset)(graph);
75549 _t("operations.change_tags.annotation")
75551 context.validator().validate();
75552 dispatch14.call("choose", this, preset);
75554 item.help = function(d3_event) {
75555 d3_event.stopPropagation();
75556 item.reference.toggle();
75558 item.preset = preset;
75559 item.reference = uiTagReference(preset.reference(), context);
75562 function updateForFeatureHiddenState() {
75563 if (!_entityIDs.every(context.hasEntity)) return;
75564 var geometries = entityGeometries();
75565 var button = context.container().selectAll(".preset-list .preset-list-button");
75566 button.call(uiTooltip().destroyAny);
75567 button.each(function(item, index) {
75568 var hiddenPresetFeaturesId;
75569 for (var i3 in geometries) {
75570 hiddenPresetFeaturesId = context.features().isHiddenPreset(item.preset, geometries[i3]);
75571 if (hiddenPresetFeaturesId) break;
75573 var isHiddenPreset = !context.inIntro() && !!hiddenPresetFeaturesId && (_currentPresets.length !== 1 || item.preset !== _currentPresets[0]);
75574 select_default2(this).classed("disabled", isHiddenPreset);
75575 if (isHiddenPreset) {
75576 var isAutoHidden = context.features().autoHidden(hiddenPresetFeaturesId);
75577 select_default2(this).call(
75578 uiTooltip().title(() => _t.append("inspector.hidden_preset." + (isAutoHidden ? "zoom" : "manual"), {
75579 features: _t("feature." + hiddenPresetFeaturesId + ".description")
75580 })).placement(index < 2 ? "bottom" : "top")
75585 presetList.autofocus = function(val) {
75586 if (!arguments.length) return _autofocus;
75590 presetList.entityIDs = function(val) {
75591 if (!arguments.length) return _entityIDs;
75594 if (_entityIDs && _entityIDs.length) {
75595 const extent = _entityIDs.reduce(function(extent2, entityID) {
75596 var entity = context.graph().entity(entityID);
75597 return extent2.extend(entity.extent(context.graph()));
75599 _currLoc = extent.center();
75600 var presets = _entityIDs.map(function(entityID) {
75601 return _mainPresetIndex.match(context.entity(entityID), context.graph());
75603 presetList.presets(presets);
75607 presetList.presets = function(val) {
75608 if (!arguments.length) return _currentPresets;
75609 _currentPresets = val;
75612 function entityGeometries() {
75614 for (var i3 in _entityIDs) {
75615 var entityID = _entityIDs[i3];
75616 var entity = context.entity(entityID);
75617 var geometry = entity.geometry(context.graph());
75618 if (geometry === "vertex" && entity.isOnAddressLine(context.graph())) {
75619 geometry = "point";
75621 if (!counts[geometry]) counts[geometry] = 0;
75622 counts[geometry] += 1;
75624 return Object.keys(counts).sort(function(geom1, geom2) {
75625 return counts[geom2] - counts[geom1];
75628 return utilRebind(presetList, dispatch14, "on");
75630 var init_preset_list = __esm({
75631 "modules/ui/preset_list.js"() {
75638 init_change_preset();
75643 init_preset_icon();
75644 init_tag_reference();
75649 // modules/ui/inspector.js
75650 var inspector_exports = {};
75651 __export(inspector_exports, {
75652 uiInspector: () => uiInspector
75654 function uiInspector(context) {
75655 var presetList = uiPresetList(context);
75656 var entityEditor = uiEntityEditor(context);
75657 var wrap2 = select_default2(null), presetPane = select_default2(null), editorPane = select_default2(null);
75658 var _state = "select";
75660 var _newFeature = false;
75661 function inspector(selection2) {
75662 presetList.entityIDs(_entityIDs).autofocus(_newFeature).on("choose", inspector.setPreset).on("cancel", function() {
75663 inspector.setPreset();
75665 entityEditor.state(_state).entityIDs(_entityIDs).on("choose", inspector.showList);
75666 wrap2 = selection2.selectAll(".panewrap").data([0]);
75667 var enter = wrap2.enter().append("div").attr("class", "panewrap");
75668 enter.append("div").attr("class", "preset-list-pane pane");
75669 enter.append("div").attr("class", "entity-editor-pane pane");
75670 wrap2 = wrap2.merge(enter);
75671 presetPane = wrap2.selectAll(".preset-list-pane");
75672 editorPane = wrap2.selectAll(".entity-editor-pane");
75673 function shouldDefaultToPresetList() {
75674 if (_state !== "select") return false;
75675 if (_entityIDs.length !== 1) return false;
75676 var entityID = _entityIDs[0];
75677 var entity = context.hasEntity(entityID);
75678 if (!entity) return false;
75679 if (entity.hasNonGeometryTags()) return false;
75680 if (_newFeature) return true;
75681 if (entity.geometry(context.graph()) !== "vertex") return false;
75682 if (context.graph().parentRelations(entity).length) return false;
75683 if (context.validator().getEntityIssues(entityID).length) return false;
75684 if (entity.type === "node" && entity.isHighwayIntersection(context.graph())) return false;
75687 if (shouldDefaultToPresetList()) {
75688 wrap2.style("right", "-100%");
75689 editorPane.classed("hide", true);
75690 presetPane.classed("hide", false).call(presetList);
75692 wrap2.style("right", "0%");
75693 presetPane.classed("hide", true);
75694 editorPane.classed("hide", false).call(entityEditor);
75696 var footer = selection2.selectAll(".footer").data([0]);
75697 footer = footer.enter().append("div").attr("class", "footer").merge(footer);
75699 uiViewOnOSM(context).what(context.hasEntity(_entityIDs.length === 1 && _entityIDs[0]))
75702 inspector.showList = function(presets) {
75703 presetPane.classed("hide", false);
75704 wrap2.transition().styleTween("right", function() {
75705 return value_default("0%", "-100%");
75706 }).on("end", function() {
75707 editorPane.classed("hide", true);
75710 presetList.presets(presets);
75712 presetPane.call(presetList.autofocus(true));
75714 inspector.setPreset = function(preset) {
75715 if (preset && preset.id === "type/multipolygon") {
75716 presetPane.call(presetList.autofocus(true));
75718 editorPane.classed("hide", false);
75719 wrap2.transition().styleTween("right", function() {
75720 return value_default("-100%", "0%");
75721 }).on("end", function() {
75722 presetPane.classed("hide", true);
75725 entityEditor.presets([preset]);
75727 editorPane.call(entityEditor);
75730 inspector.state = function(val) {
75731 if (!arguments.length) return _state;
75733 entityEditor.state(_state);
75734 context.container().selectAll(".field-help-body").remove();
75737 inspector.entityIDs = function(val) {
75738 if (!arguments.length) return _entityIDs;
75742 inspector.newFeature = function(val) {
75743 if (!arguments.length) return _newFeature;
75749 var init_inspector = __esm({
75750 "modules/ui/inspector.js"() {
75754 init_entity_editor();
75755 init_preset_list();
75756 init_view_on_osm();
75760 // modules/ui/sidebar.js
75761 var sidebar_exports = {};
75762 __export(sidebar_exports, {
75763 uiSidebar: () => uiSidebar
75765 function uiSidebar(context) {
75766 var inspector = uiInspector(context);
75767 var dataEditor = uiDataEditor(context);
75768 var noteEditor = uiNoteEditor(context);
75769 var keepRightEditor = uiKeepRightEditor(context);
75770 var osmoseEditor = uiOsmoseEditor(context);
75772 var _wasData = false;
75773 var _wasNote = false;
75774 var _wasQaItem = false;
75775 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
75776 function sidebar(selection2) {
75777 var container = context.container();
75778 var minWidth = 240;
75780 var containerWidth;
75782 selection2.style("min-width", minWidth + "px").style("max-width", "400px").style("width", "33.3333%");
75783 var resizer = selection2.append("div").attr("class", "sidebar-resizer").on(_pointerPrefix + "down.sidebar-resizer", pointerdown);
75784 var downPointerId, lastClientX, containerLocGetter;
75785 function pointerdown(d3_event) {
75786 if (downPointerId) return;
75787 if ("button" in d3_event && d3_event.button !== 0) return;
75788 downPointerId = d3_event.pointerId || "mouse";
75789 lastClientX = d3_event.clientX;
75790 containerLocGetter = utilFastMouse(container.node());
75791 dragOffset = utilFastMouse(resizer.node())(d3_event)[0] - 1;
75792 sidebarWidth = selection2.node().getBoundingClientRect().width;
75793 containerWidth = container.node().getBoundingClientRect().width;
75794 var widthPct = sidebarWidth / containerWidth * 100;
75795 selection2.style("width", widthPct + "%").style("max-width", "85%");
75796 resizer.classed("dragging", true);
75797 select_default2(window).on("touchmove.sidebar-resizer", function(d3_event2) {
75798 d3_event2.preventDefault();
75799 }, { passive: false }).on(_pointerPrefix + "move.sidebar-resizer", pointermove).on(_pointerPrefix + "up.sidebar-resizer pointercancel.sidebar-resizer", pointerup);
75801 function pointermove(d3_event) {
75802 if (downPointerId !== (d3_event.pointerId || "mouse")) return;
75803 d3_event.preventDefault();
75804 var dx = d3_event.clientX - lastClientX;
75805 lastClientX = d3_event.clientX;
75806 var isRTL = _mainLocalizer.textDirection() === "rtl";
75807 var scaleX = isRTL ? 0 : 1;
75808 var xMarginProperty = isRTL ? "margin-right" : "margin-left";
75809 var x2 = containerLocGetter(d3_event)[0] - dragOffset;
75810 sidebarWidth = isRTL ? containerWidth - x2 : x2;
75811 var isCollapsed = selection2.classed("collapsed");
75812 var shouldCollapse = sidebarWidth < minWidth;
75813 selection2.classed("collapsed", shouldCollapse);
75814 if (shouldCollapse) {
75815 if (!isCollapsed) {
75816 selection2.style(xMarginProperty, "-400px").style("width", "400px");
75817 context.ui().onResize([(sidebarWidth - dx) * scaleX, 0]);
75820 var widthPct = sidebarWidth / containerWidth * 100;
75821 selection2.style(xMarginProperty, null).style("width", widthPct + "%");
75823 context.ui().onResize([-sidebarWidth * scaleX, 0]);
75825 context.ui().onResize([-dx * scaleX, 0]);
75829 function pointerup(d3_event) {
75830 if (downPointerId !== (d3_event.pointerId || "mouse")) return;
75831 downPointerId = null;
75832 resizer.classed("dragging", false);
75833 select_default2(window).on("touchmove.sidebar-resizer", null).on(_pointerPrefix + "move.sidebar-resizer", null).on(_pointerPrefix + "up.sidebar-resizer pointercancel.sidebar-resizer", null);
75835 var featureListWrap = selection2.append("div").attr("class", "feature-list-pane").call(uiFeatureList(context));
75836 var inspectorWrap = selection2.append("div").attr("class", "inspector-hidden inspector-wrap");
75837 var hoverModeSelect = function(targets) {
75838 context.container().selectAll(".feature-list-item button").classed("hover", false);
75839 if (context.selectedIDs().length > 1 && targets && targets.length) {
75840 var elements = context.container().selectAll(".feature-list-item button").filter(function(node) {
75841 return targets.indexOf(node) !== -1;
75843 if (!elements.empty()) {
75844 elements.classed("hover", true);
75848 sidebar.hoverModeSelect = throttle_default(hoverModeSelect, 200);
75849 function hover(targets) {
75850 var datum2 = targets && targets.length && targets[0];
75851 if (datum2 && datum2.__featurehash__) {
75853 sidebar.show(dataEditor.datum(datum2));
75854 selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
75855 } else if (datum2 instanceof osmNote) {
75856 if (context.mode().id === "drag-note") return;
75858 var osm = services.osm;
75860 datum2 = osm.getNote(datum2.id);
75862 sidebar.show(noteEditor.note(datum2));
75863 selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
75864 } else if (datum2 instanceof QAItem) {
75866 var errService = services[datum2.service];
75868 datum2 = errService.getError(datum2.id);
75871 if (datum2.service === "keepRight") {
75872 errEditor = keepRightEditor;
75874 errEditor = osmoseEditor;
75876 context.container().selectAll(".qaItem." + datum2.service).classed("hover", function(d4) {
75877 return d4.id === datum2.id;
75879 sidebar.show(errEditor.error(datum2));
75880 selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
75881 } else if (!_current && datum2 instanceof osmEntity) {
75882 featureListWrap.classed("inspector-hidden", true);
75883 inspectorWrap.classed("inspector-hidden", false).classed("inspector-hover", true);
75884 if (!inspector.entityIDs() || !utilArrayIdentical(inspector.entityIDs(), [datum2.id]) || inspector.state() !== "hover") {
75885 inspector.state("hover").entityIDs([datum2.id]).newFeature(false);
75886 inspectorWrap.call(inspector);
75888 } else if (!_current) {
75889 featureListWrap.classed("inspector-hidden", false);
75890 inspectorWrap.classed("inspector-hidden", true);
75891 inspector.state("hide");
75892 } else if (_wasData || _wasNote || _wasQaItem) {
75895 _wasQaItem = false;
75896 context.container().selectAll(".note").classed("hover", false);
75897 context.container().selectAll(".qaItem").classed("hover", false);
75901 sidebar.hover = throttle_default(hover, 200);
75902 sidebar.intersects = function(extent) {
75903 var rect = selection2.node().getBoundingClientRect();
75904 return extent.intersects([
75905 context.projection.invert([0, rect.height]),
75906 context.projection.invert([rect.width, 0])
75909 sidebar.select = function(ids, newFeature) {
75911 if (ids && ids.length) {
75912 var entity = ids.length === 1 && context.entity(ids[0]);
75913 if (entity && newFeature && selection2.classed("collapsed")) {
75914 var extent = entity.extent(context.graph());
75915 sidebar.expand(sidebar.intersects(extent));
75917 featureListWrap.classed("inspector-hidden", true);
75918 inspectorWrap.classed("inspector-hidden", false).classed("inspector-hover", false);
75919 inspector.state("select").entityIDs(ids).newFeature(newFeature);
75920 inspectorWrap.call(inspector);
75922 inspector.state("hide");
75925 sidebar.showPresetList = function() {
75926 inspector.showList();
75928 sidebar.show = function(component, element) {
75929 featureListWrap.classed("inspector-hidden", true);
75930 inspectorWrap.classed("inspector-hidden", true);
75931 if (_current) _current.remove();
75932 _current = selection2.append("div").attr("class", "sidebar-component").call(component, element);
75934 sidebar.hide = function() {
75935 featureListWrap.classed("inspector-hidden", false);
75936 inspectorWrap.classed("inspector-hidden", true);
75937 if (_current) _current.remove();
75940 sidebar.expand = function(moveMap) {
75941 if (selection2.classed("collapsed")) {
75942 sidebar.toggle(moveMap);
75945 sidebar.collapse = function(moveMap) {
75946 if (!selection2.classed("collapsed")) {
75947 sidebar.toggle(moveMap);
75950 sidebar.toggle = function(moveMap) {
75951 if (context.inIntro()) return;
75952 var isCollapsed = selection2.classed("collapsed");
75953 var isCollapsing = !isCollapsed;
75954 var isRTL = _mainLocalizer.textDirection() === "rtl";
75955 var scaleX = isRTL ? 0 : 1;
75956 var xMarginProperty = isRTL ? "margin-right" : "margin-left";
75957 sidebarWidth = selection2.node().getBoundingClientRect().width;
75958 selection2.style("width", sidebarWidth + "px");
75959 var startMargin, endMargin, lastMargin;
75960 if (isCollapsing) {
75961 startMargin = lastMargin = 0;
75962 endMargin = -sidebarWidth;
75964 startMargin = lastMargin = -sidebarWidth;
75967 if (!isCollapsing) {
75968 selection2.classed("collapsed", isCollapsing);
75970 selection2.transition().style(xMarginProperty, endMargin + "px").tween("panner", function() {
75971 var i3 = number_default(startMargin, endMargin);
75972 return function(t2) {
75973 var dx = lastMargin - Math.round(i3(t2));
75974 lastMargin = lastMargin - dx;
75975 context.ui().onResize(moveMap ? void 0 : [dx * scaleX, 0]);
75977 }).on("end", function() {
75978 if (isCollapsing) {
75979 selection2.classed("collapsed", isCollapsing);
75981 if (!isCollapsing) {
75982 var containerWidth2 = container.node().getBoundingClientRect().width;
75983 var widthPct = sidebarWidth / containerWidth2 * 100;
75984 selection2.style(xMarginProperty, null).style("width", widthPct + "%");
75988 resizer.on("dblclick", function(d3_event) {
75989 d3_event.preventDefault();
75990 if (d3_event.sourceEvent) {
75991 d3_event.sourceEvent.preventDefault();
75995 context.map().on("crossEditableZoom.sidebar", function(within) {
75996 if (!within && !selection2.select(".inspector-hover").empty()) {
76001 sidebar.showPresetList = function() {
76003 sidebar.hover = function() {
76005 sidebar.hover.cancel = function() {
76007 sidebar.intersects = function() {
76009 sidebar.select = function() {
76011 sidebar.show = function() {
76013 sidebar.hide = function() {
76015 sidebar.expand = function() {
76017 sidebar.collapse = function() {
76019 sidebar.toggle = function() {
76023 var init_sidebar = __esm({
76024 "modules/ui/sidebar.js"() {
76033 init_data_editor();
76034 init_feature_list();
76036 init_keepRight_editor();
76037 init_osmose_editor();
76038 init_note_editor();
76043 // modules/ui/source_switch.js
76044 var source_switch_exports = {};
76045 __export(source_switch_exports, {
76046 uiSourceSwitch: () => uiSourceSwitch
76048 function uiSourceSwitch(context) {
76050 function click(d3_event) {
76051 d3_event.preventDefault();
76052 var osm = context.connection();
76054 if (context.inIntro()) return;
76055 if (context.history().hasChanges() && !window.confirm(_t("source_switch.lose_changes"))) return;
76056 var isLive = select_default2(this).classed("live");
76058 context.enter(modeBrowse(context));
76059 context.history().clearSaved();
76061 select_default2(this).html(isLive ? _t.html("source_switch.live") : _t.html("source_switch.dev")).classed("live", isLive).classed("chip", isLive);
76062 osm.switch(isLive ? keys2[0] : keys2[1]);
76064 var sourceSwitch = function(selection2) {
76065 selection2.append("a").attr("href", "#").call(_t.append("source_switch.live")).attr("class", "live chip").on("click", click);
76067 sourceSwitch.keys = function(_3) {
76068 if (!arguments.length) return keys2;
76070 return sourceSwitch;
76072 return sourceSwitch;
76074 var init_source_switch = __esm({
76075 "modules/ui/source_switch.js"() {
76083 // modules/ui/spinner.js
76084 var spinner_exports = {};
76085 __export(spinner_exports, {
76086 uiSpinner: () => uiSpinner
76088 function uiSpinner(context) {
76089 var osm = context.connection();
76090 return function(selection2) {
76091 var img = selection2.append("img").attr("src", context.imagePath("loader-black.gif")).style("opacity", 0);
76093 osm.on("loading.spinner", function() {
76094 img.transition().style("opacity", 1);
76095 }).on("loaded.spinner", function() {
76096 img.transition().style("opacity", 0);
76101 var init_spinner = __esm({
76102 "modules/ui/spinner.js"() {
76107 // modules/ui/sections/privacy.js
76108 var privacy_exports = {};
76109 __export(privacy_exports, {
76110 uiSectionPrivacy: () => uiSectionPrivacy
76112 function uiSectionPrivacy(context) {
76113 let section = uiSection("preferences-third-party", context).label(() => _t.append("preferences.privacy.title")).disclosureContent(renderDisclosureContent);
76114 function renderDisclosureContent(selection2) {
76115 selection2.selectAll(".privacy-options-list").data([0]).enter().append("ul").attr("class", "layer-list privacy-options-list");
76116 let thirdPartyIconsEnter = selection2.select(".privacy-options-list").selectAll(".privacy-third-party-icons-item").data([corePreferences("preferences.privacy.thirdpartyicons") || "true"]).enter().append("li").attr("class", "privacy-third-party-icons-item").append("label").call(
76117 uiTooltip().title(() => _t.append("preferences.privacy.third_party_icons.tooltip")).placement("bottom")
76119 thirdPartyIconsEnter.append("input").attr("type", "checkbox").on("change", (d3_event, d4) => {
76120 d3_event.preventDefault();
76121 corePreferences("preferences.privacy.thirdpartyicons", d4 === "true" ? "false" : "true");
76123 thirdPartyIconsEnter.append("span").call(_t.append("preferences.privacy.third_party_icons.description"));
76124 selection2.selectAll(".privacy-third-party-icons-item").classed("active", (d4) => d4 === "true").select("input").property("checked", (d4) => d4 === "true");
76125 selection2.selectAll(".privacy-link").data([0]).enter().append("div").attr("class", "privacy-link").append("a").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).attr("href", "https://github.com/openstreetmap/iD/blob/release/PRIVACY.md").append("span").call(_t.append("preferences.privacy.privacy_link"));
76127 corePreferences.onChange("preferences.privacy.thirdpartyicons", section.reRender);
76130 var init_privacy = __esm({
76131 "modules/ui/sections/privacy.js"() {
76133 init_preferences();
76141 // modules/ui/splash.js
76142 var splash_exports = {};
76143 __export(splash_exports, {
76144 uiSplash: () => uiSplash
76146 function uiSplash(context) {
76147 return (selection2) => {
76148 if (context.history().hasRestorableChanges()) return;
76149 let updateMessage = "";
76150 const sawPrivacyVersion = corePreferences("sawPrivacyVersion");
76151 let showSplash = !corePreferences("sawSplash");
76152 if (sawPrivacyVersion && sawPrivacyVersion !== context.privacyVersion) {
76153 updateMessage = _t("splash.privacy_update");
76156 if (!showSplash) return;
76157 corePreferences("sawSplash", true);
76158 corePreferences("sawPrivacyVersion", context.privacyVersion);
76159 _mainFileFetcher.get("intro_graph");
76160 let modalSelection = uiModal(selection2);
76161 modalSelection.select(".modal").attr("class", "modal-splash modal");
76162 let introModal = modalSelection.select(".content").append("div").attr("class", "fillL");
76163 introModal.append("div").attr("class", "modal-section").append("h3").call(_t.append("splash.welcome"));
76164 let modalSection = introModal.append("div").attr("class", "modal-section");
76165 modalSection.append("p").html(_t.html("splash.text", {
76166 version: context.version,
76167 website: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/blob/develop/CHANGELOG.md#whats-new">' + _t.html("splash.changelog") + "</a>" },
76168 github: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/issues">github.com</a>' }
76170 modalSection.append("p").html(_t.html("splash.privacy", {
76172 privacyLink: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/blob/release/PRIVACY.md">' + _t("splash.privacy_policy") + "</a>" }
76174 uiSectionPrivacy(context).label(() => _t.append("splash.privacy_settings")).render(modalSection);
76175 let buttonWrap = introModal.append("div").attr("class", "modal-actions");
76176 let walkthrough = buttonWrap.append("button").attr("class", "walkthrough").on("click", () => {
76177 context.container().call(uiIntro(context));
76178 modalSelection.close();
76180 walkthrough.append("svg").attr("class", "logo logo-walkthrough").append("use").attr("xlink:href", "#iD-logo-walkthrough");
76181 walkthrough.append("div").call(_t.append("splash.walkthrough"));
76182 let startEditing = buttonWrap.append("button").attr("class", "start-editing").on("click", modalSelection.close);
76183 startEditing.append("svg").attr("class", "logo logo-features").append("use").attr("xlink:href", "#iD-logo-features");
76184 startEditing.append("div").call(_t.append("splash.start"));
76185 modalSelection.select("button.close").attr("class", "hide");
76188 var init_splash = __esm({
76189 "modules/ui/splash.js"() {
76191 init_preferences();
76192 init_file_fetcher();
76200 // modules/ui/status.js
76201 var status_exports = {};
76202 __export(status_exports, {
76203 uiStatus: () => uiStatus
76205 function uiStatus(context) {
76206 var osm = context.connection();
76207 return function(selection2) {
76209 function update(err, apiStatus) {
76210 selection2.html("");
76212 if (apiStatus === "connectionSwitched") {
76214 } else if (apiStatus === "rateLimited") {
76215 if (!osm.authenticated()) {
76216 selection2.call(_t.append("osm_api_status.message.rateLimit")).append("a").attr("href", "#").attr("class", "api-status-login").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).append("span").call(_t.append("login")).on("click.login", function(d3_event) {
76217 d3_event.preventDefault();
76218 osm.authenticate();
76221 selection2.call(_t.append("osm_api_status.message.rateLimited"));
76224 var throttledRetry = throttle_default(function() {
76225 context.loadTiles(context.projection);
76226 osm.reloadApiStatus();
76228 selection2.call(_t.append("osm_api_status.message.error", { suffix: " " })).append("a").attr("href", "#").call(_t.append("osm_api_status.retry")).on("click.retry", function(d3_event) {
76229 d3_event.preventDefault();
76233 } else if (apiStatus === "readonly") {
76234 selection2.call(_t.append("osm_api_status.message.readonly"));
76235 } else if (apiStatus === "offline") {
76236 selection2.call(_t.append("osm_api_status.message.offline"));
76238 selection2.attr("class", "api-status " + (err ? "error" : apiStatus));
76240 osm.on("apiStatusChange.uiStatus", update);
76241 context.history().on("storage_error", () => {
76242 selection2.selectAll("span.local-storage-full").remove();
76243 selection2.append("span").attr("class", "local-storage-full").call(_t.append("osm_api_status.message.local_storage_full"));
76244 selection2.classed("error", true);
76246 window.setInterval(function() {
76247 osm.reloadApiStatus();
76249 osm.reloadApiStatus();
76252 var init_status = __esm({
76253 "modules/ui/status.js"() {
76261 // modules/ui/tools/modes.js
76262 var modes_exports = {};
76263 __export(modes_exports, {
76264 uiToolDrawModes: () => uiToolDrawModes
76266 function uiToolDrawModes(context) {
76269 label: _t.append("toolbar.add_feature")
76272 modeAddPoint(context, {
76273 title: _t.append("modes.add_point.title"),
76275 description: _t.append("modes.add_point.description"),
76276 preset: _mainPresetIndex.item("point"),
76279 modeAddLine(context, {
76280 title: _t.append("modes.add_line.title"),
76282 description: _t.append("modes.add_line.description"),
76283 preset: _mainPresetIndex.item("line"),
76286 modeAddArea(context, {
76287 title: _t.append("modes.add_area.title"),
76289 description: _t.append("modes.add_area.description"),
76290 preset: _mainPresetIndex.item("area"),
76294 function enabled(_mode) {
76295 return osmEditable();
76297 function osmEditable() {
76298 return context.editable();
76300 modes.forEach(function(mode) {
76301 context.keybinding().on(mode.key, function() {
76302 if (!enabled(mode)) return;
76303 if (mode.id === context.mode().id) {
76304 context.enter(modeBrowse(context));
76306 context.enter(mode);
76310 tool.render = function(selection2) {
76311 var wrap2 = selection2.append("div").attr("class", "joined").style("display", "flex");
76312 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
76313 context.map().on("move.modes", debouncedUpdate).on("drawn.modes", debouncedUpdate);
76314 context.on("enter.modes", update);
76316 function update() {
76317 var buttons = wrap2.selectAll("button.add-button").data(modes, function(d4) {
76320 buttons.exit().remove();
76321 var buttonsEnter = buttons.enter().append("button").attr("class", function(d4) {
76322 return d4.id + " add-button bar-button";
76323 }).on("click.mode-buttons", function(d3_event, d4) {
76324 if (!enabled(d4)) return;
76325 var currMode = context.mode().id;
76326 if (/^draw/.test(currMode)) return;
76327 if (d4.id === currMode) {
76328 context.enter(modeBrowse(context));
76333 uiTooltip().placement("bottom").title(function(d4) {
76334 return d4.description;
76335 }).keys(function(d4) {
76337 }).scrollContainer(context.container().select(".top-toolbar"))
76339 buttonsEnter.each(function(d4) {
76340 select_default2(this).call(svgIcon("#iD-icon-" + d4.button));
76342 buttonsEnter.append("span").attr("class", "label").text("").each(function(mode) {
76343 mode.title(select_default2(this));
76345 if (buttons.enter().size() || buttons.exit().size()) {
76346 context.ui().checkOverflow(".top-toolbar", true);
76348 buttons = buttons.merge(buttonsEnter).attr("aria-disabled", function(d4) {
76349 return !enabled(d4);
76350 }).classed("disabled", function(d4) {
76351 return !enabled(d4);
76352 }).attr("aria-pressed", function(d4) {
76353 return context.mode() && context.mode().button === d4.button;
76354 }).classed("active", function(d4) {
76355 return context.mode() && context.mode().button === d4.button;
76361 var init_modes = __esm({
76362 "modules/ui/tools/modes.js"() {
76374 // modules/ui/tools/notes.js
76375 var notes_exports2 = {};
76376 __export(notes_exports2, {
76377 uiToolNotes: () => uiToolNotes
76379 function uiToolNotes(context) {
76382 label: _t.append("modes.add_note.label")
76384 var mode = modeAddNote(context);
76385 function enabled() {
76386 return notesEnabled() && notesEditable();
76388 function notesEnabled() {
76389 var noteLayer = context.layers().layer("notes");
76390 return noteLayer && noteLayer.enabled();
76392 function notesEditable() {
76393 var mode2 = context.mode();
76394 return context.map().notesEditable() && mode2 && mode2.id !== "save";
76396 context.keybinding().on(mode.key, function() {
76397 if (!enabled()) return;
76398 if (mode.id === context.mode().id) {
76399 context.enter(modeBrowse(context));
76401 context.enter(mode);
76404 tool.render = function(selection2) {
76405 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
76406 context.map().on("move.notes", debouncedUpdate).on("drawn.notes", debouncedUpdate);
76407 context.on("enter.notes", update);
76409 function update() {
76410 var showNotes = notesEnabled();
76411 var data = showNotes ? [mode] : [];
76412 var buttons = selection2.selectAll("button.add-button").data(data, function(d4) {
76415 buttons.exit().remove();
76416 var buttonsEnter = buttons.enter().append("button").attr("class", function(d4) {
76417 return d4.id + " add-button bar-button";
76418 }).on("click.notes", function(d3_event, d4) {
76419 if (!enabled()) return;
76420 var currMode = context.mode().id;
76421 if (/^draw/.test(currMode)) return;
76422 if (d4.id === currMode) {
76423 context.enter(modeBrowse(context));
76428 uiTooltip().placement("bottom").title(function(d4) {
76429 return d4.description;
76430 }).keys(function(d4) {
76432 }).scrollContainer(context.container().select(".top-toolbar"))
76434 buttonsEnter.each(function(d4) {
76435 select_default2(this).call(svgIcon(d4.icon || "#iD-icon-" + d4.button));
76437 if (buttons.enter().size() || buttons.exit().size()) {
76438 context.ui().checkOverflow(".top-toolbar", true);
76440 buttons = buttons.merge(buttonsEnter).classed("disabled", function() {
76442 }).attr("aria-disabled", function() {
76444 }).classed("active", function(d4) {
76445 return context.mode() && context.mode().button === d4.button;
76446 }).attr("aria-pressed", function(d4) {
76447 return context.mode() && context.mode().button === d4.button;
76451 tool.uninstall = function() {
76452 context.on("enter.editor.notes", null).on("exit.editor.notes", null).on("enter.notes", null);
76453 context.map().on("move.notes", null).on("drawn.notes", null);
76457 var init_notes2 = __esm({
76458 "modules/ui/tools/notes.js"() {
76469 // modules/ui/tools/save.js
76470 var save_exports = {};
76471 __export(save_exports, {
76472 uiToolSave: () => uiToolSave
76474 function uiToolSave(context) {
76477 label: _t.append("save.title")
76480 var tooltipBehavior = null;
76481 var history = context.history();
76482 var key = uiCmd("\u2318S");
76483 var _numChanges = 0;
76484 function isSaving() {
76485 var mode = context.mode();
76486 return mode && mode.id === "save";
76488 function isDisabled() {
76489 return _numChanges === 0 || isSaving();
76491 function save(d3_event) {
76492 d3_event.preventDefault();
76493 if (!context.inIntro() && !isSaving() && history.hasChanges()) {
76494 context.enter(modeSave(context));
76497 function bgColor(numChanges) {
76499 if (numChanges === 0) {
76501 } else if (numChanges <= 50) {
76502 step = numChanges / 50;
76503 return rgb_default("#fff0", "#ff08")(step);
76505 step = Math.min((numChanges - 50) / 50, 1);
76506 return rgb_default("#ff08", "#f008")(step);
76509 function updateCount() {
76510 var val = history.difference().summary().length;
76511 if (val === _numChanges) return;
76513 if (tooltipBehavior) {
76514 tooltipBehavior.title(() => _t.append(_numChanges > 0 ? "save.help" : "save.no_changes")).keys([key]);
76517 button.classed("disabled", isDisabled()).style("--accent-color", bgColor(_numChanges));
76518 button.select("span.count").text(_numChanges);
76521 tool.render = function(selection2) {
76522 tooltipBehavior = uiTooltip().placement("bottom").title(() => _t.append("save.no_changes")).keys([key]).scrollContainer(context.container().select(".top-toolbar"));
76523 var lastPointerUpType;
76524 button = selection2.append("button").attr("class", "save disabled bar-button").on("pointerup", function(d3_event) {
76525 lastPointerUpType = d3_event.pointerType;
76526 }).on("click", function(d3_event) {
76528 if (_numChanges === 0 && (lastPointerUpType === "touch" || lastPointerUpType === "pen")) {
76529 context.ui().flash.duration(2e3).iconName("#iD-icon-save").iconClass("disabled").label(_t.append("save.no_changes"))();
76531 lastPointerUpType = null;
76532 }).call(tooltipBehavior);
76533 button.call(svgIcon("#iD-icon-save"));
76534 button.append("span").attr("class", "count").attr("aria-hidden", "true").text("0");
76536 context.keybinding().on(key, save, true);
76537 context.history().on("change.save", updateCount);
76538 context.on("enter.save", function() {
76540 button.classed("disabled", isDisabled());
76542 button.call(tooltipBehavior.hide);
76547 tool.uninstall = function() {
76548 context.keybinding().off(key, true);
76549 context.history().on("change.save", null);
76550 context.on("enter.save", null);
76552 tooltipBehavior = null;
76556 var init_save = __esm({
76557 "modules/ui/tools/save.js"() {
76568 // modules/ui/tools/sidebar_toggle.js
76569 var sidebar_toggle_exports = {};
76570 __export(sidebar_toggle_exports, {
76571 uiToolSidebarToggle: () => uiToolSidebarToggle
76573 function uiToolSidebarToggle(context) {
76575 id: "sidebar_toggle",
76576 label: _t.append("toolbar.inspect")
76578 tool.render = function(selection2) {
76579 selection2.append("button").attr("class", "bar-button").attr("aria-label", _t("sidebar.tooltip")).on("click", function() {
76580 context.ui().sidebar.toggle();
76582 uiTooltip().placement("bottom").title(() => _t.append("sidebar.tooltip")).keys([_t("sidebar.key")]).scrollContainer(context.container().select(".top-toolbar"))
76583 ).call(svgIcon("#iD-icon-sidebar-" + (_mainLocalizer.textDirection() === "rtl" ? "right" : "left")));
76587 var init_sidebar_toggle = __esm({
76588 "modules/ui/tools/sidebar_toggle.js"() {
76596 // modules/ui/tools/undo_redo.js
76597 var undo_redo_exports = {};
76598 __export(undo_redo_exports, {
76599 uiToolUndoRedo: () => uiToolUndoRedo
76601 function uiToolUndoRedo(context) {
76604 label: _t.append("toolbar.undo_redo")
76608 cmd: uiCmd("\u2318Z"),
76609 action: function() {
76612 annotation: function() {
76613 return context.history().undoAnnotation();
76615 icon: "iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")
76618 cmd: uiCmd("\u2318\u21E7Z"),
76619 action: function() {
76622 annotation: function() {
76623 return context.history().redoAnnotation();
76625 icon: "iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "undo" : "redo")
76627 function editable() {
76628 return context.mode() && context.mode().id !== "save" && context.map().editableDataEnabled(
76630 /* ignore min zoom */
76633 tool.render = function(selection2) {
76634 var tooltipBehavior = uiTooltip().placement("bottom").title(function(d4) {
76635 return d4.annotation() ? _t.append(d4.id + ".tooltip", { action: d4.annotation() }) : _t.append(d4.id + ".nothing");
76636 }).keys(function(d4) {
76638 }).scrollContainer(context.container().select(".top-toolbar"));
76639 var lastPointerUpType;
76640 var buttons = selection2.selectAll("button").data(commands).enter().append("button").attr("class", function(d4) {
76641 return "disabled " + d4.id + "-button bar-button";
76642 }).on("pointerup", function(d3_event) {
76643 lastPointerUpType = d3_event.pointerType;
76644 }).on("click", function(d3_event, d4) {
76645 d3_event.preventDefault();
76646 var annotation = d4.annotation();
76647 if (editable() && annotation) {
76650 if (editable() && (lastPointerUpType === "touch" || lastPointerUpType === "pen")) {
76651 var label = annotation ? _t.append(d4.id + ".tooltip", { action: annotation }) : _t.append(d4.id + ".nothing");
76652 context.ui().flash.duration(2e3).iconName("#" + d4.icon).iconClass(annotation ? "" : "disabled").label(label)();
76654 lastPointerUpType = null;
76655 }).call(tooltipBehavior);
76656 buttons.each(function(d4) {
76657 select_default2(this).call(svgIcon("#" + d4.icon));
76659 context.keybinding().on(commands[0].cmd, function(d3_event) {
76660 d3_event.preventDefault();
76661 if (editable()) commands[0].action();
76662 }).on(commands[1].cmd, function(d3_event) {
76663 d3_event.preventDefault();
76664 if (editable()) commands[1].action();
76666 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
76667 context.map().on("move.undo_redo", debouncedUpdate).on("drawn.undo_redo", debouncedUpdate);
76668 context.history().on("change.undo_redo", function(difference2) {
76669 if (difference2) update();
76671 context.on("enter.undo_redo", update);
76672 function update() {
76673 buttons.classed("disabled", function(d4) {
76674 return !editable() || !d4.annotation();
76675 }).each(function() {
76676 var selection3 = select_default2(this);
76677 if (!selection3.select(".tooltip.in").empty()) {
76678 selection3.call(tooltipBehavior.updateContent);
76683 tool.uninstall = function() {
76684 context.keybinding().off(commands[0].cmd).off(commands[1].cmd);
76685 context.map().on("move.undo_redo", null).on("drawn.undo_redo", null);
76686 context.history().on("change.undo_redo", null);
76687 context.on("enter.undo_redo", null);
76691 var init_undo_redo = __esm({
76692 "modules/ui/tools/undo_redo.js"() {
76703 // modules/ui/tools/index.js
76704 var tools_exports = {};
76705 __export(tools_exports, {
76706 uiToolDrawModes: () => uiToolDrawModes,
76707 uiToolNotes: () => uiToolNotes,
76708 uiToolSave: () => uiToolSave,
76709 uiToolSidebarToggle: () => uiToolSidebarToggle,
76710 uiToolUndoRedo: () => uiToolUndoRedo
76712 var init_tools = __esm({
76713 "modules/ui/tools/index.js"() {
76718 init_sidebar_toggle();
76723 // modules/ui/top_toolbar.js
76724 var top_toolbar_exports = {};
76725 __export(top_toolbar_exports, {
76726 uiTopToolbar: () => uiTopToolbar
76728 function uiTopToolbar(context) {
76729 var sidebarToggle = uiToolSidebarToggle(context), modes = uiToolDrawModes(context), notes = uiToolNotes(context), undoRedo = uiToolUndoRedo(context), save = uiToolSave(context);
76730 function notesEnabled() {
76731 var noteLayer = context.layers().layer("notes");
76732 return noteLayer && noteLayer.enabled();
76734 function topToolbar(bar) {
76735 bar.on("wheel.topToolbar", function(d3_event) {
76736 if (!d3_event.deltaX) {
76737 bar.node().scrollLeft += d3_event.deltaY;
76740 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
76741 context.layers().on("change.topToolbar", debouncedUpdate);
76743 function update() {
76749 tools.push("spacer");
76750 if (notesEnabled()) {
76751 tools = tools.concat([notes, "spacer"]);
76753 tools = tools.concat([undoRedo, save]);
76754 var toolbarItems = bar.selectAll(".toolbar-item").data(tools, function(d4) {
76755 return d4.id || d4;
76757 toolbarItems.exit().each(function(d4) {
76758 if (d4.uninstall) {
76762 var itemsEnter = toolbarItems.enter().append("div").attr("class", function(d4) {
76763 var classes = "toolbar-item " + (d4.id || d4).replace("_", "-");
76764 if (d4.klass) classes += " " + d4.klass;
76767 var actionableItems = itemsEnter.filter(function(d4) {
76768 return d4 !== "spacer";
76770 actionableItems.append("div").attr("class", "item-content").each(function(d4) {
76771 select_default2(this).call(d4.render, bar);
76773 actionableItems.append("div").attr("class", "item-label").each(function(d4) {
76774 d4.label(select_default2(this));
76780 var init_top_toolbar = __esm({
76781 "modules/ui/top_toolbar.js"() {
76789 // modules/ui/version.js
76790 var version_exports = {};
76791 __export(version_exports, {
76792 uiVersion: () => uiVersion
76794 function uiVersion(context) {
76795 var currVersion = context.version;
76796 var matchedVersion = currVersion.match(/\d+\.\d+\.\d+.*/);
76797 if (sawVersion === null && matchedVersion !== null) {
76798 if (corePreferences("sawVersion")) {
76800 isNewVersion = corePreferences("sawVersion") !== currVersion && currVersion.indexOf("-") === -1;
76803 isNewVersion = true;
76805 corePreferences("sawVersion", currVersion);
76806 sawVersion = currVersion;
76808 return function(selection2) {
76809 selection2.append("a").attr("target", "_blank").attr("href", "https://github.com/openstreetmap/iD").text(currVersion);
76810 if (isNewVersion && !isNewUser) {
76811 selection2.append("a").attr("class", "badge").attr("target", "_blank").attr("href", `https://github.com/openstreetmap/iD/releases/tag/v${currVersion}`).call(svgIcon("#maki-gift")).call(
76812 uiTooltip().title(() => _t.append("version.whats_new", { version: currVersion })).placement("top").scrollContainer(context.container().select(".main-footer-wrap"))
76817 var sawVersion, isNewVersion, isNewUser;
76818 var init_version = __esm({
76819 "modules/ui/version.js"() {
76821 init_preferences();
76826 isNewVersion = false;
76831 // modules/ui/zoom.js
76832 var zoom_exports = {};
76833 __export(zoom_exports, {
76834 uiZoom: () => uiZoom
76836 function uiZoom(context) {
76839 icon: "iD-icon-plus",
76840 title: _t.append("zoom.in"),
76842 disabled: function() {
76843 return !context.map().canZoomIn();
76845 disabledTitle: _t.append("zoom.disabled.in"),
76849 icon: "iD-icon-minus",
76850 title: _t.append("zoom.out"),
76852 disabled: function() {
76853 return !context.map().canZoomOut();
76855 disabledTitle: _t.append("zoom.disabled.out"),
76858 function zoomIn(d3_event) {
76859 if (d3_event.shiftKey) return;
76860 d3_event.preventDefault();
76861 context.map().zoomIn();
76863 function zoomOut(d3_event) {
76864 if (d3_event.shiftKey) return;
76865 d3_event.preventDefault();
76866 context.map().zoomOut();
76868 function zoomInFurther(d3_event) {
76869 if (d3_event.shiftKey) return;
76870 d3_event.preventDefault();
76871 context.map().zoomInFurther();
76873 function zoomOutFurther(d3_event) {
76874 if (d3_event.shiftKey) return;
76875 d3_event.preventDefault();
76876 context.map().zoomOutFurther();
76878 return function(selection2) {
76879 var tooltipBehavior = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(function(d4) {
76880 if (d4.disabled()) {
76881 return d4.disabledTitle;
76884 }).keys(function(d4) {
76887 var lastPointerUpType;
76888 var buttons = selection2.selectAll("button").data(zooms).enter().append("button").attr("class", function(d4) {
76890 }).on("pointerup.editor", function(d3_event) {
76891 lastPointerUpType = d3_event.pointerType;
76892 }).on("click.editor", function(d3_event, d4) {
76893 if (!d4.disabled()) {
76894 d4.action(d3_event);
76895 } else if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
76896 context.ui().flash.duration(2e3).iconName("#" + d4.icon).iconClass("disabled").label(d4.disabledTitle)();
76898 lastPointerUpType = null;
76899 }).call(tooltipBehavior);
76900 buttons.each(function(d4) {
76901 select_default2(this).call(svgIcon("#" + d4.icon, "light"));
76903 utilKeybinding.plusKeys.forEach(function(key) {
76904 context.keybinding().on([key], zoomIn);
76905 context.keybinding().on([uiCmd("\u2325" + key)], zoomInFurther);
76907 utilKeybinding.minusKeys.forEach(function(key) {
76908 context.keybinding().on([key], zoomOut);
76909 context.keybinding().on([uiCmd("\u2325" + key)], zoomOutFurther);
76911 function updateButtonStates() {
76912 buttons.classed("disabled", function(d4) {
76913 return d4.disabled();
76914 }).each(function() {
76915 var selection3 = select_default2(this);
76916 if (!selection3.select(".tooltip.in").empty()) {
76917 selection3.call(tooltipBehavior.updateContent);
76921 updateButtonStates();
76922 context.map().on("move.uiZoom", updateButtonStates);
76925 var init_zoom3 = __esm({
76926 "modules/ui/zoom.js"() {
76937 // modules/ui/zoom_to_selection.js
76938 var zoom_to_selection_exports = {};
76939 __export(zoom_to_selection_exports, {
76940 uiZoomToSelection: () => uiZoomToSelection
76942 function uiZoomToSelection(context) {
76943 function isDisabled() {
76944 var mode = context.mode();
76945 return !mode || !mode.zoomToSelected;
76947 var _lastPointerUpType;
76948 function pointerup(d3_event) {
76949 _lastPointerUpType = d3_event.pointerType;
76951 function click(d3_event) {
76952 d3_event.preventDefault();
76953 if (isDisabled()) {
76954 if (_lastPointerUpType === "touch" || _lastPointerUpType === "pen") {
76955 context.ui().flash.duration(2e3).iconName("#iD-icon-framed-dot").iconClass("disabled").label(_t.append("inspector.zoom_to.no_selection"))();
76958 var mode = context.mode();
76959 if (mode && mode.zoomToSelected) {
76960 mode.zoomToSelected();
76963 _lastPointerUpType = null;
76965 return function(selection2) {
76966 var tooltipBehavior = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(function() {
76967 if (isDisabled()) {
76968 return _t.append("inspector.zoom_to.no_selection");
76970 return _t.append("inspector.zoom_to.title");
76971 }).keys([_t("inspector.zoom_to.key")]);
76972 var button = selection2.append("button").on("pointerup", pointerup).on("click", click).call(svgIcon("#iD-icon-framed-dot", "light")).call(tooltipBehavior);
76973 function setEnabledState() {
76974 button.classed("disabled", isDisabled());
76975 if (!button.select(".tooltip.in").empty()) {
76976 button.call(tooltipBehavior.updateContent);
76979 context.on("enter.uiZoomToSelection", setEnabledState);
76983 var init_zoom_to_selection = __esm({
76984 "modules/ui/zoom_to_selection.js"() {
76992 // modules/ui/pane.js
76993 var pane_exports = {};
76994 __export(pane_exports, {
76995 uiPane: () => uiPane
76997 function uiPane(id2, context) {
77000 var _description = "";
77001 var _iconName = "";
77003 var _paneSelection = select_default2(null);
77008 pane.label = function(val) {
77009 if (!arguments.length) return _label;
77013 pane.key = function(val) {
77014 if (!arguments.length) return _key;
77018 pane.description = function(val) {
77019 if (!arguments.length) return _description;
77020 _description = val;
77023 pane.iconName = function(val) {
77024 if (!arguments.length) return _iconName;
77028 pane.sections = function(val) {
77029 if (!arguments.length) return _sections;
77033 pane.selection = function() {
77034 return _paneSelection;
77036 function hidePane() {
77037 context.ui().togglePanes();
77039 pane.togglePane = function(d3_event) {
77040 if (d3_event) d3_event.preventDefault();
77041 _paneTooltip.hide();
77042 context.ui().togglePanes(!_paneSelection.classed("shown") ? _paneSelection : void 0);
77044 pane.renderToggleButton = function(selection2) {
77045 if (!_paneTooltip) {
77046 _paneTooltip = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(() => _description).keys([_key]);
77048 selection2.append("button").on("click", pane.togglePane).call(svgIcon("#" + _iconName, "light")).call(_paneTooltip);
77050 pane.renderContent = function(selection2) {
77052 _sections.forEach(function(section) {
77053 selection2.call(section.render);
77057 pane.renderPane = function(selection2) {
77058 _paneSelection = selection2.append("div").attr("class", "fillL map-pane hide " + id2 + "-pane").attr("pane", id2);
77059 var heading = _paneSelection.append("div").attr("class", "pane-heading");
77060 heading.append("h2").text("").call(_label);
77061 heading.append("button").attr("title", _t("icons.close")).on("click", hidePane).call(svgIcon("#iD-icon-close"));
77062 _paneSelection.append("div").attr("class", "pane-content").call(pane.renderContent);
77064 context.keybinding().on(_key, pane.togglePane);
77069 var init_pane = __esm({
77070 "modules/ui/pane.js"() {
77079 // modules/ui/sections/background_display_options.js
77080 var background_display_options_exports = {};
77081 __export(background_display_options_exports, {
77082 uiSectionBackgroundDisplayOptions: () => uiSectionBackgroundDisplayOptions
77084 function uiSectionBackgroundDisplayOptions(context) {
77085 var section = uiSection("background-display-options", context).label(() => _t.append("background.display_options")).disclosureContent(renderDisclosureContent);
77086 var _storedOpacity = corePreferences("background-opacity");
77089 var _sliders = ["brightness", "contrast", "saturation", "sharpness"];
77091 brightness: _storedOpacity !== null ? +_storedOpacity : 1,
77096 function updateValue(d4, val) {
77097 val = clamp_default(val, _minVal, _maxVal);
77098 _options[d4] = val;
77099 context.background()[d4](val);
77100 if (d4 === "brightness") {
77101 corePreferences("background-opacity", val);
77103 section.reRender();
77105 function renderDisclosureContent(selection2) {
77106 var container = selection2.selectAll(".display-options-container").data([0]);
77107 var containerEnter = container.enter().append("div").attr("class", "display-options-container controls-list");
77108 var slidersEnter = containerEnter.selectAll(".display-control").data(_sliders).enter().append("label").attr("class", function(d4) {
77109 return "display-control display-control-" + d4;
77111 slidersEnter.html(function(d4) {
77112 return _t.html("background." + d4);
77113 }).append("span").attr("class", function(d4) {
77114 return "display-option-value display-option-value-" + d4;
77116 var sildersControlEnter = slidersEnter.append("div").attr("class", "control-wrap");
77117 sildersControlEnter.append("input").attr("class", function(d4) {
77118 return "display-option-input display-option-input-" + d4;
77119 }).attr("type", "range").attr("min", _minVal).attr("max", _maxVal).attr("step", "0.01").on("input", function(d3_event, d4) {
77120 var val = select_default2(this).property("value");
77121 if (!val && d3_event && d3_event.target) {
77122 val = d3_event.target.value;
77124 updateValue(d4, val);
77126 sildersControlEnter.append("button").attr("title", function(d4) {
77127 return `${_t("background.reset")} ${_t("background." + d4)}`;
77128 }).attr("class", function(d4) {
77129 return "display-option-reset display-option-reset-" + d4;
77130 }).on("click", function(d3_event, d4) {
77131 if (d3_event.button !== 0) return;
77132 updateValue(d4, 1);
77133 }).call(svgIcon("#iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")));
77134 containerEnter.append("a").attr("class", "display-option-resetlink").attr("role", "button").attr("href", "#").call(_t.append("background.reset_all")).on("click", function(d3_event) {
77135 d3_event.preventDefault();
77136 for (var i3 = 0; i3 < _sliders.length; i3++) {
77137 updateValue(_sliders[i3], 1);
77140 container = containerEnter.merge(container);
77141 container.selectAll(".display-option-input").property("value", function(d4) {
77142 return _options[d4];
77144 container.selectAll(".display-option-value").text(function(d4) {
77145 return Math.floor(_options[d4] * 100) + "%";
77147 container.selectAll(".display-option-reset").classed("disabled", function(d4) {
77148 return _options[d4] === 1;
77150 if (containerEnter.size() && _options.brightness !== 1) {
77151 context.background().brightness(_options.brightness);
77156 var init_background_display_options = __esm({
77157 "modules/ui/sections/background_display_options.js"() {
77161 init_preferences();
77168 // modules/ui/settings/custom_background.js
77169 var custom_background_exports = {};
77170 __export(custom_background_exports, {
77171 uiSettingsCustomBackground: () => uiSettingsCustomBackground
77173 function uiSettingsCustomBackground() {
77174 var dispatch14 = dispatch_default("change");
77175 function render(selection2) {
77176 var _origSettings = {
77177 template: corePreferences("background-custom-template")
77179 var _currSettings = {
77180 template: corePreferences("background-custom-template")
77182 var example = "https://tile.openstreetmap.org/{zoom}/{x}/{y}.png";
77183 var modal = uiConfirm(selection2).okButton();
77184 modal.classed("settings-modal settings-custom-background", true);
77185 modal.select(".modal-section.header").append("h3").call(_t.append("settings.custom_background.header"));
77186 var textSection = modal.select(".modal-section.message-text");
77187 var instructions = `${_t.html("settings.custom_background.instructions.info")}
77189 #### ${_t.html("settings.custom_background.instructions.wms.tokens_label")}
77190 * ${_t.html("settings.custom_background.instructions.wms.tokens.proj")}
77191 * ${_t.html("settings.custom_background.instructions.wms.tokens.wkid")}
77192 * ${_t.html("settings.custom_background.instructions.wms.tokens.dimensions")}
77193 * ${_t.html("settings.custom_background.instructions.wms.tokens.bbox")}
77195 #### ${_t.html("settings.custom_background.instructions.tms.tokens_label")}
77196 * ${_t.html("settings.custom_background.instructions.tms.tokens.xyz")}
77197 * ${_t.html("settings.custom_background.instructions.tms.tokens.flipped_y")}
77198 * ${_t.html("settings.custom_background.instructions.tms.tokens.switch")}
77199 * ${_t.html("settings.custom_background.instructions.tms.tokens.quadtile")}
77200 * ${_t.html("settings.custom_background.instructions.tms.tokens.scale_factor")}
77202 #### ${_t.html("settings.custom_background.instructions.example")}
77204 textSection.append("div").attr("class", "instructions-template").html(d(instructions));
77205 textSection.append("textarea").attr("class", "field-template").attr("placeholder", _t("settings.custom_background.template.placeholder")).call(utilNoAuto).property("value", _currSettings.template);
77206 var buttonSection = modal.select(".modal-section.buttons");
77207 buttonSection.insert("button", ".ok-button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
77208 buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
77209 buttonSection.select(".ok-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
77210 function isSaveDisabled() {
77213 function clickCancel() {
77214 textSection.select(".field-template").property("value", _origSettings.template);
77215 corePreferences("background-custom-template", _origSettings.template);
77219 function clickSave() {
77220 _currSettings.template = textSection.select(".field-template").property("value");
77221 corePreferences("background-custom-template", _currSettings.template);
77224 dispatch14.call("change", this, _currSettings);
77227 return utilRebind(render, dispatch14, "on");
77229 var init_custom_background = __esm({
77230 "modules/ui/settings/custom_background.js"() {
77234 init_preferences();
77241 // modules/ui/sections/background_list.js
77242 var background_list_exports = {};
77243 __export(background_list_exports, {
77244 uiSectionBackgroundList: () => uiSectionBackgroundList
77246 function uiSectionBackgroundList(context) {
77247 var _backgroundList = select_default2(null);
77248 var _customSource = context.background().findSource("custom");
77249 var _settingsCustomBackground = uiSettingsCustomBackground(context).on("change", customChanged);
77250 var section = uiSection("background-list", context).label(() => _t.append("background.backgrounds")).disclosureContent(renderDisclosureContent);
77251 function previousBackgroundID() {
77252 return corePreferences("background-last-used-toggle");
77254 function renderDisclosureContent(selection2) {
77255 var container = selection2.selectAll(".layer-background-list").data([0]);
77256 _backgroundList = container.enter().append("ul").attr("class", "layer-list layer-background-list").attr("dir", "auto").merge(container);
77257 var bgExtrasListEnter = selection2.selectAll(".bg-extras-list").data([0]).enter().append("ul").attr("class", "layer-list bg-extras-list");
77258 var minimapLabelEnter = bgExtrasListEnter.append("li").attr("class", "minimap-toggle-item").append("label").call(
77259 uiTooltip().title(() => _t.append("background.minimap.tooltip")).keys([_t("background.minimap.key")]).placement("top")
77261 minimapLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
77262 d3_event.preventDefault();
77263 uiMapInMap.toggle();
77265 minimapLabelEnter.append("span").call(_t.append("background.minimap.description"));
77266 var panelLabelEnter = bgExtrasListEnter.append("li").attr("class", "background-panel-toggle-item").append("label").call(
77267 uiTooltip().title(() => _t.append("background.panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.background.key"))]).placement("top")
77269 panelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
77270 d3_event.preventDefault();
77271 context.ui().info.toggle("background");
77273 panelLabelEnter.append("span").call(_t.append("background.panel.description"));
77274 var locPanelLabelEnter = bgExtrasListEnter.append("li").attr("class", "location-panel-toggle-item").append("label").call(
77275 uiTooltip().title(() => _t.append("background.location_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.location.key"))]).placement("top")
77277 locPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
77278 d3_event.preventDefault();
77279 context.ui().info.toggle("location");
77281 locPanelLabelEnter.append("span").call(_t.append("background.location_panel.description"));
77282 selection2.selectAll(".imagery-faq").data([0]).enter().append("div").attr("class", "imagery-faq").append("a").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).attr("href", "https://github.com/openstreetmap/iD/blob/develop/FAQ.md#how-can-i-report-an-issue-with-background-imagery").append("span").call(_t.append("background.imagery_problem_faq"));
77283 _backgroundList.call(drawListItems, "radio", function(d3_event, d4) {
77284 chooseBackground(d4);
77286 return !d4.isHidden() && !d4.overlay;
77289 function setTooltips(selection2) {
77290 selection2.each(function(d4, i3, nodes) {
77291 var item = select_default2(this).select("label");
77292 var span = item.select("span");
77293 var placement = i3 < nodes.length / 2 ? "bottom" : "top";
77294 var hasDescription = d4.hasDescription();
77295 var isOverflowing = span.property("clientWidth") !== span.property("scrollWidth");
77296 item.call(uiTooltip().destroyAny);
77297 if (d4.id === previousBackgroundID()) {
77299 uiTooltip().placement(placement).title(() => _t.append("background.switch")).keys([uiCmd("\u2318" + _t("background.key"))])
77301 } else if (hasDescription || isOverflowing) {
77303 uiTooltip().placement(placement).title(() => hasDescription ? d4.description() : d4.label())
77308 function drawListItems(layerList, type2, change, filter2) {
77309 var sources = context.background().sources(context.map().extent(), context.map().zoom(), true).filter(filter2).sort(function(a2, b3) {
77310 return a2.best() && !b3.best() ? -1 : b3.best() && !a2.best() ? 1 : descending(a2.area(), b3.area()) || ascending(a2.name(), b3.name()) || 0;
77312 var layerLinks = layerList.selectAll("li").data(sources, function(d4, i3) {
77313 return d4.id + "---" + i3;
77315 layerLinks.exit().remove();
77316 var enter = layerLinks.enter().append("li").classed("layer-custom", function(d4) {
77317 return d4.id === "custom";
77318 }).classed("best", function(d4) {
77321 var label = enter.append("label");
77322 label.append("input").attr("type", type2).attr("name", "background-layer").attr("value", function(d4) {
77324 }).on("change", change);
77325 label.append("span").each(function(d4) {
77326 d4.label()(select_default2(this));
77328 enter.filter(function(d4) {
77329 return d4.id === "custom";
77330 }).append("button").attr("class", "layer-browse").call(
77331 uiTooltip().title(() => _t.append("settings.custom_background.tooltip")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
77332 ).on("click", function(d3_event) {
77333 d3_event.preventDefault();
77335 }).call(svgIcon("#iD-icon-more"));
77336 enter.filter(function(d4) {
77338 }).append("div").attr("class", "best").call(
77339 uiTooltip().title(() => _t.append("background.best_imagery")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
77340 ).append("span").text("\u2605");
77341 layerList.call(updateLayerSelections);
77343 function updateLayerSelections(selection2) {
77344 function active(d4) {
77345 return context.background().showsLayer(d4);
77347 selection2.selectAll("li").classed("active", active).classed("switch", function(d4) {
77348 return d4.id === previousBackgroundID();
77349 }).call(setTooltips).selectAll("input").property("checked", active);
77351 function chooseBackground(d4) {
77352 if (d4.id === "custom" && !d4.template()) {
77353 return editCustom();
77355 var previousBackground = context.background().baseLayerSource();
77356 corePreferences("background-last-used-toggle", previousBackground.id);
77357 corePreferences("background-last-used", d4.id);
77358 context.background().baseLayerSource(d4);
77360 function customChanged(d4) {
77361 if (d4 && d4.template) {
77362 _customSource.template(d4.template);
77363 chooseBackground(_customSource);
77365 _customSource.template("");
77366 chooseBackground(context.background().findSource("none"));
77369 function editCustom() {
77370 context.container().call(_settingsCustomBackground);
77372 context.background().on("change.background_list", function() {
77373 _backgroundList.call(updateLayerSelections);
77376 "move.background_list",
77377 debounce_default(function() {
77378 window.requestIdleCallback(section.reRender);
77383 var init_background_list = __esm({
77384 "modules/ui/sections/background_list.js"() {
77389 init_preferences();
77394 init_custom_background();
77400 // modules/ui/sections/background_offset.js
77401 var background_offset_exports = {};
77402 __export(background_offset_exports, {
77403 uiSectionBackgroundOffset: () => uiSectionBackgroundOffset
77405 function uiSectionBackgroundOffset(context) {
77406 var section = uiSection("background-offset", context).label(() => _t.append("background.fix_misalignment")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
77407 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
77408 var _directions = [
77409 ["top", [0, -0.5]],
77410 ["left", [-0.5, 0]],
77411 ["right", [0.5, 0]],
77412 ["bottom", [0, 0.5]]
77414 function updateValue() {
77415 var meters = geoOffsetToMeters(context.background().offset());
77416 var x2 = +meters[0].toFixed(2);
77417 var y3 = +meters[1].toFixed(2);
77418 context.container().selectAll(".nudge-inner-rect").select("input").classed("error", false).property("value", x2 + ", " + y3);
77419 context.container().selectAll(".nudge-reset").classed("disabled", function() {
77420 return x2 === 0 && y3 === 0;
77423 function resetOffset() {
77424 context.background().offset([0, 0]);
77427 function nudge(d4) {
77428 context.background().nudge(d4, context.map().zoom());
77431 function inputOffset() {
77432 var input = select_default2(this);
77433 var d4 = input.node().value;
77434 if (d4 === "") return resetOffset();
77435 d4 = d4.replace(/;/g, ",").split(",").map(function(n3) {
77436 return !isNaN(n3) && n3;
77438 if (d4.length !== 2 || !d4[0] || !d4[1]) {
77439 input.classed("error", true);
77442 context.background().offset(geoMetersToOffset(d4));
77445 function dragOffset(d3_event) {
77446 if (d3_event.button !== 0) return;
77447 var origin = [d3_event.clientX, d3_event.clientY];
77448 var pointerId = d3_event.pointerId || "mouse";
77449 context.container().append("div").attr("class", "nudge-surface");
77450 select_default2(window).on(_pointerPrefix + "move.drag-bg-offset", pointermove).on(_pointerPrefix + "up.drag-bg-offset", pointerup);
77451 if (_pointerPrefix === "pointer") {
77452 select_default2(window).on("pointercancel.drag-bg-offset", pointerup);
77454 function pointermove(d3_event2) {
77455 if (pointerId !== (d3_event2.pointerId || "mouse")) return;
77456 var latest = [d3_event2.clientX, d3_event2.clientY];
77458 -(origin[0] - latest[0]) / 4,
77459 -(origin[1] - latest[1]) / 4
77464 function pointerup(d3_event2) {
77465 if (pointerId !== (d3_event2.pointerId || "mouse")) return;
77466 if (d3_event2.button !== 0) return;
77467 context.container().selectAll(".nudge-surface").remove();
77468 select_default2(window).on(".drag-bg-offset", null);
77471 function renderDisclosureContent(selection2) {
77472 var container = selection2.selectAll(".nudge-container").data([0]);
77473 var containerEnter = container.enter().append("div").attr("class", "nudge-container");
77474 containerEnter.append("div").attr("class", "nudge-instructions").call(_t.append("background.offset"));
77475 var nudgeWrapEnter = containerEnter.append("div").attr("class", "nudge-controls-wrap");
77476 var nudgeEnter = nudgeWrapEnter.append("div").attr("class", "nudge-outer-rect").on(_pointerPrefix + "down", dragOffset);
77477 nudgeEnter.append("div").attr("class", "nudge-inner-rect").append("input").attr("type", "text").attr("aria-label", _t("background.offset_label")).on("change", inputOffset);
77478 nudgeWrapEnter.append("div").selectAll("button").data(_directions).enter().append("button").attr("title", function(d4) {
77479 return _t(`background.nudge.${d4[0]}`);
77480 }).attr("class", function(d4) {
77481 return d4[0] + " nudge";
77482 }).on("click", function(d3_event, d4) {
77485 nudgeWrapEnter.append("button").attr("title", _t("background.reset")).attr("class", "nudge-reset disabled").on("click", function(d3_event) {
77486 d3_event.preventDefault();
77488 }).call(svgIcon("#iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")));
77491 context.background().on("change.backgroundOffset-update", updateValue);
77494 var init_background_offset = __esm({
77495 "modules/ui/sections/background_offset.js"() {
77505 // modules/ui/sections/overlay_list.js
77506 var overlay_list_exports = {};
77507 __export(overlay_list_exports, {
77508 uiSectionOverlayList: () => uiSectionOverlayList
77510 function uiSectionOverlayList(context) {
77511 var section = uiSection("overlay-list", context).label(() => _t.append("background.overlays")).disclosureContent(renderDisclosureContent);
77512 var _overlayList = select_default2(null);
77513 function setTooltips(selection2) {
77514 selection2.each(function(d4, i3, nodes) {
77515 var item = select_default2(this).select("label");
77516 var span = item.select("span");
77517 var placement = i3 < nodes.length / 2 ? "bottom" : "top";
77518 var description = d4.description();
77519 var isOverflowing = span.property("clientWidth") !== span.property("scrollWidth");
77520 item.call(uiTooltip().destroyAny);
77521 if (description || isOverflowing) {
77523 uiTooltip().placement(placement).title(() => description || d4.name())
77528 function updateLayerSelections(selection2) {
77529 function active(d4) {
77530 return context.background().showsLayer(d4);
77532 selection2.selectAll("li").classed("active", active).call(setTooltips).selectAll("input").property("checked", active);
77534 function chooseOverlay(d3_event, d4) {
77535 d3_event.preventDefault();
77536 context.background().toggleOverlayLayer(d4);
77537 _overlayList.call(updateLayerSelections);
77538 document.activeElement.blur();
77540 function drawListItems(layerList, type2, change, filter2) {
77541 var sources = context.background().sources(context.map().extent(), context.map().zoom(), true).filter(filter2);
77542 var layerLinks = layerList.selectAll("li").data(sources, function(d4) {
77545 layerLinks.exit().remove();
77546 var enter = layerLinks.enter().append("li");
77547 var label = enter.append("label");
77548 label.append("input").attr("type", type2).attr("name", "layers").on("change", change);
77549 label.append("span").each(function(d4) {
77550 d4.label()(select_default2(this));
77552 layerList.selectAll("li").sort(sortSources);
77553 layerList.call(updateLayerSelections);
77554 function sortSources(a2, b3) {
77555 return a2.best() && !b3.best() ? -1 : b3.best() && !a2.best() ? 1 : descending(a2.area(), b3.area()) || ascending(a2.name(), b3.name()) || 0;
77558 function renderDisclosureContent(selection2) {
77559 var container = selection2.selectAll(".layer-overlay-list").data([0]);
77560 _overlayList = container.enter().append("ul").attr("class", "layer-list layer-overlay-list").attr("dir", "auto").merge(container);
77561 _overlayList.call(drawListItems, "checkbox", chooseOverlay, function(d4) {
77562 return !d4.isHidden() && d4.overlay;
77566 "move.overlay_list",
77567 debounce_default(function() {
77568 window.requestIdleCallback(section.reRender);
77573 var init_overlay_list = __esm({
77574 "modules/ui/sections/overlay_list.js"() {
77585 // modules/ui/panes/background.js
77586 var background_exports3 = {};
77587 __export(background_exports3, {
77588 uiPaneBackground: () => uiPaneBackground
77590 function uiPaneBackground(context) {
77591 var backgroundPane = uiPane("background", context).key(_t("background.key")).label(_t.append("background.title")).description(_t.append("background.description")).iconName("iD-icon-layers").sections([
77592 uiSectionBackgroundList(context),
77593 uiSectionOverlayList(context),
77594 uiSectionBackgroundDisplayOptions(context),
77595 uiSectionBackgroundOffset(context)
77597 return backgroundPane;
77599 var init_background3 = __esm({
77600 "modules/ui/panes/background.js"() {
77604 init_background_display_options();
77605 init_background_list();
77606 init_background_offset();
77607 init_overlay_list();
77611 // modules/ui/panes/help.js
77612 var help_exports = {};
77613 __export(help_exports, {
77614 uiPaneHelp: () => uiPaneHelp
77616 function uiPaneHelp(context) {
77626 "open_source_attribution",
77639 "select_left_click",
77640 "select_right_click",
77644 "multiselect_shift_click",
77645 "multiselect_lasso",
77658 ["feature_editor", [
77665 "fields_all_fields",
77667 "fields_add_field",
77676 "add_point_finish",
77681 "delete_point_command"
77688 "add_line_continue",
77691 "modify_line_dragnode",
77692 "modify_line_addnode",
77695 "connect_line_display",
77696 "connect_line_drag",
77697 "connect_line_tag",
77698 "disconnect_line_h",
77699 "disconnect_line_command",
77701 "move_line_command",
77702 "move_line_connected",
77705 "delete_line_command"
77712 "add_area_command",
77714 "add_area_continue",
77717 "square_area_command",
77719 "modify_area_dragnode",
77720 "modify_area_addnode",
77723 "delete_area_command"
77729 "edit_relation_add",
77730 "edit_relation_delete",
77731 "maintain_relation_h",
77732 "maintain_relation",
77733 "relation_types_h",
77736 "multipolygon_create",
77737 "multipolygon_merge",
77738 "turn_restriction_h",
77739 "turn_restriction",
77740 "turn_restriction_field",
77741 "turn_restriction_editing",
77812 "help.help.open_data_h": 3,
77813 "help.help.before_start_h": 3,
77814 "help.help.open_source_h": 3,
77815 "help.overview.navigation_h": 3,
77816 "help.overview.features_h": 3,
77817 "help.editing.select_h": 3,
77818 "help.editing.multiselect_h": 3,
77819 "help.editing.undo_redo_h": 3,
77820 "help.editing.save_h": 3,
77821 "help.editing.upload_h": 3,
77822 "help.editing.backups_h": 3,
77823 "help.editing.keyboard_h": 3,
77824 "help.feature_editor.type_h": 3,
77825 "help.feature_editor.fields_h": 3,
77826 "help.feature_editor.tags_h": 3,
77827 "help.points.add_point_h": 3,
77828 "help.points.move_point_h": 3,
77829 "help.points.delete_point_h": 3,
77830 "help.lines.add_line_h": 3,
77831 "help.lines.modify_line_h": 3,
77832 "help.lines.connect_line_h": 3,
77833 "help.lines.disconnect_line_h": 3,
77834 "help.lines.move_line_h": 3,
77835 "help.lines.delete_line_h": 3,
77836 "help.areas.point_or_area_h": 3,
77837 "help.areas.add_area_h": 3,
77838 "help.areas.square_area_h": 3,
77839 "help.areas.modify_area_h": 3,
77840 "help.areas.delete_area_h": 3,
77841 "help.relations.edit_relation_h": 3,
77842 "help.relations.maintain_relation_h": 3,
77843 "help.relations.relation_types_h": 2,
77844 "help.relations.multipolygon_h": 3,
77845 "help.relations.turn_restriction_h": 3,
77846 "help.relations.route_h": 3,
77847 "help.relations.boundary_h": 3,
77848 "help.notes.add_note_h": 3,
77849 "help.notes.update_note_h": 3,
77850 "help.notes.save_note_h": 3,
77851 "help.imagery.sources_h": 3,
77852 "help.imagery.offsets_h": 3,
77853 "help.streetlevel.using_h": 3,
77854 "help.gps.using_h": 3,
77855 "help.qa.tools_h": 3,
77856 "help.qa.issues_h": 3
77858 var docs = docKeys.map(function(key) {
77859 var helpkey = "help." + key[0];
77860 var helpPaneReplacements = { version: context.version };
77861 var text = key[1].reduce(function(all, part) {
77862 var subkey = helpkey + "." + part;
77863 var depth = headings[subkey];
77864 var hhh = depth ? Array(depth + 1).join("#") + " " : "";
77865 return all + hhh + helpHtml(subkey, helpPaneReplacements) + "\n\n";
77868 title: _t.html(helpkey + ".title"),
77869 content: d(text.trim()).replace(/<code>/g, "<kbd>").replace(/<\/code>/g, "</kbd>")
77872 var helpPane = uiPane("help", context).key(_t("help.key")).label(_t.append("help.title")).description(_t.append("help.title")).iconName("iD-icon-help");
77873 helpPane.renderContent = function(content) {
77874 function clickHelp(d4, i3) {
77875 var rtl = _mainLocalizer.textDirection() === "rtl";
77876 content.property("scrollTop", 0);
77877 helpPane.selection().select(".pane-heading h2").html(d4.title);
77878 body.html(d4.content);
77879 body.selectAll("a").attr("target", "_blank");
77880 menuItems.classed("selected", function(m3) {
77881 return m3.title === d4.title;
77885 nav.call(drawNext).call(drawPrevious);
77887 nav.call(drawPrevious).call(drawNext);
77889 function drawNext(selection2) {
77890 if (i3 < docs.length - 1) {
77891 var nextLink = selection2.append("a").attr("href", "#").attr("class", "next").on("click", function(d3_event) {
77892 d3_event.preventDefault();
77893 clickHelp(docs[i3 + 1], i3 + 1);
77895 nextLink.append("span").html(docs[i3 + 1].title).call(svgIcon(rtl ? "#iD-icon-backward" : "#iD-icon-forward", "inline"));
77898 function drawPrevious(selection2) {
77900 var prevLink = selection2.append("a").attr("href", "#").attr("class", "previous").on("click", function(d3_event) {
77901 d3_event.preventDefault();
77902 clickHelp(docs[i3 - 1], i3 - 1);
77904 prevLink.call(svgIcon(rtl ? "#iD-icon-forward" : "#iD-icon-backward", "inline")).append("span").html(docs[i3 - 1].title);
77908 function clickWalkthrough(d3_event) {
77909 d3_event.preventDefault();
77910 if (context.inIntro()) return;
77911 context.container().call(uiIntro(context));
77912 context.ui().togglePanes();
77914 function clickShortcuts(d3_event) {
77915 d3_event.preventDefault();
77916 context.container().call(context.ui().shortcuts, true);
77918 var toc = content.append("ul").attr("class", "toc");
77919 var menuItems = toc.selectAll("li").data(docs).enter().append("li").append("a").attr("role", "button").attr("href", "#").html(function(d4) {
77921 }).on("click", function(d3_event, d4) {
77922 d3_event.preventDefault();
77923 clickHelp(d4, docs.indexOf(d4));
77925 var shortcuts = toc.append("li").attr("class", "shortcuts").call(
77926 uiTooltip().title(() => _t.append("shortcuts.tooltip")).keys(["?"]).placement("top")
77927 ).append("a").attr("href", "#").on("click", clickShortcuts);
77928 shortcuts.append("div").call(_t.append("shortcuts.title"));
77929 var walkthrough = toc.append("li").attr("class", "walkthrough").append("a").attr("href", "#").on("click", clickWalkthrough);
77930 walkthrough.append("svg").attr("class", "logo logo-walkthrough").append("use").attr("xlink:href", "#iD-logo-walkthrough");
77931 walkthrough.append("div").call(_t.append("splash.walkthrough"));
77932 var helpContent = content.append("div").attr("class", "left-content");
77933 var body = helpContent.append("div").attr("class", "body");
77934 var nav = helpContent.append("div").attr("class", "nav");
77935 clickHelp(docs[0], 0);
77939 var init_help = __esm({
77940 "modules/ui/panes/help.js"() {
77952 // modules/ui/sections/validation_issues.js
77953 var validation_issues_exports = {};
77954 __export(validation_issues_exports, {
77955 uiSectionValidationIssues: () => uiSectionValidationIssues
77957 function uiSectionValidationIssues(id2, severity, context) {
77959 var section = uiSection(id2, context).label(function() {
77960 if (!_issues) return "";
77961 var issueCountText = _issues.length > 1e3 ? "1000+" : String(_issues.length);
77962 return _t.append("inspector.title_count", { title: _t("issues." + severity + "s.list_title"), count: issueCountText });
77963 }).disclosureContent(renderDisclosureContent).shouldDisplay(function() {
77964 return _issues && _issues.length;
77966 function getOptions() {
77968 what: corePreferences("validate-what") || "edited",
77969 where: corePreferences("validate-where") || "all"
77972 function reloadIssues() {
77973 _issues = context.validator().getIssuesBySeverity(getOptions())[severity];
77975 function renderDisclosureContent(selection2) {
77976 var center = context.map().center();
77977 var graph = context.graph();
77978 var issues = _issues.map(function withDistance(issue) {
77979 var extent = issue.extent(graph);
77980 var dist = extent ? geoSphericalDistance(center, extent.center()) : 0;
77981 return Object.assign(issue, { dist });
77982 }).sort(function byDistance(a2, b3) {
77983 return a2.dist - b3.dist;
77985 issues = issues.slice(0, 1e3);
77986 selection2.call(drawIssuesList, issues);
77988 function drawIssuesList(selection2, issues) {
77989 var list = selection2.selectAll(".issues-list").data([0]);
77990 list = list.enter().append("ul").attr("class", "layer-list issues-list " + severity + "s-list").merge(list);
77991 var items = list.selectAll("li").data(issues, function(d4) {
77994 items.exit().remove();
77995 var itemsEnter = items.enter().append("li").attr("class", function(d4) {
77996 return "issue severity-" + d4.severity;
77998 var labelsEnter = itemsEnter.append("button").attr("class", "issue-label").on("click", function(d3_event, d4) {
77999 context.validator().focusIssue(d4);
78000 }).on("mouseover", function(d3_event, d4) {
78001 utilHighlightEntities(d4.entityIds, true, context);
78002 }).on("mouseout", function(d3_event, d4) {
78003 utilHighlightEntities(d4.entityIds, false, context);
78005 var textEnter = labelsEnter.append("span").attr("class", "issue-text");
78006 textEnter.append("span").attr("class", "issue-icon").each(function(d4) {
78007 select_default2(this).call(svgIcon(validationIssue.ICONS[d4.severity]));
78009 textEnter.append("span").attr("class", "issue-message");
78010 items = items.merge(itemsEnter).order();
78011 items.selectAll(".issue-message").text("").each(function(d4) {
78012 return d4.message(context)(select_default2(this));
78015 context.validator().on("validated.uiSectionValidationIssues" + id2, function() {
78016 window.requestIdleCallback(function() {
78018 section.reRender();
78022 "move.uiSectionValidationIssues" + id2,
78023 debounce_default(function() {
78024 window.requestIdleCallback(function() {
78025 if (getOptions().where === "visible") {
78028 section.reRender();
78034 var init_validation_issues = __esm({
78035 "modules/ui/sections/validation_issues.js"() {
78041 init_preferences();
78049 // modules/ui/sections/validation_options.js
78050 var validation_options_exports = {};
78051 __export(validation_options_exports, {
78052 uiSectionValidationOptions: () => uiSectionValidationOptions
78054 function uiSectionValidationOptions(context) {
78055 var section = uiSection("issues-options", context).content(renderContent);
78056 function renderContent(selection2) {
78057 var container = selection2.selectAll(".issues-options-container").data([0]);
78058 container = container.enter().append("div").attr("class", "issues-options-container").merge(container);
78060 { key: "what", values: ["edited", "all"] },
78061 { key: "where", values: ["visible", "all"] }
78063 var options = container.selectAll(".issues-option").data(data, function(d4) {
78066 var optionsEnter = options.enter().append("div").attr("class", function(d4) {
78067 return "issues-option issues-option-" + d4.key;
78069 optionsEnter.append("div").attr("class", "issues-option-title").html(function(d4) {
78070 return _t.html("issues.options." + d4.key + ".title");
78072 var valuesEnter = optionsEnter.selectAll("label").data(function(d4) {
78073 return d4.values.map(function(val) {
78074 return { value: val, key: d4.key };
78076 }).enter().append("label");
78077 valuesEnter.append("input").attr("type", "radio").attr("name", function(d4) {
78078 return "issues-option-" + d4.key;
78079 }).attr("value", function(d4) {
78081 }).property("checked", function(d4) {
78082 return getOptions()[d4.key] === d4.value;
78083 }).on("change", function(d3_event, d4) {
78084 updateOptionValue(d3_event, d4.key, d4.value);
78086 valuesEnter.append("span").html(function(d4) {
78087 return _t.html("issues.options." + d4.key + "." + d4.value);
78090 function getOptions() {
78092 what: corePreferences("validate-what") || "edited",
78094 where: corePreferences("validate-where") || "all"
78095 // 'all', 'visible'
78098 function updateOptionValue(d3_event, d4, val) {
78099 if (!val && d3_event && d3_event.target) {
78100 val = d3_event.target.value;
78102 corePreferences("validate-" + d4, val);
78103 context.validator().validate();
78107 var init_validation_options = __esm({
78108 "modules/ui/sections/validation_options.js"() {
78110 init_preferences();
78116 // modules/ui/sections/validation_rules.js
78117 var validation_rules_exports = {};
78118 __export(validation_rules_exports, {
78119 uiSectionValidationRules: () => uiSectionValidationRules
78121 function uiSectionValidationRules(context) {
78123 var MAXSQUARE = 20;
78124 var DEFAULTSQUARE = 5;
78125 var section = uiSection("issues-rules", context).disclosureContent(renderDisclosureContent).label(() => _t.append("issues.rules.title"));
78126 var _ruleKeys = context.validator().getRuleKeys().filter(function(key) {
78127 return key !== "maprules";
78128 }).sort(function(key1, key2) {
78129 return _t("issues." + key1 + ".title") < _t("issues." + key2 + ".title") ? -1 : 1;
78131 function renderDisclosureContent(selection2) {
78132 var container = selection2.selectAll(".issues-rulelist-container").data([0]);
78133 var containerEnter = container.enter().append("div").attr("class", "issues-rulelist-container");
78134 containerEnter.append("ul").attr("class", "layer-list issue-rules-list");
78135 var ruleLinks = containerEnter.append("div").attr("class", "issue-rules-links section-footer");
78136 ruleLinks.append("a").attr("class", "issue-rules-link").attr("role", "button").attr("href", "#").call(_t.append("issues.disable_all")).on("click", function(d3_event) {
78137 d3_event.preventDefault();
78138 context.validator().disableRules(_ruleKeys);
78140 ruleLinks.append("a").attr("class", "issue-rules-link").attr("role", "button").attr("href", "#").call(_t.append("issues.enable_all")).on("click", function(d3_event) {
78141 d3_event.preventDefault();
78142 context.validator().disableRules([]);
78144 container = container.merge(containerEnter);
78145 container.selectAll(".issue-rules-list").call(drawListItems, _ruleKeys, "checkbox", "rule", toggleRule, isRuleEnabled);
78147 function drawListItems(selection2, data, type2, name, change, active) {
78148 var items = selection2.selectAll("li").data(data);
78149 items.exit().remove();
78150 var enter = items.enter().append("li");
78151 if (name === "rule") {
78153 uiTooltip().title(function(d4) {
78154 return _t.append("issues." + d4 + ".tip");
78155 }).placement("top")
78158 var label = enter.append("label");
78159 label.append("input").attr("type", type2).attr("name", name).on("change", change);
78160 label.append("span").html(function(d4) {
78162 if (d4 === "unsquare_way") {
78163 params.val = { html: '<span class="square-degrees"></span>' };
78165 return _t.html("issues." + d4 + ".title", params);
78167 items = items.merge(enter);
78168 items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", false);
78169 var degStr = corePreferences("validate-square-degrees");
78170 if (degStr === null) {
78171 degStr = DEFAULTSQUARE.toString();
78173 var span = items.selectAll(".square-degrees");
78174 var input = span.selectAll(".square-degrees-input").data([0]);
78175 input.enter().append("input").attr("type", "number").attr("min", MINSQUARE.toString()).attr("max", MAXSQUARE.toString()).attr("step", "0.5").attr("class", "square-degrees-input").call(utilNoAuto).on("click", function(d3_event) {
78176 d3_event.preventDefault();
78177 d3_event.stopPropagation();
78179 }).on("keyup", function(d3_event) {
78180 if (d3_event.keyCode === 13) {
78184 }).on("blur", changeSquare).merge(input).property("value", degStr);
78186 function changeSquare() {
78187 var input = select_default2(this);
78188 var degStr = utilGetSetValue(input).trim();
78189 var degNum = Number(degStr);
78190 if (!isFinite(degNum)) {
78191 degNum = DEFAULTSQUARE;
78192 } else if (degNum > MAXSQUARE) {
78193 degNum = MAXSQUARE;
78194 } else if (degNum < MINSQUARE) {
78195 degNum = MINSQUARE;
78197 degNum = Math.round(degNum * 10) / 10;
78198 degStr = degNum.toString();
78199 input.property("value", degStr);
78200 corePreferences("validate-square-degrees", degStr);
78201 context.validator().revalidateUnsquare();
78203 function isRuleEnabled(d4) {
78204 return context.validator().isRuleEnabled(d4);
78206 function toggleRule(d3_event, d4) {
78207 context.validator().toggleRule(d4);
78209 context.validator().on("validated.uiSectionValidationRules", function() {
78210 window.requestIdleCallback(section.reRender);
78214 var init_validation_rules = __esm({
78215 "modules/ui/sections/validation_rules.js"() {
78218 init_preferences();
78226 // modules/ui/sections/validation_status.js
78227 var validation_status_exports = {};
78228 __export(validation_status_exports, {
78229 uiSectionValidationStatus: () => uiSectionValidationStatus
78231 function uiSectionValidationStatus(context) {
78232 var section = uiSection("issues-status", context).content(renderContent).shouldDisplay(function() {
78233 var issues = context.validator().getIssues(getOptions());
78234 return issues.length === 0;
78236 function getOptions() {
78238 what: corePreferences("validate-what") || "edited",
78239 where: corePreferences("validate-where") || "all"
78242 function renderContent(selection2) {
78243 var box = selection2.selectAll(".box").data([0]);
78244 var boxEnter = box.enter().append("div").attr("class", "box");
78245 boxEnter.append("div").call(svgIcon("#iD-icon-apply", "pre-text"));
78246 var noIssuesMessage = boxEnter.append("span");
78247 noIssuesMessage.append("strong").attr("class", "message");
78248 noIssuesMessage.append("br");
78249 noIssuesMessage.append("span").attr("class", "details");
78250 renderIgnoredIssuesReset(selection2);
78251 setNoIssuesText(selection2);
78253 function renderIgnoredIssuesReset(selection2) {
78254 var ignoredIssues = context.validator().getIssues({ what: "all", where: "all", includeDisabledRules: true, includeIgnored: "only" });
78255 var resetIgnored = selection2.selectAll(".reset-ignored").data(ignoredIssues.length ? [0] : []);
78256 resetIgnored.exit().remove();
78257 var resetIgnoredEnter = resetIgnored.enter().append("div").attr("class", "reset-ignored section-footer");
78258 resetIgnoredEnter.append("a").attr("href", "#");
78259 resetIgnored = resetIgnored.merge(resetIgnoredEnter);
78260 resetIgnored.select("a").html(_t.html("inspector.title_count", { title: { html: _t.html("issues.reset_ignored") }, count: ignoredIssues.length }));
78261 resetIgnored.on("click", function(d3_event) {
78262 d3_event.preventDefault();
78263 context.validator().resetIgnoredIssues();
78266 function setNoIssuesText(selection2) {
78267 var opts = getOptions();
78268 function checkForHiddenIssues(cases) {
78269 for (var type2 in cases) {
78270 var hiddenOpts = cases[type2];
78271 var hiddenIssues = context.validator().getIssues(hiddenOpts);
78272 if (hiddenIssues.length) {
78273 selection2.select(".box .details").html("").call(_t.append(
78274 "issues.no_issues.hidden_issues." + type2,
78275 { count: hiddenIssues.length.toString() }
78280 selection2.select(".box .details").html("").call(_t.append("issues.no_issues.hidden_issues.none"));
78283 if (opts.what === "edited" && opts.where === "visible") {
78284 messageType = "edits_in_view";
78285 checkForHiddenIssues({
78286 elsewhere: { what: "edited", where: "all" },
78287 everything_else: { what: "all", where: "visible" },
78288 disabled_rules: { what: "edited", where: "visible", includeDisabledRules: "only" },
78289 everything_else_elsewhere: { what: "all", where: "all" },
78290 disabled_rules_elsewhere: { what: "edited", where: "all", includeDisabledRules: "only" },
78291 ignored_issues: { what: "edited", where: "visible", includeIgnored: "only" },
78292 ignored_issues_elsewhere: { what: "edited", where: "all", includeIgnored: "only" }
78294 } else if (opts.what === "edited" && opts.where === "all") {
78295 messageType = "edits";
78296 checkForHiddenIssues({
78297 everything_else: { what: "all", where: "all" },
78298 disabled_rules: { what: "edited", where: "all", includeDisabledRules: "only" },
78299 ignored_issues: { what: "edited", where: "all", includeIgnored: "only" }
78301 } else if (opts.what === "all" && opts.where === "visible") {
78302 messageType = "everything_in_view";
78303 checkForHiddenIssues({
78304 elsewhere: { what: "all", where: "all" },
78305 disabled_rules: { what: "all", where: "visible", includeDisabledRules: "only" },
78306 disabled_rules_elsewhere: { what: "all", where: "all", includeDisabledRules: "only" },
78307 ignored_issues: { what: "all", where: "visible", includeIgnored: "only" },
78308 ignored_issues_elsewhere: { what: "all", where: "all", includeIgnored: "only" }
78310 } else if (opts.what === "all" && opts.where === "all") {
78311 messageType = "everything";
78312 checkForHiddenIssues({
78313 disabled_rules: { what: "all", where: "all", includeDisabledRules: "only" },
78314 ignored_issues: { what: "all", where: "all", includeIgnored: "only" }
78317 if (opts.what === "edited" && context.history().difference().summary().length === 0) {
78318 messageType = "no_edits";
78320 selection2.select(".box .message").html("").call(_t.append("issues.no_issues.message." + messageType));
78322 context.validator().on("validated.uiSectionValidationStatus", function() {
78323 window.requestIdleCallback(section.reRender);
78326 "move.uiSectionValidationStatus",
78327 debounce_default(function() {
78328 window.requestIdleCallback(section.reRender);
78333 var init_validation_status = __esm({
78334 "modules/ui/sections/validation_status.js"() {
78338 init_preferences();
78344 // modules/ui/panes/issues.js
78345 var issues_exports = {};
78346 __export(issues_exports, {
78347 uiPaneIssues: () => uiPaneIssues
78349 function uiPaneIssues(context) {
78350 var issuesPane = uiPane("issues", context).key(_t("issues.key")).label(_t.append("issues.title")).description(_t.append("issues.title")).iconName("iD-icon-alert").sections([
78351 uiSectionValidationOptions(context),
78352 uiSectionValidationStatus(context),
78353 uiSectionValidationIssues("issues-errors", "error", context),
78354 uiSectionValidationIssues("issues-warnings", "warning", context),
78355 uiSectionValidationIssues("issues-suggestions", "suggestion", context),
78356 uiSectionValidationRules(context)
78360 var init_issues = __esm({
78361 "modules/ui/panes/issues.js"() {
78365 init_validation_issues();
78366 init_validation_options();
78367 init_validation_rules();
78368 init_validation_status();
78372 // modules/ui/settings/custom_data.js
78373 var custom_data_exports = {};
78374 __export(custom_data_exports, {
78375 uiSettingsCustomData: () => uiSettingsCustomData
78377 function uiSettingsCustomData(context) {
78378 var dispatch14 = dispatch_default("change");
78379 function render(selection2) {
78380 var dataLayer = context.layers().layer("data");
78381 var _origSettings = {
78382 fileList: dataLayer && dataLayer.fileList() || null,
78383 url: corePreferences("settings-custom-data-url")
78385 var _currSettings = {
78386 fileList: dataLayer && dataLayer.fileList() || null
78387 // url: prefs('settings-custom-data-url')
78389 var modal = uiConfirm(selection2).okButton();
78390 modal.classed("settings-modal settings-custom-data", true);
78391 modal.select(".modal-section.header").append("h3").call(_t.append("settings.custom_data.header"));
78392 var textSection = modal.select(".modal-section.message-text");
78393 textSection.append("pre").attr("class", "instructions-file").call(_t.append("settings.custom_data.file.instructions"));
78394 textSection.append("input").attr("class", "field-file").attr("type", "file").attr("accept", ".gpx,.kml,.geojson,.json,application/gpx+xml,application/vnd.google-earth.kml+xml,application/geo+json,application/json").property("files", _currSettings.fileList).on("change", function(d3_event) {
78395 var files = d3_event.target.files;
78396 if (files && files.length) {
78397 _currSettings.url = "";
78398 textSection.select(".field-url").property("value", "");
78399 _currSettings.fileList = files;
78401 _currSettings.fileList = null;
78404 textSection.append("h4").call(_t.append("settings.custom_data.or"));
78405 textSection.append("pre").attr("class", "instructions-url").call(_t.append("settings.custom_data.url.instructions"));
78406 textSection.append("textarea").attr("class", "field-url").attr("placeholder", _t("settings.custom_data.url.placeholder")).call(utilNoAuto).property("value", _currSettings.url);
78407 var buttonSection = modal.select(".modal-section.buttons");
78408 buttonSection.insert("button", ".ok-button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
78409 buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
78410 buttonSection.select(".ok-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
78411 function isSaveDisabled() {
78414 function clickCancel() {
78415 textSection.select(".field-url").property("value", _origSettings.url);
78416 corePreferences("settings-custom-data-url", _origSettings.url);
78420 function clickSave() {
78421 _currSettings.url = textSection.select(".field-url").property("value").trim();
78422 if (_currSettings.url) {
78423 _currSettings.fileList = null;
78425 if (_currSettings.fileList) {
78426 _currSettings.url = "";
78428 corePreferences("settings-custom-data-url", _currSettings.url);
78431 dispatch14.call("change", this, _currSettings);
78434 return utilRebind(render, dispatch14, "on");
78436 var init_custom_data = __esm({
78437 "modules/ui/settings/custom_data.js"() {
78440 init_preferences();
78447 // modules/ui/sections/data_layers.js
78448 var data_layers_exports = {};
78449 __export(data_layers_exports, {
78450 uiSectionDataLayers: () => uiSectionDataLayers
78452 function uiSectionDataLayers(context) {
78453 var settingsCustomData = uiSettingsCustomData(context).on("change", customChanged);
78454 var layers = context.layers();
78455 var section = uiSection("data-layers", context).label(() => _t.append("map_data.data_layers")).disclosureContent(renderDisclosureContent);
78456 function renderDisclosureContent(selection2) {
78457 var container = selection2.selectAll(".data-layer-container").data([0]);
78458 container.enter().append("div").attr("class", "data-layer-container").merge(container).call(drawOsmItems).call(drawQAItems).call(drawCustomDataItems).call(drawVectorItems).call(drawPanelItems);
78460 function showsLayer(which) {
78461 var layer = layers.layer(which);
78463 return layer.enabled();
78467 function setLayer(which, enabled) {
78468 var mode = context.mode();
78469 if (mode && /^draw/.test(mode.id)) return;
78470 var layer = layers.layer(which);
78472 layer.enabled(enabled);
78473 if (!enabled && (which === "osm" || which === "notes")) {
78474 context.enter(modeBrowse(context));
78478 function toggleLayer(which) {
78479 setLayer(which, !showsLayer(which));
78481 function drawOsmItems(selection2) {
78482 var osmKeys = ["osm", "notes"];
78483 var osmLayers = layers.all().filter(function(obj) {
78484 return osmKeys.indexOf(obj.id) !== -1;
78486 var ul = selection2.selectAll(".layer-list-osm").data([0]);
78487 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-osm").merge(ul);
78488 var li = ul.selectAll(".list-item").data(osmLayers);
78489 li.exit().remove();
78490 var liEnter = li.enter().append("li").attr("class", function(d4) {
78491 return "list-item list-item-" + d4.id;
78493 var labelEnter = liEnter.append("label").each(function(d4) {
78494 if (d4.id === "osm") {
78495 select_default2(this).call(
78496 uiTooltip().title(() => _t.append("map_data.layers." + d4.id + ".tooltip")).keys([uiCmd("\u2325" + _t("area_fill.wireframe.key"))]).placement("bottom")
78499 select_default2(this).call(
78500 uiTooltip().title(() => _t.append("map_data.layers." + d4.id + ".tooltip")).placement("bottom")
78504 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d4) {
78505 toggleLayer(d4.id);
78507 labelEnter.append("span").html(function(d4) {
78508 return _t.html("map_data.layers." + d4.id + ".title");
78510 li.merge(liEnter).classed("active", function(d4) {
78511 return d4.layer.enabled();
78512 }).selectAll("input").property("checked", function(d4) {
78513 return d4.layer.enabled();
78516 function drawQAItems(selection2) {
78517 var qaKeys = ["osmose"];
78518 var qaLayers = layers.all().filter(function(obj) {
78519 return qaKeys.indexOf(obj.id) !== -1;
78521 var ul = selection2.selectAll(".layer-list-qa").data([0]);
78522 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-qa").merge(ul);
78523 var li = ul.selectAll(".list-item").data(qaLayers);
78524 li.exit().remove();
78525 var liEnter = li.enter().append("li").attr("class", function(d4) {
78526 return "list-item list-item-" + d4.id;
78528 var labelEnter = liEnter.append("label").each(function(d4) {
78529 select_default2(this).call(
78530 uiTooltip().title(() => _t.append("map_data.layers." + d4.id + ".tooltip")).placement("bottom")
78533 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d4) {
78534 toggleLayer(d4.id);
78536 labelEnter.append("span").each(function(d4) {
78537 _t.append("map_data.layers." + d4.id + ".title")(select_default2(this));
78539 li.merge(liEnter).classed("active", function(d4) {
78540 return d4.layer.enabled();
78541 }).selectAll("input").property("checked", function(d4) {
78542 return d4.layer.enabled();
78545 function drawVectorItems(selection2) {
78546 var dataLayer = layers.layer("data");
78549 name: "Detroit Neighborhoods/Parks",
78550 src: "neighborhoods-parks",
78551 tooltip: "Neighborhood boundaries and parks as compiled by City of Detroit in concert with community groups.",
78552 template: "https://{switch:a,b,c,d}.tiles.mapbox.com/v4/jonahadkins.cjksmur6x34562qp9iv1u3ksf-54hev,jonahadkins.cjksmqxdx33jj2wp90xd9x2md-4e5y2/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1Ijoiam9uYWhhZGtpbnMiLCJhIjoiRlVVVkx3VSJ9.9sdVEK_B_VkEXPjssU5MqA"
78555 name: "Detroit Composite POIs",
78556 src: "composite-poi",
78557 tooltip: "Fire Inspections, Business Licenses, and other public location data collated from the City of Detroit.",
78558 template: "https://{switch:a,b,c,d}.tiles.mapbox.com/v4/jonahadkins.cjksmm6a02sli31myxhsr7zf3-2sw8h/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1Ijoiam9uYWhhZGtpbnMiLCJhIjoiRlVVVkx3VSJ9.9sdVEK_B_VkEXPjssU5MqA"
78561 name: "Detroit All-The-Places POIs",
78562 src: "alltheplaces-poi",
78563 tooltip: "Public domain business location data created by web scrapers.",
78564 template: "https://{switch:a,b,c,d}.tiles.mapbox.com/v4/jonahadkins.cjksmswgk340g2vo06p1w9w0j-8fjjc/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1Ijoiam9uYWhhZGtpbnMiLCJhIjoiRlVVVkx3VSJ9.9sdVEK_B_VkEXPjssU5MqA"
78567 var detroit = geoExtent([-83.5, 42.1], [-82.8, 42.5]);
78568 var showVectorItems = context.map().zoom() > 9 && detroit.contains(context.map().center());
78569 var container = selection2.selectAll(".vectortile-container").data(showVectorItems ? [0] : []);
78570 container.exit().remove();
78571 var containerEnter = container.enter().append("div").attr("class", "vectortile-container");
78572 containerEnter.append("h4").attr("class", "vectortile-header").text("Detroit Vector Tiles (Beta)");
78573 containerEnter.append("ul").attr("class", "layer-list layer-list-vectortile");
78574 containerEnter.append("div").attr("class", "vectortile-footer").append("a").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).attr("href", "https://github.com/osmus/detroit-mapping-challenge").append("span").text("About these layers");
78575 container = container.merge(containerEnter);
78576 var ul = container.selectAll(".layer-list-vectortile");
78577 var li = ul.selectAll(".list-item").data(vtData);
78578 li.exit().remove();
78579 var liEnter = li.enter().append("li").attr("class", function(d4) {
78580 return "list-item list-item-" + d4.src;
78582 var labelEnter = liEnter.append("label").each(function(d4) {
78583 select_default2(this).call(
78584 uiTooltip().title(d4.tooltip).placement("top")
78587 labelEnter.append("input").attr("type", "radio").attr("name", "vectortile").on("change", selectVTLayer);
78588 labelEnter.append("span").text(function(d4) {
78591 li.merge(liEnter).classed("active", isVTLayerSelected).selectAll("input").property("checked", isVTLayerSelected);
78592 function isVTLayerSelected(d4) {
78593 return dataLayer && dataLayer.template() === d4.template;
78595 function selectVTLayer(d3_event, d4) {
78596 corePreferences("settings-custom-data-url", d4.template);
78598 dataLayer.template(d4.template, d4.src);
78599 dataLayer.enabled(true);
78603 function drawCustomDataItems(selection2) {
78604 var dataLayer = layers.layer("data");
78605 var hasData = dataLayer && dataLayer.hasData();
78606 var showsData = hasData && dataLayer.enabled();
78607 var ul = selection2.selectAll(".layer-list-data").data(dataLayer ? [0] : []);
78608 ul.exit().remove();
78609 var ulEnter = ul.enter().append("ul").attr("class", "layer-list layer-list-data");
78610 var liEnter = ulEnter.append("li").attr("class", "list-item-data");
78611 var labelEnter = liEnter.append("label").call(
78612 uiTooltip().title(() => _t.append("map_data.layers.custom.tooltip")).placement("top")
78614 labelEnter.append("input").attr("type", "checkbox").on("change", function() {
78615 toggleLayer("data");
78617 labelEnter.append("span").call(_t.append("map_data.layers.custom.title"));
78618 liEnter.append("button").attr("class", "open-data-options").call(
78619 uiTooltip().title(() => _t.append("settings.custom_data.tooltip")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
78620 ).on("click", function(d3_event) {
78621 d3_event.preventDefault();
78623 }).call(svgIcon("#iD-icon-more"));
78624 liEnter.append("button").attr("class", "zoom-to-data").call(
78625 uiTooltip().title(() => _t.append("map_data.layers.custom.zoom")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
78626 ).on("click", function(d3_event) {
78627 if (select_default2(this).classed("disabled")) return;
78628 d3_event.preventDefault();
78629 d3_event.stopPropagation();
78630 dataLayer.fitZoom();
78631 }).call(svgIcon("#iD-icon-framed-dot", "monochrome"));
78632 ul = ul.merge(ulEnter);
78633 ul.selectAll(".list-item-data").classed("active", showsData).selectAll("label").classed("deemphasize", !hasData).selectAll("input").property("disabled", !hasData).property("checked", showsData);
78634 ul.selectAll("button.zoom-to-data").classed("disabled", !hasData);
78636 function editCustom() {
78637 context.container().call(settingsCustomData);
78639 function customChanged(d4) {
78640 var dataLayer = layers.layer("data");
78641 if (d4 && d4.url) {
78642 dataLayer.url(d4.url);
78643 } else if (d4 && d4.fileList) {
78644 dataLayer.fileList(d4.fileList);
78647 function drawPanelItems(selection2) {
78648 var panelsListEnter = selection2.selectAll(".md-extras-list").data([0]).enter().append("ul").attr("class", "layer-list md-extras-list");
78649 var historyPanelLabelEnter = panelsListEnter.append("li").attr("class", "history-panel-toggle-item").append("label").call(
78650 uiTooltip().title(() => _t.append("map_data.history_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.history.key"))]).placement("top")
78652 historyPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
78653 d3_event.preventDefault();
78654 context.ui().info.toggle("history");
78656 historyPanelLabelEnter.append("span").call(_t.append("map_data.history_panel.title"));
78657 var measurementPanelLabelEnter = panelsListEnter.append("li").attr("class", "measurement-panel-toggle-item").append("label").call(
78658 uiTooltip().title(() => _t.append("map_data.measurement_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.measurement.key"))]).placement("top")
78660 measurementPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
78661 d3_event.preventDefault();
78662 context.ui().info.toggle("measurement");
78664 measurementPanelLabelEnter.append("span").call(_t.append("map_data.measurement_panel.title"));
78666 context.layers().on("change.uiSectionDataLayers", section.reRender);
78668 "move.uiSectionDataLayers",
78669 debounce_default(function() {
78670 window.requestIdleCallback(section.reRender);
78675 var init_data_layers = __esm({
78676 "modules/ui/sections/data_layers.js"() {
78680 init_preferences();
78688 init_custom_data();
78692 // modules/ui/sections/map_features.js
78693 var map_features_exports = {};
78694 __export(map_features_exports, {
78695 uiSectionMapFeatures: () => uiSectionMapFeatures
78697 function uiSectionMapFeatures(context) {
78698 var _features = context.features().keys();
78699 var section = uiSection("map-features", context).label(() => _t.append("map_data.map_features")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
78700 function renderDisclosureContent(selection2) {
78701 var container = selection2.selectAll(".layer-feature-list-container").data([0]);
78702 var containerEnter = container.enter().append("div").attr("class", "layer-feature-list-container");
78703 containerEnter.append("ul").attr("class", "layer-list layer-feature-list");
78704 var footer = containerEnter.append("div").attr("class", "feature-list-links section-footer");
78705 footer.append("a").attr("class", "feature-list-link").attr("role", "button").attr("href", "#").call(_t.append("issues.disable_all")).on("click", function(d3_event) {
78706 d3_event.preventDefault();
78707 context.features().disableAll();
78709 footer.append("a").attr("class", "feature-list-link").attr("role", "button").attr("href", "#").call(_t.append("issues.enable_all")).on("click", function(d3_event) {
78710 d3_event.preventDefault();
78711 context.features().enableAll();
78713 container = container.merge(containerEnter);
78714 container.selectAll(".layer-feature-list").call(drawListItems, _features, "checkbox", "feature", clickFeature, showsFeature);
78716 function drawListItems(selection2, data, type2, name, change, active) {
78717 var items = selection2.selectAll("li").data(data);
78718 items.exit().remove();
78719 var enter = items.enter().append("li").call(
78720 uiTooltip().title(function(d4) {
78721 var tip = _t.append(name + "." + d4 + ".tooltip");
78722 if (autoHiddenFeature(d4)) {
78723 var msg = showsLayer("osm") ? _t.append("map_data.autohidden") : _t.append("map_data.osmhidden");
78724 return (selection3) => {
78725 selection3.call(tip);
78726 selection3.append("div").call(msg);
78730 }).placement("top")
78732 var label = enter.append("label");
78733 label.append("input").attr("type", type2).attr("name", name).on("change", change);
78734 label.append("span").html(function(d4) {
78735 return _t.html(name + "." + d4 + ".description");
78737 items = items.merge(enter);
78738 items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", autoHiddenFeature);
78740 function autoHiddenFeature(d4) {
78741 return context.features().autoHidden(d4);
78743 function showsFeature(d4) {
78744 return context.features().enabled(d4);
78746 function clickFeature(d3_event, d4) {
78747 context.features().toggle(d4);
78749 function showsLayer(id2) {
78750 var layer = context.layers().layer(id2);
78751 return layer && layer.enabled();
78753 context.features().on("change.map_features", section.reRender);
78756 var init_map_features = __esm({
78757 "modules/ui/sections/map_features.js"() {
78765 // modules/ui/sections/map_style_options.js
78766 var map_style_options_exports = {};
78767 __export(map_style_options_exports, {
78768 uiSectionMapStyleOptions: () => uiSectionMapStyleOptions
78770 function uiSectionMapStyleOptions(context) {
78771 var section = uiSection("fill-area", context).label(() => _t.append("map_data.style_options")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
78772 function renderDisclosureContent(selection2) {
78773 var container = selection2.selectAll(".layer-fill-list").data([0]);
78774 container.enter().append("ul").attr("class", "layer-list layer-fill-list").merge(container).call(drawListItems, context.map().areaFillOptions, "radio", "area_fill", setFill, isActiveFill);
78775 var container2 = selection2.selectAll(".layer-visual-diff-list").data([0]);
78776 container2.enter().append("ul").attr("class", "layer-list layer-visual-diff-list").merge(container2).call(drawListItems, ["highlight_edits"], "checkbox", "visual_diff", toggleHighlightEdited, function() {
78777 return context.surface().classed("highlight-edited");
78780 function drawListItems(selection2, data, type2, name, change, active) {
78781 var items = selection2.selectAll("li").data(data);
78782 items.exit().remove();
78783 var enter = items.enter().append("li").call(
78784 uiTooltip().title(function(d4) {
78785 return _t.append(name + "." + d4 + ".tooltip");
78786 }).keys(function(d4) {
78787 var key = d4 === "wireframe" ? _t("area_fill.wireframe.key") : null;
78788 if (d4 === "highlight_edits") key = _t("map_data.highlight_edits.key");
78789 return key ? [key] : null;
78790 }).placement("top")
78792 var label = enter.append("label");
78793 label.append("input").attr("type", type2).attr("name", name).on("change", change);
78794 label.append("span").html(function(d4) {
78795 return _t.html(name + "." + d4 + ".description");
78797 items = items.merge(enter);
78798 items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", false);
78800 function isActiveFill(d4) {
78801 return context.map().activeAreaFill() === d4;
78803 function toggleHighlightEdited(d3_event) {
78804 d3_event.preventDefault();
78805 context.map().toggleHighlightEdited();
78807 function setFill(d3_event, d4) {
78808 context.map().activeAreaFill(d4);
78810 context.map().on("changeHighlighting.ui_style, changeAreaFill.ui_style", section.reRender);
78813 var init_map_style_options = __esm({
78814 "modules/ui/sections/map_style_options.js"() {
78822 // modules/ui/settings/local_photos.js
78823 var local_photos_exports2 = {};
78824 __export(local_photos_exports2, {
78825 uiSettingsLocalPhotos: () => uiSettingsLocalPhotos
78827 function uiSettingsLocalPhotos(context) {
78828 var dispatch14 = dispatch_default("change");
78829 var photoLayer = context.layers().layer("local-photos");
78831 function render(selection2) {
78832 modal = uiConfirm(selection2).okButton();
78833 modal.classed("settings-modal settings-local-photos", true);
78834 modal.select(".modal-section.header").append("h3").call(_t.append("local_photos.header"));
78835 modal.select(".modal-section.message-text").append("div").classed("local-photos", true);
78836 var instructionsSection = modal.select(".modal-section.message-text .local-photos").append("div").classed("instructions", true);
78837 instructionsSection.append("p").classed("instructions-local-photos", true).call(_t.append("local_photos.file.instructions"));
78838 instructionsSection.append("input").classed("field-file", true).attr("type", "file").attr("multiple", "multiple").attr("accept", ".jpg,.jpeg,.png,image/png,image/jpeg").style("visibility", "hidden").attr("id", "local-photo-files").on("change", function(d3_event) {
78839 var files = d3_event.target.files;
78840 if (files && files.length) {
78841 photoList.select("ul").append("li").classed("placeholder", true).append("div");
78842 dispatch14.call("change", this, files);
78844 d3_event.target.value = null;
78846 instructionsSection.append("label").attr("for", "local-photo-files").classed("button", true).call(_t.append("local_photos.file.label"));
78847 const photoList = modal.select(".modal-section.message-text .local-photos").append("div").append("div").classed("list-local-photos", true);
78848 photoList.append("ul");
78849 updatePhotoList(photoList.select("ul"));
78850 context.layers().on("change", () => updatePhotoList(photoList.select("ul")));
78852 function updatePhotoList(container) {
78854 function locationUnavailable(d4) {
78855 return !(isArray_default(d4.loc) && isNumber_default(d4.loc[0]) && isNumber_default(d4.loc[1]));
78857 container.selectAll("li.placeholder").remove();
78858 let selection2 = container.selectAll("li").data((_a4 = photoLayer.getPhotos()) != null ? _a4 : [], (d4) => d4.id);
78859 selection2.exit().remove();
78860 const selectionEnter = selection2.enter().append("li");
78861 selectionEnter.append("span").classed("filename", true);
78862 selectionEnter.append("button").classed("form-field-button zoom-to-data", true).attr("title", _t("local_photos.zoom_single")).call(svgIcon("#iD-icon-framed-dot"));
78863 selectionEnter.append("button").classed("form-field-button no-geolocation", true).call(svgIcon("#iD-icon-alert")).call(
78864 uiTooltip().title(() => _t.append("local_photos.no_geolocation.tooltip")).placement("left")
78866 selectionEnter.append("button").classed("form-field-button remove", true).attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
78867 selection2 = selection2.merge(selectionEnter);
78868 selection2.classed("invalid", locationUnavailable);
78869 selection2.select("span.filename").text((d4) => d4.name).attr("title", (d4) => d4.name);
78870 selection2.select("span.filename").on("click", (d3_event, d4) => {
78871 photoLayer.openPhoto(d3_event, d4, false);
78873 selection2.select("button.zoom-to-data").on("click", (d3_event, d4) => {
78874 photoLayer.openPhoto(d3_event, d4, true);
78876 selection2.select("button.remove").on("click", (d3_event, d4) => {
78877 photoLayer.removePhoto(d4.id);
78878 updatePhotoList(container);
78881 return utilRebind(render, dispatch14, "on");
78883 var init_local_photos2 = __esm({
78884 "modules/ui/settings/local_photos.js"() {
78896 // modules/ui/sections/photo_overlays.js
78897 var photo_overlays_exports = {};
78898 __export(photo_overlays_exports, {
78899 uiSectionPhotoOverlays: () => uiSectionPhotoOverlays
78901 function uiSectionPhotoOverlays(context) {
78902 let _savedLayers = [];
78903 let _layersHidden = false;
78904 const _streetLayerIDs = ["streetside", "mapillary", "mapillary-map-features", "mapillary-signs", "kartaview", "mapilio", "vegbilder", "panoramax"];
78905 var settingsLocalPhotos = uiSettingsLocalPhotos(context).on("change", localPhotosChanged);
78906 var layers = context.layers();
78907 var section = uiSection("photo-overlays", context).label(() => _t.append("photo_overlays.title")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
78908 const photoDates = {};
78909 const now3 = +/* @__PURE__ */ new Date();
78910 function renderDisclosureContent(selection2) {
78911 var container = selection2.selectAll(".photo-overlay-container").data([0]);
78912 container.enter().append("div").attr("class", "photo-overlay-container").merge(container).call(drawPhotoItems).call(drawPhotoTypeItems).call(drawDateSlider).call(drawUsernameFilter).call(drawLocalPhotos);
78914 function drawPhotoItems(selection2) {
78915 var photoKeys = context.photos().overlayLayerIDs();
78916 var photoLayers = layers.all().filter(function(obj) {
78917 return photoKeys.indexOf(obj.id) !== -1;
78919 var data = photoLayers.filter(function(obj) {
78920 if (!obj.layer.supported()) return false;
78921 if (layerEnabled(obj)) return true;
78922 if (typeof obj.layer.validHere === "function") {
78923 return obj.layer.validHere(context.map().extent(), context.map().zoom());
78927 function layerSupported(d4) {
78928 return d4.layer && d4.layer.supported();
78930 function layerEnabled(d4) {
78931 return layerSupported(d4) && (d4.layer.enabled() || _savedLayers.includes(d4.id));
78933 function layerRendered(d4) {
78935 return (_c = (_b2 = (_a4 = d4.layer).rendered) == null ? void 0 : _b2.call(_a4, context.map().zoom())) != null ? _c : true;
78937 var ul = selection2.selectAll(".layer-list-photos").data([0]);
78938 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-photos").merge(ul);
78939 var li = ul.selectAll(".list-item-photos").data(data, (d4) => d4.id);
78940 li.exit().remove();
78941 var liEnter = li.enter().append("li").attr("class", function(d4) {
78942 var classes = "list-item-photos list-item-" + d4.id;
78943 if (d4.id === "mapillary-signs" || d4.id === "mapillary-map-features") {
78944 classes += " indented";
78948 var labelEnter = liEnter.append("label").each(function(d4) {
78950 if (d4.id === "mapillary-signs") titleID = "mapillary.signs.tooltip";
78951 else if (d4.id === "mapillary") titleID = "mapillary_images.tooltip";
78952 else if (d4.id === "kartaview") titleID = "kartaview_images.tooltip";
78953 else titleID = d4.id.replace(/-/g, "_") + ".tooltip";
78954 select_default2(this).call(
78955 uiTooltip().title(() => {
78956 if (!layerRendered(d4)) {
78957 return _t.append("street_side.minzoom_tooltip");
78959 return _t.append(titleID);
78961 }).placement("top")
78964 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d4) {
78965 toggleLayer(d4.id);
78967 labelEnter.append("span").html(function(d4) {
78969 if (id2 === "mapillary-signs") id2 = "photo_overlays.traffic_signs";
78970 return _t.html(id2.replace(/-/g, "_") + ".title");
78972 li.merge(liEnter).classed("active", layerEnabled).selectAll("input").property("disabled", (d4) => !layerRendered(d4)).property("checked", layerEnabled);
78974 function drawPhotoTypeItems(selection2) {
78975 var data = context.photos().allPhotoTypes();
78976 function typeEnabled(d4) {
78977 return context.photos().showsPhotoType(d4);
78979 var ul = selection2.selectAll(".layer-list-photo-types").data([0]);
78980 ul.exit().remove();
78981 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-photo-types").merge(ul);
78982 var li = ul.selectAll(".list-item-photo-types").data(context.photos().shouldFilterByPhotoType() ? data : []);
78983 li.exit().remove();
78984 var liEnter = li.enter().append("li").attr("class", function(d4) {
78985 return "list-item-photo-types list-item-" + d4;
78987 var labelEnter = liEnter.append("label").each(function(d4) {
78988 select_default2(this).call(
78989 uiTooltip().title(() => _t.append("photo_overlays.photo_type." + d4 + ".tooltip")).placement("top")
78992 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d4) {
78993 context.photos().togglePhotoType(d4, true);
78995 labelEnter.append("span").html(function(d4) {
78996 return _t.html("photo_overlays.photo_type." + d4 + ".title");
78998 li.merge(liEnter).classed("active", typeEnabled).selectAll("input").property("checked", typeEnabled);
79000 function drawDateSlider(selection2) {
79001 var ul = selection2.selectAll(".layer-list-date-slider").data([0]);
79002 ul.exit().remove();
79003 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-date-slider").merge(ul);
79004 var li = ul.selectAll(".list-item-date-slider").data(context.photos().shouldFilterDateBySlider() ? ["date-slider"] : []);
79005 li.exit().remove();
79006 var liEnter = li.enter().append("li").attr("class", "list-item-date-slider");
79007 var labelEnter = liEnter.append("label").each(function() {
79008 select_default2(this).call(
79009 uiTooltip().title(() => _t.append("photo_overlays.age_slider_filter.tooltip")).placement("top")
79012 labelEnter.append("span").attr("class", "dateSliderSpan").call(_t.append("photo_overlays.age_slider_filter.title"));
79013 let sliderWrap = labelEnter.append("div").attr("class", "slider-wrap");
79014 sliderWrap.append("input").attr("type", "range").attr("min", 0).attr("max", 1).attr("step", 1e-3).attr("list", "photo-overlay-date-range").attr("value", () => dateSliderValue("from")).classed("list-option-date-slider", true).classed("from-date", true).style("direction", _mainLocalizer.textDirection() === "rtl" ? "ltr" : "rtl").call(utilNoAuto).on("change", function() {
79015 let value = select_default2(this).property("value");
79016 setYearFilter(value, true, "from");
79018 selection2.select("input.from-date").each(function() {
79019 this.value = dateSliderValue("from");
79021 sliderWrap.append("div").attr("class", "date-slider-label");
79022 sliderWrap.append("input").attr("type", "range").attr("min", 0).attr("max", 1).attr("step", 1e-3).attr("list", "photo-overlay-date-range-inverted").attr("value", () => 1 - dateSliderValue("to")).classed("list-option-date-slider", true).classed("to-date", true).style("display", () => dateSliderValue("to") === 0 ? "none" : null).style("direction", _mainLocalizer.textDirection()).call(utilNoAuto).on("change", function() {
79023 let value = select_default2(this).property("value");
79024 setYearFilter(1 - value, true, "to");
79026 selection2.select("input.to-date").each(function() {
79027 this.value = 1 - dateSliderValue("to");
79029 selection2.select(".date-slider-label").call(dateSliderValue("from") === 1 ? _t.addOrUpdate("photo_overlays.age_slider_filter.label_all") : _t.addOrUpdate("photo_overlays.age_slider_filter.label_date", {
79030 date: new Date(now3 - Math.pow(dateSliderValue("from"), 1.45) * 10 * 365.25 * 86400 * 1e3).toLocaleDateString(_mainLocalizer.localeCode())
79032 sliderWrap.append("datalist").attr("class", "date-slider-values").attr("id", "photo-overlay-date-range");
79033 sliderWrap.append("datalist").attr("class", "date-slider-values").attr("id", "photo-overlay-date-range-inverted");
79034 const dateTicks = /* @__PURE__ */ new Set();
79035 for (const dates of Object.values(photoDates)) {
79036 dates.forEach((date) => {
79037 dateTicks.add(Math.round(1e3 * Math.pow((now3 - date) / (10 * 365.25 * 86400 * 1e3), 1 / 1.45)) / 1e3);
79040 const ticks2 = selection2.select("datalist#photo-overlay-date-range").selectAll("option").data([...dateTicks].concat([1, 0]));
79041 ticks2.exit().remove();
79042 ticks2.enter().append("option").merge(ticks2).attr("value", (d4) => d4);
79043 const ticksInverted = selection2.select("datalist#photo-overlay-date-range-inverted").selectAll("option").data([...dateTicks].concat([1, 0]));
79044 ticksInverted.exit().remove();
79045 ticksInverted.enter().append("option").merge(ticksInverted).attr("value", (d4) => 1 - d4);
79046 li.merge(liEnter).classed("active", filterEnabled);
79047 function filterEnabled() {
79048 return !!context.photos().fromDate();
79051 function dateSliderValue(which) {
79052 const val = which === "from" ? context.photos().fromDate() : context.photos().toDate();
79054 const date = +new Date(val);
79055 return Math.pow((now3 - date) / (10 * 365.25 * 86400 * 1e3), 1 / 1.45);
79056 } else return which === "from" ? 1 : 0;
79058 function setYearFilter(value, updateUrl, which) {
79059 value = +value + (which === "from" ? 1e-3 : -1e-3);
79060 if (value < 1 && value > 0) {
79061 const date = new Date(now3 - Math.pow(value, 1.45) * 10 * 365.25 * 86400 * 1e3).toISOString().substring(0, 10);
79062 context.photos().setDateFilter(`${which}Date`, date, updateUrl);
79064 context.photos().setDateFilter(`${which}Date`, null, updateUrl);
79068 function drawUsernameFilter(selection2) {
79069 function filterEnabled() {
79070 return context.photos().usernames();
79072 var ul = selection2.selectAll(".layer-list-username-filter").data([0]);
79073 ul.exit().remove();
79074 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-username-filter").merge(ul);
79075 var li = ul.selectAll(".list-item-username-filter").data(context.photos().shouldFilterByUsername() ? ["username-filter"] : []);
79076 li.exit().remove();
79077 var liEnter = li.enter().append("li").attr("class", "list-item-username-filter");
79078 var labelEnter = liEnter.append("label").each(function() {
79079 select_default2(this).call(
79080 uiTooltip().title(() => _t.append("photo_overlays.username_filter.tooltip")).placement("top")
79083 labelEnter.append("span").call(_t.append("photo_overlays.username_filter.title"));
79084 labelEnter.append("input").attr("type", "text").attr("class", "list-item-input").call(utilNoAuto).property("value", usernameValue).on("change", function() {
79085 var value = select_default2(this).property("value");
79086 context.photos().setUsernameFilter(value, true);
79087 select_default2(this).property("value", usernameValue);
79089 li.merge(liEnter).classed("active", filterEnabled);
79090 function usernameValue() {
79091 var usernames = context.photos().usernames();
79092 if (usernames) return usernames.join("; ");
79096 function toggleLayer(which) {
79097 setLayer(which, !showsLayer(which));
79099 function showsLayer(which) {
79100 var layer = layers.layer(which);
79102 return layer.enabled();
79106 function setLayer(which, enabled) {
79107 var layer = layers.layer(which);
79109 layer.enabled(enabled);
79112 function drawLocalPhotos(selection2) {
79113 var photoLayer = layers.layer("local-photos");
79114 var hasData = photoLayer && photoLayer.hasData();
79115 var showsData = hasData && photoLayer.enabled();
79116 var ul = selection2.selectAll(".layer-list-local-photos").data(photoLayer ? [0] : []);
79117 ul.exit().remove();
79118 var ulEnter = ul.enter().append("ul").attr("class", "layer-list layer-list-local-photos");
79119 var localPhotosEnter = ulEnter.append("li").attr("class", "list-item-local-photos");
79120 var localPhotosLabelEnter = localPhotosEnter.append("label").call(uiTooltip().title(() => _t.append("local_photos.tooltip")));
79121 localPhotosLabelEnter.append("input").attr("type", "checkbox").on("change", function() {
79122 toggleLayer("local-photos");
79124 localPhotosLabelEnter.call(_t.append("local_photos.header"));
79125 localPhotosEnter.append("button").attr("class", "open-data-options").call(
79126 uiTooltip().title(() => _t.append("local_photos.tooltip_edit")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
79127 ).on("click", function(d3_event) {
79128 d3_event.preventDefault();
79130 }).call(svgIcon("#iD-icon-more"));
79131 localPhotosEnter.append("button").attr("class", "zoom-to-data").call(
79132 uiTooltip().title(() => _t.append("local_photos.zoom")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
79133 ).on("click", function(d3_event) {
79134 if (select_default2(this).classed("disabled")) return;
79135 d3_event.preventDefault();
79136 d3_event.stopPropagation();
79137 photoLayer.fitZoom();
79138 }).call(svgIcon("#iD-icon-framed-dot", "monochrome"));
79139 ul = ul.merge(ulEnter);
79140 ul.selectAll(".list-item-local-photos").classed("active", showsData).selectAll("label").classed("deemphasize", !hasData).selectAll("input").property("disabled", !hasData).property("checked", showsData);
79141 ul.selectAll("button.zoom-to-data").classed("disabled", !hasData);
79143 function editLocalPhotos() {
79144 context.container().call(settingsLocalPhotos);
79146 function localPhotosChanged(d4) {
79147 var localPhotosLayer = layers.layer("local-photos");
79148 localPhotosLayer.fileList(d4);
79150 function toggleStreetSide() {
79151 let layerContainer = select_default2(".photo-overlay-container");
79152 if (!_layersHidden) {
79153 layers.all().forEach((d4) => {
79154 if (_streetLayerIDs.includes(d4.id)) {
79155 if (showsLayer(d4.id)) _savedLayers.push(d4.id);
79156 setLayer(d4.id, false);
79159 layerContainer.classed("disabled-panel", true);
79161 _savedLayers.forEach((d4) => {
79162 setLayer(d4, true);
79165 layerContainer.classed("disabled-panel", false);
79167 _layersHidden = !_layersHidden;
79170 context.layers().on("change.uiSectionPhotoOverlays", section.reRender);
79171 context.photos().on("change.uiSectionPhotoOverlays", section.reRender);
79172 context.layers().on("photoDatesChanged.uiSectionPhotoOverlays", function(service, dates) {
79173 photoDates[service] = dates.map((date) => +new Date(date));
79174 section.reRender();
79176 context.keybinding().on("\u21E7P", toggleStreetSide);
79178 "move.photo_overlays",
79179 debounce_default(function() {
79180 window.requestIdleCallback(section.reRender);
79185 var init_photo_overlays = __esm({
79186 "modules/ui/sections/photo_overlays.js"() {
79194 init_local_photos2();
79199 // modules/ui/panes/map_data.js
79200 var map_data_exports = {};
79201 __export(map_data_exports, {
79202 uiPaneMapData: () => uiPaneMapData
79204 function uiPaneMapData(context) {
79205 var mapDataPane = uiPane("map-data", context).key(_t("map_data.key")).label(_t.append("map_data.title")).description(_t.append("map_data.description")).iconName("iD-icon-data").sections([
79206 uiSectionDataLayers(context),
79207 uiSectionPhotoOverlays(context),
79208 uiSectionMapStyleOptions(context),
79209 uiSectionMapFeatures(context)
79211 return mapDataPane;
79213 var init_map_data = __esm({
79214 "modules/ui/panes/map_data.js"() {
79218 init_data_layers();
79219 init_map_features();
79220 init_map_style_options();
79221 init_photo_overlays();
79225 // modules/ui/panes/preferences.js
79226 var preferences_exports2 = {};
79227 __export(preferences_exports2, {
79228 uiPanePreferences: () => uiPanePreferences
79230 function uiPanePreferences(context) {
79231 let preferencesPane = uiPane("preferences", context).key(_t("preferences.key")).label(_t.append("preferences.title")).description(_t.append("preferences.description")).iconName("fas-user-cog").sections([
79232 uiSectionPrivacy(context)
79234 return preferencesPane;
79236 var init_preferences2 = __esm({
79237 "modules/ui/panes/preferences.js"() {
79245 // modules/ui/init.js
79246 var init_exports = {};
79247 __export(init_exports, {
79248 uiInit: () => uiInit
79250 function uiInit(context) {
79251 var _initCounter = 0;
79252 var _needWidth = {};
79253 var _lastPointerType;
79255 function render(container) {
79256 container.on("click.ui", function(d3_event) {
79257 if (d3_event.button !== 0) return;
79258 if (!d3_event.composedPath) return;
79259 var isOkayTarget = d3_event.composedPath().some(function(node) {
79260 return node.nodeType === 1 && // clicking <input> focuses it and/or changes a value
79261 (node.nodeName === "INPUT" || // clicking <label> affects its <input> by default
79262 node.nodeName === "LABEL" || // clicking <a> opens a hyperlink by default
79263 node.nodeName === "A");
79265 if (isOkayTarget) return;
79266 d3_event.preventDefault();
79268 var detected = utilDetect();
79269 if ("GestureEvent" in window && // Listening for gesture events on iOS 13.4+ breaks double-tapping,
79270 // but we only need to do this on desktop Safari anyway. – #7694
79271 !detected.isMobileWebKit) {
79272 container.on("gesturestart.ui gesturechange.ui gestureend.ui", function(d3_event) {
79273 d3_event.preventDefault();
79276 if ("PointerEvent" in window) {
79277 select_default2(window).on("pointerdown.ui pointerup.ui", function(d3_event) {
79278 var pointerType = d3_event.pointerType || "mouse";
79279 if (_lastPointerType !== pointerType) {
79280 _lastPointerType = pointerType;
79281 container.attr("pointer", pointerType);
79285 _lastPointerType = "mouse";
79286 container.attr("pointer", "mouse");
79288 container.attr("lang", _mainLocalizer.localeCode()).attr("dir", _mainLocalizer.textDirection());
79289 container.call(uiFullScreen(context));
79290 var map2 = context.map();
79291 map2.redrawEnable(false);
79292 map2.on("hitMinZoom.ui", function() {
79293 ui.flash.iconName("#iD-icon-no").label(_t.append("cannot_zoom"))();
79295 container.append("svg").attr("id", "ideditor-defs").call(ui.svgDefs);
79296 container.append("div").attr("class", "sidebar").call(ui.sidebar);
79297 var content = container.append("div").attr("class", "main-content active");
79298 content.append("div").attr("class", "top-toolbar-wrap").append("div").attr("class", "top-toolbar fillD").call(uiTopToolbar(context));
79299 content.append("div").attr("class", "main-map").attr("dir", "ltr").call(map2);
79300 overMap = content.append("div").attr("class", "over-map");
79301 overMap.append("div").attr("class", "select-trap").text("t");
79302 overMap.call(uiMapInMap(context)).call(uiNotice(context));
79303 overMap.append("div").attr("class", "spinner").call(uiSpinner(context));
79304 var controlsWrap = overMap.append("div").attr("class", "map-controls-wrap");
79305 var controls = controlsWrap.append("div").attr("class", "map-controls");
79306 controls.append("div").attr("class", "map-control zoombuttons").call(uiZoom(context));
79307 controls.append("div").attr("class", "map-control zoom-to-selection-control").call(uiZoomToSelection(context));
79308 controls.append("div").attr("class", "map-control geolocate-control").call(uiGeolocate(context));
79309 controlsWrap.on("wheel.mapControls", function(d3_event) {
79310 if (!d3_event.deltaX) {
79311 controlsWrap.node().scrollTop += d3_event.deltaY;
79314 var panes = overMap.append("div").attr("class", "map-panes");
79316 uiPaneBackground(context),
79317 uiPaneMapData(context),
79318 uiPaneIssues(context),
79319 uiPanePreferences(context),
79320 uiPaneHelp(context)
79322 uiPanes.forEach(function(pane) {
79323 controls.append("div").attr("class", "map-control map-pane-control " + pane.id + "-control").call(pane.renderToggleButton);
79324 panes.call(pane.renderPane);
79326 ui.info = uiInfo(context);
79327 overMap.call(ui.info);
79328 overMap.append("div").attr("class", "photoviewer").classed("al", true).classed("hide", true).call(ui.photoviewer);
79329 overMap.append("div").attr("class", "attribution-wrap").attr("dir", "ltr").call(uiAttribution(context));
79330 var about = content.append("div").attr("class", "map-footer");
79331 about.append("div").attr("class", "api-status").call(uiStatus(context));
79332 var footer = about.append("div").attr("class", "map-footer-bar fillD");
79333 footer.append("div").attr("class", "flash-wrap footer-hide");
79334 var footerWrap = footer.append("div").attr("class", "main-footer-wrap footer-show");
79335 footerWrap.append("div").attr("class", "scale-block").call(uiScale(context));
79336 var aboutList = footerWrap.append("div").attr("class", "info-block").append("ul").attr("class", "map-footer-list");
79337 aboutList.append("li").attr("class", "user-list").call(uiContributors(context));
79338 var apiConnections = context.connection().apiConnections();
79339 if (apiConnections && apiConnections.length > 1) {
79340 aboutList.append("li").attr("class", "source-switch").call(
79341 uiSourceSwitch(context).keys(apiConnections)
79344 aboutList.append("li").attr("class", "issues-info").call(uiIssuesInfo(context));
79345 aboutList.append("li").attr("class", "feature-warning").call(uiFeatureInfo(context));
79346 var issueLinks = aboutList.append("li");
79347 issueLinks.append("a").attr("target", "_blank").attr("href", "https://github.com/openstreetmap/iD/issues").attr("aria-label", _t("report_a_bug")).call(svgIcon("#iD-icon-bug", "light")).call(uiTooltip().title(() => _t.append("report_a_bug")).placement("top"));
79348 issueLinks.append("a").attr("target", "_blank").attr("href", "https://github.com/openstreetmap/iD/blob/develop/CONTRIBUTING.md#translating").attr("aria-label", _t("help_translate")).call(svgIcon("#iD-icon-translate", "light")).call(uiTooltip().title(() => _t.append("help_translate")).placement("top"));
79349 aboutList.append("li").attr("class", "version").call(uiVersion(context));
79350 if (!context.embed()) {
79351 aboutList.call(uiAccount(context));
79354 map2.redrawEnable(true);
79355 ui.hash = behaviorHash(context);
79357 if (!ui.hash.hadLocation) {
79358 map2.centerZoom([0, 0], 2);
79360 window.onbeforeunload = function() {
79361 return context.save();
79363 window.onunload = function() {
79364 context.history().unlock();
79366 select_default2(window).on("resize.editor", function() {
79369 var panPixels = 80;
79370 context.keybinding().on([_t("sidebar.key"), "`", "\xB2", "@"], ui.sidebar.toggle).on("\u2190", pan([panPixels, 0])).on("\u2191", pan([0, panPixels])).on("\u2192", pan([-panPixels, 0])).on("\u2193", pan([0, -panPixels])).on(uiCmd("\u2325\u2190"), pan([map2.dimensions()[0], 0])).on(uiCmd("\u2325\u2191"), pan([0, map2.dimensions()[1]])).on(uiCmd("\u2325\u2192"), pan([-map2.dimensions()[0], 0])).on(uiCmd("\u2325\u2193"), pan([0, -map2.dimensions()[1]])).on(uiCmd("\u2318" + _t("background.key")), function quickSwitch(d3_event) {
79372 d3_event.stopImmediatePropagation();
79373 d3_event.preventDefault();
79375 var previousBackground = context.background().findSource(corePreferences("background-last-used-toggle"));
79376 if (previousBackground) {
79377 var currentBackground = context.background().baseLayerSource();
79378 corePreferences("background-last-used-toggle", currentBackground.id);
79379 corePreferences("background-last-used", previousBackground.id);
79380 context.background().baseLayerSource(previousBackground);
79382 }).on(_t("area_fill.wireframe.key"), function toggleWireframe(d3_event) {
79383 d3_event.preventDefault();
79384 d3_event.stopPropagation();
79385 context.map().toggleWireframe();
79386 }).on(uiCmd("\u2325" + _t("area_fill.wireframe.key")), function toggleOsmData(d3_event) {
79387 d3_event.preventDefault();
79388 d3_event.stopPropagation();
79389 var mode = context.mode();
79390 if (mode && /^draw/.test(mode.id)) return;
79391 var layer = context.layers().layer("osm");
79393 layer.enabled(!layer.enabled());
79394 if (!layer.enabled()) {
79395 context.enter(modeBrowse(context));
79398 }).on(_t("map_data.highlight_edits.key"), function toggleHighlightEdited(d3_event) {
79399 d3_event.preventDefault();
79400 context.map().toggleHighlightEdited();
79402 context.on("enter.editor", function(entered) {
79403 container.classed("mode-" + entered.id, true);
79404 }).on("exit.editor", function(exited) {
79405 container.classed("mode-" + exited.id, false);
79407 context.enter(modeBrowse(context));
79408 if (!_initCounter++) {
79409 if (!ui.hash.startWalkthrough) {
79410 context.container().call(uiSplash(context)).call(uiRestore(context));
79412 context.container().call(ui.shortcuts);
79414 var osm = context.connection();
79415 var auth = uiLoading(context).message(_t.html("loading_auth")).blocking(true);
79417 osm.on("authLoading.ui", function() {
79418 context.container().call(auth);
79419 }).on("authDone.ui", function() {
79424 if (ui.hash.startWalkthrough) {
79425 ui.hash.startWalkthrough = false;
79426 context.container().call(uiIntro(context));
79429 return function(d3_event) {
79430 if (d3_event.shiftKey) return;
79431 if (context.container().select(".combobox").size()) return;
79432 d3_event.preventDefault();
79433 context.map().pan(d4, 100);
79439 ui.ensureLoaded = () => {
79440 if (_loadPromise) return _loadPromise;
79441 return _loadPromise = Promise.all([
79442 // must have strings and presets before loading the UI
79443 _mainLocalizer.ensureLoaded(),
79444 _mainPresetIndex.ensureLoaded()
79446 if (!context.container().empty()) render(context.container());
79447 }).catch((err) => console.error(err));
79449 ui.restart = function() {
79450 context.keybinding().clear();
79451 _loadPromise = null;
79452 context.container().selectAll("*").remove();
79455 ui.lastPointerType = function() {
79456 return _lastPointerType;
79458 ui.svgDefs = svgDefs(context);
79459 ui.flash = uiFlash(context);
79460 ui.sidebar = uiSidebar(context);
79461 ui.photoviewer = uiPhotoviewer(context);
79462 ui.shortcuts = uiShortcuts(context);
79463 ui.onResize = function(withPan) {
79464 var map2 = context.map();
79465 var mapDimensions = utilGetDimensions(context.container().select(".main-content"), true);
79466 utilGetDimensions(context.container().select(".sidebar"), true);
79467 if (withPan !== void 0) {
79468 map2.redrawEnable(false);
79470 map2.redrawEnable(true);
79472 map2.dimensions(mapDimensions);
79473 ui.photoviewer.onMapResize();
79474 ui.checkOverflow(".top-toolbar");
79475 ui.checkOverflow(".map-footer-bar");
79476 var resizeWindowEvent = document.createEvent("Event");
79477 resizeWindowEvent.initEvent("resizeWindow", true, true);
79478 document.dispatchEvent(resizeWindowEvent);
79480 ui.checkOverflow = function(selector, reset) {
79482 delete _needWidth[selector];
79484 var selection2 = context.container().select(selector);
79485 if (selection2.empty()) return;
79486 var scrollWidth = selection2.property("scrollWidth");
79487 var clientWidth = selection2.property("clientWidth");
79488 var needed = _needWidth[selector] || scrollWidth;
79489 if (scrollWidth > clientWidth) {
79490 selection2.classed("narrow", true);
79491 if (!_needWidth[selector]) {
79492 _needWidth[selector] = scrollWidth;
79494 } else if (scrollWidth >= needed) {
79495 selection2.classed("narrow", false);
79498 ui.togglePanes = function(showPane) {
79499 var hidePanes = context.container().selectAll(".map-pane.shown");
79500 var side = _mainLocalizer.textDirection() === "ltr" ? "right" : "left";
79501 hidePanes.classed("shown", false).classed("hide", true);
79502 context.container().selectAll(".map-pane-control button").classed("active", false);
79504 hidePanes.classed("shown", false).classed("hide", true).style(side, "-500px");
79505 context.container().selectAll("." + showPane.attr("pane") + "-control button").classed("active", true);
79506 showPane.classed("shown", true).classed("hide", false);
79507 if (hidePanes.empty()) {
79508 showPane.style(side, "-500px").transition().duration(200).style(side, "0px");
79510 showPane.style(side, "0px");
79513 hidePanes.classed("shown", true).classed("hide", false).style(side, "0px").transition().duration(200).style(side, "-500px").on("end", function() {
79514 select_default2(this).classed("shown", false).classed("hide", true);
79518 var _editMenu = uiEditMenu(context);
79519 ui.editMenu = function() {
79522 ui.showEditMenu = function(anchorPoint, triggerType, operations) {
79523 ui.closeEditMenu();
79524 if (!operations && context.mode().operations) operations = context.mode().operations();
79525 if (!operations || !operations.length) return;
79526 if (!context.map().editableDataEnabled()) return;
79527 var surfaceNode = context.surface().node();
79528 if (surfaceNode.focus) {
79529 surfaceNode.focus();
79531 operations.forEach(function(operation2) {
79532 if (operation2.point) operation2.point(anchorPoint);
79534 _editMenu.anchorLoc(anchorPoint).triggerType(triggerType).operations(operations);
79535 overMap.call(_editMenu);
79537 ui.closeEditMenu = function() {
79538 if (overMap !== void 0) {
79539 overMap.select(".edit-menu").remove();
79542 var _saveLoading = select_default2(null);
79543 context.uploader().on("saveStarted.ui", function() {
79544 _saveLoading = uiLoading(context).message(_t.html("save.uploading")).blocking(true);
79545 context.container().call(_saveLoading);
79546 }).on("saveEnded.ui", function() {
79547 _saveLoading.close();
79548 _saveLoading = select_default2(null);
79556 var init_init2 = __esm({
79557 "modules/ui/init.js"() {
79561 init_preferences();
79570 init_attribution();
79571 init_contributors();
79573 init_feature_info();
79575 init_full_screen();
79579 init_issues_info();
79583 init_photoviewer();
79588 init_source_switch();
79593 init_top_toolbar();
79596 init_zoom_to_selection();
79598 init_background3();
79602 init_preferences2();
79606 // modules/ui/commit_warnings.js
79607 var commit_warnings_exports = {};
79608 __export(commit_warnings_exports, {
79609 uiCommitWarnings: () => uiCommitWarnings
79611 function uiCommitWarnings(context) {
79612 function commitWarnings(selection2) {
79613 var issuesBySeverity = context.validator().getIssuesBySeverity({ what: "edited", where: "all", includeDisabledRules: true });
79614 for (var severity in issuesBySeverity) {
79615 if (severity === "suggestion") continue;
79616 var issues = issuesBySeverity[severity];
79617 if (severity !== "error") {
79618 issues = issues.filter(function(issue) {
79619 return issue.type !== "help_request";
79622 var section = severity + "-section";
79623 var issueItem = severity + "-item";
79624 var container = selection2.selectAll("." + section).data(issues.length ? [0] : []);
79625 container.exit().remove();
79626 var containerEnter = container.enter().append("div").attr("class", "modal-section " + section + " fillL2");
79627 containerEnter.append("h3").call(_t.append(`commit.${severity}s`));
79628 containerEnter.append("ul").attr("class", "changeset-list");
79629 container = containerEnter.merge(container);
79630 var items = container.select("ul").selectAll("li").data(issues, function(d4) {
79633 items.exit().remove();
79634 var itemsEnter = items.enter().append("li").attr("class", issueItem);
79635 var buttons = itemsEnter.append("button").on("mouseover", function(d3_event, d4) {
79636 if (d4.entityIds) {
79637 context.surface().selectAll(
79638 utilEntityOrMemberSelector(
79642 ).classed("hover", true);
79644 }).on("mouseout", function() {
79645 context.surface().selectAll(".hover").classed("hover", false);
79646 }).on("click", function(d3_event, d4) {
79647 context.validator().focusIssue(d4);
79649 buttons.call(svgIcon("#iD-icon-alert", "pre-text"));
79650 buttons.append("strong").attr("class", "issue-message");
79651 buttons.filter(function(d4) {
79654 uiTooltip().title(function(d4) {
79656 }).placement("top")
79658 items = itemsEnter.merge(items);
79659 items.selectAll(".issue-message").text("").each(function(d4) {
79660 return d4.message(context)(select_default2(this));
79664 return commitWarnings;
79666 var init_commit_warnings = __esm({
79667 "modules/ui/commit_warnings.js"() {
79677 // modules/ui/lasso.js
79678 var lasso_exports = {};
79679 __export(lasso_exports, {
79680 uiLasso: () => uiLasso
79682 function uiLasso(context) {
79683 var group, polygon2;
79684 lasso.coordinates = [];
79685 function lasso(selection2) {
79686 context.container().classed("lasso", true);
79687 group = selection2.append("g").attr("class", "lasso hide");
79688 polygon2 = group.append("path").attr("class", "lasso-path");
79689 group.call(uiToggle(true));
79693 polygon2.data([lasso.coordinates]).attr("d", function(d4) {
79694 return "M" + d4.join(" L") + " Z";
79698 lasso.extent = function() {
79699 return lasso.coordinates.reduce(function(extent, point) {
79700 return extent.extend(geoExtent(point));
79703 lasso.p = function(_3) {
79704 if (!arguments.length) return lasso;
79705 lasso.coordinates.push(_3);
79709 lasso.close = function() {
79711 group.call(uiToggle(false, function() {
79712 select_default2(this).remove();
79715 context.container().classed("lasso", false);
79719 var init_lasso = __esm({
79720 "modules/ui/lasso.js"() {
79728 // node_modules/osm-community-index/lib/simplify.js
79729 function simplify2(str) {
79730 if (typeof str !== "string") return "";
79731 return import_diacritics3.default.remove(
79732 str.replace(/&/g, "and").replace(/(İ|i̇)/ig, "i").replace(/[\s\-=_!"#%'*{},.\/:;?\(\)\[\]@\\$\^*+<>«»~`’\u00a1\u00a7\u00b6\u00b7\u00bf\u037e\u0387\u055a-\u055f\u0589\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0af0\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f14\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1360-\u1368\u166d\u166e\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u1805\u1807-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cc0-\u1cc7\u1cd3\u2000-\u206f\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e7f\u3001-\u3003\u303d\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uaaf0\uaaf1\uabeb\ufe10-\ufe16\ufe19\ufe30\ufe45\ufe46\ufe49-\ufe4c\ufe50-\ufe52\ufe54-\ufe57\ufe5f-\ufe61\ufe68\ufe6a\ufe6b\ufeff\uff01-\uff03\uff05-\uff07\uff0a\uff0c\uff0e\uff0f\uff1a\uff1b\uff1f\uff20\uff3c\uff61\uff64\uff65]+/g, "").toLowerCase()
79735 var import_diacritics3;
79736 var init_simplify2 = __esm({
79737 "node_modules/osm-community-index/lib/simplify.js"() {
79738 import_diacritics3 = __toESM(require_diacritics(), 1);
79742 // node_modules/osm-community-index/lib/resolve_strings.js
79743 function resolveStrings(item, defaults, localizerFn) {
79744 let itemStrings = Object.assign({}, item.strings);
79745 let defaultStrings = Object.assign({}, defaults[item.type]);
79746 const anyToken = new RegExp(/(\{\w+\})/, "gi");
79748 if (itemStrings.community) {
79749 const communityID = simplify2(itemStrings.community);
79750 itemStrings.community = localizerFn(`_communities.${communityID}`);
79752 ["name", "description", "extendedDescription"].forEach((prop) => {
79753 if (defaultStrings[prop]) defaultStrings[prop] = localizerFn(`_defaults.${item.type}.${prop}`);
79754 if (itemStrings[prop]) itemStrings[prop] = localizerFn(`${item.id}.${prop}`);
79757 let replacements = {
79758 account: item.account,
79759 community: itemStrings.community,
79760 signupUrl: itemStrings.signupUrl,
79761 url: itemStrings.url
79763 if (!replacements.signupUrl) {
79764 replacements.signupUrl = resolve(itemStrings.signupUrl || defaultStrings.signupUrl);
79766 if (!replacements.url) {
79767 replacements.url = resolve(itemStrings.url || defaultStrings.url);
79770 name: resolve(itemStrings.name || defaultStrings.name),
79771 url: resolve(itemStrings.url || defaultStrings.url),
79772 signupUrl: resolve(itemStrings.signupUrl || defaultStrings.signupUrl),
79773 description: resolve(itemStrings.description || defaultStrings.description),
79774 extendedDescription: resolve(itemStrings.extendedDescription || defaultStrings.extendedDescription)
79776 resolved.nameHTML = linkify(resolved.url, resolved.name);
79777 resolved.urlHTML = linkify(resolved.url);
79778 resolved.signupUrlHTML = linkify(resolved.signupUrl);
79779 resolved.descriptionHTML = resolve(itemStrings.description || defaultStrings.description, true);
79780 resolved.extendedDescriptionHTML = resolve(itemStrings.extendedDescription || defaultStrings.extendedDescription, true);
79782 function resolve(s2, addLinks) {
79783 if (!s2) return void 0;
79785 for (let key in replacements) {
79786 const token = `{${key}}`;
79787 const regex = new RegExp(token, "g");
79788 if (regex.test(result)) {
79789 let replacement = replacements[key];
79790 if (!replacement) {
79791 throw new Error(`Cannot resolve token: ${token}`);
79793 if (addLinks && (key === "signupUrl" || key === "url")) {
79794 replacement = linkify(replacement);
79796 result = result.replace(regex, replacement);
79800 const leftovers = result.match(anyToken);
79802 throw new Error(`Cannot resolve tokens: ${leftovers}`);
79804 if (addLinks && item.type === "reddit") {
79805 result = result.replace(/(\/r\/\w+\/*)/i, (match) => linkify(resolved.url, match));
79809 function linkify(url, text) {
79810 if (!url) return void 0;
79811 text = text || url;
79812 return `<a target="_blank" href="${url}">${text}</a>`;
79815 var init_resolve_strings = __esm({
79816 "node_modules/osm-community-index/lib/resolve_strings.js"() {
79821 // node_modules/osm-community-index/index.mjs
79822 var init_osm_community_index = __esm({
79823 "node_modules/osm-community-index/index.mjs"() {
79824 init_resolve_strings();
79829 // modules/ui/success.js
79830 var success_exports = {};
79831 __export(success_exports, {
79832 uiSuccess: () => uiSuccess
79834 function uiSuccess(context) {
79835 const MAXEVENTS = 2;
79836 const dispatch14 = dispatch_default("cancel");
79839 ensureOSMCommunityIndex();
79840 function ensureOSMCommunityIndex() {
79841 const data = _mainFileFetcher;
79842 return Promise.all([
79843 data.get("oci_features"),
79844 data.get("oci_resources"),
79845 data.get("oci_defaults")
79846 ]).then((vals) => {
79847 if (_oci) return _oci;
79848 if (vals[0] && Array.isArray(vals[0].features)) {
79849 _sharedLocationManager.mergeCustomGeoJSON(vals[0]);
79851 let ociResources = Object.values(vals[1].resources);
79852 if (ociResources.length) {
79853 return _sharedLocationManager.mergeLocationSets(ociResources).then(() => {
79855 resources: ociResources,
79856 defaults: vals[2].defaults
79864 defaults: vals[2].defaults
79870 function parseEventDate(when) {
79872 let raw = when.trim();
79874 if (!/Z$/.test(raw)) {
79877 const parsed = new Date(raw);
79878 return new Date(parsed.toUTCString().slice(0, 25));
79880 function success(selection2) {
79881 let header = selection2.append("div").attr("class", "header fillL");
79882 header.append("h2").call(_t.append("success.just_edited"));
79883 header.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => dispatch14.call("cancel")).call(svgIcon("#iD-icon-close"));
79884 let body = selection2.append("div").attr("class", "body save-success fillL");
79885 let summary = body.append("div").attr("class", "save-summary");
79886 summary.append("h3").call(_t.append("success.thank_you" + (_location ? "_location" : ""), { where: _location }));
79887 summary.append("p").call(_t.append("success.help_html")).append("a").attr("class", "link-out").attr("target", "_blank").attr("href", _t("success.help_link_url")).call(svgIcon("#iD-icon-out-link", "inline")).append("span").call(_t.append("success.help_link_text"));
79888 let osm = context.connection();
79890 let changesetURL = osm.changesetURL(_changeset2.id);
79891 let table = summary.append("table").attr("class", "summary-table");
79892 let row = table.append("tr").attr("class", "summary-row");
79893 row.append("td").attr("class", "cell-icon summary-icon").append("a").attr("target", "_blank").attr("href", changesetURL).append("svg").attr("class", "logo-small").append("use").attr("xlink:href", "#iD-logo-osm");
79894 let summaryDetail = row.append("td").attr("class", "cell-detail summary-detail");
79895 summaryDetail.append("a").attr("class", "cell-detail summary-view-on-osm").attr("target", "_blank").attr("href", changesetURL).call(_t.append("success.view_on_osm"));
79896 summaryDetail.append("div").html(_t.html("success.changeset_id", {
79897 changeset_id: { html: `<a href="${changesetURL}" target="_blank">${_changeset2.id}</a>` }
79899 if (showDonationMessage !== false) {
79900 const donationUrl = "https://supporting.openstreetmap.org/";
79901 let supporting = body.append("div").attr("class", "save-supporting");
79902 supporting.append("h3").call(_t.append("success.supporting.title"));
79903 supporting.append("p").call(_t.append("success.supporting.details"));
79904 table = supporting.append("table").attr("class", "supporting-table");
79905 row = table.append("tr").attr("class", "supporting-row");
79906 row.append("td").attr("class", "cell-icon supporting-icon").append("a").attr("target", "_blank").attr("href", donationUrl).append("svg").attr("class", "logo-small").append("use").attr("xlink:href", "#iD-donation");
79907 let supportingDetail = row.append("td").attr("class", "cell-detail supporting-detail");
79908 supportingDetail.append("a").attr("class", "cell-detail support-the-map").attr("target", "_blank").attr("href", donationUrl).call(_t.append("success.supporting.donation.title"));
79909 supportingDetail.append("div").call(_t.append("success.supporting.donation.details"));
79911 ensureOSMCommunityIndex().then((oci) => {
79912 const loc = context.map().center();
79913 const validHere = _sharedLocationManager.locationSetsAt(loc);
79914 let communities = [];
79915 oci.resources.forEach((resource) => {
79916 let area = validHere[resource.locationSetID];
79918 const localizer = (stringID) => _t.html(`community.${stringID}`);
79919 resource.resolved = resolveStrings(resource, oci.defaults, localizer);
79922 order: resource.order || 0,
79926 communities.sort((a2, b3) => a2.area - b3.area || b3.order - a2.order);
79927 body.call(showCommunityLinks, communities.map((c2) => c2.resource));
79930 function showCommunityLinks(selection2, resources) {
79931 let communityLinks = selection2.append("div").attr("class", "save-communityLinks");
79932 communityLinks.append("h3").call(_t.append("success.like_osm"));
79933 let table = communityLinks.append("table").attr("class", "community-table");
79934 let row = table.selectAll(".community-row").data(resources);
79935 let rowEnter = row.enter().append("tr").attr("class", "community-row");
79936 rowEnter.append("td").attr("class", "cell-icon community-icon").append("a").attr("target", "_blank").attr("href", (d4) => d4.resolved.url).append("svg").attr("class", "logo-small").append("use").attr("xlink:href", (d4) => `#community-${d4.type}`);
79937 let communityDetail = rowEnter.append("td").attr("class", "cell-detail community-detail");
79938 communityDetail.each(showCommunityDetails);
79939 communityLinks.append("div").attr("class", "community-missing").call(_t.append("success.missing")).append("a").attr("class", "link-out").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).attr("href", "https://github.com/osmlab/osm-community-index/issues").append("span").call(_t.append("success.tell_us"));
79941 function showCommunityDetails(d4) {
79942 let selection2 = select_default2(this);
79943 let communityID = d4.id;
79944 selection2.append("div").attr("class", "community-name").html(d4.resolved.nameHTML);
79945 selection2.append("div").attr("class", "community-description").html(d4.resolved.descriptionHTML);
79946 if (d4.resolved.extendedDescriptionHTML || d4.languageCodes && d4.languageCodes.length) {
79947 selection2.append("div").call(
79948 uiDisclosure(context, `community-more-${d4.id}`, false).expanded(false).updatePreference(false).label(() => _t.append("success.more")).content(showMore)
79951 let nextEvents = (d4.events || []).map((event) => {
79952 event.date = parseEventDate(event.when);
79954 }).filter((event) => {
79955 const t2 = event.date.getTime();
79956 const now3 = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0);
79957 return !isNaN(t2) && t2 >= now3;
79958 }).sort((a2, b3) => {
79959 return a2.date < b3.date ? -1 : a2.date > b3.date ? 1 : 0;
79960 }).slice(0, MAXEVENTS);
79961 if (nextEvents.length) {
79962 selection2.append("div").call(
79963 uiDisclosure(context, `community-events-${d4.id}`, false).expanded(false).updatePreference(false).label(_t.html("success.events")).content(showNextEvents)
79964 ).select(".hide-toggle").append("span").attr("class", "badge-text").text(nextEvents.length);
79966 function showMore(selection3) {
79967 let more = selection3.selectAll(".community-more").data([0]);
79968 let moreEnter = more.enter().append("div").attr("class", "community-more");
79969 if (d4.resolved.extendedDescriptionHTML) {
79970 moreEnter.append("div").attr("class", "community-extended-description").html(d4.resolved.extendedDescriptionHTML);
79972 if (d4.languageCodes && d4.languageCodes.length) {
79973 const languageList = d4.languageCodes.map((code) => _mainLocalizer.languageName(code)).join(", ");
79974 moreEnter.append("div").attr("class", "community-languages").call(_t.append("success.languages", { languages: languageList }));
79977 function showNextEvents(selection3) {
79978 let events = selection3.append("div").attr("class", "community-events");
79979 let item = events.selectAll(".community-event").data(nextEvents);
79980 let itemEnter = item.enter().append("div").attr("class", "community-event");
79981 itemEnter.append("div").attr("class", "community-event-name").append("a").attr("target", "_blank").attr("href", (d5) => d5.url).text((d5) => {
79982 let name = d5.name;
79983 if (d5.i18n && d5.id) {
79984 name = _t(`community.${communityID}.events.${d5.id}.name`, { default: name });
79988 itemEnter.append("div").attr("class", "community-event-when").text((d5) => {
79989 let options = { weekday: "short", day: "numeric", month: "short", year: "numeric" };
79990 if (d5.date.getHours() || d5.date.getMinutes()) {
79991 options.hour = "numeric";
79992 options.minute = "numeric";
79994 return d5.date.toLocaleString(_mainLocalizer.localeCode(), options);
79996 itemEnter.append("div").attr("class", "community-event-where").text((d5) => {
79997 let where = d5.where;
79998 if (d5.i18n && d5.id) {
79999 where = _t(`community.${communityID}.events.${d5.id}.where`, { default: where });
80003 itemEnter.append("div").attr("class", "community-event-description").text((d5) => {
80004 let description = d5.description;
80005 if (d5.i18n && d5.id) {
80006 description = _t(`community.${communityID}.events.${d5.id}.description`, { default: description });
80008 return description;
80012 success.changeset = function(val) {
80013 if (!arguments.length) return _changeset2;
80017 success.location = function(val) {
80018 if (!arguments.length) return _location;
80022 return utilRebind(success, dispatch14, "on");
80025 var init_success = __esm({
80026 "modules/ui/success.js"() {
80030 init_osm_community_index();
80032 init_file_fetcher();
80033 init_LocationManager();
80042 // modules/ui/index.js
80043 var ui_exports = {};
80044 __export(ui_exports, {
80045 uiAccount: () => uiAccount,
80046 uiAttribution: () => uiAttribution,
80047 uiChangesetEditor: () => uiChangesetEditor,
80048 uiCmd: () => uiCmd,
80049 uiCombobox: () => uiCombobox,
80050 uiCommit: () => uiCommit,
80051 uiCommitWarnings: () => uiCommitWarnings,
80052 uiConfirm: () => uiConfirm,
80053 uiConflicts: () => uiConflicts,
80054 uiContributors: () => uiContributors,
80055 uiCurtain: () => uiCurtain,
80056 uiDataEditor: () => uiDataEditor,
80057 uiDataHeader: () => uiDataHeader,
80058 uiDisclosure: () => uiDisclosure,
80059 uiEditMenu: () => uiEditMenu,
80060 uiEntityEditor: () => uiEntityEditor,
80061 uiFeatureInfo: () => uiFeatureInfo,
80062 uiFeatureList: () => uiFeatureList,
80063 uiField: () => uiField,
80064 uiFieldHelp: () => uiFieldHelp,
80065 uiFlash: () => uiFlash,
80066 uiFormFields: () => uiFormFields,
80067 uiFullScreen: () => uiFullScreen,
80068 uiGeolocate: () => uiGeolocate,
80069 uiInfo: () => uiInfo,
80070 uiInit: () => uiInit,
80071 uiInspector: () => uiInspector,
80072 uiIssuesInfo: () => uiIssuesInfo,
80073 uiKeepRightDetails: () => uiKeepRightDetails,
80074 uiKeepRightEditor: () => uiKeepRightEditor,
80075 uiKeepRightHeader: () => uiKeepRightHeader,
80076 uiLasso: () => uiLasso,
80077 uiLengthIndicator: () => uiLengthIndicator,
80078 uiLoading: () => uiLoading,
80079 uiMapInMap: () => uiMapInMap,
80080 uiModal: () => uiModal,
80081 uiNoteComments: () => uiNoteComments,
80082 uiNoteEditor: () => uiNoteEditor,
80083 uiNoteHeader: () => uiNoteHeader,
80084 uiNoteReport: () => uiNoteReport,
80085 uiNotice: () => uiNotice,
80086 uiPopover: () => uiPopover,
80087 uiPresetIcon: () => uiPresetIcon,
80088 uiPresetList: () => uiPresetList,
80089 uiRestore: () => uiRestore,
80090 uiScale: () => uiScale,
80091 uiSidebar: () => uiSidebar,
80092 uiSourceSwitch: () => uiSourceSwitch,
80093 uiSpinner: () => uiSpinner,
80094 uiSplash: () => uiSplash,
80095 uiStatus: () => uiStatus,
80096 uiSuccess: () => uiSuccess,
80097 uiTagReference: () => uiTagReference,
80098 uiToggle: () => uiToggle,
80099 uiTooltip: () => uiTooltip,
80100 uiVersion: () => uiVersion,
80101 uiViewOnKeepRight: () => uiViewOnKeepRight,
80102 uiViewOnOSM: () => uiViewOnOSM,
80103 uiZoom: () => uiZoom
80105 var init_ui = __esm({
80106 "modules/ui/index.js"() {
80110 init_attribution();
80111 init_changeset_editor();
80115 init_commit_warnings();
80118 init_contributors();
80120 init_data_editor();
80121 init_data_header();
80124 init_entity_editor();
80125 init_feature_info();
80126 init_feature_list();
80130 init_form_fields();
80131 init_full_screen();
80135 init_issues_info();
80136 init_keepRight_details();
80137 init_keepRight_editor();
80138 init_keepRight_header();
80139 init_length_indicator();
80145 init_note_comments();
80146 init_note_editor();
80147 init_note_header();
80148 init_note_report();
80150 init_preset_icon();
80151 init_preset_list();
80155 init_source_switch();
80160 init_tag_reference();
80164 init_view_on_osm();
80165 init_view_on_keepRight();
80170 // modules/ui/fields/input.js
80171 var input_exports = {};
80172 __export(input_exports, {
80173 likelyRawNumberFormat: () => likelyRawNumberFormat,
80174 uiFieldColour: () => uiFieldText,
80175 uiFieldEmail: () => uiFieldText,
80176 uiFieldIdentifier: () => uiFieldText,
80177 uiFieldNumber: () => uiFieldText,
80178 uiFieldSchedule: () => uiFieldText,
80179 uiFieldTel: () => uiFieldText,
80180 uiFieldText: () => uiFieldText,
80181 uiFieldUrl: () => uiFieldText
80183 function uiFieldText(field, context) {
80184 var dispatch14 = dispatch_default("change");
80185 var input = select_default2(null);
80186 var outlinkButton = select_default2(null);
80187 var wrap2 = select_default2(null);
80188 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
80189 var _entityIDs = [];
80191 var _phoneFormats = {};
80192 const isDirectionField = field.key.split(":").some((keyPart) => keyPart === "direction");
80193 const formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
80194 const parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
80195 const countDecimalPlaces = _mainLocalizer.decimalPlaceCounter(_mainLocalizer.languageCode());
80196 if (field.type === "tel") {
80197 _mainFileFetcher.get("phone_formats").then(function(d4) {
80198 _phoneFormats = d4;
80199 updatePhonePlaceholder();
80200 }).catch(function() {
80203 function calcLocked() {
80204 var isLocked = (field.id === "brand" || field.id === "network" || field.id === "operator" || field.id === "flag") && _entityIDs.length && _entityIDs.some(function(entityID) {
80205 var entity = context.graph().hasEntity(entityID);
80206 if (!entity) return false;
80207 if (entity.tags.wikidata) return true;
80208 var preset = _mainPresetIndex.match(entity, context.graph());
80209 var isSuggestion = preset && preset.suggestion;
80210 var which = field.id;
80211 return isSuggestion && !!entity.tags[which] && !!entity.tags[which + ":wikidata"];
80213 field.locked(isLocked);
80215 function i3(selection2) {
80217 var isLocked = field.locked();
80218 wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
80219 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
80220 input = wrap2.selectAll("input").data([0]);
80221 input = input.enter().append("input").attr("type", field.type === "identifier" ? "text" : field.type).attr("dir", "auto").attr("id", field.domId).classed(field.type, true).call(utilNoAuto).merge(input);
80222 input.classed("disabled", !!isLocked).attr("readonly", isLocked || null).on("input", change(true)).on("blur", change()).on("change", change());
80223 wrap2.call(_lengthIndicator);
80224 if (field.type === "tel") {
80225 updatePhonePlaceholder();
80226 } else if (field.type === "number") {
80227 var rtl = _mainLocalizer.textDirection() === "rtl";
80228 input.attr("type", "text");
80229 var inc = field.increment;
80230 var buttons = wrap2.selectAll(".increment, .decrement").data(rtl ? [inc, -inc] : [-inc, inc]);
80231 buttons.enter().append("button").attr("class", function(d4) {
80232 var which = d4 > 0 ? "increment" : "decrement";
80233 return "form-field-button " + which;
80234 }).attr("title", function(d4) {
80235 var which = d4 > 0 ? "increment" : "decrement";
80236 return _t(`inspector.${which}`);
80237 }).merge(buttons).on("click", function(d3_event, d4) {
80238 d3_event.preventDefault();
80239 var isMixed = Array.isArray(_tags[field.key]);
80240 if (isMixed) return;
80241 var raw_vals = input.node().value || "0";
80242 var vals = raw_vals.split(";");
80243 vals = vals.map(function(v3) {
80245 const isRawNumber = likelyRawNumberFormat.test(v3);
80246 var num = isRawNumber ? parseFloat(v3) : parseLocaleFloat(v3);
80247 if (isDirectionField) {
80248 const compassDir = cardinal[v3.toLowerCase()];
80249 if (compassDir !== void 0) {
80253 if (!isFinite(num)) return v3;
80254 num = parseFloat(num);
80255 if (!isFinite(num)) return v3;
80257 if (isDirectionField) {
80258 num = (num % 360 + 360) % 360;
80260 return formatFloat(clamped(num), isRawNumber ? v3.includes(".") ? v3.split(".")[1].length : 0 : countDecimalPlaces(v3));
80262 input.node().value = vals.join(";");
80265 } else if (field.type === "identifier" && field.urlFormat && field.pattern) {
80266 input.attr("type", "text");
80267 outlinkButton = wrap2.selectAll(".foreign-id-permalink").data([0]);
80268 outlinkButton = outlinkButton.enter().append("button").call(svgIcon("#iD-icon-out-link")).attr("class", "form-field-button foreign-id-permalink").attr("title", function() {
80269 var domainResults = /^https?:\/\/(.{1,}?)\//.exec(field.urlFormat);
80270 if (domainResults.length >= 2 && domainResults[1]) {
80271 var domain = domainResults[1];
80272 return _t("icons.view_on", { domain });
80275 }).merge(outlinkButton);
80276 outlinkButton.on("click", function(d3_event) {
80277 d3_event.preventDefault();
80278 var value = validIdentifierValueForLink();
80280 var url = field.urlFormat.replace(/{value}/, encodeURIComponent(value));
80281 window.open(url, "_blank");
80283 }).classed("disabled", () => !validIdentifierValueForLink()).merge(outlinkButton);
80284 } else if (field.type === "schedule") {
80285 input.attr("type", "text");
80286 outlinkButton = wrap2.selectAll(".foreign-id-permalink").data([0]);
80287 outlinkButton.enter().append("button").call(svgIcon("#iD-icon-out-link")).attr("class", "form-field-button foreign-id-permalink").attr("title", () => _t("icons.edit_in", { tool: "YoHours" })).on("click", function(d3_event) {
80288 d3_event.preventDefault();
80289 var value = validIdentifierValueForLink();
80290 var url = yoHoursURLFormat.replace(/{value}/, encodeURIComponent(value || ""));
80291 window.open(url, "_blank");
80292 }).merge(outlinkButton);
80293 } else if (field.type === "url") {
80294 input.attr("type", "text");
80295 outlinkButton = wrap2.selectAll(".foreign-id-permalink").data([0]);
80296 outlinkButton.enter().append("button").call(svgIcon("#iD-icon-out-link")).attr("class", "form-field-button foreign-id-permalink").attr("title", () => _t("icons.visit_website")).on("click", function(d3_event) {
80297 d3_event.preventDefault();
80298 const value = validIdentifierValueForLink();
80299 if (value) window.open(value, "_blank");
80300 }).merge(outlinkButton);
80301 } else if (field.type === "colour") {
80302 input.attr("type", "text");
80303 updateColourPreview();
80304 } else if (field.type === "date") {
80305 input.attr("type", "text");
80309 function updateColourPreview() {
80310 wrap2.selectAll(".colour-preview").remove();
80311 const colour = utilGetSetValue(input);
80312 if (!isColourValid(colour) && colour !== "") {
80313 wrap2.selectAll("input.colour-selector").remove();
80314 wrap2.selectAll(".form-field-button").remove();
80317 var colourSelector = wrap2.selectAll(".colour-selector").data([0]);
80318 colourSelector.enter().append("input").attr("type", "color").attr("class", "colour-selector").on("input", debounce_default(function(d3_event) {
80319 d3_event.preventDefault();
80320 var colour2 = this.value;
80321 if (!isColourValid(colour2)) return;
80322 utilGetSetValue(input, this.value);
80324 updateColourPreview();
80326 wrap2.selectAll("input.colour-selector").attr("value", colour);
80327 var chooserButton = wrap2.selectAll(".colour-preview").data([colour]);
80328 chooserButton = chooserButton.enter().append("div").attr("class", "form-field-button colour-preview").append("div").style("background-color", (d4) => d4).attr("class", "colour-box");
80329 if (colour === "") {
80330 chooserButton = chooserButton.call(svgIcon("#iD-icon-edit"));
80332 chooserButton.on("click", () => wrap2.select(".colour-selector").node().showPicker());
80334 function updateDateField() {
80335 function isDateValid(date2) {
80336 return date2.match(/^[0-9]{4}(-[0-9]{2}(-[0-9]{2})?)?$/);
80338 const date = utilGetSetValue(input);
80339 const now3 = /* @__PURE__ */ new Date();
80340 const today = new Date(now3.getTime() - now3.getTimezoneOffset() * 6e4).toISOString().split("T")[0];
80341 if ((field.key === "check_date" || field.key === "survey:date") && date !== today) {
80342 wrap2.selectAll(".date-set-today").data([0]).enter().append("button").attr("class", "form-field-button date-set-today").call(svgIcon("#fas-rotate")).call(uiTooltip().title(() => _t.append("inspector.set_today"))).on("click", () => {
80343 utilGetSetValue(input, today);
80348 wrap2.selectAll(".date-set-today").remove();
80350 if (!isDateValid(date) && date !== "") {
80351 wrap2.selectAll("input.date-selector").remove();
80352 wrap2.selectAll(".date-calendar").remove();
80355 if (utilDetect().browser !== "Safari") {
80356 var dateSelector = wrap2.selectAll(".date-selector").data([0]);
80357 dateSelector.enter().append("input").attr("type", "date").attr("class", "date-selector").on("input", debounce_default(function(d3_event) {
80358 d3_event.preventDefault();
80359 var date2 = this.value;
80360 if (!isDateValid(date2)) return;
80361 utilGetSetValue(input, this.value);
80365 wrap2.selectAll("input.date-selector").attr("value", date);
80366 var calendarButton = wrap2.selectAll(".date-calendar").data([date]);
80367 calendarButton = calendarButton.enter().append("button").attr("class", "form-field-button date-calendar").call(svgIcon("#fas-calendar-days"));
80368 calendarButton.on("click", () => wrap2.select(".date-selector").node().showPicker());
80371 function updatePhonePlaceholder() {
80372 if (input.empty() || !Object.keys(_phoneFormats).length) return;
80373 var extent = combinedEntityExtent();
80374 var countryCode = extent && iso1A2Code(extent.center());
80375 var format2 = countryCode && _phoneFormats[countryCode.toLowerCase()];
80376 if (format2) input.attr("placeholder", format2);
80378 function validIdentifierValueForLink() {
80380 const value = utilGetSetValue(input).trim();
80381 if (field.type === "url" && value) {
80383 return new URL(value).href;
80388 if (field.type === "identifier" && field.pattern) {
80389 return value && ((_a4 = value.match(new RegExp(field.pattern))) == null ? void 0 : _a4[0]);
80391 if (field.type === "schedule") {
80396 function clamped(num) {
80397 if (field.minValue !== void 0) {
80398 num = Math.max(num, field.minValue);
80400 if (field.maxValue !== void 0) {
80401 num = Math.min(num, field.maxValue);
80405 function getVals(tags) {
80407 const multiSelection = context.selectedIDs();
80408 tags = multiSelection.length > 1 ? context.selectedIDs().map((id2) => context.graph().entity(id2)).map((entity) => entity.tags) : [tags];
80409 return tags.map((tags2) => new Set(field.keys.reduce((acc, key) => acc.concat(tags2[key]), []).filter(Boolean))).map((vals) => vals.size === 0 ? /* @__PURE__ */ new Set([void 0]) : vals).reduce((a2, b3) => /* @__PURE__ */ new Set([...a2, ...b3]));
80411 return new Set([].concat(tags[field.key]));
80414 function change(onInput) {
80415 return function() {
80417 var val = utilGetSetValue(input);
80418 if (!onInput) val = context.cleanTagValue(val);
80419 if (!val && getVals(_tags).size > 1) return;
80420 let displayVal = val;
80421 if (field.type === "number" && val) {
80422 const numbers2 = val.split(";").map((v3) => {
80423 if (likelyRawNumberFormat.test(v3)) {
80426 num: parseFloat(v3),
80427 fractionDigits: v3.includes(".") ? v3.split(".")[1].length : 0
80432 num: parseLocaleFloat(v3),
80433 fractionDigits: countDecimalPlaces(v3)
80437 val = numbers2.map(({ num, v: v3, fractionDigits }) => {
80438 if (!isFinite(num)) return v3;
80439 return clamped(num).toFixed(fractionDigits);
80441 displayVal = numbers2.map(({ num, v: v3, fractionDigits }) => {
80442 if (!isFinite(num)) return v3;
80443 return formatFloat(clamped(num), fractionDigits);
80446 if (!onInput) utilGetSetValue(input, displayVal);
80447 t2[field.key] = val || void 0;
80449 dispatch14.call("change", this, (tags) => {
80450 if (field.keys.some((key) => tags[key])) {
80451 field.keys.filter((key) => tags[key]).forEach((key) => {
80452 tags[key] = val || void 0;
80455 tags[field.key] = val || void 0;
80460 dispatch14.call("change", this, t2, onInput);
80464 i3.entityIDs = function(val) {
80465 if (!arguments.length) return _entityIDs;
80469 i3.tags = function(tags) {
80472 const vals = getVals(tags);
80473 const isMixed = vals.size > 1;
80474 var val = vals.size === 1 ? (_a4 = [...vals][0]) != null ? _a4 : "" : "";
80476 if (field.type === "number" && val) {
80477 var numbers2 = val.split(";");
80478 var oriNumbers = utilGetSetValue(input).split(";");
80479 if (numbers2.length !== oriNumbers.length) shouldUpdate = true;
80480 numbers2 = numbers2.map(function(v3) {
80482 var num = Number(v3);
80483 if (!isFinite(num) || v3 === "") return v3;
80484 const fractionDigits = v3.includes(".") ? v3.split(".")[1].length : 0;
80485 return formatFloat(num, fractionDigits);
80487 val = numbers2.join(";");
80488 shouldUpdate = (inputValue, setValue) => {
80489 const inputNums = inputValue.split(";").map((val2) => {
80490 const parsedNum = likelyRawNumberFormat.test(val2) ? parseFloat(val2) : parseLocaleFloat(val2);
80491 if (!isFinite(parsedNum)) return val2;
80494 const setNums = setValue.split(";").map((val2) => {
80495 const parsedNum = parseLocaleFloat(val2);
80496 if (!isFinite(parsedNum)) return val2;
80499 return !isEqual_default(inputNums, setNums);
80502 utilGetSetValue(input, val, shouldUpdate).attr("title", isMixed ? [...vals].join("\n") : void 0).attr("placeholder", isMixed ? _t("inspector.multiple_values") : field.placeholder() || _t("inspector.unknown")).classed("mixed", isMixed);
80503 if (field.type === "number") {
80504 const buttons = wrap2.selectAll(".increment, .decrement");
80506 buttons.attr("disabled", "disabled").classed("disabled", true);
80508 var raw_vals = tags[field.key] || "0";
80509 const canIncDec = raw_vals.split(";").some(
80510 (val2) => isFinite(Number(val2)) || isDirectionField && val2.trim().toLowerCase() in cardinal
80512 buttons.attr("disabled", canIncDec ? null : "disabled").classed("disabled", !canIncDec);
80515 if (field.type === "tel") updatePhonePlaceholder();
80516 if (field.type === "colour") updateColourPreview();
80517 if (field.type === "date") updateDateField();
80518 if (outlinkButton && !outlinkButton.empty()) {
80519 var disabled = !validIdentifierValueForLink() && field.type !== "schedule";
80520 outlinkButton.classed("disabled", disabled);
80523 _lengthIndicator.update(tags[field.key]);
80526 i3.focus = function() {
80527 var node = input.node();
80528 if (node) node.focus();
80530 function combinedEntityExtent() {
80531 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
80533 return utilRebind(i3, dispatch14, "on");
80535 var likelyRawNumberFormat, yoHoursURLFormat;
80536 var init_input = __esm({
80537 "modules/ui/fields/input.js"() {
80542 init_country_coder();
80544 init_file_fetcher();
80553 likelyRawNumberFormat = /^-?(0\.\d*|\d*\.\d{0,2}(\d{4,})?|\d{4,}\.\d{3})$/;
80554 yoHoursURLFormat = "https://projets.pavie.info/yohours/?oh={value}";
80558 // modules/ui/fields/access.js
80559 var access_exports = {};
80560 __export(access_exports, {
80561 uiFieldAccess: () => uiFieldAccess
80563 function uiFieldAccess(field, context) {
80564 var dispatch14 = dispatch_default("change");
80565 var items = select_default2(null);
80567 function access(selection2) {
80568 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
80569 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
80570 var list = wrap2.selectAll("ul").data([0]);
80571 list = list.enter().append("ul").attr("class", "rows").merge(list);
80572 items = list.selectAll("li").data(field.keys);
80573 var enter = items.enter().append("li").attr("class", function(d4) {
80574 return "labeled-input preset-access-" + d4;
80576 enter.append("div").attr("class", "label preset-label-access").attr("for", function(d4) {
80577 return "preset-input-access-" + d4;
80578 }).html(function(d4) {
80579 return field.t.html("types." + d4);
80581 enter.append("div").attr("class", "preset-input-access-wrap").append("input").attr("type", "text").attr("class", function(d4) {
80582 return "preset-input-access preset-input-access-" + d4;
80583 }).call(utilNoAuto).each(function(d4) {
80584 select_default2(this).call(
80585 uiCombobox(context, "access-" + d4).data(access.options(d4))
80588 items = items.merge(enter);
80589 wrap2.selectAll(".preset-input-access").on("change", change).on("blur", change);
80591 function change(d3_event, d4) {
80593 var value = context.cleanTagValue(utilGetSetValue(select_default2(this)));
80594 if (!value && typeof _tags[d4] !== "string") return;
80595 tag[d4] = value || void 0;
80596 dispatch14.call("change", this, tag);
80598 access.options = function(type2) {
80610 if (type2 === "access") {
80611 options = options.filter((v3) => v3 !== "yes" && v3 !== "designated");
80613 if (type2 === "bicycle") {
80614 options.splice(options.length - 4, 0, "dismount");
80616 var stringsField = field.resolveReference("stringsCrossReference");
80617 return options.map(function(option) {
80619 title: stringsField.t("options." + option + ".description"),
80624 const placeholdersByTag = {
80627 foot: "designated",
80628 motor_vehicle: "no"
80632 motor_vehicle: "no",
80638 motor_vehicle: "no",
80644 motor_vehicle: "no"
80647 motor_vehicle: "no",
80648 bicycle: "designated"
80651 motor_vehicle: "no",
80652 horse: "designated"
80656 motor_vehicle: "no",
80662 motor_vehicle: "yes",
80667 motor_vehicle: "yes"
80671 motor_vehicle: "yes",
80677 motor_vehicle: "yes",
80683 motor_vehicle: "yes",
80689 motor_vehicle: "yes",
80695 motor_vehicle: "yes",
80701 motor_vehicle: "yes",
80707 motor_vehicle: "yes",
80712 motor_vehicle: "yes"
80716 motor_vehicle: "yes",
80722 motor_vehicle: "yes",
80728 motor_vehicle: "yes",
80748 motor_vehicle: "no",
80760 motor_vehicle: "no"
80777 motorcycle_barrier: {
80778 motor_vehicle: "no"
80785 access.tags = function(tags) {
80787 utilGetSetValue(items.selectAll(".preset-input-access"), function(d4) {
80788 return typeof tags[d4] === "string" ? tags[d4] : "";
80789 }).classed("mixed", function(accessField) {
80790 return tags[accessField] && Array.isArray(tags[accessField]) || new Set(getAllPlaceholders(tags, accessField)).size > 1;
80791 }).attr("title", function(accessField) {
80792 return tags[accessField] && Array.isArray(tags[accessField]) && tags[accessField].filter(Boolean).join("\n");
80793 }).attr("placeholder", function(accessField) {
80794 let placeholders = getAllPlaceholders(tags, accessField);
80795 if (new Set(placeholders).size === 1) {
80796 return placeholders[0];
80798 return _t("inspector.multiple_values");
80801 function getAllPlaceholders(tags2, accessField) {
80802 let allTags = tags2[Symbol.for("allTags")];
80803 if (allTags && allTags.length > 1) {
80804 const placeholders = [];
80805 allTags.forEach((tags3) => {
80806 placeholders.push(getPlaceholder(tags3, accessField));
80808 return placeholders;
80810 return [getPlaceholder(tags2, accessField)];
80813 function getPlaceholder(tags2, accessField) {
80814 if (tags2[accessField]) {
80815 return tags2[accessField];
80817 if (tags2.motorroad === "yes" && (accessField === "foot" || accessField === "bicycle" || accessField === "horse")) {
80820 if (tags2.vehicle && (accessField === "bicycle" || accessField === "motor_vehicle")) {
80821 return tags2.vehicle;
80823 if (tags2.access) {
80824 return tags2.access;
80826 for (const key in placeholdersByTag) {
80828 if (placeholdersByTag[key][tags2[key]] && placeholdersByTag[key][tags2[key]][accessField]) {
80829 return placeholdersByTag[key][tags2[key]][accessField];
80833 if (accessField === "access" && !tags2.barrier) {
80836 return field.placeholder();
80839 access.focus = function() {
80840 items.selectAll(".preset-input-access").node().focus();
80842 return utilRebind(access, dispatch14, "on");
80844 var init_access = __esm({
80845 "modules/ui/fields/access.js"() {
80855 // modules/ui/fields/address.js
80856 var address_exports = {};
80857 __export(address_exports, {
80858 uiFieldAddress: () => uiFieldAddress
80860 function uiFieldAddress(field, context) {
80861 var dispatch14 = dispatch_default("change");
80862 var _selection = select_default2(null);
80863 var _wrap = select_default2(null);
80864 var addrField = _mainPresetIndex.field("address");
80865 var _entityIDs = [];
80868 var _addressFormats = [{
80870 ["housenumber", "street"],
80871 ["city", "postcode"]
80874 _mainFileFetcher.get("address_formats").then(function(d4) {
80875 _addressFormats = d4;
80876 if (!_selection.empty()) {
80877 _selection.call(address);
80879 }).catch(function() {
80881 function getNear(isAddressable, type2, searchRadius, resultProp) {
80882 var extent = combinedEntityExtent();
80883 var l4 = extent.center();
80884 var box = extent.padByMeters(searchRadius);
80885 var features = context.history().intersects(box).filter(isAddressable).map((d4) => {
80886 let dist = geoSphericalDistance(d4.extent(context.graph()).center(), l4);
80887 if (d4.geometry(context.graph()) === "line") {
80888 var loc = context.projection([
80889 (extent[0][0] + extent[1][0]) / 2,
80890 (extent[0][1] + extent[1][1]) / 2
80892 var choice = geoChooseEdge(context.graph().childNodes(d4), loc, context.projection);
80893 dist = geoSphericalDistance(choice.loc, l4);
80895 const value = resultProp && d4.tags[resultProp] ? d4.tags[resultProp] : d4.tags.name;
80897 if (type2 === "street") {
80898 title = `${addrField.t("placeholders.street")}: ${title}`;
80899 } else if (type2 === "place") {
80900 title = `${addrField.t("placeholders.place")}: ${title}`;
80907 klass: `address-${type2}`
80909 }).sort(function(a2, b3) {
80910 return a2.dist - b3.dist;
80912 return utilArrayUniqBy(features, "value");
80914 function getEnclosing(isAddressable, type2, resultProp) {
80915 var extent = combinedEntityExtent();
80916 var features = context.history().intersects(extent).filter(isAddressable).map((d4) => {
80917 if (d4.geometry(context.graph()) !== "area") {
80920 const geom = d4.asGeoJSON(context.graph()).coordinates[0];
80921 if (!geoPolygonContainsPolygon(geom, extent.polygon())) {
80924 const value = resultProp && d4.tags[resultProp] ? d4.tags[resultProp] : d4.tags.name;
80931 klass: `address-${type2}`
80933 }).filter(Boolean);
80934 return utilArrayUniqBy(features, "value");
80936 function getNearStreets() {
80937 function isAddressable(d4) {
80938 return d4.tags.highway && d4.tags.name && d4.type === "way";
80940 return getNear(isAddressable, "street", 200);
80942 function getNearPlaces() {
80943 function isAddressable(d4) {
80944 if (d4.tags.name) {
80945 if (d4.tags.place) return true;
80946 if (d4.tags.boundary === "administrative" && d4.tags.admin_level > 8) return true;
80950 return getNear(isAddressable, "place", 200);
80952 function getNearCities() {
80953 function isAddressable(d4) {
80954 if (d4.tags.name) {
80955 if (d4.tags.boundary === "administrative" && d4.tags.admin_level === "8") return true;
80956 if (d4.tags.border_type === "city") return true;
80957 if (d4.tags.place === "city" || d4.tags.place === "town" || d4.tags.place === "village" || d4.tags.place === "hamlet") return true;
80959 if (d4.tags[`${field.key}:city`]) return true;
80962 return getNear(isAddressable, "city", 200, `${field.key}:city`);
80964 function getNearPostcodes() {
80965 const postcodes = [].concat(getNearValues("postcode")).concat(getNear((d4) => d4.tags.postal_code, "postcode", 200, "postal_code"));
80966 return utilArrayUniqBy(postcodes, (item) => item.value);
80968 function getNearValues(key) {
80969 const tagKey = `${field.key}:${key}`;
80970 function hasTag(d4) {
80971 return _entityIDs.indexOf(d4.id) === -1 && d4.tags[tagKey];
80973 return getNear(hasTag, key, 200, tagKey);
80975 function getEnclosingValues(key) {
80976 const tagKey = `${field.key}:${key}`;
80977 function hasTag(d4) {
80978 return _entityIDs.indexOf(d4.id) === -1 && d4.tags[tagKey];
80980 const enclosingAddresses = getEnclosing(hasTag, key, tagKey);
80981 function isBuilding(d4) {
80982 return _entityIDs.indexOf(d4.id) === -1 && d4.tags.building && d4.tags.building !== "no";
80984 const enclosingBuildings = getEnclosing(isBuilding, "building", "building").map((d4) => d4.geom);
80985 function isInNearbyBuilding(d4) {
80986 return hasTag(d4) && d4.type === "node" && enclosingBuildings.some(
80987 (geom) => geoPointInPolygon(d4.loc, geom) || geom.indexOf(d4.loc) !== -1
80990 const nearPointAddresses = getNear(isInNearbyBuilding, key, 100, tagKey);
80991 return utilArrayUniqBy([
80992 ...enclosingAddresses,
80993 ...nearPointAddresses
80994 ], "value").sort((a2, b3) => a2.value > b3.value ? 1 : -1);
80996 function updateForCountryCode() {
80997 if (!_countryCode) return;
80999 for (var i3 = 0; i3 < _addressFormats.length; i3++) {
81000 var format2 = _addressFormats[i3];
81001 if (!format2.countryCodes) {
81002 addressFormat = format2;
81003 } else if (format2.countryCodes.indexOf(_countryCode) !== -1) {
81004 addressFormat = format2;
81008 const maybeDropdowns = /* @__PURE__ */ new Set([
81012 const dropdowns = /* @__PURE__ */ new Set([
81033 var widths = addressFormat.widths || {
81034 housenumber: 1 / 5,
81043 var total = r2.reduce(function(sum, key) {
81044 return sum + (widths[key] || 0.5);
81046 return r2.map(function(key) {
81049 width: (widths[key] || 0.5) / total
81053 var rows = _wrap.selectAll(".addr-row").data(addressFormat.format, function(d4) {
81054 return d4.toString();
81056 rows.exit().remove();
81057 rows.enter().append("div").attr("class", "addr-row").selectAll("input").data(row).enter().append("input").property("type", "text").attr("id", (d4) => d4.id === "housenumber" ? field.domId : null).attr("class", function(d4) {
81058 return "addr-" + d4.id;
81059 }).call(utilNoAuto).each(addDropdown).call(updatePlaceholder).style("width", function(d4) {
81060 return d4.width * 100 + "%";
81062 function addDropdown(d4) {
81063 if (!dropdowns.has(d4.id)) {
81069 nearValues = getNearStreets;
81072 nearValues = getNearPlaces;
81074 case "street+place":
81075 nearValues = () => [].concat(getNearStreets()).concat(getNearPlaces());
81076 d4.isAutoStreetPlace = true;
81077 d4.id = _tags[`${field.key}:place`] ? "place" : "street";
81080 nearValues = getNearCities;
81083 nearValues = getNearPostcodes;
81085 case "housenumber":
81087 nearValues = getEnclosingValues;
81090 nearValues = getNearValues;
81092 if (maybeDropdowns.has(d4.id)) {
81093 const candidates = nearValues(d4.id);
81094 if (candidates.length === 0) return false;
81096 select_default2(this).call(
81097 uiCombobox(context, `address-${d4.isAutoStreetPlace ? "street-place" : d4.id}`).minItems(1).caseSensitive(true).fetcher(function(typedValue, callback) {
81098 typedValue = typedValue.toLowerCase();
81099 callback(nearValues(d4.id).filter((v3) => v3.value.toLowerCase().indexOf(typedValue) !== -1));
81100 }).on("accept", function(selected) {
81101 if (d4.isAutoStreetPlace) {
81102 d4.id = selected ? selected.type : "street";
81103 utilTriggerEvent(select_default2(this), "change");
81108 _wrap.selectAll("input").on("input", change(true)).on("blur", change()).on("change", change());
81109 if (_tags) updateTags(_tags);
81111 function address(selection2) {
81112 _selection = selection2;
81113 _wrap = selection2.selectAll(".form-field-input-wrap").data([0]);
81114 _wrap = _wrap.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(_wrap);
81115 var extent = combinedEntityExtent();
81118 if (context.inIntro()) {
81119 countryCode = _t("intro.graph.countrycode");
81121 var center = extent.center();
81122 countryCode = iso1A2Code(center);
81125 _countryCode = countryCode.toLowerCase();
81126 updateForCountryCode();
81130 function change(onInput) {
81131 return function() {
81133 _wrap.selectAll("input").each(function(subfield) {
81134 var key = field.key + ":" + subfield.id;
81135 var value = this.value;
81136 if (!onInput) value = context.cleanTagValue(value);
81137 if (Array.isArray(_tags[key]) && !value) return;
81138 if (subfield.isAutoStreetPlace) {
81139 if (subfield.id === "street") {
81140 tags[`${field.key}:place`] = void 0;
81141 } else if (subfield.id === "place") {
81142 tags[`${field.key}:street`] = void 0;
81145 tags[key] = value || void 0;
81147 Object.keys(tags).filter((k2) => tags[k2]).forEach((k2) => _tags[k2] = tags[k2]);
81148 dispatch14.call("change", this, tags, onInput);
81151 function updatePlaceholder(inputSelection) {
81152 return inputSelection.attr("placeholder", function(subfield) {
81153 if (_tags && Array.isArray(_tags[field.key + ":" + subfield.id])) {
81154 return _t("inspector.multiple_values");
81156 if (subfield.isAutoStreetPlace) {
81157 return `${getLocalPlaceholder("street")} / ${getLocalPlaceholder("place")}`;
81159 return getLocalPlaceholder(subfield.id);
81162 function getLocalPlaceholder(key) {
81163 if (_countryCode) {
81164 var localkey = key + "!" + _countryCode;
81165 var tkey = addrField.hasTextForStringId("placeholders." + localkey) ? localkey : key;
81166 return addrField.t("placeholders." + tkey);
81169 function updateTags(tags) {
81170 utilGetSetValue(_wrap.selectAll("input"), (subfield) => {
81172 if (subfield.isAutoStreetPlace) {
81173 const streetKey = `${field.key}:street`;
81174 const placeKey = `${field.key}:place`;
81175 if (tags[streetKey] !== void 0 || tags[placeKey] === void 0) {
81176 val = tags[streetKey];
81177 subfield.id = "street";
81179 val = tags[placeKey];
81180 subfield.id = "place";
81183 val = tags[`${field.key}:${subfield.id}`];
81185 return typeof val === "string" ? val : "";
81186 }).attr("title", function(subfield) {
81187 var val = tags[field.key + ":" + subfield.id];
81188 return val && Array.isArray(val) ? val.filter(Boolean).join("\n") : void 0;
81189 }).classed("mixed", function(subfield) {
81190 return Array.isArray(tags[field.key + ":" + subfield.id]);
81191 }).call(updatePlaceholder);
81193 function combinedEntityExtent() {
81194 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
81196 address.entityIDs = function(val) {
81197 if (!arguments.length) return _entityIDs;
81201 address.tags = function(tags) {
81205 address.focus = function() {
81206 var node = _wrap.selectAll("input").node();
81207 if (node) node.focus();
81209 return utilRebind(address, dispatch14, "on");
81211 var init_address = __esm({
81212 "modules/ui/fields/address.js"() {
81216 init_country_coder();
81218 init_file_fetcher();
81226 // modules/ui/fields/directional_combo.js
81227 var directional_combo_exports = {};
81228 __export(directional_combo_exports, {
81229 uiFieldDirectionalCombo: () => uiFieldDirectionalCombo
81231 function uiFieldDirectionalCombo(field, context) {
81232 var dispatch14 = dispatch_default("change");
81233 var items = select_default2(null);
81234 var wrap2 = select_default2(null);
81237 if (field.type === "cycleway") {
81240 key: field.keys[0],
81241 keys: field.keys.slice(1)
81244 function directionalCombo(selection2) {
81245 function stripcolon(s2) {
81246 return s2.replace(":", "");
81248 wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
81249 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
81250 var div = wrap2.selectAll("ul").data([0]);
81251 div = div.enter().append("ul").attr("class", "rows rows-table").merge(div);
81252 items = div.selectAll("li").data(field.keys);
81253 var enter = items.enter().append("li").attr("class", function(d4) {
81254 return "labeled-input preset-directionalcombo-" + stripcolon(d4);
81256 enter.append("div").attr("class", "label preset-label-directionalcombo").attr("for", function(d4) {
81257 return "preset-input-directionalcombo-" + stripcolon(d4);
81258 }).html(function(d4) {
81259 return field.t.html("types." + d4);
81261 enter.append("div").attr("class", "preset-input-directionalcombo-wrap form-field-input-wrap").each(function(key) {
81267 const combo = uiFieldCombo(subField, context);
81268 combo.on("change", (t2) => change(key, t2[key]));
81269 _combos[key] = combo;
81270 select_default2(this).call(combo);
81272 items = items.merge(enter);
81273 wrap2.selectAll(".preset-input-directionalcombo").on("change", change).on("blur", change);
81275 function change(key, newValue) {
81276 const commonKey = field.key;
81277 const otherCommonKey = field.key.endsWith(":both") ? field.key.replace(/:both$/, "") : `${field.key}:both`;
81278 const otherKey = key === field.keys[0] ? field.keys[1] : field.keys[0];
81279 dispatch14.call("change", this, (tags) => {
81280 const otherValue = tags[otherKey] || tags[commonKey] || tags[otherCommonKey];
81281 if (newValue === otherValue) {
81282 tags[commonKey] = newValue;
81284 delete tags[otherKey];
81285 delete tags[otherCommonKey];
81287 tags[key] = newValue;
81288 delete tags[commonKey];
81289 delete tags[otherCommonKey];
81290 tags[otherKey] = otherValue;
81295 directionalCombo.tags = function(tags) {
81297 const commonKey = field.key.replace(/:both$/, "");
81298 for (let key in _combos) {
81299 const uniqueValues = [...new Set([].concat(_tags[commonKey]).concat(_tags[`${commonKey}:both`]).concat(_tags[key]).filter(Boolean))];
81300 _combos[key].tags({ [key]: uniqueValues.length > 1 ? uniqueValues : uniqueValues[0] });
81303 directionalCombo.focus = function() {
81304 var node = wrap2.selectAll("input").node();
81305 if (node) node.focus();
81307 return utilRebind(directionalCombo, dispatch14, "on");
81309 var init_directional_combo = __esm({
81310 "modules/ui/fields/directional_combo.js"() {
81319 // modules/ui/fields/lanes.js
81320 var lanes_exports2 = {};
81321 __export(lanes_exports2, {
81322 uiFieldLanes: () => uiFieldLanes
81324 function uiFieldLanes(field, context) {
81325 var dispatch14 = dispatch_default("change");
81326 var LANE_WIDTH = 40;
81327 var LANE_HEIGHT = 200;
81328 var _entityIDs = [];
81329 function lanes(selection2) {
81330 var lanesData = context.entity(_entityIDs[0]).lanes();
81331 if (!context.container().select(".inspector-wrap.inspector-hidden").empty() || !selection2.node().parentNode) {
81332 selection2.call(lanes.off);
81335 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
81336 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
81337 var surface = wrap2.selectAll(".surface").data([0]);
81338 var d4 = utilGetDimensions(wrap2);
81339 var freeSpace = d4[0] - lanesData.lanes.length * LANE_WIDTH * 1.5 + LANE_WIDTH * 0.5;
81340 surface = surface.enter().append("svg").attr("width", d4[0]).attr("height", 300).attr("class", "surface").merge(surface);
81341 var lanesSelection = surface.selectAll(".lanes").data([0]);
81342 lanesSelection = lanesSelection.enter().append("g").attr("class", "lanes").merge(lanesSelection);
81343 lanesSelection.attr("transform", function() {
81344 return "translate(" + freeSpace / 2 + ", 0)";
81346 var lane = lanesSelection.selectAll(".lane").data(lanesData.lanes);
81347 lane.exit().remove();
81348 var enter = lane.enter().append("g").attr("class", "lane");
81349 enter.append("g").append("rect").attr("y", 50).attr("width", LANE_WIDTH).attr("height", LANE_HEIGHT);
81350 enter.append("g").attr("class", "forward").append("text").attr("y", 40).attr("x", 14).text("\u25B2");
81351 enter.append("g").attr("class", "bothways").append("text").attr("y", 40).attr("x", 14).text("\u25B2\u25BC");
81352 enter.append("g").attr("class", "backward").append("text").attr("y", 40).attr("x", 14).text("\u25BC");
81353 lane = lane.merge(enter);
81354 lane.attr("transform", function(d5) {
81355 return "translate(" + LANE_WIDTH * d5.index * 1.5 + ", 0)";
81357 lane.select(".forward").style("visibility", function(d5) {
81358 return d5.direction === "forward" ? "visible" : "hidden";
81360 lane.select(".bothways").style("visibility", function(d5) {
81361 return d5.direction === "bothways" ? "visible" : "hidden";
81363 lane.select(".backward").style("visibility", function(d5) {
81364 return d5.direction === "backward" ? "visible" : "hidden";
81367 lanes.entityIDs = function(val) {
81370 lanes.tags = function() {
81372 lanes.focus = function() {
81374 lanes.off = function() {
81376 return utilRebind(lanes, dispatch14, "on");
81378 var init_lanes2 = __esm({
81379 "modules/ui/fields/lanes.js"() {
81384 uiFieldLanes.supportsMultiselection = false;
81388 // modules/ui/fields/localized.js
81389 var localized_exports = {};
81390 __export(localized_exports, {
81391 LANGUAGE_SUFFIX_REGEX: () => LANGUAGE_SUFFIX_REGEX,
81392 uiFieldLocalized: () => uiFieldLocalized
81394 function uiFieldLocalized(field, context) {
81395 var dispatch14 = dispatch_default("change", "input");
81396 var wikipedia = services.wikipedia;
81397 var input = select_default2(null);
81398 var localizedInputs = select_default2(null);
81399 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
81402 _mainFileFetcher.get("languages").then(loadLanguagesArray).catch(function() {
81404 var _territoryLanguages = {};
81405 _mainFileFetcher.get("territory_languages").then(function(d4) {
81406 _territoryLanguages = d4;
81407 }).catch(function() {
81409 var langCombo = uiCombobox(context, "localized-lang").fetcher(fetchLanguages).minItems(0);
81410 var _selection = select_default2(null);
81411 var _multilingual = [];
81412 var _buttonTip = uiTooltip().title(() => _t.append("translate.translate")).placement("left");
81414 var _entityIDs = [];
81415 function loadLanguagesArray(dataLanguages) {
81416 if (_languagesArray.length !== 0) return;
81417 var replacements = {
81419 // in OSM, `sr` implies Cyrillic
81421 // `sr-Cyrl` isn't used in OSM
81423 for (var code in dataLanguages) {
81424 if (replacements[code] === false) continue;
81425 var metaCode = code;
81426 if (replacements[code]) metaCode = replacements[code];
81427 _languagesArray.push({
81428 localName: _mainLocalizer.languageName(metaCode, { localOnly: true }),
81429 nativeName: dataLanguages[metaCode].nativeName,
81431 label: _mainLocalizer.languageName(metaCode)
81435 function calcLocked() {
81436 var isLocked = field.id === "name" && _entityIDs.length && _entityIDs.some(function(entityID) {
81437 var entity = context.graph().hasEntity(entityID);
81438 if (!entity) return false;
81439 if (entity.tags.wikidata) return true;
81440 if (entity.tags["name:etymology:wikidata"]) return true;
81441 var preset = _mainPresetIndex.match(entity, context.graph());
81443 var isSuggestion = preset.suggestion;
81444 var fields = preset.fields(entity.extent(context.graph()).center());
81445 var showsBrandField = fields.some(function(d4) {
81446 return d4.id === "brand";
81448 var showsOperatorField = fields.some(function(d4) {
81449 return d4.id === "operator";
81451 var setsName = preset.addTags.name;
81452 var setsBrandWikidata = preset.addTags["brand:wikidata"];
81453 var setsOperatorWikidata = preset.addTags["operator:wikidata"];
81454 return isSuggestion && setsName && (setsBrandWikidata && !showsBrandField || setsOperatorWikidata && !showsOperatorField);
81458 field.locked(isLocked);
81460 function calcMultilingual(tags) {
81461 var existingLangsOrdered = _multilingual.map(function(item2) {
81464 var existingLangs = new Set(existingLangsOrdered.filter(Boolean));
81465 for (var k2 in tags) {
81466 var m3 = k2.match(LANGUAGE_SUFFIX_REGEX);
81467 if (m3 && m3[1] === field.key && m3[2]) {
81468 var item = { lang: m3[2], value: tags[k2] };
81469 if (existingLangs.has(item.lang)) {
81470 _multilingual[existingLangsOrdered.indexOf(item.lang)].value = item.value;
81471 existingLangs.delete(item.lang);
81473 _multilingual.push(item);
81477 _multilingual.forEach(function(item2) {
81478 if (item2.lang && existingLangs.has(item2.lang)) {
81483 function localized(selection2) {
81484 _selection = selection2;
81486 var isLocked = field.locked();
81487 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
81488 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
81489 input = wrap2.selectAll(".localized-main").data([0]);
81490 input = input.enter().append("input").attr("type", "text").attr("dir", "auto").attr("id", field.domId).attr("class", "localized-main").call(utilNoAuto).merge(input);
81491 input.classed("disabled", !!isLocked).attr("readonly", isLocked || null).on("input", change(true)).on("blur", change()).on("change", change());
81492 wrap2.call(_lengthIndicator);
81493 var translateButton = wrap2.selectAll(".localized-add").data([0]);
81494 translateButton = translateButton.enter().append("button").attr("class", "localized-add form-field-button").attr("aria-label", _t("icons.plus")).call(svgIcon("#iD-icon-plus")).merge(translateButton);
81495 translateButton.classed("disabled", !!isLocked).call(isLocked ? _buttonTip.destroy : _buttonTip).on("click", addNew);
81496 if (_tags && !_multilingual.length) {
81497 calcMultilingual(_tags);
81499 localizedInputs = selection2.selectAll(".localized-multilingual").data([0]);
81500 localizedInputs = localizedInputs.enter().append("div").attr("class", "localized-multilingual").merge(localizedInputs);
81501 localizedInputs.call(renderMultilingual);
81502 localizedInputs.selectAll("button, input").classed("disabled", !!isLocked).attr("readonly", isLocked || null);
81503 selection2.selectAll(".combobox-caret").classed("nope", true);
81504 function addNew(d3_event) {
81505 d3_event.preventDefault();
81506 if (field.locked()) return;
81507 var defaultLang = _mainLocalizer.languageCode().toLowerCase();
81508 var langExists = _multilingual.find(function(datum2) {
81509 return datum2.lang === defaultLang;
81511 var isLangEn = defaultLang.indexOf("en") > -1;
81512 if (isLangEn || langExists) {
81514 langExists = _multilingual.find(function(datum2) {
81515 return datum2.lang === defaultLang;
81519 _multilingual.unshift({ lang: defaultLang, value: "" });
81520 localizedInputs.call(renderMultilingual);
81523 function change(onInput) {
81524 return function(d3_event) {
81525 if (field.locked()) {
81526 d3_event.preventDefault();
81529 var val = utilGetSetValue(select_default2(this));
81530 if (!onInput) val = context.cleanTagValue(val);
81531 if (!val && Array.isArray(_tags[field.key])) return;
81533 t2[field.key] = val || void 0;
81534 dispatch14.call("change", this, t2, onInput);
81538 function key(lang) {
81539 return field.key + ":" + lang;
81541 function changeLang(d3_event, d4) {
81543 var lang = utilGetSetValue(select_default2(this)).toLowerCase();
81544 var language = _languagesArray.find(function(d5) {
81545 return d5.label.toLowerCase() === lang || d5.localName && d5.localName.toLowerCase() === lang || d5.nativeName && d5.nativeName.toLowerCase() === lang;
81547 if (language) lang = language.code;
81548 if (d4.lang && d4.lang !== lang) {
81549 tags[key(d4.lang)] = void 0;
81551 var newKey = lang && context.cleanTagKey(key(lang));
81552 var value = utilGetSetValue(select_default2(this.parentNode).selectAll(".localized-value"));
81553 if (newKey && value) {
81554 tags[newKey] = value;
81555 } else if (newKey && _wikiTitles && _wikiTitles[d4.lang]) {
81556 tags[newKey] = _wikiTitles[d4.lang];
81559 dispatch14.call("change", this, tags);
81561 function changeValue(d3_event, d4) {
81562 if (!d4.lang) return;
81563 var value = context.cleanTagValue(utilGetSetValue(select_default2(this))) || void 0;
81564 if (!value && Array.isArray(d4.value)) return;
81566 t2[key(d4.lang)] = value;
81568 dispatch14.call("change", this, t2);
81570 function fetchLanguages(value, cb) {
81571 var v3 = value.toLowerCase();
81572 var langCodes = [_mainLocalizer.localeCode(), _mainLocalizer.languageCode()];
81573 if (_countryCode && _territoryLanguages[_countryCode]) {
81574 langCodes = langCodes.concat(_territoryLanguages[_countryCode]);
81576 var langItems = [];
81577 langCodes.forEach(function(code) {
81578 var langItem = _languagesArray.find(function(item) {
81579 return item.code === code;
81581 if (langItem) langItems.push(langItem);
81583 langItems = utilArrayUniq(langItems.concat(_languagesArray));
81584 cb(langItems.filter(function(d4) {
81585 return d4.label.toLowerCase().indexOf(v3) >= 0 || d4.localName && d4.localName.toLowerCase().indexOf(v3) >= 0 || d4.nativeName && d4.nativeName.toLowerCase().indexOf(v3) >= 0 || d4.code.toLowerCase().indexOf(v3) >= 0;
81586 }).map(function(d4) {
81587 return { value: d4.label };
81590 function renderMultilingual(selection2) {
81591 var entries = selection2.selectAll("div.entry").data(_multilingual, function(d4) {
81594 entries.exit().style("top", "0").style("max-height", "240px").transition().duration(200).style("opacity", "0").style("max-height", "0px").remove();
81595 var entriesEnter = entries.enter().append("div").attr("class", "entry").each(function(_3, index) {
81596 var wrap2 = select_default2(this);
81597 var domId = utilUniqueDomId(index);
81598 var label = wrap2.append("label").attr("class", "field-label").attr("for", domId);
81599 var text = label.append("span").attr("class", "label-text");
81600 text.append("span").attr("class", "label-textvalue").call(_t.append("translate.localized_translation_label"));
81601 text.append("span").attr("class", "label-textannotation");
81602 label.append("button").attr("class", "remove-icon-multilingual").attr("title", _t("icons.remove")).on("click", function(d3_event, d4) {
81603 if (field.locked()) return;
81604 d3_event.preventDefault();
81605 _multilingual.splice(_multilingual.indexOf(d4), 1);
81606 var langKey = d4.lang && key(d4.lang);
81607 if (langKey && langKey in _tags) {
81608 delete _tags[langKey];
81610 t2[langKey] = void 0;
81611 dispatch14.call("change", this, t2);
81614 renderMultilingual(selection2);
81615 }).call(svgIcon("#iD-operation-delete"));
81616 wrap2.append("input").attr("class", "localized-lang").attr("id", domId).attr("type", "text").attr("placeholder", _t("translate.localized_translation_language")).on("blur", changeLang).on("change", changeLang).call(langCombo);
81617 wrap2.append("input").attr("type", "text").attr("dir", "auto").attr("class", "localized-value").on("blur", changeValue).on("change", changeValue);
81619 entriesEnter.style("margin-top", "0px").style("max-height", "0px").style("opacity", "0").transition().duration(200).style("margin-top", "10px").style("max-height", "240px").style("opacity", "1").on("end", function() {
81620 select_default2(this).style("max-height", "").style("overflow", "visible");
81622 entries = entries.merge(entriesEnter);
81624 entries.classed("present", true);
81625 utilGetSetValue(entries.select(".localized-lang"), function(d4) {
81626 var langItem = _languagesArray.find(function(item) {
81627 return item.code === d4.lang;
81629 if (langItem) return langItem.label;
81632 utilGetSetValue(entries.select(".localized-value"), function(d4) {
81633 return typeof d4.value === "string" ? d4.value : "";
81634 }).attr("title", function(d4) {
81635 return Array.isArray(d4.value) ? d4.value.filter(Boolean).join("\n") : null;
81636 }).attr("placeholder", function(d4) {
81637 return Array.isArray(d4.value) ? _t("inspector.multiple_values") : _t("translate.localized_translation_name");
81638 }).attr("lang", function(d4) {
81640 }).classed("mixed", function(d4) {
81641 return Array.isArray(d4.value);
81644 localized.tags = function(tags) {
81646 if (typeof tags.wikipedia === "string" && !_wikiTitles) {
81648 var wm = tags.wikipedia.match(/([^:]+):(.+)/);
81649 if (wm && wm[0] && wm[1]) {
81650 wikipedia.translations(wm[1], wm[2], function(err, d4) {
81651 if (err || !d4) return;
81656 var isMixed = Array.isArray(tags[field.key]);
81657 utilGetSetValue(input, typeof tags[field.key] === "string" ? tags[field.key] : "").attr("title", isMixed ? tags[field.key].filter(Boolean).join("\n") : void 0).attr("placeholder", isMixed ? _t("inspector.multiple_values") : field.placeholder()).classed("mixed", isMixed);
81658 calcMultilingual(tags);
81659 _selection.call(localized);
81661 _lengthIndicator.update(tags[field.key]);
81664 localized.focus = function() {
81665 input.node().focus();
81667 localized.entityIDs = function(val) {
81668 if (!arguments.length) return _entityIDs;
81670 _multilingual = [];
81674 function loadCountryCode() {
81675 var extent = combinedEntityExtent();
81676 var countryCode = extent && iso1A2Code(extent.center());
81677 _countryCode = countryCode && countryCode.toLowerCase();
81679 function combinedEntityExtent() {
81680 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
81682 return utilRebind(localized, dispatch14, "on");
81684 var _languagesArray, LANGUAGE_SUFFIX_REGEX;
81685 var init_localized = __esm({
81686 "modules/ui/fields/localized.js"() {
81690 init_country_coder();
81692 init_file_fetcher();
81699 init_length_indicator();
81700 _languagesArray = [];
81701 LANGUAGE_SUFFIX_REGEX = /^(.*):([a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2})?)$/;
81705 // modules/ui/fields/roadheight.js
81706 var roadheight_exports = {};
81707 __export(roadheight_exports, {
81708 uiFieldRoadheight: () => uiFieldRoadheight
81710 function uiFieldRoadheight(field, context) {
81711 var dispatch14 = dispatch_default("change");
81712 var primaryUnitInput = select_default2(null);
81713 var primaryInput = select_default2(null);
81714 var secondaryInput = select_default2(null);
81715 var secondaryUnitInput = select_default2(null);
81716 var _entityIDs = [];
81719 var formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
81720 var parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
81721 var primaryUnits = [
81724 title: _t("inspector.roadheight.meter")
81728 title: _t("inspector.roadheight.foot")
81731 var unitCombo = uiCombobox(context, "roadheight-unit").data(primaryUnits);
81732 function roadheight(selection2) {
81733 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
81734 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
81735 primaryInput = wrap2.selectAll("input.roadheight-number").data([0]);
81736 primaryInput = primaryInput.enter().append("input").attr("type", "text").attr("class", "roadheight-number").attr("id", field.domId).call(utilNoAuto).merge(primaryInput);
81737 primaryInput.on("change", change).on("blur", change);
81738 var loc = combinedEntityExtent().center();
81739 _isImperial = roadHeightUnit(loc) === "ft";
81740 primaryUnitInput = wrap2.selectAll("input.roadheight-unit").data([0]);
81741 primaryUnitInput = primaryUnitInput.enter().append("input").attr("type", "text").attr("class", "roadheight-unit").call(unitCombo).merge(primaryUnitInput);
81742 primaryUnitInput.on("blur", changeUnits).on("change", changeUnits);
81743 secondaryInput = wrap2.selectAll("input.roadheight-secondary-number").data([0]);
81744 secondaryInput = secondaryInput.enter().append("input").attr("type", "text").attr("class", "roadheight-secondary-number").call(utilNoAuto).merge(secondaryInput);
81745 secondaryInput.on("change", change).on("blur", change);
81746 secondaryUnitInput = wrap2.selectAll("input.roadheight-secondary-unit").data([0]);
81747 secondaryUnitInput = secondaryUnitInput.enter().append("input").attr("type", "text").call(utilNoAuto).classed("disabled", true).classed("roadheight-secondary-unit", true).attr("readonly", "readonly").merge(secondaryUnitInput);
81748 function changeUnits() {
81749 var primaryUnit = utilGetSetValue(primaryUnitInput);
81750 if (primaryUnit === "m") {
81751 _isImperial = false;
81752 } else if (primaryUnit === "ft") {
81753 _isImperial = true;
81755 utilGetSetValue(primaryUnitInput, _isImperial ? "ft" : "m");
81756 setUnitSuggestions();
81760 function setUnitSuggestions() {
81761 utilGetSetValue(primaryUnitInput, _isImperial ? "ft" : "m");
81763 function change() {
81765 var primaryValue = utilGetSetValue(primaryInput).trim();
81766 var secondaryValue = utilGetSetValue(secondaryInput).trim();
81767 if (!primaryValue && !secondaryValue && Array.isArray(_tags[field.key])) return;
81768 if (!primaryValue && !secondaryValue) {
81769 tag[field.key] = void 0;
81771 var rawPrimaryValue = likelyRawNumberFormat.test(primaryValue) ? parseFloat(primaryValue) : parseLocaleFloat(primaryValue);
81772 if (isNaN(rawPrimaryValue)) rawPrimaryValue = primaryValue;
81773 var rawSecondaryValue = likelyRawNumberFormat.test(secondaryValue) ? parseFloat(secondaryValue) : parseLocaleFloat(secondaryValue);
81774 if (isNaN(rawSecondaryValue)) rawSecondaryValue = secondaryValue;
81775 if (isNaN(rawPrimaryValue) || isNaN(rawSecondaryValue) || !_isImperial) {
81776 tag[field.key] = context.cleanTagValue(rawPrimaryValue);
81778 if (rawPrimaryValue !== "") {
81779 rawPrimaryValue = rawPrimaryValue + "'";
81781 if (rawSecondaryValue !== "") {
81782 rawSecondaryValue = rawSecondaryValue + '"';
81784 tag[field.key] = context.cleanTagValue(rawPrimaryValue + rawSecondaryValue);
81787 dispatch14.call("change", this, tag);
81789 roadheight.tags = function(tags) {
81791 var primaryValue = tags[field.key];
81792 var secondaryValue;
81793 var isMixed = Array.isArray(primaryValue);
81795 if (primaryValue && (primaryValue.indexOf("'") >= 0 || primaryValue.indexOf('"') >= 0)) {
81796 secondaryValue = primaryValue.match(/(-?[\d.]+)"/);
81797 if (secondaryValue !== null) {
81798 secondaryValue = formatFloat(parseFloat(secondaryValue[1]));
81800 primaryValue = primaryValue.match(/(-?[\d.]+)'/);
81801 if (primaryValue !== null) {
81802 primaryValue = formatFloat(parseFloat(primaryValue[1]));
81804 _isImperial = true;
81805 } else if (primaryValue) {
81806 var rawValue = primaryValue;
81807 primaryValue = parseFloat(rawValue);
81808 if (isNaN(primaryValue)) {
81809 primaryValue = rawValue;
81811 primaryValue = formatFloat(primaryValue);
81813 _isImperial = false;
81816 setUnitSuggestions();
81817 var inchesPlaceholder = formatFloat(0);
81818 utilGetSetValue(primaryInput, typeof primaryValue === "string" ? primaryValue : "").attr("title", isMixed ? primaryValue.filter(Boolean).join("\n") : null).attr("placeholder", isMixed ? _t("inspector.multiple_values") : _t("inspector.unknown")).classed("mixed", isMixed);
81819 utilGetSetValue(secondaryInput, typeof secondaryValue === "string" ? secondaryValue : "").attr("placeholder", isMixed ? _t("inspector.multiple_values") : _isImperial ? inchesPlaceholder : null).classed("mixed", isMixed).classed("disabled", !_isImperial).attr("readonly", _isImperial ? null : "readonly");
81820 secondaryUnitInput.attr("value", _isImperial ? _t("inspector.roadheight.inch") : null);
81822 roadheight.focus = function() {
81823 primaryInput.node().focus();
81825 roadheight.entityIDs = function(val) {
81828 function combinedEntityExtent() {
81829 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
81831 return utilRebind(roadheight, dispatch14, "on");
81833 var init_roadheight = __esm({
81834 "modules/ui/fields/roadheight.js"() {
81838 init_country_coder();
81846 // modules/ui/fields/roadspeed.js
81847 var roadspeed_exports = {};
81848 __export(roadspeed_exports, {
81849 uiFieldRoadspeed: () => uiFieldRoadspeed
81851 function uiFieldRoadspeed(field, context) {
81852 var dispatch14 = dispatch_default("change");
81853 var unitInput = select_default2(null);
81854 var input = select_default2(null);
81855 var _entityIDs = [];
81858 var formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
81859 var parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
81860 var speedCombo = uiCombobox(context, "roadspeed");
81861 var unitCombo = uiCombobox(context, "roadspeed-unit").data(["km/h", "mph"].map(comboValues));
81862 var metricValues = [20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120];
81863 var imperialValues = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80];
81864 function roadspeed(selection2) {
81865 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
81866 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
81867 input = wrap2.selectAll("input.roadspeed-number").data([0]);
81868 input = input.enter().append("input").attr("type", "text").attr("class", "roadspeed-number").attr("id", field.domId).call(utilNoAuto).call(speedCombo).merge(input);
81869 input.on("change", change).on("blur", change);
81870 var loc = combinedEntityExtent().center();
81871 _isImperial = roadSpeedUnit(loc) === "mph";
81872 unitInput = wrap2.selectAll("input.roadspeed-unit").data([0]);
81873 unitInput = unitInput.enter().append("input").attr("type", "text").attr("class", "roadspeed-unit").attr("aria-label", _t("inspector.speed_unit")).call(unitCombo).merge(unitInput);
81874 unitInput.on("blur", changeUnits).on("change", changeUnits);
81875 function changeUnits() {
81876 var unit2 = utilGetSetValue(unitInput);
81877 if (unit2 === "km/h") {
81878 _isImperial = false;
81879 } else if (unit2 === "mph") {
81880 _isImperial = true;
81882 utilGetSetValue(unitInput, _isImperial ? "mph" : "km/h");
81883 setUnitSuggestions();
81887 function setUnitSuggestions() {
81888 speedCombo.data((_isImperial ? imperialValues : metricValues).map(comboValues));
81889 utilGetSetValue(unitInput, _isImperial ? "mph" : "km/h");
81891 function comboValues(d4) {
81893 value: formatFloat(d4),
81894 title: formatFloat(d4)
81897 function change() {
81899 var value = utilGetSetValue(input).trim();
81900 if (!value && Array.isArray(_tags[field.key])) return;
81902 tag[field.key] = void 0;
81904 var rawValue = likelyRawNumberFormat.test(value) ? parseFloat(value) : parseLocaleFloat(value);
81905 if (isNaN(rawValue)) rawValue = value;
81906 if (isNaN(rawValue) || !_isImperial) {
81907 tag[field.key] = context.cleanTagValue(rawValue);
81909 tag[field.key] = context.cleanTagValue(rawValue + " mph");
81912 dispatch14.call("change", this, tag);
81914 roadspeed.tags = function(tags) {
81916 var rawValue = tags[field.key];
81917 var value = rawValue;
81918 var isMixed = Array.isArray(value);
81920 if (rawValue && rawValue.indexOf("mph") >= 0) {
81921 _isImperial = true;
81922 } else if (rawValue) {
81923 _isImperial = false;
81925 value = parseInt(value, 10);
81926 if (isNaN(value)) {
81929 value = formatFloat(value);
81932 setUnitSuggestions();
81933 utilGetSetValue(input, typeof value === "string" ? value : "").attr("title", isMixed ? value.filter(Boolean).join("\n") : null).attr("placeholder", isMixed ? _t("inspector.multiple_values") : field.placeholder()).classed("mixed", isMixed);
81935 roadspeed.focus = function() {
81936 input.node().focus();
81938 roadspeed.entityIDs = function(val) {
81941 function combinedEntityExtent() {
81942 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
81944 return utilRebind(roadspeed, dispatch14, "on");
81946 var init_roadspeed = __esm({
81947 "modules/ui/fields/roadspeed.js"() {
81951 init_country_coder();
81959 // modules/ui/fields/radio.js
81960 var radio_exports = {};
81961 __export(radio_exports, {
81962 uiFieldRadio: () => uiFieldRadio,
81963 uiFieldStructureRadio: () => uiFieldRadio
81965 function uiFieldRadio(field, context) {
81966 var dispatch14 = dispatch_default("change");
81967 var placeholder = select_default2(null);
81968 var wrap2 = select_default2(null);
81969 var labels = select_default2(null);
81970 var radios = select_default2(null);
81971 var strings = field.resolveReference("stringsCrossReference");
81972 var radioData = (field.options || strings.options || field.keys).slice();
81976 var _entityIDs = [];
81977 function selectedKey() {
81978 var node = wrap2.selectAll(".form-field-input-radio label.active input");
81979 return !node.empty() && node.datum();
81981 function radio(selection2) {
81982 selection2.classed("preset-radio", true);
81983 wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
81984 var enter = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-radio");
81985 enter.append("span").attr("class", "placeholder");
81986 wrap2 = wrap2.merge(enter);
81987 placeholder = wrap2.selectAll(".placeholder");
81988 labels = wrap2.selectAll("label").data(radioData);
81989 enter = labels.enter().append("label");
81990 enter.append("input").attr("type", "radio").attr("name", field.id).attr("value", function(d4) {
81991 return strings.t("options." + d4, { "default": d4 });
81992 }).attr("checked", false);
81993 enter.append("span").each(function(d4) {
81994 strings.t.append("options." + d4, { "default": d4 })(select_default2(this));
81996 labels = labels.merge(enter);
81997 radios = labels.selectAll("input").on("change", changeRadio);
81999 function structureExtras(selection2, tags) {
82000 var selected = selectedKey() || tags.layer !== void 0;
82001 var type2 = _mainPresetIndex.field(selected);
82002 var layer = _mainPresetIndex.field("layer");
82003 var showLayer = selected === "bridge" || selected === "tunnel" || tags.layer !== void 0;
82004 var extrasWrap = selection2.selectAll(".structure-extras-wrap").data(selected ? [0] : []);
82005 extrasWrap.exit().remove();
82006 extrasWrap = extrasWrap.enter().append("div").attr("class", "structure-extras-wrap").merge(extrasWrap);
82007 var list = extrasWrap.selectAll("ul").data([0]);
82008 list = list.enter().append("ul").attr("class", "rows").merge(list);
82010 if (!typeField || typeField.id !== selected) {
82011 typeField = uiField(context, type2, _entityIDs, { wrap: false }).on("change", changeType);
82013 typeField.tags(tags);
82017 var typeItem = list.selectAll(".structure-type-item").data(typeField ? [typeField] : [], function(d4) {
82020 typeItem.exit().remove();
82021 var typeEnter = typeItem.enter().insert("li", ":first-child").attr("class", "labeled-input structure-type-item");
82022 typeEnter.append("div").attr("class", "label structure-label-type").attr("for", "preset-input-" + selected).call(_t.append("inspector.radio.structure.type"));
82023 typeEnter.append("div").attr("class", "structure-input-type-wrap");
82024 typeItem = typeItem.merge(typeEnter);
82026 typeItem.selectAll(".structure-input-type-wrap").call(typeField.render);
82028 if (layer && showLayer) {
82030 layerField = uiField(context, layer, _entityIDs, { wrap: false }).on("change", changeLayer);
82032 layerField.tags(tags);
82033 field.keys = utilArrayUnion(field.keys, ["layer"]);
82036 field.keys = field.keys.filter(function(k2) {
82037 return k2 !== "layer";
82040 var layerItem = list.selectAll(".structure-layer-item").data(layerField ? [layerField] : []);
82041 layerItem.exit().remove();
82042 var layerEnter = layerItem.enter().append("li").attr("class", "labeled-input structure-layer-item");
82043 layerEnter.append("div").attr("class", "label structure-label-layer").attr("for", "preset-input-layer").call(_t.append("inspector.radio.structure.layer"));
82044 layerEnter.append("div").attr("class", "structure-input-layer-wrap");
82045 layerItem = layerItem.merge(layerEnter);
82047 layerItem.selectAll(".structure-input-layer-wrap").call(layerField.render);
82050 function changeType(t2, onInput) {
82051 var key = selectedKey();
82054 if (val !== "no") {
82055 _oldType[key] = val;
82057 if (field.type === "structureRadio") {
82058 if (val === "no" || key !== "bridge" && key !== "tunnel" || key === "tunnel" && val === "building_passage") {
82061 if (t2.layer === void 0) {
82062 if (key === "bridge" && val !== "no") {
82065 if (key === "tunnel" && val !== "no" && val !== "building_passage") {
82070 dispatch14.call("change", this, t2, onInput);
82072 function changeLayer(t2, onInput) {
82073 dispatch14.call("change", this, t2, onInput);
82075 function changeRadio() {
82079 t2[field.key] = void 0;
82081 radios.each(function(d4) {
82082 var active = select_default2(this).property("checked");
82083 if (active) activeKey = d4;
82085 if (active) t2[field.key] = d4;
82087 var val = _oldType[activeKey] || "yes";
82088 t2[d4] = active ? val : void 0;
82091 if (field.type === "structureRadio") {
82092 if (activeKey === "bridge") {
82094 } else if (activeKey === "tunnel" && t2.tunnel !== "building_passage") {
82100 dispatch14.call("change", this, t2);
82102 radio.tags = function(tags) {
82103 function isOptionChecked(d4) {
82105 return tags[field.key] === d4;
82107 return !!(typeof tags[d4] === "string" && tags[d4].toLowerCase() !== "no");
82109 function isMixed(d4) {
82111 return Array.isArray(tags[field.key]) && tags[field.key].includes(d4);
82113 return Array.isArray(tags[d4]);
82115 radios.property("checked", function(d4) {
82116 return isOptionChecked(d4) && (field.key || field.options.filter(isOptionChecked).length === 1);
82118 labels.classed("active", function(d4) {
82120 return Array.isArray(tags[field.key]) && tags[field.key].includes(d4) || tags[field.key] === d4;
82122 return Array.isArray(tags[d4]) && tags[d4].some((v3) => typeof v3 === "string" && v3.toLowerCase() !== "no") || !!(typeof tags[d4] === "string" && tags[d4].toLowerCase() !== "no");
82123 }).classed("mixed", isMixed).attr("title", function(d4) {
82124 return isMixed(d4) ? _t("inspector.unshared_value_tooltip") : null;
82126 var selection2 = radios.filter(function() {
82127 return this.checked;
82129 if (selection2.empty()) {
82130 placeholder.text("");
82131 placeholder.call(_t.append("inspector.none"));
82133 placeholder.text(selection2.attr("value"));
82134 _oldType[selection2.datum()] = tags[selection2.datum()];
82136 if (field.type === "structureRadio") {
82137 if (!!tags.waterway && !_oldType.tunnel) {
82138 _oldType.tunnel = "culvert";
82140 if (!!tags.waterway && !_oldType.bridge) {
82141 _oldType.bridge = "aqueduct";
82143 wrap2.call(structureExtras, tags);
82146 radio.focus = function() {
82147 radios.node().focus();
82149 radio.entityIDs = function(val) {
82150 if (!arguments.length) return _entityIDs;
82155 radio.isAllowed = function() {
82156 return _entityIDs.length === 1;
82158 return utilRebind(radio, dispatch14, "on");
82160 var init_radio = __esm({
82161 "modules/ui/fields/radio.js"() {
82172 // modules/ui/fields/restrictions.js
82173 var restrictions_exports = {};
82174 __export(restrictions_exports, {
82175 uiFieldRestrictions: () => uiFieldRestrictions
82177 function uiFieldRestrictions(field, context) {
82178 var dispatch14 = dispatch_default("change");
82179 var breathe = behaviorBreathe(context);
82180 corePreferences("turn-restriction-via-way", null);
82181 var storedViaWay = corePreferences("turn-restriction-via-way0");
82182 var storedDistance = corePreferences("turn-restriction-distance");
82183 var _maxViaWay = storedViaWay !== null ? +storedViaWay : 0;
82184 var _maxDistance = storedDistance ? +storedDistance : 30;
82185 var _initialized3 = false;
82186 var _parent = select_default2(null);
82187 var _container = select_default2(null);
82194 function restrictions(selection2) {
82195 _parent = selection2;
82196 if (_vertexID && (context.graph() !== _graph || !_intersection)) {
82197 _graph = context.graph();
82198 _intersection = osmIntersection(_graph, _vertexID, _maxDistance);
82200 var isOK = _intersection && _intersection.vertices.length && // has vertices
82201 _intersection.vertices.filter(function(vertex) {
82202 return vertex.id === _vertexID;
82203 }).length && _intersection.ways.length > 2;
82204 select_default2(selection2.node().parentNode).classed("hide", !isOK);
82205 if (!isOK || !context.container().select(".inspector-wrap.inspector-hidden").empty() || !selection2.node().parentNode || !selection2.node().parentNode.parentNode) {
82206 selection2.call(restrictions.off);
82209 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
82210 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
82211 var container = wrap2.selectAll(".restriction-container").data([0]);
82212 var containerEnter = container.enter().append("div").attr("class", "restriction-container");
82213 containerEnter.append("div").attr("class", "restriction-help");
82214 _container = containerEnter.merge(container).call(renderViewer);
82215 var controls = wrap2.selectAll(".restriction-controls").data([0]);
82216 controls.enter().append("div").attr("class", "restriction-controls-container").append("div").attr("class", "restriction-controls").merge(controls).call(renderControls);
82218 function renderControls(selection2) {
82219 var distControl = selection2.selectAll(".restriction-distance").data([0]);
82220 distControl.exit().remove();
82221 var distControlEnter = distControl.enter().append("div").attr("class", "restriction-control restriction-distance");
82222 distControlEnter.append("span").attr("class", "restriction-control-label restriction-distance-label").call(_t.append("restriction.controls.distance", { suffix: ":" }));
82223 distControlEnter.append("input").attr("class", "restriction-distance-input").attr("type", "range").attr("min", "20").attr("max", "50").attr("step", "5");
82224 distControlEnter.append("span").attr("class", "restriction-distance-text");
82225 selection2.selectAll(".restriction-distance-input").property("value", _maxDistance).on("input", function() {
82226 var val = select_default2(this).property("value");
82227 _maxDistance = +val;
82228 _intersection = null;
82229 _container.selectAll(".layer-osm .layer-turns *").remove();
82230 corePreferences("turn-restriction-distance", _maxDistance);
82231 _parent.call(restrictions);
82233 selection2.selectAll(".restriction-distance-text").call(displayMaxDistance(_maxDistance));
82234 var viaControl = selection2.selectAll(".restriction-via-way").data([0]);
82235 viaControl.exit().remove();
82236 var viaControlEnter = viaControl.enter().append("div").attr("class", "restriction-control restriction-via-way");
82237 viaControlEnter.append("span").attr("class", "restriction-control-label restriction-via-way-label").call(_t.append("restriction.controls.via", { suffix: ":" }));
82238 viaControlEnter.append("input").attr("class", "restriction-via-way-input").attr("type", "range").attr("min", "0").attr("max", "2").attr("step", "1");
82239 viaControlEnter.append("span").attr("class", "restriction-via-way-text");
82240 selection2.selectAll(".restriction-via-way-input").property("value", _maxViaWay).on("input", function() {
82241 var val = select_default2(this).property("value");
82243 _container.selectAll(".layer-osm .layer-turns *").remove();
82244 corePreferences("turn-restriction-via-way0", _maxViaWay);
82245 _parent.call(restrictions);
82247 selection2.selectAll(".restriction-via-way-text").call(displayMaxVia(_maxViaWay));
82249 function renderViewer(selection2) {
82250 if (!_intersection) return;
82251 var vgraph = _intersection.graph;
82252 var filter2 = utilFunctor(true);
82253 var projection2 = geoRawMercator();
82254 var sdims = utilGetDimensions(context.container().select(".sidebar"));
82255 var d4 = [sdims[0] - 50, 370];
82256 var c2 = geoVecScale(d4, 0.5);
82258 projection2.scale(geoZoomToScale(z3));
82259 var extent = geoExtent();
82260 for (var i3 = 0; i3 < _intersection.vertices.length; i3++) {
82261 extent._extend(_intersection.vertices[i3].extent());
82264 if (_intersection.vertices.length > 1) {
82265 var hPadding = Math.min(160, Math.max(110, d4[0] * 0.4));
82266 var vPadding = 160;
82267 var tl = projection2([extent[0][0], extent[1][1]]);
82268 var br = projection2([extent[1][0], extent[0][1]]);
82269 var hFactor = (br[0] - tl[0]) / (d4[0] - hPadding);
82270 var vFactor = (br[1] - tl[1]) / (d4[1] - vPadding - padTop);
82271 var hZoomDiff = Math.log(Math.abs(hFactor)) / Math.LN2;
82272 var vZoomDiff = Math.log(Math.abs(vFactor)) / Math.LN2;
82273 z3 = z3 - Math.max(hZoomDiff, vZoomDiff);
82274 projection2.scale(geoZoomToScale(z3));
82276 var extentCenter = projection2(extent.center());
82277 extentCenter[1] = extentCenter[1] - padTop / 2;
82278 projection2.translate(geoVecSubtract(c2, extentCenter)).clipExtent([[0, 0], d4]);
82279 var drawLayers = svgLayers(projection2, context).only(["osm", "touch"]).dimensions(d4);
82280 var drawVertices = svgVertices(projection2, context);
82281 var drawLines = svgLines(projection2, context);
82282 var drawTurns = svgTurns(projection2, context);
82283 var firstTime = selection2.selectAll(".surface").empty();
82284 selection2.call(drawLayers);
82285 var surface = selection2.selectAll(".surface").classed("tr", true);
82287 _initialized3 = true;
82288 surface.call(breathe);
82290 if (_fromWayID && !vgraph.hasEntity(_fromWayID)) {
82294 surface.call(utilSetDimensions, d4).call(drawVertices, vgraph, _intersection.vertices, filter2, extent, z3).call(drawLines, vgraph, _intersection.ways, filter2).call(drawTurns, vgraph, _intersection.turns(_fromWayID, _maxViaWay));
82295 surface.on("click.restrictions", click).on("mouseover.restrictions", mouseover);
82296 surface.selectAll(".selected").classed("selected", false);
82297 surface.selectAll(".related").classed("related", false);
82300 way = vgraph.entity(_fromWayID);
82301 surface.selectAll("." + _fromWayID).classed("selected", true).classed("related", true);
82303 document.addEventListener("resizeWindow", function() {
82304 utilSetDimensions(_container, null);
82308 function click(d3_event) {
82309 surface.call(breathe.off).call(breathe);
82310 var datum2 = d3_event.target.__data__;
82311 var entity = datum2 && datum2.properties && datum2.properties.entity;
82315 if (datum2 instanceof osmWay && (datum2.__from || datum2.__via)) {
82316 _fromWayID = datum2.id;
82319 } else if (datum2 instanceof osmTurn) {
82320 var actions, extraActions, turns, i4;
82321 var restrictionType = osmInferRestriction(vgraph, datum2, projection2);
82322 if (datum2.restrictionID && !datum2.direct) {
82324 } else if (datum2.restrictionID && !datum2.only) {
82326 var datumOnly = JSON.parse(JSON.stringify(datum2));
82327 datumOnly.only = true;
82328 restrictionType = restrictionType.replace(/^no/, "only");
82329 turns = _intersection.turns(_fromWayID, 2);
82332 for (i4 = 0; i4 < turns.length; i4++) {
82333 var turn = turns[i4];
82334 if (seen[turn.restrictionID]) continue;
82335 if (turn.direct && turn.path[1] === datum2.path[1]) {
82336 seen[turns[i4].restrictionID] = true;
82337 turn.restrictionType = osmInferRestriction(vgraph, turn, projection2);
82338 _oldTurns.push(turn);
82339 extraActions.push(actionUnrestrictTurn(turn));
82342 actions = _intersection.actions.concat(extraActions, [
82343 actionRestrictTurn(datumOnly, restrictionType),
82344 _t("operations.restriction.annotation.create")
82346 } else if (datum2.restrictionID) {
82347 turns = _oldTurns || [];
82349 for (i4 = 0; i4 < turns.length; i4++) {
82350 if (turns[i4].key !== datum2.key) {
82351 extraActions.push(actionRestrictTurn(turns[i4], turns[i4].restrictionType));
82355 actions = _intersection.actions.concat(extraActions, [
82356 actionUnrestrictTurn(datum2),
82357 _t("operations.restriction.annotation.delete")
82360 actions = _intersection.actions.concat([
82361 actionRestrictTurn(datum2, restrictionType),
82362 _t("operations.restriction.annotation.create")
82365 context.perform.apply(context, actions);
82366 var s2 = surface.selectAll("." + datum2.key);
82367 datum2 = s2.empty() ? null : s2.datum();
82368 updateHints(datum2);
82375 function mouseover(d3_event) {
82376 var datum2 = d3_event.target.__data__;
82377 updateHints(datum2);
82379 _lastXPos = _lastXPos || sdims[0];
82380 function redraw(minChange) {
82383 xPos = utilGetDimensions(context.container().select(".sidebar"))[0];
82385 if (!minChange || minChange && Math.abs(xPos - _lastXPos) >= minChange) {
82386 if (context.hasEntity(_vertexID)) {
82388 _container.call(renderViewer);
82392 function highlightPathsFrom(wayID) {
82393 surface.selectAll(".related").classed("related", false).classed("allow", false).classed("restrict", false).classed("only", false);
82394 surface.selectAll("." + wayID).classed("related", true);
82396 var turns = _intersection.turns(wayID, _maxViaWay);
82397 for (var i4 = 0; i4 < turns.length; i4++) {
82398 var turn = turns[i4];
82399 var ids = [turn.to.way];
82400 var klass = turn.no ? "restrict" : turn.only ? "only" : "allow";
82401 if (turn.only || turns.length === 1) {
82402 if (turn.via.ways) {
82403 ids = ids.concat(turn.via.ways);
82405 } else if (turn.to.way === wayID) {
82408 surface.selectAll(utilEntitySelector(ids)).classed("related", true).classed("allow", klass === "allow").classed("restrict", klass === "restrict").classed("only", klass === "only");
82412 function updateHints(datum2) {
82413 var help = _container.selectAll(".restriction-help").html("");
82414 var placeholders = {};
82415 ["from", "via", "to"].forEach(function(k2) {
82416 placeholders[k2] = { html: '<span class="qualifier">' + _t("restriction.help." + k2) + "</span>" };
82418 var entity = datum2 && datum2.properties && datum2.properties.entity;
82423 way = vgraph.entity(_fromWayID);
82424 surface.selectAll("." + _fromWayID).classed("selected", true).classed("related", true);
82426 if (datum2 instanceof osmWay && datum2.__from) {
82428 highlightPathsFrom(_fromWayID ? null : way.id);
82429 surface.selectAll("." + way.id).classed("related", true);
82430 var clickSelect = !_fromWayID || _fromWayID !== way.id;
82431 help.append("div").html(_t.html("restriction.help." + (clickSelect ? "select_from_name" : "from_name"), {
82432 from: placeholders.from,
82433 fromName: displayName(way.id, vgraph)
82435 } else if (datum2 instanceof osmTurn) {
82436 var restrictionType = osmInferRestriction(vgraph, datum2, projection2);
82437 var turnType = restrictionType.replace(/^(only|no)\_/, "");
82438 var indirect = datum2.direct === false ? _t.html("restriction.help.indirect") : "";
82439 var klass, turnText, nextText;
82441 klass = "restrict";
82442 turnText = _t.html("restriction.help.turn.no_" + turnType, { indirect: { html: indirect } });
82443 nextText = _t.html("restriction.help.turn.only_" + turnType, { indirect: "" });
82444 } else if (datum2.only) {
82446 turnText = _t.html("restriction.help.turn.only_" + turnType, { indirect: { html: indirect } });
82447 nextText = _t.html("restriction.help.turn.allowed_" + turnType, { indirect: "" });
82450 turnText = _t.html("restriction.help.turn.allowed_" + turnType, { indirect: { html: indirect } });
82451 nextText = _t.html("restriction.help.turn.no_" + turnType, { indirect: "" });
82453 help.append("div").attr("class", "qualifier " + klass).html(turnText);
82454 help.append("div").html(_t.html("restriction.help.from_name_to_name", {
82455 from: placeholders.from,
82456 fromName: displayName(datum2.from.way, vgraph),
82457 to: placeholders.to,
82458 toName: displayName(datum2.to.way, vgraph)
82460 if (datum2.via.ways && datum2.via.ways.length) {
82462 for (var i4 = 0; i4 < datum2.via.ways.length; i4++) {
82463 var prev = names[names.length - 1];
82464 var curr = displayName(datum2.via.ways[i4], vgraph);
82465 if (!prev || curr !== prev) {
82469 help.append("div").html(_t.html("restriction.help.via_names", {
82470 via: placeholders.via,
82471 viaNames: names.join(", ")
82475 help.append("div").html(_t.html("restriction.help.toggle", { turn: { html: nextText.trim() } }));
82477 highlightPathsFrom(null);
82478 var alongIDs = datum2.path.slice();
82479 surface.selectAll(utilEntitySelector(alongIDs)).classed("related", true).classed("allow", klass === "allow").classed("restrict", klass === "restrict").classed("only", klass === "only");
82481 highlightPathsFrom(null);
82483 help.append("div").html(_t.html("restriction.help.from_name", {
82484 from: placeholders.from,
82485 fromName: displayName(_fromWayID, vgraph)
82488 help.append("div").html(_t.html("restriction.help.select_from", {
82489 from: placeholders.from
82495 function displayMaxDistance(maxDist) {
82496 return (selection2) => {
82497 var isImperial = !_mainLocalizer.usesMetric();
82501 // imprecise conversion for prettier display
82510 opts = { distance: _t("units.feet", { quantity: distToFeet }) };
82512 opts = { distance: _t("units.meters", { quantity: maxDist }) };
82514 return selection2.html("").call(_t.append("restriction.controls.distance_up_to", opts));
82517 function displayMaxVia(maxVia) {
82518 return (selection2) => {
82519 selection2 = selection2.html("");
82520 return maxVia === 0 ? selection2.call(_t.append("restriction.controls.via_node_only")) : maxVia === 1 ? selection2.call(_t.append("restriction.controls.via_up_to_one")) : selection2.call(_t.append("restriction.controls.via_up_to_two"));
82523 function displayName(entityID, graph) {
82524 var entity = graph.entity(entityID);
82525 var name = utilDisplayName(entity) || "";
82526 var matched = _mainPresetIndex.match(entity, graph);
82527 var type2 = matched && matched.name() || utilDisplayType(entity.id);
82528 return name || type2;
82530 restrictions.entityIDs = function(val) {
82531 _intersection = null;
82534 _vertexID = val[0];
82536 restrictions.tags = function() {
82538 restrictions.focus = function() {
82540 restrictions.off = function(selection2) {
82541 if (!_initialized3) return;
82542 selection2.selectAll(".surface").call(breathe.off).on("click.restrictions", null).on("mouseover.restrictions", null);
82543 select_default2(window).on("resize.restrictions", null);
82545 return utilRebind(restrictions, dispatch14, "on");
82547 var init_restrictions = __esm({
82548 "modules/ui/fields/restrictions.js"() {
82553 init_preferences();
82555 init_restrict_turn();
82556 init_unrestrict_turn();
82563 uiFieldRestrictions.supportsMultiselection = false;
82567 // modules/ui/fields/textarea.js
82568 var textarea_exports = {};
82569 __export(textarea_exports, {
82570 uiFieldTextarea: () => uiFieldTextarea
82572 function uiFieldTextarea(field, context) {
82573 var dispatch14 = dispatch_default("change");
82574 var input = select_default2(null);
82575 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue()).silent(field.usage === "changeset" && field.key === "comment");
82577 function textarea(selection2) {
82578 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
82579 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).style("position", "relative").merge(wrap2);
82580 input = wrap2.selectAll("textarea").data([0]);
82581 input = input.enter().append("textarea").attr("dir", "auto").attr("id", field.domId).call(utilNoAuto).on("input", change(true)).on("blur", change()).on("change", change()).merge(input);
82582 wrap2.call(_lengthIndicator);
82583 function change(onInput) {
82584 return function() {
82585 var val = utilGetSetValue(input);
82586 if (!onInput) val = context.cleanTagValue(val);
82587 if (!val && Array.isArray(_tags[field.key])) return;
82589 t2[field.key] = val || void 0;
82590 dispatch14.call("change", this, t2, onInput);
82594 textarea.tags = function(tags) {
82596 var isMixed = Array.isArray(tags[field.key]);
82597 utilGetSetValue(input, !isMixed && tags[field.key] ? tags[field.key] : "").attr("title", isMixed ? tags[field.key].filter(Boolean).join("\n") : void 0).attr("placeholder", isMixed ? _t("inspector.multiple_values") : field.placeholder() || _t("inspector.unknown")).classed("mixed", isMixed);
82599 _lengthIndicator.update(tags[field.key]);
82602 textarea.focus = function() {
82603 input.node().focus();
82605 return utilRebind(textarea, dispatch14, "on");
82607 var init_textarea = __esm({
82608 "modules/ui/fields/textarea.js"() {
82618 // modules/ui/fields/wikidata.js
82619 var wikidata_exports2 = {};
82620 __export(wikidata_exports2, {
82621 uiFieldWikidata: () => uiFieldWikidata
82623 function uiFieldWikidata(field, context) {
82624 var wikidata = services.wikidata;
82625 var dispatch14 = dispatch_default("change");
82626 var _selection = select_default2(null);
82627 var _searchInput = select_default2(null);
82629 var _wikidataEntity = null;
82631 var _entityIDs = [];
82632 var _wikipediaKey = field.keys && field.keys.find(function(key) {
82633 return key.includes("wikipedia");
82635 var _hintKey = field.key === "wikidata" ? "name" : field.key.split(":")[0];
82636 var combobox = uiCombobox(context, "combo-" + field.safeid).caseSensitive(true).minItems(1);
82637 function wiki(selection2) {
82638 _selection = selection2;
82639 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
82640 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
82641 var list = wrap2.selectAll("ul").data([0]);
82642 list = list.enter().append("ul").attr("class", "rows").merge(list);
82643 var searchRow = list.selectAll("li.wikidata-search").data([0]);
82644 var searchRowEnter = searchRow.enter().append("li").attr("class", "wikidata-search");
82645 searchRowEnter.append("input").attr("type", "text").attr("dir", "auto").attr("id", field.domId).style("flex", "1").call(utilNoAuto).on("focus", function() {
82646 var node = select_default2(this).node();
82647 node.setSelectionRange(0, node.value.length);
82648 }).on("blur", function() {
82649 setLabelForEntity();
82650 }).call(combobox.fetcher(fetchWikidataItems));
82651 combobox.on("accept", function(d4) {
82656 }).on("cancel", function() {
82657 setLabelForEntity();
82659 searchRowEnter.append("button").attr("class", "form-field-button wiki-link").attr("title", _t("icons.view_on", { domain: "wikidata.org" })).call(svgIcon("#iD-icon-out-link")).on("click", function(d3_event) {
82660 d3_event.preventDefault();
82661 if (_wikiURL) window.open(_wikiURL, "_blank");
82663 searchRow = searchRow.merge(searchRowEnter);
82664 _searchInput = searchRow.select("input");
82665 var wikidataProperties = ["description", "identifier"];
82666 var items = list.selectAll("li.labeled-input").data(wikidataProperties);
82667 var enter = items.enter().append("li").attr("class", function(d4) {
82668 return "labeled-input preset-wikidata-" + d4;
82670 enter.append("div").attr("class", "label").html(function(d4) {
82671 return _t.html("wikidata." + d4);
82673 enter.append("input").attr("type", "text").attr("dir", "auto").call(utilNoAuto).classed("disabled", "true").attr("readonly", "true");
82674 enter.append("button").attr("class", "form-field-button").attr("title", _t("icons.copy")).call(svgIcon("#iD-operation-copy")).on("click", function(d3_event) {
82675 d3_event.preventDefault();
82676 select_default2(this.parentNode).select("input").node().select();
82677 document.execCommand("copy");
82680 function fetchWikidataItems(q3, callback) {
82681 if (!q3 && _hintKey) {
82682 for (var i3 in _entityIDs) {
82683 var entity = context.hasEntity(_entityIDs[i3]);
82684 if (entity.tags[_hintKey]) {
82685 q3 = entity.tags[_hintKey];
82690 wikidata.itemsForSearchQuery(q3, function(err, data) {
82692 if (err !== "No query") console.error(err);
82695 var result = data.map(function(item) {
82698 value: item.display.label.value + " (" + item.id + ")",
82699 display: (selection2) => selection2.append("span").attr("class", "localized-text").attr("lang", item.display.label.language).text(item.display.label.value),
82700 title: item.display.description && item.display.description.value,
82701 terms: item.aliases
82704 if (callback) callback(result);
82707 function change() {
82709 syncTags[field.key] = _qid;
82710 dispatch14.call("change", this, syncTags);
82711 var initGraph = context.graph();
82712 var initEntityIDs = _entityIDs;
82713 wikidata.entityByQID(_qid, function(err, entity) {
82715 if (context.graph() !== initGraph) return;
82716 if (!entity.sitelinks) return;
82717 var langs = wikidata.languagesToQuery();
82718 ["labels", "descriptions"].forEach(function(key) {
82719 if (!entity[key]) return;
82720 var valueLangs = Object.keys(entity[key]);
82721 if (valueLangs.length === 0) return;
82722 var valueLang = valueLangs[0];
82723 if (langs.indexOf(valueLang) === -1) {
82724 langs.push(valueLang);
82727 var newWikipediaValue;
82728 if (_wikipediaKey) {
82729 var foundPreferred;
82730 for (var i3 in langs) {
82731 var lang = langs[i3];
82732 var siteID = lang.replace("-", "_") + "wiki";
82733 if (entity.sitelinks[siteID]) {
82734 foundPreferred = true;
82735 newWikipediaValue = lang + ":" + entity.sitelinks[siteID].title;
82739 if (!foundPreferred) {
82740 var wikiSiteKeys = Object.keys(entity.sitelinks).filter(function(site) {
82741 return site.endsWith("wiki");
82743 if (wikiSiteKeys.length === 0) {
82744 newWikipediaValue = null;
82746 var wikiLang = wikiSiteKeys[0].slice(0, -4).replace("_", "-");
82747 var wikiTitle = entity.sitelinks[wikiSiteKeys[0]].title;
82748 newWikipediaValue = wikiLang + ":" + wikiTitle;
82752 if (newWikipediaValue) {
82753 newWikipediaValue = context.cleanTagValue(newWikipediaValue);
82755 if (typeof newWikipediaValue === "undefined") return;
82756 var actions = initEntityIDs.map(function(entityID) {
82757 var entity2 = context.hasEntity(entityID);
82758 if (!entity2) return null;
82759 var currTags = Object.assign({}, entity2.tags);
82760 if (newWikipediaValue === null) {
82761 if (!currTags[_wikipediaKey]) return null;
82762 delete currTags[_wikipediaKey];
82764 currTags[_wikipediaKey] = newWikipediaValue;
82766 return actionChangeTags(entityID, currTags);
82767 }).filter(Boolean);
82768 if (!actions.length) return;
82770 function actionUpdateWikipediaTags(graph) {
82771 actions.forEach(function(action) {
82772 graph = action(graph);
82776 context.history().undoAnnotation()
82780 function setLabelForEntity() {
82784 if (_wikidataEntity) {
82785 label = entityPropertyForDisplay(_wikidataEntity, "labels");
82786 if (label.value.length === 0) {
82787 label.value = _wikidataEntity.id.toString();
82790 utilGetSetValue(_searchInput, label.value).attr("lang", label.language);
82792 wiki.tags = function(tags) {
82793 var isMixed = Array.isArray(tags[field.key]);
82794 _searchInput.attr("title", isMixed ? tags[field.key].filter(Boolean).join("\n") : null).attr("placeholder", isMixed ? _t("inspector.multiple_values") : "").classed("mixed", isMixed);
82795 _qid = typeof tags[field.key] === "string" && tags[field.key] || "";
82796 if (!/^Q[0-9]*$/.test(_qid)) {
82800 _wikiURL = "https://wikidata.org/wiki/" + _qid;
82801 wikidata.entityByQID(_qid, function(err, entity) {
82806 _wikidataEntity = entity;
82807 setLabelForEntity();
82808 var description = entityPropertyForDisplay(entity, "descriptions");
82809 _selection.select("button.wiki-link").classed("disabled", false);
82810 _selection.select(".preset-wikidata-description").style("display", function() {
82811 return description.value.length > 0 ? "flex" : "none";
82812 }).select("input").attr("value", description.value).attr("lang", description.language);
82813 _selection.select(".preset-wikidata-identifier").style("display", function() {
82814 return entity.id ? "flex" : "none";
82815 }).select("input").attr("value", entity.id);
82817 function unrecognized() {
82818 _wikidataEntity = null;
82819 setLabelForEntity();
82820 _selection.select(".preset-wikidata-description").style("display", "none");
82821 _selection.select(".preset-wikidata-identifier").style("display", "none");
82822 _selection.select("button.wiki-link").classed("disabled", true);
82823 if (_qid && _qid !== "") {
82824 _wikiURL = "https://wikidata.org/wiki/Special:Search?search=" + _qid;
82830 function entityPropertyForDisplay(wikidataEntity, propKey) {
82831 var blankResponse = { value: "" };
82832 if (!wikidataEntity[propKey]) return blankResponse;
82833 var propObj = wikidataEntity[propKey];
82834 var langKeys = Object.keys(propObj);
82835 if (langKeys.length === 0) return blankResponse;
82836 var langs = wikidata.languagesToQuery();
82837 for (var i3 in langs) {
82838 var lang = langs[i3];
82839 var valueObj = propObj[lang];
82840 if (valueObj && valueObj.value && valueObj.value.length > 0) return valueObj;
82842 return propObj[langKeys[0]];
82844 wiki.entityIDs = function(val) {
82845 if (!arguments.length) return _entityIDs;
82849 wiki.focus = function() {
82850 _searchInput.node().focus();
82852 return utilRebind(wiki, dispatch14, "on");
82854 var init_wikidata2 = __esm({
82855 "modules/ui/fields/wikidata.js"() {
82859 init_change_tags();
82868 // modules/ui/fields/wikipedia.js
82869 var wikipedia_exports2 = {};
82870 __export(wikipedia_exports2, {
82871 uiFieldWikipedia: () => uiFieldWikipedia
82873 function uiFieldWikipedia(field, context) {
82874 const scheme = "https://";
82875 const domain = "wikipedia.org";
82876 const dispatch14 = dispatch_default("change");
82877 const wikipedia = services.wikipedia;
82878 const wikidata = services.wikidata;
82879 let _langInput = select_default2(null);
82880 let _titleInput = select_default2(null);
82884 let _dataWikipedia = [];
82885 _mainFileFetcher.get("wmf_sitematrix").then((d4) => {
82886 _dataWikipedia = d4;
82887 if (_tags) updateForTags(_tags);
82890 const langCombo = uiCombobox(context, "wikipedia-lang").fetcher((value, callback) => {
82891 const v3 = value.toLowerCase();
82893 _dataWikipedia.filter((d4) => {
82894 return d4[0].toLowerCase().indexOf(v3) >= 0 || d4[1].toLowerCase().indexOf(v3) >= 0 || d4[2].toLowerCase().indexOf(v3) >= 0;
82895 }).map((d4) => ({ value: d4[1] }))
82898 const titleCombo = uiCombobox(context, "wikipedia-title").fetcher((value, callback) => {
82901 for (let i3 in _entityIDs) {
82902 let entity = context.hasEntity(_entityIDs[i3]);
82903 if (entity.tags.name) {
82904 value = entity.tags.name;
82909 const searchfn = value.length > 7 ? wikipedia.search : wikipedia.suggestions;
82910 searchfn(language()[2], value, (query, data) => {
82911 callback(data.map((d4) => ({ value: d4 })));
82914 function wiki(selection2) {
82915 let wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
82916 wrap2 = wrap2.enter().append("div").attr("class", `form-field-input-wrap form-field-input-${field.type}`).merge(wrap2);
82917 let langContainer = wrap2.selectAll(".wiki-lang-container").data([0]);
82918 langContainer = langContainer.enter().append("div").attr("class", "wiki-lang-container").merge(langContainer);
82919 _langInput = langContainer.selectAll("input.wiki-lang").data([0]);
82920 _langInput = _langInput.enter().append("input").attr("type", "text").attr("class", "wiki-lang").attr("placeholder", _t("translate.localized_translation_language")).call(utilNoAuto).call(langCombo).merge(_langInput);
82921 _langInput.on("blur", changeLang).on("change", changeLang);
82922 let titleContainer = wrap2.selectAll(".wiki-title-container").data([0]);
82923 titleContainer = titleContainer.enter().append("div").attr("class", "wiki-title-container").merge(titleContainer);
82924 _titleInput = titleContainer.selectAll("input.wiki-title").data([0]);
82925 _titleInput = _titleInput.enter().append("input").attr("type", "text").attr("dir", "auto").attr("class", "wiki-title").attr("id", field.domId).call(utilNoAuto).call(titleCombo).merge(_titleInput);
82926 _titleInput.on("blur", function() {
82928 }).on("change", function() {
82931 let link2 = titleContainer.selectAll(".wiki-link").data([0]);
82932 link2 = link2.enter().append("button").attr("class", "form-field-button wiki-link").attr("title", _t("icons.view_on", { domain })).call(svgIcon("#iD-icon-out-link")).merge(link2);
82933 link2.on("click", (d3_event) => {
82934 d3_event.preventDefault();
82935 if (_wikiURL) window.open(_wikiURL, "_blank");
82938 function defaultLanguageInfo(skipEnglishFallback) {
82939 const langCode = _mainLocalizer.languageCode().toLowerCase();
82940 for (let i3 in _dataWikipedia) {
82941 let d4 = _dataWikipedia[i3];
82942 if (d4[2] === langCode) return d4;
82944 return skipEnglishFallback ? ["", "", ""] : ["English", "English", "en"];
82946 function language(skipEnglishFallback) {
82947 const value = utilGetSetValue(_langInput).toLowerCase();
82948 for (let i3 in _dataWikipedia) {
82949 let d4 = _dataWikipedia[i3];
82950 if (d4[0].toLowerCase() === value || d4[1].toLowerCase() === value || d4[2] === value) return d4;
82952 return defaultLanguageInfo(skipEnglishFallback);
82954 function changeLang() {
82955 utilGetSetValue(_langInput, language()[1]);
82958 function change(skipWikidata) {
82959 let value = utilGetSetValue(_titleInput);
82960 const m3 = value.match(/https?:\/\/([-a-z]+)\.wikipedia\.org\/(?:wiki|\1-[-a-z]+)\/([^#]+)(?:#(.+))?/);
82961 const langInfo = m3 && _dataWikipedia.find((d4) => m3[1] === d4[2]);
82964 const nativeLangName = langInfo[1];
82965 value = decodeURIComponent(m3[2]).replace(/_/g, " ");
82968 anchor = decodeURIComponent(m3[3]);
82969 value += "#" + anchor.replace(/_/g, " ");
82971 value = value.slice(0, 1).toUpperCase() + value.slice(1);
82972 utilGetSetValue(_langInput, nativeLangName).attr("lang", langInfo[2]);
82973 utilGetSetValue(_titleInput, value);
82976 syncTags.wikipedia = context.cleanTagValue(language()[2] + ":" + value);
82978 syncTags.wikipedia = void 0;
82980 dispatch14.call("change", this, syncTags);
82981 if (skipWikidata || !value || !language()[2]) return;
82982 const initGraph = context.graph();
82983 const initEntityIDs = _entityIDs;
82984 wikidata.itemsByTitle(language()[2], value, (err, data) => {
82985 if (err || !data || !Object.keys(data).length) return;
82986 if (context.graph() !== initGraph) return;
82987 const qids = Object.keys(data);
82988 const value2 = qids && qids.find((id2) => id2.match(/^Q\d+$/));
82989 let actions = initEntityIDs.map((entityID) => {
82990 let entity = context.entity(entityID).tags;
82991 let currTags = Object.assign({}, entity);
82992 if (currTags.wikidata !== value2) {
82993 currTags.wikidata = value2;
82994 return actionChangeTags(entityID, currTags);
82997 }).filter(Boolean);
82998 if (!actions.length) return;
83000 function actionUpdateWikidataTags(graph) {
83001 actions.forEach(function(action) {
83002 graph = action(graph);
83006 context.history().undoAnnotation()
83010 wiki.tags = (tags) => {
83012 updateForTags(tags);
83014 function updateForTags(tags) {
83015 const value = typeof tags[field.key] === "string" ? tags[field.key] : "";
83016 const m3 = value.match(/([^:]+):([^#]+)(?:#(.+))?/);
83017 const tagLang = m3 && m3[1];
83018 const tagArticleTitle = m3 && m3[2];
83019 let anchor = m3 && m3[3];
83020 const tagLangInfo = tagLang && _dataWikipedia.find((d4) => tagLang === d4[2]);
83022 const nativeLangName = tagLangInfo[1];
83023 utilGetSetValue(_langInput, nativeLangName);
83024 _titleInput.attr("lang", tagLangInfo[2]);
83025 utilGetSetValue(_titleInput, tagArticleTitle + (anchor ? "#" + anchor : ""));
83026 _wikiURL = `${scheme}${tagLang}.${domain}/wiki/${wiki.encodePath(tagArticleTitle, anchor)}`;
83028 utilGetSetValue(_titleInput, value);
83029 if (value && value !== "") {
83030 utilGetSetValue(_langInput, "");
83031 const defaultLangInfo = defaultLanguageInfo();
83032 _wikiURL = `${scheme}${defaultLangInfo[2]}.${domain}/w/index.php?fulltext=1&search=${value}`;
83034 const shownOrDefaultLangInfo = language(
83036 /* skipEnglishFallback */
83038 utilGetSetValue(_langInput, shownOrDefaultLangInfo[1]);
83043 wiki.encodePath = (tagArticleTitle, anchor) => {
83044 const underscoredTitle = tagArticleTitle.replace(/ /g, "_");
83045 const uriEncodedUnderscoredTitle = encodeURIComponent(underscoredTitle);
83046 const uriEncodedAnchorFragment = wiki.encodeURIAnchorFragment(anchor);
83047 return `${uriEncodedUnderscoredTitle}${uriEncodedAnchorFragment}`;
83049 wiki.encodeURIAnchorFragment = (anchor) => {
83050 if (!anchor) return "";
83051 const underscoredAnchor = anchor.replace(/ /g, "_");
83052 return "#" + encodeURIComponent(underscoredAnchor);
83054 wiki.entityIDs = (val) => {
83055 if (!arguments.length) return _entityIDs;
83059 wiki.focus = () => {
83060 _titleInput.node().focus();
83062 return utilRebind(wiki, dispatch14, "on");
83064 var init_wikipedia2 = __esm({
83065 "modules/ui/fields/wikipedia.js"() {
83069 init_file_fetcher();
83071 init_change_tags();
83076 uiFieldWikipedia.supportsMultiselection = false;
83080 // modules/ui/fields/index.js
83081 var fields_exports = {};
83082 __export(fields_exports, {
83083 LANGUAGE_SUFFIX_REGEX: () => LANGUAGE_SUFFIX_REGEX,
83084 likelyRawNumberFormat: () => likelyRawNumberFormat,
83085 uiFieldAccess: () => uiFieldAccess,
83086 uiFieldAddress: () => uiFieldAddress,
83087 uiFieldCheck: () => uiFieldCheck,
83088 uiFieldColour: () => uiFieldText,
83089 uiFieldCombo: () => uiFieldCombo,
83090 uiFieldDefaultCheck: () => uiFieldCheck,
83091 uiFieldDirectionalCombo: () => uiFieldDirectionalCombo,
83092 uiFieldEmail: () => uiFieldText,
83093 uiFieldIdentifier: () => uiFieldText,
83094 uiFieldLanes: () => uiFieldLanes,
83095 uiFieldLocalized: () => uiFieldLocalized,
83096 uiFieldManyCombo: () => uiFieldCombo,
83097 uiFieldMultiCombo: () => uiFieldCombo,
83098 uiFieldNetworkCombo: () => uiFieldCombo,
83099 uiFieldNumber: () => uiFieldText,
83100 uiFieldOnewayCheck: () => uiFieldCheck,
83101 uiFieldRadio: () => uiFieldRadio,
83102 uiFieldRestrictions: () => uiFieldRestrictions,
83103 uiFieldRoadheight: () => uiFieldRoadheight,
83104 uiFieldRoadspeed: () => uiFieldRoadspeed,
83105 uiFieldSchedule: () => uiFieldText,
83106 uiFieldSemiCombo: () => uiFieldCombo,
83107 uiFieldStructureRadio: () => uiFieldRadio,
83108 uiFieldTel: () => uiFieldText,
83109 uiFieldText: () => uiFieldText,
83110 uiFieldTextarea: () => uiFieldTextarea,
83111 uiFieldTypeCombo: () => uiFieldCombo,
83112 uiFieldUrl: () => uiFieldText,
83113 uiFieldWikidata: () => uiFieldWikidata,
83114 uiFieldWikipedia: () => uiFieldWikipedia,
83115 uiFields: () => uiFields
83118 var init_fields = __esm({
83119 "modules/ui/fields/index.js"() {
83126 init_directional_combo();
83132 init_restrictions();
83142 init_directional_combo();
83147 init_restrictions();
83152 access: uiFieldAccess,
83153 address: uiFieldAddress,
83154 check: uiFieldCheck,
83155 colour: uiFieldText,
83156 combo: uiFieldCombo,
83157 cycleway: uiFieldDirectionalCombo,
83159 defaultCheck: uiFieldCheck,
83160 directionalCombo: uiFieldDirectionalCombo,
83161 email: uiFieldText,
83162 identifier: uiFieldText,
83163 lanes: uiFieldLanes,
83164 localized: uiFieldLocalized,
83165 roadheight: uiFieldRoadheight,
83166 roadspeed: uiFieldRoadspeed,
83167 manyCombo: uiFieldCombo,
83168 multiCombo: uiFieldCombo,
83169 networkCombo: uiFieldCombo,
83170 number: uiFieldText,
83171 onewayCheck: uiFieldCheck,
83172 radio: uiFieldRadio,
83173 restrictions: uiFieldRestrictions,
83174 schedule: uiFieldText,
83175 semiCombo: uiFieldCombo,
83176 structureRadio: uiFieldRadio,
83179 textarea: uiFieldTextarea,
83180 typeCombo: uiFieldCombo,
83182 wikidata: uiFieldWikidata,
83183 wikipedia: uiFieldWikipedia
83188 // modules/ui/field.js
83189 var field_exports = {};
83190 __export(field_exports, {
83191 uiField: () => uiField
83193 function uiField(context, presetField2, entityIDs, options) {
83194 options = Object.assign({
83201 var dispatch14 = dispatch_default("change", "revert");
83202 var field = Object.assign({}, presetField2);
83203 field.domId = utilUniqueDomId("form-field-" + field.safeid);
83204 var _show = options.show;
83208 if (entityIDs && entityIDs.length) {
83209 _entityExtent = entityIDs.reduce(function(extent, entityID) {
83210 var entity = context.graph().entity(entityID);
83211 return extent.extend(entity.extent(context.graph()));
83214 var _locked = false;
83215 var _lockedTip = uiTooltip().title(() => _t.append("inspector.lock.suggestion", { label: field.title })).placement("bottom");
83216 if (_show && !field.impl) {
83219 function createField() {
83220 field.impl = uiFields[field.type](field, context).on("change", function(t2, onInput) {
83221 dispatch14.call("change", field, t2, onInput);
83224 field.entityIDs = entityIDs;
83225 if (field.impl.entityIDs) {
83226 field.impl.entityIDs(entityIDs);
83230 function allKeys() {
83231 let keys2 = field.keys || [field.key];
83232 if (field.type === "directionalCombo" && field.key) {
83233 const baseKey = field.key.replace(/:both$/, "");
83234 keys2 = keys2.concat(baseKey, `${baseKey}:both`);
83238 function isModified() {
83239 if (!entityIDs || !entityIDs.length) return false;
83240 return entityIDs.some(function(entityID) {
83241 var original = context.graph().base().entities[entityID];
83242 var latest = context.graph().entity(entityID);
83243 return allKeys().some(function(key) {
83244 return original ? latest.tags[key] !== original.tags[key] : latest.tags[key];
83248 function tagsContainFieldKey() {
83249 return allKeys().some(function(key) {
83250 if (field.type === "multiCombo") {
83251 for (var tagKey in _tags) {
83252 if (tagKey.indexOf(key) === 0) {
83258 if (field.type === "localized") {
83259 for (let tagKey2 in _tags) {
83260 let match = tagKey2.match(LANGUAGE_SUFFIX_REGEX);
83261 if (match && match[1] === field.key && match[2]) {
83266 return _tags[key] !== void 0;
83269 function revert(d3_event, d4) {
83270 d3_event.stopPropagation();
83271 d3_event.preventDefault();
83272 if (!entityIDs || _locked) return;
83273 dispatch14.call("revert", d4, allKeys());
83275 function remove2(d3_event, d4) {
83276 d3_event.stopPropagation();
83277 d3_event.preventDefault();
83278 if (_locked) return;
83280 allKeys().forEach(function(key) {
83283 dispatch14.call("change", d4, t2);
83285 field.render = function(selection2) {
83286 var container = selection2.selectAll(".form-field").data([field]);
83287 var enter = container.enter().append("div").attr("class", function(d4) {
83288 return "form-field form-field-" + d4.safeid;
83289 }).classed("nowrap", !options.wrap);
83290 if (options.wrap) {
83291 var labelEnter = enter.append("label").attr("class", "field-label").attr("for", function(d4) {
83294 var textEnter = labelEnter.append("span").attr("class", "label-text");
83295 textEnter.append("span").attr("class", "label-textvalue").each(function(d4) {
83296 d4.label()(select_default2(this));
83298 textEnter.append("span").attr("class", "label-textannotation");
83299 if (options.remove) {
83300 labelEnter.append("button").attr("class", "remove-icon").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
83302 if (options.revert) {
83303 labelEnter.append("button").attr("class", "modified-icon").attr("title", _t("icons.undo")).call(svgIcon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-redo" : "#iD-icon-undo"));
83306 container = container.merge(enter);
83307 container.select(".field-label > .remove-icon").on("click", remove2);
83308 container.select(".field-label > .modified-icon").on("click", revert);
83309 container.each(function(d4) {
83310 var selection3 = select_default2(this);
83314 var reference, help;
83315 if (options.wrap && field.type === "restrictions") {
83316 help = uiFieldHelp(context, "restrictions");
83318 if (options.wrap && options.info) {
83319 var referenceKey = d4.key || "";
83320 if (d4.type === "multiCombo") {
83321 referenceKey = referenceKey.replace(/:$/, "");
83323 var referenceOptions = d4.reference || {
83325 value: _tags[referenceKey]
83327 reference = uiTagReference(referenceOptions, context);
83328 if (_state === "hover") {
83329 reference.showing(false);
83332 selection3.call(d4.impl);
83334 selection3.call(help.body).select(".field-label").call(help.button);
83337 selection3.call(reference.body).select(".field-label").call(reference.button);
83339 d4.impl.tags(_tags);
83341 container.classed("locked", _locked).classed("modified", isModified()).classed("present", tagsContainFieldKey());
83342 var annotation = container.selectAll(".field-label .label-textannotation");
83343 var icon2 = annotation.selectAll(".icon").data(_locked ? [0] : []);
83344 icon2.exit().remove();
83345 icon2.enter().append("svg").attr("class", "icon").append("use").attr("xlink:href", "#fas-lock");
83346 container.call(_locked ? _lockedTip : _lockedTip.destroy);
83348 field.state = function(val) {
83349 if (!arguments.length) return _state;
83353 field.tags = function(val) {
83354 if (!arguments.length) return _tags;
83356 if (tagsContainFieldKey() && !_show) {
83364 field.locked = function(val) {
83365 if (!arguments.length) return _locked;
83369 field.show = function() {
83374 if (field.default && field.key && _tags[field.key] !== field.default) {
83376 t2[field.key] = field.default;
83377 dispatch14.call("change", this, t2);
83380 field.isShown = function() {
83383 field.isAllowed = function() {
83384 if (entityIDs && entityIDs.length > 1 && uiFields[field.type].supportsMultiselection === false) return false;
83385 if (field.geometry && !entityIDs.every(function(entityID) {
83386 return field.matchGeometry(context.graph().geometry(entityID));
83388 if (entityIDs && _entityExtent && field.locationSetID) {
83389 var validHere = _sharedLocationManager.locationSetsAt(_entityExtent.center());
83390 if (!validHere[field.locationSetID]) return false;
83392 var prerequisiteTag = field.prerequisiteTag;
83393 if (entityIDs && !tagsContainFieldKey() && // ignore tagging prerequisites if a value is already present
83395 if (!entityIDs.every(function(entityID) {
83396 var entity = context.graph().entity(entityID);
83397 if (prerequisiteTag.key) {
83398 var value = entity.tags[prerequisiteTag.key] || "";
83399 if (prerequisiteTag.valuesNot) {
83400 return !prerequisiteTag.valuesNot.includes(value);
83402 if (prerequisiteTag.valueNot) {
83403 return prerequisiteTag.valueNot !== value;
83405 if (prerequisiteTag.values) {
83406 return prerequisiteTag.values.includes(value);
83408 if (prerequisiteTag.value) {
83409 return prerequisiteTag.value === value;
83411 if (!value) return false;
83412 } else if (prerequisiteTag.keyNot) {
83413 if (entity.tags[prerequisiteTag.keyNot]) return false;
83420 field.focus = function() {
83422 field.impl.focus();
83425 return utilRebind(field, dispatch14, "on");
83427 var init_field = __esm({
83428 "modules/ui/field.js"() {
83433 init_LocationManager();
83440 init_tag_reference();
83445 // modules/ui/changeset_editor.js
83446 var changeset_editor_exports = {};
83447 __export(changeset_editor_exports, {
83448 uiChangesetEditor: () => uiChangesetEditor
83450 function uiChangesetEditor(context) {
83451 var dispatch14 = dispatch_default("change");
83452 var formFields = uiFormFields(context);
83453 var commentCombo = uiCombobox(context, "comment").caseSensitive(true);
83457 function changesetEditor(selection2) {
83458 render(selection2);
83460 function render(selection2) {
83462 var initial = false;
83465 var presets = _mainPresetIndex;
83467 uiField(context, presets.field("comment"), null, { show: true, revert: false }),
83468 uiField(context, presets.field("source"), null, { show: true, revert: false }),
83469 uiField(context, presets.field("hashtags"), null, { show: false, revert: false })
83471 _fieldsArr.forEach(function(field) {
83472 field.on("change", function(t2, onInput) {
83473 dispatch14.call("change", field, void 0, t2, onInput);
83477 _fieldsArr.forEach(function(field) {
83480 selection2.call(formFields.fieldsArr(_fieldsArr));
83482 var commentField = selection2.select(".form-field-comment textarea");
83483 const sourceField = _fieldsArr.find((field) => field.id === "source");
83484 var commentNode = commentField.node();
83486 commentNode.focus();
83487 commentNode.select();
83489 utilTriggerEvent(commentField, "blur");
83490 var osm = context.connection();
83492 osm.userChangesets(function(err, changesets) {
83494 var comments = changesets.map(function(changeset) {
83495 var comment = changeset.tags.comment;
83496 return comment ? { title: comment, value: comment } : null;
83497 }).filter(Boolean);
83499 commentCombo.data(utilArrayUniqBy(comments, "title"))
83501 const recentSources = changesets.flatMap((changeset) => {
83503 return (_a5 = changeset.tags.source) == null ? void 0 : _a5.split(";");
83504 }).filter((value) => !sourceField.options.includes(value)).filter(Boolean).map((title) => ({ title, value: title, klass: "raw-option" }));
83505 sourceField.impl.setCustomOptions(utilArrayUniqBy(recentSources, "title"));
83509 const warnings = [];
83510 if ((_a4 = _tags.comment) == null ? void 0 : _a4.match(/google/i)) {
83512 id: 'contains "google"',
83513 msg: _t.append("commit.google_warning"),
83514 link: _t("commit.google_warning_link")
83517 const maxChars = context.maxCharsForTagValue();
83518 const strLen = utilUnicodeCharsCount(utilCleanOsmString(_tags.comment, Number.POSITIVE_INFINITY));
83519 if (strLen > maxChars || false) {
83521 id: "message too long",
83522 msg: _t.append("commit.changeset_comment_length_warning", { maxChars })
83525 var commentWarning = selection2.select(".form-field-comment").selectAll(".comment-warning").data(warnings, (d4) => d4.id);
83526 commentWarning.exit().transition().duration(200).style("opacity", 0).remove();
83527 var commentEnter = commentWarning.enter().insert("div", ".comment-warning").attr("class", "comment-warning field-warning").style("opacity", 0);
83528 commentEnter.call(svgIcon("#iD-icon-alert", "inline")).append("span");
83529 commentEnter.transition().duration(200).style("opacity", 1);
83530 commentWarning.merge(commentEnter).selectAll("div > span").text("").each(function(d4) {
83531 let selection3 = select_default2(this);
83533 selection3 = selection3.append("a").attr("target", "_blank").attr("href", d4.link);
83535 selection3.call(d4.msg);
83538 changesetEditor.tags = function(_3) {
83539 if (!arguments.length) return _tags;
83541 return changesetEditor;
83543 changesetEditor.changesetID = function(_3) {
83544 if (!arguments.length) return _changesetID;
83545 if (_changesetID === _3) return changesetEditor;
83548 return changesetEditor;
83550 return utilRebind(changesetEditor, dispatch14, "on");
83552 var init_changeset_editor = __esm({
83553 "modules/ui/changeset_editor.js"() {
83562 init_form_fields();
83567 // modules/ui/sections/changes.js
83568 var changes_exports = {};
83569 __export(changes_exports, {
83570 uiSectionChanges: () => uiSectionChanges
83572 function uiSectionChanges(context) {
83573 var _discardTags = {};
83574 _mainFileFetcher.get("discarded").then(function(d4) {
83576 }).catch(function() {
83578 var section = uiSection("changes-list", context).label(function() {
83579 var history = context.history();
83580 var summary = history.difference().summary();
83581 return _t.append("inspector.title_count", { title: _t("commit.changes"), count: summary.length });
83582 }).disclosureContent(renderDisclosureContent);
83583 function renderDisclosureContent(selection2) {
83584 var history = context.history();
83585 var summary = history.difference().summary();
83586 var container = selection2.selectAll(".commit-section").data([0]);
83587 var containerEnter = container.enter().append("div").attr("class", "commit-section");
83588 containerEnter.append("ul").attr("class", "changeset-list");
83589 container = containerEnter.merge(container);
83590 var items = container.select("ul").selectAll("li").data(summary);
83591 var itemsEnter = items.enter().append("li").attr("class", "change-item");
83592 var buttons = itemsEnter.append("button").on("mouseover", mouseover).on("mouseout", mouseout).on("click", click);
83593 buttons.each(function(d4) {
83594 select_default2(this).call(svgIcon("#iD-icon-" + d4.entity.geometry(d4.graph), "pre-text " + d4.changeType));
83596 buttons.append("span").attr("class", "change-type").html(function(d4) {
83597 return _t.html("commit." + d4.changeType) + " ";
83599 buttons.append("strong").attr("class", "entity-type").text(function(d4) {
83600 var matched = _mainPresetIndex.match(d4.entity, d4.graph);
83601 return matched && matched.name() || utilDisplayType(d4.entity.id);
83603 buttons.append("span").attr("class", "entity-name").text(function(d4) {
83604 var name = utilDisplayName(d4.entity) || "", string = "";
83608 return string += " " + name;
83610 items = itemsEnter.merge(items);
83611 var changeset = new osmChangeset().update({ id: void 0 });
83612 var changes = history.changes(actionDiscardTags(history.difference(), _discardTags));
83613 delete changeset.id;
83614 var data = JXON.stringify(changeset.osmChangeJXON(changes));
83615 var blob = new Blob([data], { type: "text/xml;charset=utf-8;" });
83616 var fileName = "changes.osc";
83617 var linkEnter = container.selectAll(".download-changes").data([0]).enter().append("a").attr("class", "download-changes");
83618 linkEnter.attr("href", window.URL.createObjectURL(blob)).attr("download", fileName);
83619 linkEnter.call(svgIcon("#iD-icon-load", "inline")).append("span").call(_t.append("commit.download_changes"));
83620 function mouseover(d3_event, d4) {
83622 context.surface().selectAll(
83623 utilEntityOrMemberSelector([d4.entity.id], context.graph())
83624 ).classed("hover", true);
83627 function mouseout() {
83628 context.surface().selectAll(".hover").classed("hover", false);
83630 function click(d3_event, change) {
83631 if (change.changeType !== "deleted") {
83632 var entity = change.entity;
83633 context.map().zoomToEase(entity);
83634 context.surface().selectAll(utilEntityOrMemberSelector([entity.id], context.graph())).classed("hover", true);
83640 var init_changes = __esm({
83641 "modules/ui/sections/changes.js"() {
83645 init_file_fetcher();
83648 init_discard_tags();
83656 // modules/ui/commit.js
83657 var commit_exports = {};
83658 __export(commit_exports, {
83659 uiCommit: () => uiCommit
83661 function uiCommit(context) {
83662 var dispatch14 = dispatch_default("cancel");
83665 var changesetEditor = uiChangesetEditor(context).on("change", changeTags);
83666 var rawTagEditor = uiSectionRawTagEditor("changeset-tag-editor", context).on("change", changeTags).readOnlyTags(readOnlyTags);
83667 var commitChanges = uiSectionChanges(context);
83668 var commitWarnings = uiCommitWarnings(context);
83669 function commit(selection2) {
83670 _selection = selection2;
83671 if (!context.changeset) initChangeset();
83672 loadDerivedChangesetTags();
83673 selection2.call(render);
83675 function initChangeset() {
83676 var commentDate = +corePreferences("commentDate") || 0;
83677 var currDate = Date.now();
83678 var cutoff = 2 * 86400 * 1e3;
83679 if (commentDate > currDate || currDate - commentDate > cutoff) {
83680 corePreferences("comment", null);
83681 corePreferences("hashtags", null);
83682 corePreferences("source", null);
83684 if (context.defaultChangesetComment()) {
83685 corePreferences("comment", context.defaultChangesetComment());
83686 corePreferences("commentDate", Date.now());
83688 if (context.defaultChangesetSource()) {
83689 corePreferences("source", context.defaultChangesetSource());
83690 corePreferences("commentDate", Date.now());
83692 if (context.defaultChangesetHashtags()) {
83693 corePreferences("hashtags", context.defaultChangesetHashtags());
83694 corePreferences("commentDate", Date.now());
83696 var detected = utilDetect();
83698 comment: corePreferences("comment") || "",
83699 created_by: context.cleanTagValue("iD " + context.version),
83700 host: context.cleanTagValue(detected.host),
83701 locale: context.cleanTagValue(_mainLocalizer.localeCode())
83703 findHashtags(tags, true);
83704 var hashtags = corePreferences("hashtags");
83706 tags.hashtags = hashtags;
83708 var source = corePreferences("source");
83710 tags.source = source;
83712 var photoOverlaysUsed = context.history().photoOverlaysUsed();
83713 if (photoOverlaysUsed.length) {
83714 var sources = (tags.source || "").split(";");
83715 if (sources.indexOf("streetlevel imagery") === -1) {
83716 sources.push("streetlevel imagery");
83718 photoOverlaysUsed.forEach(function(photoOverlay) {
83719 if (sources.indexOf(photoOverlay) === -1) {
83720 sources.push(photoOverlay);
83723 tags.source = context.cleanTagValue(sources.filter(Boolean).join(";"));
83725 context.changeset = new osmChangeset({ tags });
83727 function loadDerivedChangesetTags() {
83728 var osm = context.connection();
83730 var tags = Object.assign({}, context.changeset.tags);
83731 var imageryUsed = context.cleanTagValue(context.history().imageryUsed().join(";"));
83732 tags.imagery_used = imageryUsed || "None";
83733 var osmClosed = osm.getClosedIDs();
83735 if (osmClosed.length) {
83736 tags["closed:note"] = context.cleanTagValue(osmClosed.join(";"));
83738 if (services.keepRight) {
83739 var krClosed = services.keepRight.getClosedIDs();
83740 if (krClosed.length) {
83741 tags["closed:keepright"] = context.cleanTagValue(krClosed.join(";"));
83744 if (services.osmose) {
83745 var osmoseClosed = services.osmose.getClosedCounts();
83746 for (itemType in osmoseClosed) {
83747 tags["closed:osmose:" + itemType] = context.cleanTagValue(osmoseClosed[itemType].toString());
83750 for (var key in tags) {
83751 if (key.match(/(^warnings:)|(^resolved:)/)) {
83755 function addIssueCounts(issues, prefix) {
83756 var issuesByType = utilArrayGroupBy(issues, "type");
83757 for (var issueType in issuesByType) {
83758 var issuesOfType = issuesByType[issueType];
83759 if (issuesOfType[0].subtype) {
83760 var issuesBySubtype = utilArrayGroupBy(issuesOfType, "subtype");
83761 for (var issueSubtype in issuesBySubtype) {
83762 var issuesOfSubtype = issuesBySubtype[issueSubtype];
83763 tags[prefix + ":" + issueType + ":" + issueSubtype] = context.cleanTagValue(issuesOfSubtype.length.toString());
83766 tags[prefix + ":" + issueType] = context.cleanTagValue(issuesOfType.length.toString());
83770 var warnings = context.validator().getIssuesBySeverity({ what: "edited", where: "all", includeIgnored: true, includeDisabledRules: true }).warning.filter(function(issue) {
83771 return issue.type !== "help_request";
83773 addIssueCounts(warnings, "warnings");
83774 var resolvedIssues = context.validator().getResolvedIssues();
83775 addIssueCounts(resolvedIssues, "resolved");
83776 context.changeset = context.changeset.update({ tags });
83778 function render(selection2) {
83779 var osm = context.connection();
83781 var header = selection2.selectAll(".header").data([0]);
83782 var headerTitle = header.enter().append("div").attr("class", "header fillL");
83783 headerTitle.append("div").append("h2").call(_t.append("commit.title"));
83784 headerTitle.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
83785 dispatch14.call("cancel", this);
83786 }).call(svgIcon("#iD-icon-close"));
83787 var body = selection2.selectAll(".body").data([0]);
83788 body = body.enter().append("div").attr("class", "body").merge(body);
83789 var changesetSection = body.selectAll(".changeset-editor").data([0]);
83790 changesetSection = changesetSection.enter().append("div").attr("class", "modal-section changeset-editor").merge(changesetSection);
83791 changesetSection.call(
83792 changesetEditor.changesetID(context.changeset.id).tags(context.changeset.tags)
83794 body.call(commitWarnings);
83795 var saveSection = body.selectAll(".save-section").data([0]);
83796 saveSection = saveSection.enter().append("div").attr("class", "modal-section save-section fillL").merge(saveSection);
83797 var prose = saveSection.selectAll(".commit-info").data([0]);
83798 if (prose.enter().size()) {
83799 _userDetails2 = null;
83801 prose = prose.enter().append("p").attr("class", "commit-info").call(_t.append("commit.upload_explanation")).merge(prose);
83802 osm.userDetails(function(err, user) {
83804 if (_userDetails2 === user) return;
83805 _userDetails2 = user;
83806 var userLink = select_default2(document.createElement("div"));
83807 if (user.image_url) {
83808 userLink.append("img").attr("src", user.image_url).attr("class", "icon pre-text user-icon");
83810 userLink.append("a").attr("class", "user-info").text(user.display_name).attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
83811 prose.html(_t.html("commit.upload_explanation_with_user", { user: { html: userLink.html() } }));
83813 var requestReview = saveSection.selectAll(".request-review").data([0]);
83814 var requestReviewEnter = requestReview.enter().append("div").attr("class", "request-review");
83815 var requestReviewDomId = utilUniqueDomId("commit-input-request-review");
83816 var labelEnter = requestReviewEnter.append("label").attr("for", requestReviewDomId);
83817 if (!labelEnter.empty()) {
83818 labelEnter.call(uiTooltip().title(() => _t.append("commit.request_review_info")).placement("top"));
83820 labelEnter.append("input").attr("type", "checkbox").attr("id", requestReviewDomId);
83821 labelEnter.append("span").call(_t.append("commit.request_review"));
83822 requestReview = requestReview.merge(requestReviewEnter);
83823 var requestReviewInput = requestReview.selectAll("input").property("checked", isReviewRequested(context.changeset.tags)).on("change", toggleRequestReview);
83824 var buttonSection = saveSection.selectAll(".buttons").data([0]);
83825 var buttonEnter = buttonSection.enter().append("div").attr("class", "buttons fillL");
83826 buttonEnter.append("button").attr("class", "secondary-action button cancel-button").append("span").attr("class", "label").call(_t.append("commit.cancel"));
83827 var uploadButton = buttonEnter.append("button").attr("class", "action button save-button");
83828 uploadButton.append("span").attr("class", "label").call(_t.append("commit.save"));
83829 var uploadBlockerTooltipText = getUploadBlockerMessage();
83830 buttonSection = buttonSection.merge(buttonEnter);
83831 buttonSection.selectAll(".cancel-button").on("click.cancel", function() {
83832 dispatch14.call("cancel", this);
83834 buttonSection.selectAll(".save-button").classed("disabled", uploadBlockerTooltipText !== null).on("click.save", function() {
83835 if (!select_default2(this).classed("disabled")) {
83837 for (var key in context.changeset.tags) {
83838 if (!key) delete context.changeset.tags[key];
83840 context.uploader().save(context.changeset);
83843 uiTooltip().destroyAny(buttonSection.selectAll(".save-button"));
83844 if (uploadBlockerTooltipText) {
83845 buttonSection.selectAll(".save-button").call(uiTooltip().title(() => uploadBlockerTooltipText).placement("top"));
83847 var tagSection = body.selectAll(".tag-section.raw-tag-editor").data([0]);
83848 tagSection = tagSection.enter().append("div").attr("class", "modal-section tag-section raw-tag-editor").merge(tagSection);
83850 rawTagEditor.tags(Object.assign({}, context.changeset.tags)).render
83852 var changesSection = body.selectAll(".commit-changes-section").data([0]);
83853 changesSection = changesSection.enter().append("div").attr("class", "modal-section commit-changes-section").merge(changesSection);
83854 changesSection.call(commitChanges.render);
83855 function toggleRequestReview() {
83856 var rr = requestReviewInput.property("checked");
83857 updateChangeset({ review_requested: rr ? "yes" : void 0 });
83859 rawTagEditor.tags(Object.assign({}, context.changeset.tags)).render
83863 function getUploadBlockerMessage() {
83864 var errors = context.validator().getIssuesBySeverity({ what: "edited", where: "all" }).error;
83865 if (errors.length) {
83866 return _t.append("commit.outstanding_errors_message", { count: errors.length });
83868 var hasChangesetComment = context.changeset && context.changeset.tags.comment && context.changeset.tags.comment.trim().length;
83869 if (!hasChangesetComment) {
83870 return _t.append("commit.comment_needed_message");
83875 function changeTags(_3, changed, onInput) {
83876 if (changed.hasOwnProperty("comment")) {
83878 corePreferences("comment", changed.comment);
83879 corePreferences("commentDate", Date.now());
83882 if (changed.hasOwnProperty("source")) {
83883 if (changed.source === void 0) {
83884 corePreferences("source", null);
83885 } else if (!onInput) {
83886 corePreferences("source", changed.source);
83887 corePreferences("commentDate", Date.now());
83890 updateChangeset(changed, onInput);
83892 _selection.call(render);
83895 function findHashtags(tags, commentOnly) {
83896 var detectedHashtags = commentHashtags();
83897 if (detectedHashtags.length) {
83898 corePreferences("hashtags", null);
83900 if (!detectedHashtags.length || !commentOnly) {
83901 detectedHashtags = detectedHashtags.concat(hashtagHashtags());
83903 var allLowerCase = /* @__PURE__ */ new Set();
83904 return detectedHashtags.filter(function(hashtag) {
83905 var lowerCase = hashtag.toLowerCase();
83906 if (!allLowerCase.has(lowerCase)) {
83907 allLowerCase.add(lowerCase);
83912 function commentHashtags() {
83913 var matches = (tags.comment || "").replace(/http\S*/g, "").match(hashtagRegex);
83914 return matches || [];
83916 function hashtagHashtags() {
83917 var matches = (tags.hashtags || "").split(/[,;\s]+/).map(function(s2) {
83918 if (s2[0] !== "#") {
83921 var matched = s2.match(hashtagRegex);
83922 return matched && matched[0];
83923 }).filter(Boolean);
83924 return matches || [];
83927 function isReviewRequested(tags) {
83928 var rr = tags.review_requested;
83929 if (rr === void 0) return false;
83930 rr = rr.trim().toLowerCase();
83931 return !(rr === "" || rr === "no");
83933 function updateChangeset(changed, onInput) {
83934 var tags = Object.assign({}, context.changeset.tags);
83935 Object.keys(changed).forEach(function(k2) {
83936 var v3 = changed[k2];
83937 k2 = context.cleanTagKey(k2);
83938 if (readOnlyTags.indexOf(k2) !== -1) return;
83939 if (v3 === void 0) {
83941 } else if (onInput) {
83944 tags[k2] = context.cleanTagValue(v3);
83948 var commentOnly = changed.hasOwnProperty("comment") && changed.comment !== "";
83949 var arr = findHashtags(tags, commentOnly);
83951 tags.hashtags = context.cleanTagValue(arr.join(";"));
83952 corePreferences("hashtags", tags.hashtags);
83954 delete tags.hashtags;
83955 corePreferences("hashtags", null);
83958 if (_userDetails2 && _userDetails2.changesets_count !== void 0) {
83959 var changesetsCount = parseInt(_userDetails2.changesets_count, 10) + 1;
83960 tags.changesets_count = String(changesetsCount);
83961 if (changesetsCount <= 100) {
83963 s2 = corePreferences("walkthrough_completed");
83965 tags["ideditor:walkthrough_completed"] = s2;
83967 s2 = corePreferences("walkthrough_progress");
83969 tags["ideditor:walkthrough_progress"] = s2;
83971 s2 = corePreferences("walkthrough_started");
83973 tags["ideditor:walkthrough_started"] = s2;
83977 delete tags.changesets_count;
83979 if (!(0, import_fast_deep_equal11.default)(context.changeset.tags, tags)) {
83980 context.changeset = context.changeset.update({ tags });
83983 commit.reset = function() {
83984 context.changeset = null;
83986 return utilRebind(commit, dispatch14, "on");
83988 var import_fast_deep_equal11, readOnlyTags, hashtagRegex;
83989 var init_commit = __esm({
83990 "modules/ui/commit.js"() {
83994 import_fast_deep_equal11 = __toESM(require_fast_deep_equal(), 1);
83995 init_preferences();
84001 init_changeset_editor();
84003 init_commit_warnings();
84004 init_raw_tag_editor();
84008 /^changesets_count$/,
84017 /^closed:keepright$/,
84020 hashtagRegex = /([##][^\u2000-\u206F\u2E00-\u2E7F\s\\'!"#$%()*,.\/:;<=>?@\[\]^`{|}~]+)/g;
84024 // modules/modes/save.js
84025 var save_exports2 = {};
84026 __export(save_exports2, {
84027 modeSave: () => modeSave
84029 function modeSave(context) {
84030 var mode = { id: "save" };
84031 var keybinding = utilKeybinding("modeSave");
84032 var commit = uiCommit(context).on("cancel", cancel);
84036 var uploader = context.uploader().on("saveStarted.modeSave", function() {
84038 }).on("willAttemptUpload.modeSave", prepareForSuccess).on("progressChanged.modeSave", showProgress).on("resultNoChanges.modeSave", function() {
84040 }).on("resultErrors.modeSave", showErrors).on("resultConflicts.modeSave", showConflicts).on("resultSuccess.modeSave", showSuccess);
84041 function cancel() {
84042 context.enter(modeBrowse(context));
84044 function showProgress(num, total) {
84045 var modal = context.container().select(".loading-modal .modal-section");
84046 var progress = modal.selectAll(".progress").data([0]);
84047 progress.enter().append("div").attr("class", "progress").merge(progress).text(_t("save.conflict_progress", { num, total }));
84049 function showConflicts(changeset, conflicts, origChanges) {
84050 var selection2 = context.container().select(".sidebar").append("div").attr("class", "sidebar-component");
84051 context.container().selectAll(".main-content").classed("active", true).classed("inactive", false);
84052 _conflictsUi = uiConflicts(context).conflictList(conflicts).origChanges(origChanges).on("cancel", function() {
84053 context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
84054 selection2.remove();
84056 uploader.cancelConflictResolution();
84057 }).on("save", function() {
84058 context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
84059 selection2.remove();
84060 uploader.processResolvedConflicts(changeset);
84062 selection2.call(_conflictsUi);
84064 function showErrors(errors) {
84066 var selection2 = uiConfirm(context.container());
84067 selection2.select(".modal-section.header").append("h3").text(_t("save.error"));
84068 addErrors(selection2, errors);
84069 selection2.okButton();
84071 function addErrors(selection2, data) {
84072 var message = selection2.select(".modal-section.message-text");
84073 var items = message.selectAll(".error-container").data(data);
84074 var enter = items.enter().append("div").attr("class", "error-container");
84075 enter.append("a").attr("class", "error-description").attr("href", "#").classed("hide-toggle", true).text(function(d4) {
84076 return d4.msg || _t("save.unknown_error_details");
84077 }).on("click", function(d3_event) {
84078 d3_event.preventDefault();
84079 var error = select_default2(this);
84080 var detail = select_default2(this.nextElementSibling);
84081 var exp2 = error.classed("expanded");
84082 detail.style("display", exp2 ? "none" : "block");
84083 error.classed("expanded", !exp2);
84085 var details = enter.append("div").attr("class", "error-detail-container").style("display", "none");
84086 details.append("ul").attr("class", "error-detail-list").selectAll("li").data(function(d4) {
84087 return d4.details || [];
84088 }).enter().append("li").attr("class", "error-detail-item").text(function(d4) {
84091 items.exit().remove();
84093 function showSuccess(changeset) {
84095 var ui = _success.changeset(changeset).location(_location).on("cancel", function() {
84096 context.ui().sidebar.hide();
84098 context.enter(modeBrowse(context).sidebar(ui));
84100 function keybindingOn() {
84101 select_default2(document).call(keybinding.on("\u238B", cancel, true));
84103 function keybindingOff() {
84104 select_default2(document).call(keybinding.unbind);
84106 function prepareForSuccess() {
84107 _success = uiSuccess(context);
84109 if (!services.geocoder) return;
84110 services.geocoder.reverse(context.map().center(), function(err, result) {
84111 if (err || !result || !result.address) return;
84112 var addr = result.address;
84113 var place = addr && (addr.town || addr.city || addr.county) || "";
84114 var region = addr && (addr.state || addr.country) || "";
84115 var separator = place && region ? _t("success.thank_you_where.separator") : "";
84117 "success.thank_you_where.format",
84118 { place, separator, region }
84122 mode.selectedIDs = function() {
84123 return _conflictsUi ? _conflictsUi.shownEntityIds() : [];
84125 mode.enter = function() {
84126 context.ui().sidebar.expand();
84128 context.ui().sidebar.show(commit);
84131 context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
84132 var osm = context.connection();
84137 if (osm.authenticated()) {
84140 osm.authenticate(function(err) {
84149 mode.exit = function() {
84151 context.container().selectAll(".main-content").classed("active", true).classed("inactive", false);
84152 context.ui().sidebar.hide();
84156 var init_save2 = __esm({
84157 "modules/modes/save.js"() {
84171 // modules/modes/index.js
84172 var modes_exports2 = {};
84173 __export(modes_exports2, {
84174 modeAddArea: () => modeAddArea,
84175 modeAddLine: () => modeAddLine,
84176 modeAddNote: () => modeAddNote,
84177 modeAddPoint: () => modeAddPoint,
84178 modeBrowse: () => modeBrowse,
84179 modeDragNode: () => modeDragNode,
84180 modeDragNote: () => modeDragNote,
84181 modeDrawArea: () => modeDrawArea,
84182 modeDrawLine: () => modeDrawLine,
84183 modeMove: () => modeMove,
84184 modeRotate: () => modeRotate,
84185 modeSave: () => modeSave,
84186 modeSelect: () => modeSelect,
84187 modeSelectData: () => modeSelectData,
84188 modeSelectError: () => modeSelectError,
84189 modeSelectNote: () => modeSelectNote
84191 var init_modes2 = __esm({
84192 "modules/modes/index.js"() {
84207 init_select_data();
84208 init_select_error();
84209 init_select_note();
84213 // modules/core/context.js
84214 var context_exports = {};
84215 __export(context_exports, {
84216 coreContext: () => coreContext
84218 function coreContext() {
84219 const dispatch14 = dispatch_default("enter", "exit", "change");
84220 const context = {};
84221 let _deferred2 = /* @__PURE__ */ new Set();
84222 context.version = package_default.version;
84223 context.privacyVersion = "20201202";
84224 context.initialHashParams = window.location.hash ? utilStringQs(window.location.hash) : {};
84225 context.changeset = null;
84226 let _defaultChangesetComment = context.initialHashParams.comment;
84227 let _defaultChangesetSource = context.initialHashParams.source;
84228 let _defaultChangesetHashtags = context.initialHashParams.hashtags;
84229 context.defaultChangesetComment = function(val) {
84230 if (!arguments.length) return _defaultChangesetComment;
84231 _defaultChangesetComment = val;
84234 context.defaultChangesetSource = function(val) {
84235 if (!arguments.length) return _defaultChangesetSource;
84236 _defaultChangesetSource = val;
84239 context.defaultChangesetHashtags = function(val) {
84240 if (!arguments.length) return _defaultChangesetHashtags;
84241 _defaultChangesetHashtags = val;
84244 let _setsDocumentTitle = true;
84245 context.setsDocumentTitle = function(val) {
84246 if (!arguments.length) return _setsDocumentTitle;
84247 _setsDocumentTitle = val;
84250 let _documentTitleBase = document.title;
84251 context.documentTitleBase = function(val) {
84252 if (!arguments.length) return _documentTitleBase;
84253 _documentTitleBase = val;
84257 context.ui = () => _ui;
84258 context.lastPointerType = () => _ui.lastPointerType();
84259 let _keybinding = utilKeybinding("context");
84260 context.keybinding = () => _keybinding;
84261 select_default2(document).call(_keybinding);
84262 let _connection = services.osm;
84266 context.connection = () => _connection;
84267 context.history = () => _history;
84268 context.validator = () => _validator;
84269 context.uploader = () => _uploader;
84270 context.preauth = (options) => {
84272 _connection.switch(options);
84276 context.locale = function(locale3) {
84277 if (!arguments.length) return _mainLocalizer.localeCode();
84278 _mainLocalizer.preferredLocaleCodes(locale3);
84281 function afterLoad(cid, callback) {
84282 return (err, result) => {
84284 if (typeof callback === "function") {
84288 } else if (_connection && _connection.getConnectionId() !== cid) {
84289 if (typeof callback === "function") {
84290 callback({ message: "Connection Switched", status: -1 });
84294 _history.merge(result.data, result.extent);
84295 if (typeof callback === "function") {
84296 callback(err, result);
84302 context.loadTiles = (projection2, callback) => {
84303 const handle = window.requestIdleCallback(() => {
84304 _deferred2.delete(handle);
84305 if (_connection && context.editableDataEnabled()) {
84306 const cid = _connection.getConnectionId();
84307 _connection.loadTiles(projection2, afterLoad(cid, callback));
84310 _deferred2.add(handle);
84312 context.loadTileAtLoc = (loc, callback) => {
84313 const handle = window.requestIdleCallback(() => {
84314 _deferred2.delete(handle);
84315 if (_connection && context.editableDataEnabled()) {
84316 const cid = _connection.getConnectionId();
84317 _connection.loadTileAtLoc(loc, afterLoad(cid, callback));
84320 _deferred2.add(handle);
84322 context.loadEntity = (entityID, callback) => {
84324 const cid = _connection.getConnectionId();
84325 _connection.loadEntity(entityID, afterLoad(cid, callback));
84326 _connection.loadEntityRelations(entityID, afterLoad(cid, callback));
84329 context.loadNote = (entityID, callback) => {
84331 const cid = _connection.getConnectionId();
84332 _connection.loadEntityNote(entityID, afterLoad(cid, callback));
84335 context.zoomToEntity = (entityID, zoomTo) => {
84336 context.zoomToEntities([entityID], zoomTo);
84338 context.zoomToEntities = (entityIDs, zoomTo) => {
84339 let loadedEntities = [];
84340 const throttledZoomTo = throttle_default(() => _map.zoomTo(loadedEntities), 500);
84341 entityIDs.forEach((entityID) => context.loadEntity(entityID, (err, result) => {
84343 const entity = result.data.find((e3) => e3.id === entityID);
84344 if (!entity) return;
84345 loadedEntities.push(entity);
84346 if (zoomTo !== false) {
84350 _map.on("drawn.zoomToEntity", () => {
84351 if (!entityIDs.every((entityID) => context.hasEntity(entityID))) return;
84352 _map.on("drawn.zoomToEntity", null);
84353 context.on("enter.zoomToEntity", null);
84354 context.enter(modeSelect(context, entityIDs));
84356 context.on("enter.zoomToEntity", () => {
84357 if (_mode.id !== "browse") {
84358 _map.on("drawn.zoomToEntity", null);
84359 context.on("enter.zoomToEntity", null);
84363 context.moveToNote = (noteId, moveTo) => {
84364 context.loadNote(noteId, (err, result) => {
84366 const entity = result.data.find((e3) => e3.id === noteId);
84367 if (!entity) return;
84368 const note = services.osm.getNote(noteId);
84369 if (moveTo !== false) {
84370 context.map().center(note.loc);
84372 const noteLayer = context.layers().layer("notes");
84373 noteLayer.enabled(true);
84374 context.enter(modeSelectNote(context, noteId));
84377 let _minEditableZoom = 16;
84378 context.minEditableZoom = function(val) {
84379 if (!arguments.length) return _minEditableZoom;
84380 _minEditableZoom = val;
84382 _connection.tileZoom(val);
84386 context.maxCharsForTagKey = () => 255;
84387 context.maxCharsForTagValue = () => 255;
84388 context.maxCharsForRelationRole = () => 255;
84389 context.cleanTagKey = (val) => utilCleanOsmString(val, context.maxCharsForTagKey());
84390 context.cleanTagValue = (val) => utilCleanOsmString(val, context.maxCharsForTagValue());
84391 context.cleanRelationRole = (val) => utilCleanOsmString(val, context.maxCharsForRelationRole());
84392 let _inIntro = false;
84393 context.inIntro = function(val) {
84394 if (!arguments.length) return _inIntro;
84398 context.save = () => {
84399 if (_inIntro || context.container().select(".modal").size()) return;
84401 if (_mode && _mode.id === "save") {
84403 if (services.osm && services.osm.isChangesetInflight()) {
84404 _history.clearSaved();
84408 canSave = context.selectedIDs().every((id2) => {
84409 const entity = context.hasEntity(id2);
84410 return entity && !entity.isDegenerate();
84416 if (_history.hasChanges()) {
84417 return _t("save.unsaved_changes");
84420 context.debouncedSave = debounce_default(context.save, 350);
84421 function withDebouncedSave(fn) {
84422 return function() {
84423 const result = fn.apply(_history, arguments);
84424 context.debouncedSave();
84428 context.hasEntity = (id2) => _history.graph().hasEntity(id2);
84429 context.entity = (id2) => _history.graph().entity(id2);
84431 context.mode = () => _mode;
84432 context.enter = (newMode) => {
84435 dispatch14.call("exit", this, _mode);
84439 dispatch14.call("enter", this, _mode);
84441 context.selectedIDs = () => _mode && _mode.selectedIDs && _mode.selectedIDs() || [];
84442 context.activeID = () => _mode && _mode.activeID && _mode.activeID();
84443 let _selectedNoteID;
84444 context.selectedNoteID = function(noteID) {
84445 if (!arguments.length) return _selectedNoteID;
84446 _selectedNoteID = noteID;
84449 let _selectedErrorID;
84450 context.selectedErrorID = function(errorID) {
84451 if (!arguments.length) return _selectedErrorID;
84452 _selectedErrorID = errorID;
84455 context.install = (behavior) => context.surface().call(behavior);
84456 context.uninstall = (behavior) => context.surface().call(behavior.off);
84458 context.copyGraph = () => _copyGraph;
84460 context.copyIDs = function(val) {
84461 if (!arguments.length) return _copyIDs;
84463 _copyGraph = _history.graph();
84467 context.copyLonLat = function(val) {
84468 if (!arguments.length) return _copyLonLat;
84473 context.background = () => _background;
84475 context.features = () => _features;
84476 context.hasHiddenConnections = (id2) => {
84477 const graph = _history.graph();
84478 const entity = graph.entity(id2);
84479 return _features.hasHiddenConnections(entity, graph);
84482 context.photos = () => _photos;
84484 context.map = () => _map;
84485 context.layers = () => _map.layers();
84486 context.surface = () => _map.surface;
84487 context.editableDataEnabled = () => _map.editableDataEnabled();
84488 context.surfaceRect = () => _map.surface.node().getBoundingClientRect();
84489 context.editable = () => {
84490 const mode = context.mode();
84491 if (!mode || mode.id === "save") return false;
84492 return _map.editableDataEnabled();
84494 let _debugFlags = {
84498 // label collision bounding boxes
84500 // imagery bounding polygons
84504 // downloaded data from osm
84506 context.debugFlags = () => _debugFlags;
84507 context.getDebug = (flag) => flag && _debugFlags[flag];
84508 context.setDebug = function(flag, val) {
84509 if (arguments.length === 1) val = true;
84510 _debugFlags[flag] = val;
84511 dispatch14.call("change");
84514 let _container = select_default2(null);
84515 context.container = function(val) {
84516 if (!arguments.length) return _container;
84518 _container.classed("ideditor", true);
84521 context.containerNode = function(val) {
84522 if (!arguments.length) return context.container().node();
84523 context.container(select_default2(val));
84527 context.embed = function(val) {
84528 if (!arguments.length) return _embed;
84532 let _assetPath = "";
84533 context.assetPath = function(val) {
84534 if (!arguments.length) return _assetPath;
84536 _mainFileFetcher.assetPath(val);
84539 let _assetMap = {};
84540 context.assetMap = function(val) {
84541 if (!arguments.length) return _assetMap;
84543 _mainFileFetcher.assetMap(val);
84546 context.asset = (val) => {
84547 if (/^http(s)?:\/\//i.test(val)) return val;
84548 const filename = _assetPath + val;
84549 return _assetMap[filename] || filename;
84551 context.imagePath = (val) => context.asset(`img/${val}`);
84552 context.reset = context.flush = () => {
84553 context.debouncedSave.cancel();
84554 Array.from(_deferred2).forEach((handle) => {
84555 window.cancelIdleCallback(handle);
84556 _deferred2.delete(handle);
84558 Object.values(services).forEach((service) => {
84559 if (service && typeof service.reset === "function") {
84560 service.reset(context);
84563 context.changeset = null;
84564 _validator.reset();
84568 context.container().select(".inspector-wrap *").remove();
84571 context.projection = geoRawMercator();
84572 context.curtainProjection = geoRawMercator();
84573 context.init = () => {
84574 instantiateInternal();
84575 initializeDependents();
84577 function instantiateInternal() {
84578 _history = coreHistory(context);
84579 context.graph = _history.graph;
84580 context.pauseChangeDispatch = _history.pauseChangeDispatch;
84581 context.resumeChangeDispatch = _history.resumeChangeDispatch;
84582 context.perform = withDebouncedSave(_history.perform);
84583 context.replace = withDebouncedSave(_history.replace);
84584 context.pop = withDebouncedSave(_history.pop);
84585 context.undo = withDebouncedSave(_history.undo);
84586 context.redo = withDebouncedSave(_history.redo);
84587 _validator = coreValidator(context);
84588 _uploader = coreUploader(context);
84589 _background = rendererBackground(context);
84590 _features = rendererFeatures(context);
84591 _map = rendererMap(context);
84592 _photos = rendererPhotos(context);
84593 _ui = uiInit(context);
84595 function initializeDependents() {
84596 if (context.initialHashParams.presets) {
84597 _mainPresetIndex.addablePresetIDs(new Set(context.initialHashParams.presets.split(",")));
84599 if (context.initialHashParams.locale) {
84600 _mainLocalizer.preferredLocaleCodes(context.initialHashParams.locale);
84602 _mainLocalizer.ensureLoaded();
84603 _mainPresetIndex.ensureLoaded();
84604 _background.ensureLoaded();
84605 Object.values(services).forEach((service) => {
84606 if (service && typeof service.init === "function") {
84613 if (services.maprules && context.initialHashParams.maprules) {
84614 json_default(context.initialHashParams.maprules).then((mapcss) => {
84615 services.maprules.init();
84616 mapcss.forEach((mapcssSelector) => services.maprules.addRule(mapcssSelector));
84620 if (!context.container().empty()) {
84621 _ui.ensureLoaded().then(() => {
84622 _background.init();
84628 return utilRebind(context, dispatch14, "on");
84630 var init_context2 = __esm({
84631 "modules/core/context.js"() {
84640 init_file_fetcher();
84645 init_raw_mercator();
84655 // modules/core/index.js
84656 var core_exports = {};
84657 __export(core_exports, {
84658 LocationManager: () => LocationManager,
84659 coreContext: () => coreContext,
84660 coreDifference: () => coreDifference,
84661 coreFileFetcher: () => coreFileFetcher,
84662 coreGraph: () => coreGraph,
84663 coreHistory: () => coreHistory,
84664 coreLocalizer: () => coreLocalizer,
84665 coreTree: () => coreTree,
84666 coreUploader: () => coreUploader,
84667 coreValidator: () => coreValidator,
84668 fileFetcher: () => _mainFileFetcher,
84669 localizer: () => _mainLocalizer,
84670 locationManager: () => _sharedLocationManager,
84671 prefs: () => corePreferences,
84674 var init_core = __esm({
84675 "modules/core/index.js"() {
84678 init_file_fetcher();
84683 init_LocationManager();
84684 init_preferences();
84691 // modules/behavior/operation.js
84692 var operation_exports = {};
84693 __export(operation_exports, {
84694 behaviorOperation: () => behaviorOperation
84696 function behaviorOperation(context) {
84698 function keypress(d3_event) {
84700 if (!context.map().withinEditableZoom()) return;
84701 if (((_a4 = _operation.availableForKeypress) == null ? void 0 : _a4.call(_operation)) === false) return;
84702 d3_event.preventDefault();
84703 if (!_operation.available()) {
84704 context.ui().flash.duration(4e3).iconName("#iD-operation-" + _operation.id).iconClass("operation disabled").label(_t.append("operations._unavailable", {
84705 operation: _t(`operations.${_operation.id}.title`) || _operation.id
84707 } else if (_operation.disabled()) {
84708 context.ui().flash.duration(4e3).iconName("#iD-operation-" + _operation.id).iconClass("operation disabled").label(_operation.tooltip())();
84710 context.ui().flash.duration(2e3).iconName("#iD-operation-" + _operation.id).iconClass("operation").label(_operation.annotation() || _operation.title)();
84711 if (_operation.point) _operation.point(null);
84712 _operation(d3_event);
84715 function behavior() {
84716 if (_operation && _operation.available()) {
84721 behavior.on = function() {
84722 context.keybinding().on(_operation.keys, keypress);
84724 behavior.off = function() {
84725 context.keybinding().off(_operation.keys);
84727 behavior.which = function(_3) {
84728 if (!arguments.length) return _operation;
84734 var init_operation = __esm({
84735 "modules/behavior/operation.js"() {
84741 // modules/operations/circularize.js
84742 var circularize_exports2 = {};
84743 __export(circularize_exports2, {
84744 operationCircularize: () => operationCircularize
84746 function operationCircularize(context, selectedIDs) {
84748 var _actions = selectedIDs.map(getAction).filter(Boolean);
84749 var _amount = _actions.length === 1 ? "single" : "multiple";
84750 var _coords = utilGetAllNodes(selectedIDs, context.graph()).map(function(n3) {
84753 function getAction(entityID) {
84754 var entity = context.entity(entityID);
84755 if (entity.type !== "way" || new Set(entity.nodes).size <= 1) return null;
84757 _extent = entity.extent(context.graph());
84759 _extent = _extent.extend(entity.extent(context.graph()));
84761 return actionCircularize(entityID, context.projection);
84763 var operation2 = function() {
84764 if (!_actions.length) return;
84765 var combinedAction = function(graph, t2) {
84766 _actions.forEach(function(action) {
84767 if (!action.disabled(graph)) {
84768 graph = action(graph, t2);
84773 combinedAction.transitionable = true;
84774 context.perform(combinedAction, operation2.annotation());
84775 window.setTimeout(function() {
84776 context.validator().validate();
84779 operation2.available = function() {
84780 return _actions.length && selectedIDs.length === _actions.length;
84782 operation2.disabled = function() {
84783 if (!_actions.length) return "";
84784 var actionDisableds = _actions.map(function(action) {
84785 return action.disabled(context.graph());
84786 }).filter(Boolean);
84787 if (actionDisableds.length === _actions.length) {
84788 if (new Set(actionDisableds).size > 1) {
84789 return "multiple_blockers";
84791 return actionDisableds[0];
84792 } else if (_extent.percentContainedIn(context.map().extent()) < 0.8) {
84793 return "too_large";
84794 } else if (someMissing()) {
84795 return "not_downloaded";
84796 } else if (selectedIDs.some(context.hasHiddenConnections)) {
84797 return "connected_to_hidden";
84800 function someMissing() {
84801 if (context.inIntro()) return false;
84802 var osm = context.connection();
84804 var missing = _coords.filter(function(loc) {
84805 return !osm.isDataLoaded(loc);
84807 if (missing.length) {
84808 missing.forEach(function(loc) {
84809 context.loadTileAtLoc(loc);
84817 operation2.tooltip = function() {
84818 var disable = operation2.disabled();
84819 return disable ? _t.append("operations.circularize." + disable + "." + _amount) : _t.append("operations.circularize.description." + _amount);
84821 operation2.annotation = function() {
84822 return _t("operations.circularize.annotation.feature", { n: _actions.length });
84824 operation2.id = "circularize";
84825 operation2.keys = [_t("operations.circularize.key")];
84826 operation2.title = _t.append("operations.circularize.title");
84827 operation2.behavior = behaviorOperation(context).which(operation2);
84830 var init_circularize2 = __esm({
84831 "modules/operations/circularize.js"() {
84834 init_circularize();
84840 // modules/operations/rotate.js
84841 var rotate_exports3 = {};
84842 __export(rotate_exports3, {
84843 operationRotate: () => operationRotate
84845 function operationRotate(context, selectedIDs) {
84846 var multi = selectedIDs.length === 1 ? "single" : "multiple";
84847 var nodes = utilGetAllNodes(selectedIDs, context.graph());
84848 var coords = nodes.map(function(n3) {
84851 var extent = utilTotalExtent(selectedIDs, context.graph());
84852 var operation2 = function() {
84853 context.enter(modeRotate(context, selectedIDs));
84855 operation2.available = function() {
84856 return nodes.length >= 2;
84858 operation2.disabled = function() {
84859 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
84860 return "too_large";
84861 } else if (someMissing()) {
84862 return "not_downloaded";
84863 } else if (selectedIDs.some(context.hasHiddenConnections)) {
84864 return "connected_to_hidden";
84865 } else if (selectedIDs.some(incompleteRelation)) {
84866 return "incomplete_relation";
84869 function someMissing() {
84870 if (context.inIntro()) return false;
84871 var osm = context.connection();
84873 var missing = coords.filter(function(loc) {
84874 return !osm.isDataLoaded(loc);
84876 if (missing.length) {
84877 missing.forEach(function(loc) {
84878 context.loadTileAtLoc(loc);
84885 function incompleteRelation(id2) {
84886 var entity = context.entity(id2);
84887 return entity.type === "relation" && !entity.isComplete(context.graph());
84890 operation2.tooltip = function() {
84891 var disable = operation2.disabled();
84892 return disable ? _t.append("operations.rotate." + disable + "." + multi) : _t.append("operations.rotate.description." + multi);
84894 operation2.annotation = function() {
84895 return selectedIDs.length === 1 ? _t("operations.rotate.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.rotate.annotation.feature", { n: selectedIDs.length });
84897 operation2.id = "rotate";
84898 operation2.keys = [_t("operations.rotate.key")];
84899 operation2.title = _t.append("operations.rotate.title");
84900 operation2.behavior = behaviorOperation(context).which(operation2);
84901 operation2.mouseOnly = true;
84904 var init_rotate3 = __esm({
84905 "modules/operations/rotate.js"() {
84914 // modules/modes/move.js
84915 var move_exports3 = {};
84916 __export(move_exports3, {
84917 modeMove: () => modeMove
84919 function modeMove(context, entityIDs, baseGraph) {
84920 var _tolerancePx = 4;
84925 var keybinding = utilKeybinding("move");
84927 behaviorEdit(context),
84928 operationCircularize(context, entityIDs).behavior,
84929 operationDelete(context, entityIDs).behavior,
84930 operationOrthogonalize(context, entityIDs).behavior,
84931 operationReflectLong(context, entityIDs).behavior,
84932 operationReflectShort(context, entityIDs).behavior,
84933 operationRotate(context, entityIDs).behavior
84935 var annotation = entityIDs.length === 1 ? _t("operations.move.annotation." + context.graph().geometry(entityIDs[0])) : _t("operations.move.annotation.feature", { n: entityIDs.length });
84938 var _origMouseCoords;
84939 var _nudgeInterval;
84940 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
84941 function doMove(nudge) {
84942 nudge = nudge || [0, 0];
84944 if (_prevGraph !== context.graph()) {
84946 _origMouseCoords = context.map().mouseCoordinates();
84947 fn = context.perform;
84951 context.perform(action);
84954 const currMouseCoords = context.map().mouseCoordinates();
84955 const currMouse = context.projection(currMouseCoords);
84956 const origMouse = context.projection(_origMouseCoords);
84957 const delta = geoVecSubtract(geoVecSubtract(currMouse, origMouse), nudge);
84958 fn(actionMove(entityIDs, delta, context.projection, _cache5));
84959 _prevGraph = context.graph();
84961 function startNudge(nudge) {
84962 if (_nudgeInterval) window.clearInterval(_nudgeInterval);
84963 _nudgeInterval = window.setInterval(function() {
84964 context.map().pan(nudge);
84968 function stopNudge() {
84969 if (_nudgeInterval) {
84970 window.clearInterval(_nudgeInterval);
84971 _nudgeInterval = null;
84976 var nudge = geoViewportEdge(context.map().mouse(), context.map().dimensions());
84983 function finish(d3_event) {
84984 d3_event.stopPropagation();
84985 context.replace(actionNoop(), annotation);
84986 context.enter(modeSelect(context, entityIDs));
84989 function cancel() {
84991 while (context.graph() !== baseGraph) context.pop();
84992 context.enter(modeBrowse(context));
84994 if (_prevGraph) context.pop();
84995 context.enter(modeSelect(context, entityIDs));
84999 function undone() {
85000 context.enter(modeBrowse(context));
85002 mode.enter = function() {
85003 _origMouseCoords = context.map().mouseCoordinates();
85006 context.features().forceVisible(entityIDs);
85007 behaviors.forEach(context.install);
85009 context.surface().on(_pointerPrefix + "down.modeMove", function(d3_event) {
85010 downEvent = d3_event;
85012 select_default2(window).on(_pointerPrefix + "move.modeMove", move, true).on(_pointerPrefix + "up.modeMove", function(d3_event) {
85013 if (!downEvent) return;
85014 var mapNode = context.container().select(".main-map").node();
85015 var pointGetter = utilFastMouse(mapNode);
85016 var p1 = pointGetter(downEvent);
85017 var p2 = pointGetter(d3_event);
85018 var dist = geoVecLength(p1, p2);
85019 if (dist <= _tolerancePx) finish(d3_event);
85022 context.history().on("undone.modeMove", undone);
85023 keybinding.on("\u238B", cancel).on("\u21A9", finish);
85024 select_default2(document).call(keybinding);
85026 mode.exit = function() {
85028 behaviors.forEach(function(behavior) {
85029 context.uninstall(behavior);
85031 context.surface().on(_pointerPrefix + "down.modeMove", null);
85032 select_default2(window).on(_pointerPrefix + "move.modeMove", null, true).on(_pointerPrefix + "up.modeMove", null, true);
85033 context.history().on("undone.modeMove", null);
85034 select_default2(document).call(keybinding.unbind);
85035 context.features().forceVisible([]);
85037 mode.selectedIDs = function() {
85038 if (!arguments.length) return entityIDs;
85041 mode.annotation = function(_annotation) {
85042 annotation = _annotation;
85047 var init_move3 = __esm({
85048 "modules/modes/move.js"() {
85061 init_circularize2();
85063 init_orthogonalize2();
85069 // modules/operations/continue.js
85070 var continue_exports = {};
85071 __export(continue_exports, {
85072 operationContinue: () => operationContinue
85074 function operationContinue(context, selectedIDs) {
85075 var _entities = selectedIDs.map(function(id2) {
85076 return context.graph().entity(id2);
85078 var _geometries = Object.assign(
85079 { line: [], vertex: [] },
85080 utilArrayGroupBy(_entities, function(entity) {
85081 return entity.geometry(context.graph());
85084 var _vertex = _geometries.vertex.length && _geometries.vertex[0];
85085 function candidateWays() {
85086 return _vertex ? context.graph().parentWays(_vertex).filter(function(parent2) {
85087 const geom = parent2.geometry(context.graph());
85088 return (geom === "line" || geom === "area") && !parent2.isClosed() && parent2.affix(_vertex.id) && (_geometries.line.length === 0 || _geometries.line[0] === parent2);
85091 var _candidates = candidateWays();
85092 var operation2 = function() {
85093 var candidate = _candidates[0];
85094 const tagsToRemove = /* @__PURE__ */ new Set();
85095 if (_vertex.tags.fixme === "continue") tagsToRemove.add("fixme");
85096 if (_vertex.tags.noexit === "yes") tagsToRemove.add("noexit");
85097 if (tagsToRemove.size) {
85098 context.perform((graph) => {
85099 const newTags = { ..._vertex.tags };
85100 for (const key of tagsToRemove) {
85101 delete newTags[key];
85103 return actionChangeTags(_vertex.id, newTags)(graph);
85104 }, operation2.annotation());
85107 modeDrawLine(context, candidate.id, context.graph(), "line", candidate.affix(_vertex.id), true)
85110 operation2.relatedEntityIds = function() {
85111 return _candidates.length ? [_candidates[0].id] : [];
85113 operation2.available = function() {
85114 return _geometries.vertex.length === 1 && _geometries.line.length <= 1 && !context.features().hasHiddenConnections(_vertex, context.graph());
85116 operation2.disabled = function() {
85117 if (_candidates.length === 0) {
85118 return "not_eligible";
85119 } else if (_candidates.length > 1) {
85124 operation2.tooltip = function() {
85125 var disable = operation2.disabled();
85126 return disable ? _t.append("operations.continue." + disable) : _t.append("operations.continue.description");
85128 operation2.annotation = function() {
85129 return _t("operations.continue.annotation.line");
85131 operation2.id = "continue";
85132 operation2.keys = [_t("operations.continue.key")];
85133 operation2.title = _t.append("operations.continue.title");
85134 operation2.behavior = behaviorOperation(context).which(operation2);
85137 var init_continue = __esm({
85138 "modules/operations/continue.js"() {
85148 // modules/operations/copy.js
85149 var copy_exports = {};
85150 __export(copy_exports, {
85151 operationCopy: () => operationCopy
85153 function operationCopy(context, selectedIDs) {
85154 function getFilteredIdsToCopy() {
85155 return selectedIDs.filter(function(selectedID) {
85156 var entity = context.graph().hasEntity(selectedID);
85157 return entity.hasInterestingTags() || entity.geometry(context.graph()) !== "vertex";
85160 var operation2 = function() {
85161 var graph = context.graph();
85162 var selected = groupEntities(getFilteredIdsToCopy(), graph);
85167 for (i3 = 0; i3 < selected.relation.length; i3++) {
85168 entity = selected.relation[i3];
85169 if (!skip[entity.id] && entity.isComplete(graph)) {
85170 canCopy.push(entity.id);
85171 skip = getDescendants(entity.id, graph, skip);
85174 for (i3 = 0; i3 < selected.way.length; i3++) {
85175 entity = selected.way[i3];
85176 if (!skip[entity.id]) {
85177 canCopy.push(entity.id);
85178 skip = getDescendants(entity.id, graph, skip);
85181 for (i3 = 0; i3 < selected.node.length; i3++) {
85182 entity = selected.node[i3];
85183 if (!skip[entity.id]) {
85184 canCopy.push(entity.id);
85187 context.copyIDs(canCopy);
85188 if (_point && (canCopy.length !== 1 || graph.entity(canCopy[0]).type !== "node")) {
85189 context.copyLonLat(context.projection.invert(_point));
85191 context.copyLonLat(null);
85194 function groupEntities(ids, graph) {
85195 var entities = ids.map(function(id2) {
85196 return graph.entity(id2);
85198 return Object.assign(
85199 { relation: [], way: [], node: [] },
85200 utilArrayGroupBy(entities, "type")
85203 function getDescendants(id2, graph, descendants) {
85204 var entity = graph.entity(id2);
85206 descendants = descendants || {};
85207 if (entity.type === "relation") {
85208 children2 = entity.members.map(function(m3) {
85211 } else if (entity.type === "way") {
85212 children2 = entity.nodes;
85216 for (var i3 = 0; i3 < children2.length; i3++) {
85217 if (!descendants[children2[i3]]) {
85218 descendants[children2[i3]] = true;
85219 descendants = getDescendants(children2[i3], graph, descendants);
85222 return descendants;
85224 operation2.available = function() {
85225 return getFilteredIdsToCopy().length > 0;
85227 operation2.disabled = function() {
85228 var extent = utilTotalExtent(getFilteredIdsToCopy(), context.graph());
85229 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
85230 return "too_large";
85234 operation2.availableForKeypress = function() {
85236 const selection2 = (_a4 = window.getSelection) == null ? void 0 : _a4.call(window);
85237 return !(selection2 == null ? void 0 : selection2.toString());
85239 operation2.tooltip = function() {
85240 var disable = operation2.disabled();
85241 return disable ? _t.append("operations.copy." + disable, { n: selectedIDs.length }) : _t.append("operations.copy.description", { n: selectedIDs.length });
85243 operation2.annotation = function() {
85244 return _t("operations.copy.annotation", { n: selectedIDs.length });
85247 operation2.point = function(val) {
85251 operation2.id = "copy";
85252 operation2.keys = [uiCmd("\u2318C")];
85253 operation2.title = _t.append("operations.copy.title");
85254 operation2.behavior = behaviorOperation(context).which(operation2);
85257 var init_copy = __esm({
85258 "modules/operations/copy.js"() {
85267 // modules/operations/disconnect.js
85268 var disconnect_exports2 = {};
85269 __export(disconnect_exports2, {
85270 operationDisconnect: () => operationDisconnect
85272 function operationDisconnect(context, selectedIDs) {
85273 var _vertexIDs = [];
85275 var _otherIDs = [];
85277 selectedIDs.forEach(function(id2) {
85278 var entity = context.entity(id2);
85279 if (entity.type === "way") {
85281 } else if (entity.geometry(context.graph()) === "vertex") {
85282 _vertexIDs.push(id2);
85284 _otherIDs.push(id2);
85287 var _coords, _descriptionID = "", _annotationID = "features";
85288 var _disconnectingVertexIds = [];
85289 var _disconnectingWayIds = [];
85290 if (_vertexIDs.length > 0) {
85291 _disconnectingVertexIds = _vertexIDs;
85292 _vertexIDs.forEach(function(vertexID) {
85293 var action = actionDisconnect(vertexID);
85294 if (_wayIDs.length > 0) {
85295 var waysIDsForVertex = _wayIDs.filter(function(wayID) {
85296 var way = context.entity(wayID);
85297 return way.nodes.indexOf(vertexID) !== -1;
85299 action.limitWays(waysIDsForVertex);
85301 _actions.push(action);
85302 _disconnectingWayIds = _disconnectingWayIds.concat(context.graph().parentWays(context.graph().entity(vertexID)).map((d4) => d4.id));
85304 _disconnectingWayIds = utilArrayUniq(_disconnectingWayIds).filter(function(id2) {
85305 return _wayIDs.indexOf(id2) === -1;
85307 _descriptionID += _actions.length === 1 ? "single_point." : "multiple_points.";
85308 if (_wayIDs.length === 1) {
85309 _descriptionID += "single_way." + context.graph().geometry(_wayIDs[0]);
85311 _descriptionID += _wayIDs.length === 0 ? "no_ways" : "multiple_ways";
85313 } else if (_wayIDs.length > 0) {
85314 var ways = _wayIDs.map(function(id2) {
85315 return context.entity(id2);
85317 var nodes = utilGetAllNodes(_wayIDs, context.graph());
85318 _coords = nodes.map(function(n3) {
85321 var sharedActions = [];
85322 var sharedNodes = [];
85323 var unsharedActions = [];
85324 var unsharedNodes = [];
85325 nodes.forEach(function(node) {
85326 var action = actionDisconnect(node.id).limitWays(_wayIDs);
85327 if (action.disabled(context.graph()) !== "not_connected") {
85329 for (var i3 in ways) {
85330 var way = ways[i3];
85331 if (way.nodes.indexOf(node.id) !== -1) {
85334 if (count > 1) break;
85337 sharedActions.push(action);
85338 sharedNodes.push(node);
85340 unsharedActions.push(action);
85341 unsharedNodes.push(node);
85345 _descriptionID += "no_points.";
85346 _descriptionID += _wayIDs.length === 1 ? "single_way." : "multiple_ways.";
85347 if (sharedActions.length) {
85348 _actions = sharedActions;
85349 _disconnectingVertexIds = sharedNodes.map((node) => node.id);
85350 _descriptionID += "conjoined";
85351 _annotationID = "from_each_other";
85353 _actions = unsharedActions;
85354 _disconnectingVertexIds = unsharedNodes.map((node) => node.id);
85355 if (_wayIDs.length === 1) {
85356 _descriptionID += context.graph().geometry(_wayIDs[0]);
85358 _descriptionID += "separate";
85362 var _extent = utilTotalExtent(_disconnectingVertexIds, context.graph());
85363 var operation2 = function() {
85364 context.perform(function(graph) {
85365 return _actions.reduce(function(graph2, action) {
85366 return action(graph2);
85368 }, operation2.annotation());
85369 context.validator().validate();
85371 operation2.relatedEntityIds = function() {
85372 if (_vertexIDs.length) {
85373 return _disconnectingWayIds;
85375 return _disconnectingVertexIds;
85377 operation2.available = function() {
85378 if (_actions.length === 0) return false;
85379 if (_otherIDs.length !== 0) return false;
85380 if (_vertexIDs.length !== 0 && _wayIDs.length !== 0 && !_wayIDs.every(function(wayID) {
85381 return _vertexIDs.some(function(vertexID) {
85382 var way = context.entity(wayID);
85383 return way.nodes.indexOf(vertexID) !== -1;
85388 operation2.disabled = function() {
85390 for (var actionIndex in _actions) {
85391 reason = _actions[actionIndex].disabled(context.graph());
85392 if (reason) return reason;
85394 if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
85395 return "too_large." + ((_vertexIDs.length ? _vertexIDs : _wayIDs).length === 1 ? "single" : "multiple");
85396 } else if (_coords && someMissing()) {
85397 return "not_downloaded";
85398 } else if (selectedIDs.some(context.hasHiddenConnections)) {
85399 return "connected_to_hidden";
85402 function someMissing() {
85403 if (context.inIntro()) return false;
85404 var osm = context.connection();
85406 var missing = _coords.filter(function(loc) {
85407 return !osm.isDataLoaded(loc);
85409 if (missing.length) {
85410 missing.forEach(function(loc) {
85411 context.loadTileAtLoc(loc);
85419 operation2.tooltip = function() {
85420 var disable = operation2.disabled();
85421 return disable ? _t.append("operations.disconnect." + disable) : _t.append("operations.disconnect.description." + _descriptionID);
85423 operation2.annotation = function() {
85424 return _t("operations.disconnect.annotation." + _annotationID);
85426 operation2.id = "disconnect";
85427 operation2.keys = [_t("operations.disconnect.key")];
85428 operation2.title = _t.append("operations.disconnect.title");
85429 operation2.behavior = behaviorOperation(context).which(operation2);
85432 var init_disconnect2 = __esm({
85433 "modules/operations/disconnect.js"() {
85443 // modules/operations/downgrade.js
85444 var downgrade_exports = {};
85445 __export(downgrade_exports, {
85446 operationDowngrade: () => operationDowngrade
85448 function operationDowngrade(context, selectedIDs) {
85449 var _affectedFeatureCount = 0;
85450 var _downgradeType = downgradeTypeForEntityIDs(selectedIDs);
85451 var _multi = _affectedFeatureCount === 1 ? "single" : "multiple";
85452 function downgradeTypeForEntityIDs(entityIds) {
85454 _affectedFeatureCount = 0;
85455 for (var i3 in entityIds) {
85456 var entityID = entityIds[i3];
85457 var type2 = downgradeTypeForEntityID(entityID);
85459 _affectedFeatureCount += 1;
85460 if (downgradeType && type2 !== downgradeType) {
85461 if (downgradeType !== "generic" && type2 !== "generic") {
85462 downgradeType = "building_address";
85464 downgradeType = "generic";
85467 downgradeType = type2;
85471 return downgradeType;
85473 function downgradeTypeForEntityID(entityID) {
85474 var graph = context.graph();
85475 var entity = graph.entity(entityID);
85476 var preset = _mainPresetIndex.match(entity, graph);
85477 if (!preset || preset.isFallback()) return null;
85478 if (entity.type === "node" && preset.id !== "address" && Object.keys(entity.tags).some(function(key) {
85479 return key.match(/^addr:.{1,}/);
85483 var geometry = entity.geometry(graph);
85484 if (geometry === "area" && entity.tags.building && !preset.tags.building) {
85487 if (geometry === "vertex" && Object.keys(entity.tags).length) {
85492 var buildingKeysToKeep = ["architect", "building", "height", "layer", "nycdoitt:bin", "source", "type", "wheelchair"];
85493 var addressKeysToKeep = ["source"];
85494 var operation2 = function() {
85495 context.perform(function(graph) {
85496 for (var i3 in selectedIDs) {
85497 var entityID = selectedIDs[i3];
85498 var type2 = downgradeTypeForEntityID(entityID);
85499 if (!type2) continue;
85500 var tags = Object.assign({}, graph.entity(entityID).tags);
85501 for (var key in tags) {
85502 if (type2 === "address" && addressKeysToKeep.indexOf(key) !== -1) continue;
85503 if (type2 === "building") {
85504 if (buildingKeysToKeep.indexOf(key) !== -1 || key.match(/^building:.{1,}/) || key.match(/^roof:.{1,}/)) continue;
85506 if (type2 !== "generic") {
85507 if (key.match(/^addr:.{1,}/) || key.match(/^source:.{1,}/)) continue;
85511 graph = actionChangeTags(entityID, tags)(graph);
85514 }, operation2.annotation());
85515 context.validator().validate();
85516 context.enter(modeSelect(context, selectedIDs));
85518 operation2.available = function() {
85519 return _downgradeType;
85521 operation2.disabled = function() {
85522 if (selectedIDs.some(hasWikidataTag)) {
85523 return "has_wikidata_tag";
85526 function hasWikidataTag(id2) {
85527 var entity = context.entity(id2);
85528 return entity.tags.wikidata && entity.tags.wikidata.trim().length > 0;
85531 operation2.tooltip = function() {
85532 var disable = operation2.disabled();
85533 return disable ? _t.append("operations.downgrade." + disable + "." + _multi) : _t.append("operations.downgrade.description." + _downgradeType);
85535 operation2.annotation = function() {
85537 if (_downgradeType === "building_address") {
85538 suffix = "generic";
85540 suffix = _downgradeType;
85542 return _t("operations.downgrade.annotation." + suffix, { n: _affectedFeatureCount });
85544 operation2.id = "downgrade";
85545 operation2.keys = [uiCmd("\u232B")];
85546 operation2.title = _t.append("operations.downgrade.title");
85547 operation2.behavior = behaviorOperation(context).which(operation2);
85550 var init_downgrade = __esm({
85551 "modules/operations/downgrade.js"() {
85553 init_change_tags();
85562 // modules/operations/extract.js
85563 var extract_exports2 = {};
85564 __export(extract_exports2, {
85565 operationExtract: () => operationExtract
85567 function operationExtract(context, selectedIDs) {
85568 var _amount = selectedIDs.length === 1 ? "single" : "multiple";
85569 var _geometries = utilArrayUniq(selectedIDs.map(function(entityID) {
85570 return context.graph().hasEntity(entityID) && context.graph().geometry(entityID);
85571 }).filter(Boolean));
85572 var _geometryID = _geometries.length === 1 ? _geometries[0] : "feature";
85574 var _actions = selectedIDs.map(function(entityID) {
85575 var graph = context.graph();
85576 var entity = graph.hasEntity(entityID);
85577 if (!entity || !entity.hasInterestingTags()) return null;
85578 if (entity.type === "node" && graph.parentWays(entity).length === 0) return null;
85579 if (entity.type !== "node") {
85580 var preset = _mainPresetIndex.match(entity, graph);
85581 if (preset.geometry.indexOf("point") === -1) return null;
85583 _extent = _extent ? _extent.extend(entity.extent(graph)) : entity.extent(graph);
85584 return actionExtract(entityID, context.projection);
85585 }).filter(Boolean);
85586 var operation2 = function(d3_event) {
85587 const shiftKeyPressed = (d3_event == null ? void 0 : d3_event.shiftKey) || false;
85588 var combinedAction = function(graph) {
85589 _actions.forEach(function(action) {
85590 graph = action(graph, shiftKeyPressed);
85594 context.perform(combinedAction, operation2.annotation());
85595 var extractedNodeIDs = _actions.map(function(action) {
85596 return action.getExtractedNodeID();
85598 context.enter(modeSelect(context, extractedNodeIDs));
85600 operation2.available = function() {
85601 return _actions.length && selectedIDs.length === _actions.length;
85603 operation2.disabled = function() {
85604 if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
85605 return "too_large";
85606 } else if (selectedIDs.some(function(entityID) {
85607 return context.graph().geometry(entityID) === "vertex" && context.hasHiddenConnections(entityID);
85609 return "connected_to_hidden";
85613 operation2.tooltip = function() {
85614 var disableReason = operation2.disabled();
85615 if (disableReason) {
85616 return _t.append("operations.extract." + disableReason + "." + _amount);
85618 return _t.append("operations.extract.description." + _geometryID + "." + _amount);
85621 operation2.annotation = function() {
85622 return _t("operations.extract.annotation", { n: selectedIDs.length });
85624 operation2.id = "extract";
85625 operation2.keys = [_t("operations.extract.key")];
85626 operation2.title = _t.append("operations.extract.title");
85627 operation2.behavior = behaviorOperation(context).which(operation2);
85630 var init_extract2 = __esm({
85631 "modules/operations/extract.js"() {
85642 // modules/operations/merge.js
85643 var merge_exports2 = {};
85644 __export(merge_exports2, {
85645 operationMerge: () => operationMerge
85647 function operationMerge(context, selectedIDs) {
85648 var _action = getAction();
85649 function getAction() {
85650 var join = actionJoin(selectedIDs);
85651 if (!join.disabled(context.graph())) return join;
85652 var merge3 = actionMerge(selectedIDs);
85653 if (!merge3.disabled(context.graph())) return merge3;
85654 var mergePolygon = actionMergePolygon(selectedIDs);
85655 if (!mergePolygon.disabled(context.graph())) return mergePolygon;
85656 var mergeNodes = actionMergeNodes(selectedIDs);
85657 if (!mergeNodes.disabled(context.graph())) return mergeNodes;
85658 if (join.disabled(context.graph()) !== "not_eligible") return join;
85659 if (merge3.disabled(context.graph()) !== "not_eligible") return merge3;
85660 if (mergePolygon.disabled(context.graph()) !== "not_eligible") return mergePolygon;
85663 var operation2 = function() {
85664 if (operation2.disabled()) return;
85665 context.perform(_action, operation2.annotation());
85666 context.validator().validate();
85667 var resultIDs = selectedIDs.filter(context.hasEntity);
85668 if (resultIDs.length > 1) {
85669 var interestingIDs = resultIDs.filter(function(id2) {
85670 return context.entity(id2).hasInterestingTags();
85672 if (interestingIDs.length) resultIDs = interestingIDs;
85674 context.enter(modeSelect(context, resultIDs));
85676 operation2.available = function() {
85677 return selectedIDs.length >= 2;
85679 operation2.disabled = function() {
85680 var actionDisabled = _action.disabled(context.graph());
85681 if (actionDisabled) return actionDisabled;
85682 var osm = context.connection();
85683 if (osm && _action.resultingWayNodesLength && _action.resultingWayNodesLength(context.graph()) > osm.maxWayNodes()) {
85684 return "too_many_vertices";
85688 operation2.tooltip = function() {
85689 var disabled = operation2.disabled();
85691 if (disabled === "conflicting_relations") {
85692 return _t.append("operations.merge.conflicting_relations");
85694 if (disabled === "restriction" || disabled === "connectivity") {
85696 "operations.merge.damage_relation",
85697 { relation: _mainPresetIndex.item("type/" + disabled).name() }
85700 return _t.append("operations.merge." + disabled);
85702 return _t.append("operations.merge.description");
85704 operation2.annotation = function() {
85705 return _t("operations.merge.annotation", { n: selectedIDs.length });
85707 operation2.id = "merge";
85708 operation2.keys = [_t("operations.merge.key")];
85709 operation2.title = _t.append("operations.merge.title");
85710 operation2.behavior = behaviorOperation(context).which(operation2);
85713 var init_merge6 = __esm({
85714 "modules/operations/merge.js"() {
85719 init_merge_nodes();
85720 init_merge_polygon();
85727 // modules/operations/paste.js
85728 var paste_exports = {};
85729 __export(paste_exports, {
85730 operationPaste: () => operationPaste
85732 function operationPaste(context) {
85734 var operation2 = function() {
85735 if (!_pastePoint) return;
85736 var oldIDs = context.copyIDs();
85737 if (!oldIDs.length) return;
85738 var projection2 = context.projection;
85739 var extent = geoExtent();
85740 var oldGraph = context.copyGraph();
85742 var action = actionCopyEntities(oldIDs, oldGraph);
85743 context.perform(action);
85744 var copies = action.copies();
85745 var originals = /* @__PURE__ */ new Set();
85746 Object.values(copies).forEach(function(entity) {
85747 originals.add(entity.id);
85749 for (var id2 in copies) {
85750 var oldEntity = oldGraph.entity(id2);
85751 var newEntity = copies[id2];
85752 extent._extend(oldEntity.extent(oldGraph));
85753 var parents = context.graph().parentWays(newEntity);
85754 var parentCopied = parents.some(function(parent2) {
85755 return originals.has(parent2.id);
85757 if (!parentCopied) {
85758 newIDs.push(newEntity.id);
85761 var copyPoint = context.copyLonLat() && projection2(context.copyLonLat()) || projection2(extent.center());
85762 var delta = geoVecSubtract(_pastePoint, copyPoint);
85763 context.replace(actionMove(newIDs, delta, projection2), operation2.annotation());
85764 context.enter(modeSelect(context, newIDs));
85766 operation2.point = function(val) {
85770 operation2.available = function() {
85771 return context.mode().id === "browse";
85773 operation2.disabled = function() {
85774 return !context.copyIDs().length;
85776 operation2.tooltip = function() {
85777 var oldGraph = context.copyGraph();
85778 var ids = context.copyIDs();
85780 return _t.append("operations.paste.nothing_copied");
85782 return _t.append("operations.paste.description", { feature: utilDisplayLabel(oldGraph.entity(ids[0]), oldGraph), n: ids.length });
85784 operation2.annotation = function() {
85785 var ids = context.copyIDs();
85786 return _t("operations.paste.annotation", { n: ids.length });
85788 operation2.id = "paste";
85789 operation2.keys = [uiCmd("\u2318V")];
85790 operation2.title = _t.append("operations.paste.title");
85793 var init_paste = __esm({
85794 "modules/operations/paste.js"() {
85796 init_copy_entities();
85802 init_utilDisplayLabel();
85806 // modules/operations/reverse.js
85807 var reverse_exports = {};
85808 __export(reverse_exports, {
85809 operationReverse: () => operationReverse
85811 function operationReverse(context, selectedIDs) {
85812 var operation2 = function() {
85813 context.perform(function combinedReverseAction(graph) {
85814 actions().forEach(function(action) {
85815 graph = action(graph);
85818 }, operation2.annotation());
85819 context.validator().validate();
85821 function actions(situation) {
85822 return selectedIDs.map(function(entityID) {
85823 var entity = context.hasEntity(entityID);
85824 if (!entity) return null;
85825 if (situation === "toolbar") {
85826 if (entity.type === "way" && (!entity.isOneWay() && !entity.isSided())) return null;
85828 var geometry = entity.geometry(context.graph());
85829 if (entity.type !== "node" && geometry !== "line") return null;
85830 var action = actionReverse(entityID);
85831 if (action.disabled(context.graph())) return null;
85833 }).filter(Boolean);
85835 function reverseTypeID() {
85836 var acts = actions();
85837 var nodeActionCount = acts.filter(function(act) {
85838 var entity = context.hasEntity(act.entityID());
85839 return entity && entity.type === "node";
85841 if (nodeActionCount === 0) return "line";
85842 if (nodeActionCount === acts.length) return "point";
85845 operation2.available = function(situation) {
85846 return actions(situation).length > 0;
85848 operation2.disabled = function() {
85851 operation2.tooltip = function() {
85852 return _t.append("operations.reverse.description." + reverseTypeID());
85854 operation2.annotation = function() {
85855 var acts = actions();
85856 return _t("operations.reverse.annotation." + reverseTypeID(), { n: acts.length });
85858 operation2.id = "reverse";
85859 operation2.keys = [_t("operations.reverse.key")];
85860 operation2.title = _t.append("operations.reverse.title");
85861 operation2.behavior = behaviorOperation(context).which(operation2);
85864 var init_reverse = __esm({
85865 "modules/operations/reverse.js"() {
85873 // modules/operations/straighten.js
85874 var straighten_exports = {};
85875 __export(straighten_exports, {
85876 operationStraighten: () => operationStraighten
85878 function operationStraighten(context, selectedIDs) {
85879 var _wayIDs = selectedIDs.filter(function(id2) {
85880 return id2.charAt(0) === "w";
85882 var _nodeIDs = selectedIDs.filter(function(id2) {
85883 return id2.charAt(0) === "n";
85885 var _amount = (_wayIDs.length ? _wayIDs : _nodeIDs).length === 1 ? "single" : "multiple";
85886 var _nodes = utilGetAllNodes(selectedIDs, context.graph());
85887 var _coords = _nodes.map(function(n3) {
85890 var _extent = utilTotalExtent(selectedIDs, context.graph());
85891 var _action = chooseAction();
85893 function chooseAction() {
85894 if (_wayIDs.length === 0 && _nodeIDs.length > 2) {
85895 _geometry = "point";
85896 return actionStraightenNodes(_nodeIDs, context.projection);
85897 } else if (_wayIDs.length > 0 && (_nodeIDs.length === 0 || _nodeIDs.length === 2)) {
85898 var startNodeIDs = [];
85899 var endNodeIDs = [];
85900 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
85901 var entity = context.entity(selectedIDs[i3]);
85902 if (entity.type === "node") {
85904 } else if (entity.type !== "way" || entity.isClosed()) {
85907 startNodeIDs.push(entity.first());
85908 endNodeIDs.push(entity.last());
85910 startNodeIDs = startNodeIDs.filter(function(n3) {
85911 return startNodeIDs.indexOf(n3) === startNodeIDs.lastIndexOf(n3);
85913 endNodeIDs = endNodeIDs.filter(function(n3) {
85914 return endNodeIDs.indexOf(n3) === endNodeIDs.lastIndexOf(n3);
85916 if (utilArrayDifference(startNodeIDs, endNodeIDs).length + utilArrayDifference(endNodeIDs, startNodeIDs).length !== 2) return null;
85917 var wayNodeIDs = utilGetAllNodes(_wayIDs, context.graph()).map(function(node) {
85920 if (wayNodeIDs.length <= 2) return null;
85921 if (_nodeIDs.length === 2 && (wayNodeIDs.indexOf(_nodeIDs[0]) === -1 || wayNodeIDs.indexOf(_nodeIDs[1]) === -1)) return null;
85922 if (_nodeIDs.length) {
85923 _extent = utilTotalExtent(_nodeIDs, context.graph());
85925 _geometry = "line";
85926 return actionStraightenWay(selectedIDs, context.projection);
85930 function operation2() {
85931 if (!_action) return;
85932 context.perform(_action, operation2.annotation());
85933 window.setTimeout(function() {
85934 context.validator().validate();
85937 operation2.available = function() {
85938 return Boolean(_action);
85940 operation2.disabled = function() {
85941 var reason = _action.disabled(context.graph());
85944 } else if (_extent.percentContainedIn(context.map().extent()) < 0.8) {
85945 return "too_large";
85946 } else if (someMissing()) {
85947 return "not_downloaded";
85948 } else if (selectedIDs.some(context.hasHiddenConnections)) {
85949 return "connected_to_hidden";
85952 function someMissing() {
85953 if (context.inIntro()) return false;
85954 var osm = context.connection();
85956 var missing = _coords.filter(function(loc) {
85957 return !osm.isDataLoaded(loc);
85959 if (missing.length) {
85960 missing.forEach(function(loc) {
85961 context.loadTileAtLoc(loc);
85969 operation2.tooltip = function() {
85970 var disable = operation2.disabled();
85971 return disable ? _t.append("operations.straighten." + disable + "." + _amount) : _t.append("operations.straighten.description." + _geometry + (_wayIDs.length === 1 ? "" : "s"));
85973 operation2.annotation = function() {
85974 return _t("operations.straighten.annotation." + _geometry, { n: _wayIDs.length ? _wayIDs.length : _nodeIDs.length });
85976 operation2.id = "straighten";
85977 operation2.keys = [_t("operations.straighten.key")];
85978 operation2.title = _t.append("operations.straighten.title");
85979 operation2.behavior = behaviorOperation(context).which(operation2);
85982 var init_straighten = __esm({
85983 "modules/operations/straighten.js"() {
85986 init_straighten_nodes();
85987 init_straighten_way();
85993 // modules/operations/index.js
85994 var operations_exports = {};
85995 __export(operations_exports, {
85996 operationCircularize: () => operationCircularize,
85997 operationContinue: () => operationContinue,
85998 operationCopy: () => operationCopy,
85999 operationDelete: () => operationDelete,
86000 operationDisconnect: () => operationDisconnect,
86001 operationDowngrade: () => operationDowngrade,
86002 operationExtract: () => operationExtract,
86003 operationMerge: () => operationMerge,
86004 operationMove: () => operationMove,
86005 operationOrthogonalize: () => operationOrthogonalize,
86006 operationPaste: () => operationPaste,
86007 operationReflectLong: () => operationReflectLong,
86008 operationReflectShort: () => operationReflectShort,
86009 operationReverse: () => operationReverse,
86010 operationRotate: () => operationRotate,
86011 operationSplit: () => operationSplit,
86012 operationStraighten: () => operationStraighten
86014 var init_operations = __esm({
86015 "modules/operations/index.js"() {
86017 init_circularize2();
86021 init_disconnect2();
86026 init_orthogonalize2();
86036 // modules/behavior/paste.js
86037 var paste_exports2 = {};
86038 __export(paste_exports2, {
86039 behaviorPaste: () => behaviorPaste
86041 function behaviorPaste(context) {
86042 function doPaste(d3_event) {
86043 if (!context.map().withinEditableZoom()) return;
86044 const isOsmLayerEnabled = context.layers().layer("osm").enabled();
86045 if (!isOsmLayerEnabled) return;
86046 d3_event.preventDefault();
86047 var baseGraph = context.graph();
86048 var mouse = context.map().mouse();
86049 var projection2 = context.projection;
86050 var viewport = geoExtent(projection2.clipExtent()).polygon();
86051 if (!geoPointInPolygon(mouse, viewport)) return;
86052 var oldIDs = context.copyIDs();
86053 if (!oldIDs.length) return;
86054 var extent = geoExtent();
86055 var oldGraph = context.copyGraph();
86057 var action = actionCopyEntities(oldIDs, oldGraph);
86058 context.perform(action);
86059 var copies = action.copies();
86060 var originals = /* @__PURE__ */ new Set();
86061 Object.values(copies).forEach(function(entity) {
86062 originals.add(entity.id);
86064 for (var id2 in copies) {
86065 var oldEntity = oldGraph.entity(id2);
86066 var newEntity = copies[id2];
86067 extent._extend(oldEntity.extent(oldGraph));
86068 var parents = context.graph().parentWays(newEntity);
86069 var parentCopied = parents.some(function(parent2) {
86070 return originals.has(parent2.id);
86072 if (!parentCopied) {
86073 newIDs.push(newEntity.id);
86076 var copyPoint = context.copyLonLat() && projection2(context.copyLonLat()) || projection2(extent.center());
86077 var delta = geoVecSubtract(mouse, copyPoint);
86078 context.perform(actionMove(newIDs, delta, projection2));
86079 context.enter(modeMove(context, newIDs, baseGraph).annotation(operationPaste(context).annotation()));
86081 function behavior() {
86082 context.keybinding().on(uiCmd("\u2318V"), doPaste);
86085 behavior.off = function() {
86086 context.keybinding().off(uiCmd("\u2318V"));
86090 var init_paste2 = __esm({
86091 "modules/behavior/paste.js"() {
86093 init_copy_entities();
86102 // modules/modes/select.js
86103 var select_exports2 = {};
86104 __export(select_exports2, {
86105 modeSelect: () => modeSelect
86107 function modeSelect(context, selectedIDs) {
86112 var keybinding = utilKeybinding("select");
86113 var _breatheBehavior = behaviorBreathe(context);
86114 var _modeDragNode = modeDragNode(context);
86115 var _selectBehavior;
86116 var _behaviors = [];
86117 var _operations = [];
86118 var _newFeature = false;
86119 var _follow = false;
86120 var _focusedParentWayId;
86121 var _focusedVertexIds;
86122 function singular() {
86123 if (selectedIDs && selectedIDs.length === 1) {
86124 return context.hasEntity(selectedIDs[0]);
86127 function selectedEntities() {
86128 return selectedIDs.map(function(id2) {
86129 return context.hasEntity(id2);
86130 }).filter(Boolean);
86132 function checkSelectedIDs() {
86134 if (Array.isArray(selectedIDs)) {
86135 ids = selectedIDs.filter(function(id2) {
86136 return context.hasEntity(id2);
86140 context.enter(modeBrowse(context));
86142 } else if (selectedIDs.length > 1 && ids.length === 1 || selectedIDs.length === 1 && ids.length > 1) {
86143 context.enter(modeSelect(context, ids));
86149 function parentWaysIdsOfSelection(onlyCommonParents) {
86150 var graph = context.graph();
86152 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
86153 var entity = context.hasEntity(selectedIDs[i3]);
86154 if (!entity || entity.geometry(graph) !== "vertex") {
86157 var currParents = graph.parentWays(entity).map(function(w3) {
86160 if (!parents.length) {
86161 parents = currParents;
86164 parents = (onlyCommonParents ? utilArrayIntersection : utilArrayUnion)(parents, currParents);
86165 if (!parents.length) {
86171 function childNodeIdsOfSelection(onlyCommon) {
86172 var graph = context.graph();
86174 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
86175 var entity = context.hasEntity(selectedIDs[i3]);
86176 if (!entity || !["area", "line"].includes(entity.geometry(graph))) {
86179 var currChilds = graph.childNodes(entity).map(function(node) {
86182 if (!childs.length) {
86183 childs = currChilds;
86186 childs = (onlyCommon ? utilArrayIntersection : utilArrayUnion)(childs, currChilds);
86187 if (!childs.length) {
86193 function checkFocusedParent() {
86194 if (_focusedParentWayId) {
86195 var parents = parentWaysIdsOfSelection(true);
86196 if (parents.indexOf(_focusedParentWayId) === -1) _focusedParentWayId = null;
86199 function parentWayIdForVertexNavigation() {
86200 var parentIds = parentWaysIdsOfSelection(true);
86201 if (_focusedParentWayId && parentIds.indexOf(_focusedParentWayId) !== -1) {
86202 return _focusedParentWayId;
86204 return parentIds.length ? parentIds[0] : null;
86206 mode.selectedIDs = function(val) {
86207 if (!arguments.length) return selectedIDs;
86211 mode.zoomToSelected = function() {
86212 context.map().zoomToEase(selectedEntities());
86214 mode.newFeature = function(val) {
86215 if (!arguments.length) return _newFeature;
86219 mode.selectBehavior = function(val) {
86220 if (!arguments.length) return _selectBehavior;
86221 _selectBehavior = val;
86224 mode.follow = function(val) {
86225 if (!arguments.length) return _follow;
86229 function loadOperations() {
86230 _operations.forEach(function(operation2) {
86231 if (operation2.behavior) {
86232 context.uninstall(operation2.behavior);
86235 _operations = Object.values(operations_exports).map((o2) => o2(context, selectedIDs)).filter((o2) => o2.id !== "delete" && o2.id !== "downgrade" && o2.id !== "copy").concat([
86236 // group copy/downgrade/delete operation together at the end of the list
86237 operationCopy(context, selectedIDs),
86238 operationDowngrade(context, selectedIDs),
86239 operationDelete(context, selectedIDs)
86241 _operations.filter((operation2) => operation2.available()).forEach((operation2) => {
86242 if (operation2.behavior) {
86243 context.install(operation2.behavior);
86246 _operations.filter((operation2) => !operation2.available()).forEach((operation2) => {
86247 if (operation2.behavior) {
86248 operation2.behavior.on();
86251 context.ui().closeEditMenu();
86253 mode.operations = function() {
86254 return _operations.filter((operation2) => operation2.available());
86256 mode.enter = function() {
86257 if (!checkSelectedIDs()) return;
86258 context.features().forceVisible(selectedIDs);
86259 _modeDragNode.restoreSelectedIDs(selectedIDs);
86261 if (!_behaviors.length) {
86262 if (!_selectBehavior) _selectBehavior = behaviorSelect(context);
86264 behaviorPaste(context),
86266 behaviorHover(context).on("hover", context.ui().sidebar.hoverModeSelect),
86268 behaviorLasso(context),
86269 _modeDragNode.behavior,
86270 modeDragNote(context).behavior
86273 _behaviors.forEach(context.install);
86274 keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on(["[", "pgup"], previousVertex).on(["]", "pgdown"], nextVertex).on(["{", uiCmd("\u2318["), "home"], firstVertex).on(["}", uiCmd("\u2318]"), "end"], lastVertex).on(uiCmd("\u21E7\u2190"), nudgeSelection([-10, 0])).on(uiCmd("\u21E7\u2191"), nudgeSelection([0, -10])).on(uiCmd("\u21E7\u2192"), nudgeSelection([10, 0])).on(uiCmd("\u21E7\u2193"), nudgeSelection([0, 10])).on(uiCmd("\u21E7\u2325\u2190"), nudgeSelection([-100, 0])).on(uiCmd("\u21E7\u2325\u2191"), nudgeSelection([0, -100])).on(uiCmd("\u21E7\u2325\u2192"), nudgeSelection([100, 0])).on(uiCmd("\u21E7\u2325\u2193"), nudgeSelection([0, 100])).on(utilKeybinding.plusKeys.map((key) => uiCmd("\u21E7" + key)), scaleSelection(1.05)).on(utilKeybinding.plusKeys.map((key) => uiCmd("\u21E7\u2325" + key)), scaleSelection(Math.pow(1.05, 5))).on(utilKeybinding.minusKeys.map((key) => uiCmd("\u21E7" + key)), scaleSelection(1 / 1.05)).on(utilKeybinding.minusKeys.map((key) => uiCmd("\u21E7\u2325" + key)), scaleSelection(1 / Math.pow(1.05, 5))).on(["\\", "pause"], focusNextParent).on(uiCmd("\u2318\u2191"), selectParent).on(uiCmd("\u2318\u2193"), selectChild).on("\u238B", esc, true);
86275 select_default2(document).call(keybinding);
86276 context.ui().sidebar.select(selectedIDs, _newFeature);
86277 context.history().on("change.select", function() {
86280 }).on("undone.select", checkSelectedIDs).on("redone.select", checkSelectedIDs);
86281 context.map().on("drawn.select", selectElements).on("crossEditableZoom.select", function() {
86283 _breatheBehavior.restartIfNeeded(context.surface());
86285 context.map().doubleUpHandler().on("doubleUp.modeSelect", didDoubleUp);
86288 var extent = geoExtent();
86289 var graph = context.graph();
86290 selectedIDs.forEach(function(id2) {
86291 var entity = context.entity(id2);
86292 extent._extend(entity.extent(graph));
86294 var loc = extent.center();
86295 context.map().centerEase(loc);
86298 function nudgeSelection(delta) {
86299 return function() {
86300 if (!context.map().withinEditableZoom()) return;
86301 var moveOp = operationMove(context, selectedIDs);
86302 if (moveOp.disabled()) {
86303 context.ui().flash.duration(4e3).iconName("#iD-operation-" + moveOp.id).iconClass("operation disabled").label(moveOp.tooltip())();
86305 context.perform(actionMove(selectedIDs, delta, context.projection), moveOp.annotation());
86306 context.validator().validate();
86310 function scaleSelection(factor) {
86311 return function() {
86312 if (!context.map().withinEditableZoom()) return;
86313 let nodes = utilGetAllNodes(selectedIDs, context.graph());
86314 let isUp = factor > 1;
86315 if (nodes.length <= 1) return;
86316 let extent2 = utilTotalExtent(selectedIDs, context.graph());
86317 function scalingDisabled() {
86319 return "too_small";
86320 } else if (extent2.percentContainedIn(context.map().extent()) < 0.8) {
86321 return "too_large";
86322 } else if (someMissing() || selectedIDs.some(incompleteRelation)) {
86323 return "not_downloaded";
86324 } else if (selectedIDs.some(context.hasHiddenConnections)) {
86325 return "connected_to_hidden";
86328 function tooSmall() {
86329 if (isUp) return false;
86330 let dLon = Math.abs(extent2[1][0] - extent2[0][0]);
86331 let dLat = Math.abs(extent2[1][1] - extent2[0][1]);
86332 return dLon < geoMetersToLon(1, extent2[1][1]) && dLat < geoMetersToLat(1);
86334 function someMissing() {
86335 if (context.inIntro()) return false;
86336 let osm = context.connection();
86338 let missing = nodes.filter(function(n3) {
86339 return !osm.isDataLoaded(n3.loc);
86341 if (missing.length) {
86342 missing.forEach(function(loc2) {
86343 context.loadTileAtLoc(loc2);
86350 function incompleteRelation(id2) {
86351 let entity = context.entity(id2);
86352 return entity.type === "relation" && !entity.isComplete(context.graph());
86355 const disabled = scalingDisabled();
86357 let multi = selectedIDs.length === 1 ? "single" : "multiple";
86358 context.ui().flash.duration(4e3).iconName("#iD-icon-no").iconClass("operation disabled").label(_t.append("operations.scale." + disabled + "." + multi))();
86360 const pivot = context.projection(extent2.center());
86361 const annotation = _t("operations.scale.annotation." + (isUp ? "up" : "down") + ".feature", { n: selectedIDs.length });
86362 context.perform(actionScale(selectedIDs, pivot, factor, context.projection), annotation);
86363 context.validator().validate();
86367 function didDoubleUp(d3_event, loc2) {
86368 if (!context.map().withinEditableZoom()) return;
86369 var target = select_default2(d3_event.target);
86370 var datum2 = target.datum();
86371 var entity = datum2 && datum2.properties && datum2.properties.entity;
86372 if (!entity) return;
86373 if (entity instanceof osmWay && target.classed("target")) {
86374 var choice = geoChooseEdge(context.graph().childNodes(entity), loc2, context.projection);
86375 var prev = entity.nodes[choice.index - 1];
86376 var next = entity.nodes[choice.index];
86378 actionAddMidpoint({ loc: choice.loc, edge: [prev, next] }, osmNode()),
86379 _t("operations.add.annotation.vertex")
86381 context.validator().validate();
86382 } else if (entity.type === "midpoint") {
86384 actionAddMidpoint({ loc: entity.loc, edge: entity.edge }, osmNode()),
86385 _t("operations.add.annotation.vertex")
86387 context.validator().validate();
86390 function selectElements() {
86391 if (!checkSelectedIDs()) return;
86392 var surface = context.surface();
86393 surface.selectAll(".selected-member").classed("selected-member", false);
86394 surface.selectAll(".selected").classed("selected", false);
86395 surface.selectAll(".related").classed("related", false);
86396 checkFocusedParent();
86397 if (_focusedParentWayId) {
86398 surface.selectAll(utilEntitySelector([_focusedParentWayId])).classed("related", true);
86400 if (context.map().withinEditableZoom()) {
86401 surface.selectAll(utilDeepMemberSelector(
86405 /* skipMultipolgonMembers */
86406 )).classed("selected-member", true);
86407 surface.selectAll(utilEntityOrDeepMemberSelector(selectedIDs, context.graph())).classed("selected", true);
86411 if (context.container().select(".combobox").size()) return;
86412 context.enter(modeBrowse(context));
86414 function firstVertex(d3_event) {
86415 d3_event.preventDefault();
86416 var entity = singular();
86417 var parentId = parentWayIdForVertexNavigation();
86419 if (entity && entity.type === "way") {
86421 } else if (parentId) {
86422 way = context.entity(parentId);
86424 _focusedParentWayId = way && way.id;
86427 mode.selectedIDs([way.first()]).follow(true)
86431 function lastVertex(d3_event) {
86432 d3_event.preventDefault();
86433 var entity = singular();
86434 var parentId = parentWayIdForVertexNavigation();
86436 if (entity && entity.type === "way") {
86438 } else if (parentId) {
86439 way = context.entity(parentId);
86441 _focusedParentWayId = way && way.id;
86444 mode.selectedIDs([way.last()]).follow(true)
86448 function previousVertex(d3_event) {
86449 d3_event.preventDefault();
86450 var parentId = parentWayIdForVertexNavigation();
86451 _focusedParentWayId = parentId;
86452 if (!parentId) return;
86453 var way = context.entity(parentId);
86454 var length2 = way.nodes.length;
86455 var curr = way.nodes.indexOf(selectedIDs[0]);
86459 } else if (way.isClosed()) {
86460 index = length2 - 2;
86462 if (index !== -1) {
86464 mode.selectedIDs([way.nodes[index]]).follow(true)
86468 function nextVertex(d3_event) {
86469 d3_event.preventDefault();
86470 var parentId = parentWayIdForVertexNavigation();
86471 _focusedParentWayId = parentId;
86472 if (!parentId) return;
86473 var way = context.entity(parentId);
86474 var length2 = way.nodes.length;
86475 var curr = way.nodes.indexOf(selectedIDs[0]);
86477 if (curr < length2 - 1) {
86479 } else if (way.isClosed()) {
86482 if (index !== -1) {
86484 mode.selectedIDs([way.nodes[index]]).follow(true)
86488 function focusNextParent(d3_event) {
86489 d3_event.preventDefault();
86490 var parents = parentWaysIdsOfSelection(true);
86491 if (!parents || parents.length < 2) return;
86492 var index = parents.indexOf(_focusedParentWayId);
86493 if (index < 0 || index > parents.length - 2) {
86494 _focusedParentWayId = parents[0];
86496 _focusedParentWayId = parents[index + 1];
86498 var surface = context.surface();
86499 surface.selectAll(".related").classed("related", false);
86500 if (_focusedParentWayId) {
86501 surface.selectAll(utilEntitySelector([_focusedParentWayId])).classed("related", true);
86504 function selectParent(d3_event) {
86505 d3_event.preventDefault();
86506 var currentSelectedIds = mode.selectedIDs();
86507 var parentIds = _focusedParentWayId ? [_focusedParentWayId] : parentWaysIdsOfSelection(false);
86508 if (!parentIds.length) return;
86510 mode.selectedIDs(parentIds)
86512 _focusedVertexIds = currentSelectedIds;
86514 function selectChild(d3_event) {
86515 d3_event.preventDefault();
86516 var currentSelectedIds = mode.selectedIDs();
86517 var childIds = _focusedVertexIds ? _focusedVertexIds.filter((id2) => context.hasEntity(id2)) : childNodeIdsOfSelection(true);
86518 if (!childIds || !childIds.length) return;
86519 if (currentSelectedIds.length === 1) _focusedParentWayId = currentSelectedIds[0];
86521 mode.selectedIDs(childIds)
86525 mode.exit = function() {
86526 _newFeature = false;
86527 _focusedVertexIds = null;
86528 _operations.forEach((operation2) => {
86529 if (operation2.behavior) {
86530 context.uninstall(operation2.behavior);
86534 _behaviors.forEach(context.uninstall);
86535 select_default2(document).call(keybinding.unbind);
86536 context.ui().closeEditMenu();
86537 context.history().on("change.select", null).on("undone.select", null).on("redone.select", null);
86538 var surface = context.surface();
86539 surface.selectAll(".selected-member").classed("selected-member", false);
86540 surface.selectAll(".selected").classed("selected", false);
86541 surface.selectAll(".highlighted").classed("highlighted", false);
86542 surface.selectAll(".related").classed("related", false);
86543 context.map().on("drawn.select", null);
86544 context.ui().sidebar.hide();
86545 context.features().forceVisible([]);
86546 var entity = singular();
86547 if (_newFeature && entity && entity.type === "relation" && // no tags
86548 Object.keys(entity.tags).length === 0 && // no parent relations
86549 context.graph().parentRelations(entity).length === 0 && // no members or one member with no role
86550 (entity.members.length === 0 || entity.members.length === 1 && !entity.members[0].role)) {
86551 var deleteAction = actionDeleteRelation(
86554 /* don't delete untagged members */
86556 context.perform(deleteAction, _t("operations.delete.annotation.relation"));
86557 context.validator().validate();
86562 var init_select5 = __esm({
86563 "modules/modes/select.js"() {
86567 init_add_midpoint();
86568 init_delete_relation();
86588 // modules/behavior/lasso.js
86589 var lasso_exports2 = {};
86590 __export(lasso_exports2, {
86591 behaviorLasso: () => behaviorLasso
86593 function behaviorLasso(context) {
86594 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
86595 var behavior = function(selection2) {
86597 function pointerdown(d3_event) {
86599 if (d3_event.button === button && d3_event.shiftKey === true) {
86601 select_default2(window).on(_pointerPrefix + "move.lasso", pointermove).on(_pointerPrefix + "up.lasso", pointerup);
86602 d3_event.stopPropagation();
86605 function pointermove() {
86607 lasso = uiLasso(context);
86608 context.surface().call(lasso);
86610 lasso.p(context.map().mouse());
86612 function normalize2(a2, b3) {
86614 [Math.min(a2[0], b3[0]), Math.min(a2[1], b3[1])],
86615 [Math.max(a2[0], b3[0]), Math.max(a2[1], b3[1])]
86618 function lassoed() {
86619 if (!lasso) return [];
86620 var graph = context.graph();
86622 if (context.map().editableDataEnabled(
86624 /* skipZoomCheck */
86625 ) && context.map().isInWideSelection()) {
86626 limitToNodes = new Set(utilGetAllNodes(context.selectedIDs(), graph));
86627 } else if (!context.map().editableDataEnabled()) {
86630 var bounds = lasso.extent().map(context.projection.invert);
86631 var extent = geoExtent(normalize2(bounds[0], bounds[1]));
86632 var intersects2 = context.history().intersects(extent).filter(function(entity) {
86633 return entity.type === "node" && (!limitToNodes || limitToNodes.has(entity)) && geoPointInPolygon(context.projection(entity.loc), lasso.coordinates) && !context.features().isHidden(entity, graph, entity.geometry(graph));
86635 intersects2.sort(function(node1, node2) {
86636 var parents1 = graph.parentWays(node1);
86637 var parents2 = graph.parentWays(node2);
86638 if (parents1.length && parents2.length) {
86639 var sharedParents = utilArrayIntersection(parents1, parents2);
86640 if (sharedParents.length) {
86641 var sharedParentNodes = sharedParents[0].nodes;
86642 return sharedParentNodes.indexOf(node1.id) - sharedParentNodes.indexOf(node2.id);
86644 return Number(parents1[0].id.slice(1)) - Number(parents2[0].id.slice(1));
86646 } else if (parents1.length || parents2.length) {
86647 return parents1.length - parents2.length;
86649 return node1.loc[0] - node2.loc[0];
86651 return intersects2.map(function(entity) {
86655 function pointerup() {
86656 select_default2(window).on(_pointerPrefix + "move.lasso", null).on(_pointerPrefix + "up.lasso", null);
86657 if (!lasso) return;
86658 var ids = lassoed();
86661 context.enter(modeSelect(context, ids));
86664 selection2.on(_pointerPrefix + "down.lasso", pointerdown);
86666 behavior.off = function(selection2) {
86667 selection2.on(_pointerPrefix + "down.lasso", null);
86671 var init_lasso2 = __esm({
86672 "modules/behavior/lasso.js"() {
86683 // modules/modes/browse.js
86684 var browse_exports = {};
86685 __export(browse_exports, {
86686 modeBrowse: () => modeBrowse
86688 function modeBrowse(context) {
86692 title: _t.append("modes.browse.title"),
86693 description: _t.append("modes.browse.description")
86696 var _selectBehavior;
86697 var _behaviors = [];
86698 mode.selectBehavior = function(val) {
86699 if (!arguments.length) return _selectBehavior;
86700 _selectBehavior = val;
86703 mode.enter = function() {
86704 if (!_behaviors.length) {
86705 if (!_selectBehavior) _selectBehavior = behaviorSelect(context);
86707 behaviorPaste(context),
86708 behaviorHover(context).on("hover", context.ui().sidebar.hover),
86710 behaviorLasso(context),
86711 modeDragNode(context).behavior,
86712 modeDragNote(context).behavior
86715 _behaviors.forEach(context.install);
86716 if (document.activeElement && document.activeElement.blur) {
86717 document.activeElement.blur();
86720 context.ui().sidebar.show(sidebar);
86722 context.ui().sidebar.select(null);
86725 mode.exit = function() {
86726 context.ui().sidebar.hover.cancel();
86727 _behaviors.forEach(context.uninstall);
86729 context.ui().sidebar.hide();
86732 mode.sidebar = function(_3) {
86733 if (!arguments.length) return sidebar;
86737 mode.operations = function() {
86738 return [operationPaste(context)];
86742 var init_browse = __esm({
86743 "modules/modes/browse.js"() {
86756 // modules/behavior/add_way.js
86757 var add_way_exports = {};
86758 __export(add_way_exports, {
86759 behaviorAddWay: () => behaviorAddWay
86761 function behaviorAddWay(context) {
86762 var dispatch14 = dispatch_default("start", "startFromWay", "startFromNode");
86763 var draw = behaviorDraw(context);
86764 function behavior(surface) {
86765 draw.on("click", function() {
86766 dispatch14.apply("start", this, arguments);
86767 }).on("clickWay", function() {
86768 dispatch14.apply("startFromWay", this, arguments);
86769 }).on("clickNode", function() {
86770 dispatch14.apply("startFromNode", this, arguments);
86771 }).on("cancel", behavior.cancel).on("finish", behavior.cancel);
86772 context.map().dblclickZoomEnable(false);
86773 surface.call(draw);
86775 behavior.off = function(surface) {
86776 surface.call(draw.off);
86778 behavior.cancel = function() {
86779 window.setTimeout(function() {
86780 context.map().dblclickZoomEnable(true);
86782 context.enter(modeBrowse(context));
86784 return utilRebind(behavior, dispatch14, "on");
86786 var init_add_way = __esm({
86787 "modules/behavior/add_way.js"() {
86796 // modules/globals.d.ts
86797 var globals_d_exports = {};
86798 var init_globals_d = __esm({
86799 "modules/globals.d.ts"() {
86804 // modules/presets/collection.js
86805 var collection_exports = {};
86806 __export(collection_exports, {
86807 presetCollection: () => presetCollection
86809 function presetCollection(collection) {
86810 const MAXRESULTS = 50;
86813 _this.collection = collection;
86814 _this.item = (id2) => {
86815 if (_memo[id2]) return _memo[id2];
86816 const found = _this.collection.find((d4) => d4.id === id2);
86817 if (found) _memo[id2] = found;
86820 _this.index = (id2) => _this.collection.findIndex((d4) => d4.id === id2);
86821 _this.matchGeometry = (geometry) => {
86822 return presetCollection(
86823 _this.collection.filter((d4) => d4.matchGeometry(geometry))
86826 _this.matchAllGeometry = (geometries) => {
86827 return presetCollection(
86828 _this.collection.filter((d4) => d4 && d4.matchAllGeometry(geometries))
86831 _this.matchAnyGeometry = (geometries) => {
86832 return presetCollection(
86833 _this.collection.filter((d4) => geometries.some((geom) => d4.matchGeometry(geom)))
86836 _this.fallback = (geometry) => {
86837 let id2 = geometry;
86838 if (id2 === "vertex") id2 = "point";
86839 return _this.item(id2);
86841 _this.search = (value, geometry, loc) => {
86842 if (!value) return _this;
86843 value = value.toLowerCase().trim();
86844 function leading(a2) {
86845 const index = a2.indexOf(value);
86846 return index === 0 || a2[index - 1] === " ";
86848 function leadingStrict(a2) {
86849 const index = a2.indexOf(value);
86850 return index === 0;
86852 function sortPresets(nameProp, aliasesProp) {
86853 return function sortNames(a2, b3) {
86854 let aCompare = a2[nameProp]();
86855 let bCompare = b3[nameProp]();
86857 const findMatchingAlias = (strings) => {
86858 if (strings.some((s2) => s2 === value)) {
86859 return strings.find((s2) => s2 === value);
86861 return strings.filter((s2) => s2.includes(value)).sort((a3, b4) => a3.length - b4.length)[0];
86864 aCompare = findMatchingAlias([aCompare].concat(a2[aliasesProp]()));
86865 bCompare = findMatchingAlias([bCompare].concat(b3[aliasesProp]()));
86867 if (value === aCompare) return -1;
86868 if (value === bCompare) return 1;
86869 let i3 = b3.originalScore - a2.originalScore;
86870 if (i3 !== 0) return i3;
86871 i3 = aCompare.indexOf(value) - bCompare.indexOf(value);
86872 if (i3 !== 0) return i3;
86873 return aCompare.length - bCompare.length;
86876 let pool = _this.collection;
86877 if (Array.isArray(loc)) {
86878 const validHere = _sharedLocationManager.locationSetsAt(loc);
86879 pool = pool.filter((a2) => !a2.locationSetID || validHere[a2.locationSetID]);
86881 const searchable = pool.filter((a2) => a2.searchable !== false && a2.suggestion !== true);
86882 const suggestions = pool.filter((a2) => a2.suggestion === true);
86883 const leadingNames = searchable.filter((a2) => leading(a2.searchName()) || a2.searchAliases().some(leading)).sort(sortPresets("searchName", "searchAliases"));
86884 const leadingSuggestions = suggestions.filter((a2) => leadingStrict(a2.searchName())).sort(sortPresets("searchName"));
86885 const leadingNamesStripped = searchable.filter((a2) => leading(a2.searchNameStripped()) || a2.searchAliasesStripped().some(leading)).sort(sortPresets("searchNameStripped", "searchAliasesStripped"));
86886 const leadingSuggestionsStripped = suggestions.filter((a2) => leadingStrict(a2.searchNameStripped())).sort(sortPresets("searchNameStripped"));
86887 const leadingTerms = searchable.filter((a2) => (a2.terms() || []).some(leading));
86888 const leadingSuggestionTerms = suggestions.filter((a2) => (a2.terms() || []).some(leading));
86889 const leadingTagValues = searchable.filter((a2) => Object.values(a2.tags || {}).filter((val) => val !== "*").some(leading));
86890 const similarName = searchable.map((a2) => ({ preset: a2, dist: utilEditDistance(value, a2.searchName()) })).filter((a2) => a2.dist + Math.min(value.length - a2.preset.searchName().length, 0) < 3).sort((a2, b3) => a2.dist - b3.dist).map((a2) => a2.preset);
86891 const similarSuggestions = suggestions.map((a2) => ({ preset: a2, dist: utilEditDistance(value, a2.searchName()) })).filter((a2) => a2.dist + Math.min(value.length - a2.preset.searchName().length, 0) < 1).sort((a2, b3) => a2.dist - b3.dist).map((a2) => a2.preset);
86892 const similarTerms = searchable.filter((a2) => {
86893 return (a2.terms() || []).some((b3) => {
86894 return utilEditDistance(value, b3) + Math.min(value.length - b3.length, 0) < 3;
86897 let leadingTagKeyValues = [];
86898 if (value.includes("=")) {
86899 leadingTagKeyValues = searchable.filter((a2) => a2.tags && Object.keys(a2.tags).some((key) => key + "=" + a2.tags[key] === value)).concat(searchable.filter((a2) => a2.tags && Object.keys(a2.tags).some((key) => leading(key + "=" + a2.tags[key]))));
86901 let results = leadingNames.concat(
86902 leadingSuggestions,
86903 leadingNamesStripped,
86904 leadingSuggestionsStripped,
86906 leadingSuggestionTerms,
86909 similarSuggestions,
86911 leadingTagKeyValues
86912 ).slice(0, MAXRESULTS - 1);
86914 if (typeof geometry === "string") {
86915 results.push(_this.fallback(geometry));
86917 geometry.forEach((geom) => results.push(_this.fallback(geom)));
86920 return presetCollection(utilArrayUniq(results));
86924 var init_collection = __esm({
86925 "modules/presets/collection.js"() {
86927 init_LocationManager();
86933 // modules/presets/category.js
86934 var category_exports = {};
86935 __export(category_exports, {
86936 presetCategory: () => presetCategory
86938 function presetCategory(categoryID, category, allPresets) {
86939 let _this = Object.assign({}, category);
86941 let _searchNameStripped;
86942 _this.id = categoryID;
86943 _this.members = presetCollection(
86944 (category.members || []).map((presetID) => allPresets[presetID]).filter(Boolean)
86946 _this.geometry = _this.members.collection.reduce((acc, preset) => {
86947 for (let i3 in preset.geometry) {
86948 const geometry = preset.geometry[i3];
86949 if (acc.indexOf(geometry) === -1) {
86950 acc.push(geometry);
86955 _this.matchGeometry = (geom) => _this.geometry.indexOf(geom) >= 0;
86956 _this.matchAllGeometry = (geometries) => _this.members.collection.some((preset) => preset.matchAllGeometry(geometries));
86957 _this.matchScore = () => -1;
86958 _this.name = () => _t(`_tagging.presets.categories.${categoryID}.name`, { "default": categoryID });
86959 _this.nameLabel = () => _t.append(`_tagging.presets.categories.${categoryID}.name`, { "default": categoryID });
86960 _this.terms = () => [];
86961 _this.searchName = () => {
86962 if (!_searchName) {
86963 _searchName = (_this.suggestion ? _this.originalName : _this.name()).toLowerCase();
86965 return _searchName;
86967 _this.searchNameStripped = () => {
86968 if (!_searchNameStripped) {
86969 _searchNameStripped = _this.searchName();
86970 if (_searchNameStripped.normalize) _searchNameStripped = _searchNameStripped.normalize("NFD");
86971 _searchNameStripped = _searchNameStripped.replace(/[\u0300-\u036f]/g, "");
86973 return _searchNameStripped;
86975 _this.searchAliases = () => [];
86976 _this.searchAliasesStripped = () => [];
86979 var init_category = __esm({
86980 "modules/presets/category.js"() {
86987 // modules/presets/field.js
86988 var field_exports2 = {};
86989 __export(field_exports2, {
86990 presetField: () => presetField
86992 function presetField(fieldID, field, allFields) {
86993 allFields = allFields || {};
86994 let _this = Object.assign({}, field);
86995 _this.id = fieldID;
86996 _this.safeid = utilSafeClassName(fieldID);
86997 _this.matchGeometry = (geom) => !_this.geometry || _this.geometry.indexOf(geom) !== -1;
86998 _this.matchAllGeometry = (geometries) => {
86999 return !_this.geometry || geometries.every((geom) => _this.geometry.indexOf(geom) !== -1);
87001 _this.t = (scope, options) => _t(`_tagging.presets.fields.${fieldID}.${scope}`, options);
87002 _this.t.html = (scope, options) => _t.html(`_tagging.presets.fields.${fieldID}.${scope}`, options);
87003 _this.t.append = (scope, options) => _t.append(`_tagging.presets.fields.${fieldID}.${scope}`, options);
87004 _this.hasTextForStringId = (scope) => _mainLocalizer.hasTextForStringId(`_tagging.presets.fields.${fieldID}.${scope}`);
87005 _this.resolveReference = (which) => {
87006 const referenceRegex = /^\{(.*)\}$/;
87007 const match = (field[which] || "").match(referenceRegex);
87009 const field2 = allFields[match[1]];
87013 console.error(`Unable to resolve referenced field: ${match[1]}`);
87017 _this.title = () => _this.overrideLabel || _this.resolveReference("label").t("label", { "default": fieldID });
87018 _this.label = () => _this.overrideLabel ? (selection2) => selection2.text(_this.overrideLabel) : _this.resolveReference("label").t.append("label", { "default": fieldID });
87019 _this.placeholder = () => _this.resolveReference("placeholder").t("placeholder", { "default": "" });
87020 _this.originalTerms = (_this.terms || []).join();
87021 _this.terms = () => _this.resolveReference("label").t("terms", { "default": _this.originalTerms }).toLowerCase().trim().split(/\s*,+\s*/);
87022 _this.increment = _this.type === "number" ? _this.increment || 1 : void 0;
87025 var init_field2 = __esm({
87026 "modules/presets/field.js"() {
87033 // modules/presets/preset.js
87034 var preset_exports = {};
87035 __export(preset_exports, {
87036 presetPreset: () => presetPreset
87038 function presetPreset(presetID, preset, addable, allFields, allPresets) {
87039 allFields = allFields || {};
87040 allPresets = allPresets || {};
87041 let _this = Object.assign({}, preset);
87042 let _addable = addable || false;
87044 let _searchNameStripped;
87045 let _searchAliases;
87046 let _searchAliasesStripped;
87047 const referenceRegex = /^\{(.*)\}$/;
87048 _this.id = presetID;
87049 _this.safeid = utilSafeClassName(presetID);
87050 _this.originalTerms = (_this.terms || []).join();
87051 _this.originalName = _this.name || "";
87052 _this.originalAliases = (_this.aliases || []).join("\n");
87053 _this.originalScore = _this.matchScore || 1;
87054 _this.originalReference = _this.reference || {};
87055 _this.originalFields = _this.fields || [];
87056 _this.originalMoreFields = _this.moreFields || [];
87057 _this.fields = (loc) => resolveFields("fields", loc);
87058 _this.moreFields = (loc) => resolveFields("moreFields", loc);
87059 _this.tags = _this.tags || {};
87060 _this.addTags = _this.addTags || _this.tags;
87061 _this.removeTags = _this.removeTags || _this.addTags;
87062 _this.geometry = _this.geometry || [];
87063 _this.matchGeometry = (geom) => _this.geometry.indexOf(geom) >= 0;
87064 _this.matchAllGeometry = (geoms) => geoms.every(_this.matchGeometry);
87065 _this.matchScore = (entityTags) => {
87066 const tags = _this.tags;
87069 for (let k2 in tags) {
87071 if (entityTags[k2] === tags[k2]) {
87072 score += _this.originalScore;
87073 } else if (tags[k2] === "*" && k2 in entityTags) {
87074 score += _this.originalScore / 2;
87079 const addTags = _this.addTags;
87080 for (let k2 in addTags) {
87081 if (!seen[k2] && entityTags[k2] === addTags[k2]) {
87082 score += _this.originalScore;
87085 if (_this.searchable === false) {
87090 _this.t = (scope, options) => {
87091 const textID = `_tagging.presets.presets.${presetID}.${scope}`;
87092 return _t(textID, options);
87094 _this.t.append = (scope, options) => {
87095 const textID = `_tagging.presets.presets.${presetID}.${scope}`;
87096 return _t.append(textID, options);
87098 function resolveReference(which) {
87099 const match = (_this[which] || "").match(referenceRegex);
87101 const preset2 = allPresets[match[1]];
87105 console.error(`Unable to resolve referenced preset: ${match[1]}`);
87109 _this.name = () => {
87110 return resolveReference("originalName").t("name", { "default": _this.originalName || presetID });
87112 _this.nameLabel = () => {
87113 return resolveReference("originalName").t.append("name", { "default": _this.originalName || presetID });
87115 _this.subtitle = () => {
87116 if (_this.suggestion) {
87117 let path = presetID.split("/");
87119 return _t("_tagging.presets.presets." + path.join("/") + ".name");
87123 _this.subtitleLabel = () => {
87124 if (_this.suggestion) {
87125 let path = presetID.split("/");
87127 return _t.append("_tagging.presets.presets." + path.join("/") + ".name");
87131 _this.aliases = () => {
87132 return resolveReference("originalName").t("aliases", { "default": _this.originalAliases }).trim().split(/\s*[\r\n]+\s*/).filter(Boolean);
87134 _this.terms = () => {
87135 return resolveReference("originalName").t("terms", { "default": _this.originalTerms }).toLowerCase().trim().split(/\s*,+\s*/);
87137 _this.searchName = () => {
87138 if (!_searchName) {
87139 _searchName = (_this.suggestion ? _this.originalName : _this.name()).toLowerCase();
87141 return _searchName;
87143 _this.searchNameStripped = () => {
87144 if (!_searchNameStripped) {
87145 _searchNameStripped = stripDiacritics(_this.searchName());
87147 return _searchNameStripped;
87149 _this.searchAliases = () => {
87150 if (!_searchAliases) {
87151 _searchAliases = _this.aliases().map((alias) => alias.toLowerCase());
87153 return _searchAliases;
87155 _this.searchAliasesStripped = () => {
87156 if (!_searchAliasesStripped) {
87157 _searchAliasesStripped = _this.searchAliases();
87158 _searchAliasesStripped = _searchAliasesStripped.map(stripDiacritics);
87160 return _searchAliasesStripped;
87162 _this.isFallback = () => {
87163 const tagCount = Object.keys(_this.tags).length;
87164 return tagCount === 0 || tagCount === 1 && _this.tags.hasOwnProperty("area");
87166 _this.addable = function(val) {
87167 if (!arguments.length) return _addable;
87171 _this.reference = () => {
87172 const qid = _this.tags.wikidata || _this.tags["flag:wikidata"] || _this.tags["brand:wikidata"] || _this.tags["network:wikidata"] || _this.tags["operator:wikidata"];
87176 let key = _this.originalReference.key || Object.keys(utilObjectOmit(_this.tags, "name"))[0];
87177 let value = _this.originalReference.value || _this.tags[key];
87178 if (value === "*") {
87181 return { key, value };
87184 _this.unsetTags = (tags, geometry, ignoringKeys, skipFieldDefaults, loc) => {
87185 let removeTags = ignoringKeys ? utilObjectOmit(_this.removeTags, ignoringKeys) : _this.removeTags;
87186 tags = utilObjectOmit(tags, Object.keys(removeTags));
87187 if (geometry && !skipFieldDefaults) {
87188 _this.fields(loc).forEach((field) => {
87189 if (field.matchGeometry(geometry) && field.key && field.default === tags[field.key] && (!ignoringKeys || ignoringKeys.indexOf(field.key) === -1)) {
87190 delete tags[field.key];
87197 _this.setTags = (tags, geometry, skipFieldDefaults, loc) => {
87198 const addTags = _this.addTags;
87199 tags = Object.assign({}, tags);
87200 for (let k2 in addTags) {
87201 if (addTags[k2] === "*") {
87202 if (_this.tags[k2] || !tags[k2]) {
87206 tags[k2] = addTags[k2];
87209 if (!addTags.hasOwnProperty("area")) {
87211 if (geometry === "area") {
87212 let needsAreaTag = true;
87213 for (let k2 in addTags) {
87214 if (_this.geometry.indexOf("line") === -1 && k2 in osmAreaKeys || k2 in osmAreaKeysExceptions && addTags[k2] in osmAreaKeysExceptions[k2]) {
87215 needsAreaTag = false;
87219 if (needsAreaTag) {
87224 if (geometry && !skipFieldDefaults) {
87225 _this.fields(loc).forEach((field) => {
87226 if (field.matchGeometry(geometry) && field.key && !tags[field.key] && field.default) {
87227 tags[field.key] = field.default;
87233 function resolveFields(which, loc) {
87234 const fieldIDs = which === "fields" ? _this.originalFields : _this.originalMoreFields;
87236 fieldIDs.forEach((fieldID) => {
87237 const match = fieldID.match(referenceRegex);
87238 if (match !== null) {
87239 resolved = resolved.concat(inheritFields(allPresets[match[1]], which, loc));
87240 } else if (allFields[fieldID]) {
87241 resolved.push(allFields[fieldID]);
87243 console.log(`Cannot resolve "${fieldID}" found in ${_this.id}.${which}`);
87246 if (!resolved.length) {
87247 const endIndex = _this.id.lastIndexOf("/");
87248 const parentID = endIndex && _this.id.substring(0, endIndex);
87250 let parent2 = allPresets[parentID];
87252 const validHere = _sharedLocationManager.locationSetsAt(loc);
87253 if ((parent2 == null ? void 0 : parent2.locationSetID) && !validHere[parent2.locationSetID]) {
87254 const candidateIDs = Object.keys(allPresets).filter((k2) => k2.startsWith(parentID));
87255 parent2 = allPresets[candidateIDs.find((candidateID) => {
87256 const candidate = allPresets[candidateID];
87257 return validHere[candidate.locationSetID] && isEqual_default(candidate.tags, parent2.tags);
87261 resolved = inheritFields(parent2, which, loc);
87265 const validHere = _sharedLocationManager.locationSetsAt(loc);
87266 resolved = resolved.filter((field) => !field.locationSetID || validHere[field.locationSetID]);
87269 function inheritFields(parent2, which2, loc2) {
87270 if (!parent2) return [];
87271 if (which2 === "fields") {
87272 return parent2.fields(loc2).filter(shouldInherit);
87273 } else if (which2 === "moreFields") {
87274 return parent2.moreFields(loc2).filter(shouldInherit);
87279 function shouldInherit(f2) {
87280 if (f2.key && _this.tags[f2.key] !== void 0 && // inherit anyway if multiple values are allowed or just a checkbox
87281 f2.type !== "multiCombo" && f2.type !== "semiCombo" && f2.type !== "manyCombo" && f2.type !== "check") return false;
87282 if (f2.key && (_this.originalFields.some((originalField) => {
87284 return f2.key === ((_a4 = allFields[originalField]) == null ? void 0 : _a4.key);
87285 }) || _this.originalMoreFields.some((originalField) => {
87287 return f2.key === ((_a4 = allFields[originalField]) == null ? void 0 : _a4.key);
87294 function stripDiacritics(s2) {
87295 if (s2.normalize) s2 = s2.normalize("NFD");
87296 s2 = s2.replace(/[\u0300-\u036f]/g, "");
87301 var init_preset = __esm({
87302 "modules/presets/preset.js"() {
87309 init_LocationManager();
87313 // modules/ui/panes/index.js
87314 var panes_exports = {};
87315 __export(panes_exports, {
87316 uiPaneBackground: () => uiPaneBackground,
87317 uiPaneHelp: () => uiPaneHelp,
87318 uiPaneIssues: () => uiPaneIssues,
87319 uiPaneMapData: () => uiPaneMapData,
87320 uiPanePreferences: () => uiPanePreferences
87322 var init_panes = __esm({
87323 "modules/ui/panes/index.js"() {
87325 init_background3();
87329 init_preferences2();
87333 // modules/ui/sections/index.js
87334 var sections_exports = {};
87335 __export(sections_exports, {
87336 uiSectionBackgroundDisplayOptions: () => uiSectionBackgroundDisplayOptions,
87337 uiSectionBackgroundList: () => uiSectionBackgroundList,
87338 uiSectionBackgroundOffset: () => uiSectionBackgroundOffset,
87339 uiSectionChanges: () => uiSectionChanges,
87340 uiSectionDataLayers: () => uiSectionDataLayers,
87341 uiSectionEntityIssues: () => uiSectionEntityIssues,
87342 uiSectionFeatureType: () => uiSectionFeatureType,
87343 uiSectionMapFeatures: () => uiSectionMapFeatures,
87344 uiSectionMapStyleOptions: () => uiSectionMapStyleOptions,
87345 uiSectionOverlayList: () => uiSectionOverlayList,
87346 uiSectionPhotoOverlays: () => uiSectionPhotoOverlays,
87347 uiSectionPresetFields: () => uiSectionPresetFields,
87348 uiSectionPrivacy: () => uiSectionPrivacy,
87349 uiSectionRawMemberEditor: () => uiSectionRawMemberEditor,
87350 uiSectionRawMembershipEditor: () => uiSectionRawMembershipEditor,
87351 uiSectionRawTagEditor: () => uiSectionRawTagEditor,
87352 uiSectionSelectionList: () => uiSectionSelectionList,
87353 uiSectionValidationIssues: () => uiSectionValidationIssues,
87354 uiSectionValidationOptions: () => uiSectionValidationOptions,
87355 uiSectionValidationRules: () => uiSectionValidationRules,
87356 uiSectionValidationStatus: () => uiSectionValidationStatus
87358 var init_sections = __esm({
87359 "modules/ui/sections/index.js"() {
87361 init_background_display_options();
87362 init_background_list();
87363 init_background_offset();
87365 init_data_layers();
87366 init_entity_issues();
87367 init_feature_type();
87368 init_map_features();
87369 init_map_style_options();
87370 init_overlay_list();
87371 init_photo_overlays();
87372 init_preset_fields();
87374 init_raw_member_editor();
87375 init_raw_membership_editor();
87376 init_raw_tag_editor();
87377 init_selection_list();
87378 init_validation_issues();
87379 init_validation_options();
87380 init_validation_rules();
87381 init_validation_status();
87385 // modules/ui/settings/index.js
87386 var settings_exports = {};
87387 __export(settings_exports, {
87388 uiSettingsCustomBackground: () => uiSettingsCustomBackground,
87389 uiSettingsCustomData: () => uiSettingsCustomData
87391 var init_settings = __esm({
87392 "modules/ui/settings/index.js"() {
87394 init_custom_background();
87395 init_custom_data();
87399 // import("../**/*") in modules/core/file_fetcher.js
87401 var init_ = __esm({
87402 'import("../**/*") in modules/core/file_fetcher.js'() {
87403 globImport = __glob({
87404 "../actions/add_entity.js": () => Promise.resolve().then(() => (init_add_entity(), add_entity_exports)),
87405 "../actions/add_member.js": () => Promise.resolve().then(() => (init_add_member(), add_member_exports)),
87406 "../actions/add_midpoint.js": () => Promise.resolve().then(() => (init_add_midpoint(), add_midpoint_exports)),
87407 "../actions/add_vertex.js": () => Promise.resolve().then(() => (init_add_vertex(), add_vertex_exports)),
87408 "../actions/change_member.js": () => Promise.resolve().then(() => (init_change_member(), change_member_exports)),
87409 "../actions/change_preset.js": () => Promise.resolve().then(() => (init_change_preset(), change_preset_exports)),
87410 "../actions/change_tags.js": () => Promise.resolve().then(() => (init_change_tags(), change_tags_exports)),
87411 "../actions/circularize.js": () => Promise.resolve().then(() => (init_circularize(), circularize_exports)),
87412 "../actions/connect.js": () => Promise.resolve().then(() => (init_connect(), connect_exports)),
87413 "../actions/copy_entities.js": () => Promise.resolve().then(() => (init_copy_entities(), copy_entities_exports)),
87414 "../actions/delete_member.js": () => Promise.resolve().then(() => (init_delete_member(), delete_member_exports)),
87415 "../actions/delete_members.js": () => Promise.resolve().then(() => (init_delete_members(), delete_members_exports)),
87416 "../actions/delete_multiple.js": () => Promise.resolve().then(() => (init_delete_multiple(), delete_multiple_exports)),
87417 "../actions/delete_node.js": () => Promise.resolve().then(() => (init_delete_node(), delete_node_exports)),
87418 "../actions/delete_relation.js": () => Promise.resolve().then(() => (init_delete_relation(), delete_relation_exports)),
87419 "../actions/delete_way.js": () => Promise.resolve().then(() => (init_delete_way(), delete_way_exports)),
87420 "../actions/discard_tags.js": () => Promise.resolve().then(() => (init_discard_tags(), discard_tags_exports)),
87421 "../actions/disconnect.js": () => Promise.resolve().then(() => (init_disconnect(), disconnect_exports)),
87422 "../actions/extract.js": () => Promise.resolve().then(() => (init_extract(), extract_exports)),
87423 "../actions/index.js": () => Promise.resolve().then(() => (init_actions(), actions_exports)),
87424 "../actions/join.js": () => Promise.resolve().then(() => (init_join2(), join_exports)),
87425 "../actions/merge.js": () => Promise.resolve().then(() => (init_merge5(), merge_exports)),
87426 "../actions/merge_nodes.js": () => Promise.resolve().then(() => (init_merge_nodes(), merge_nodes_exports)),
87427 "../actions/merge_polygon.js": () => Promise.resolve().then(() => (init_merge_polygon(), merge_polygon_exports)),
87428 "../actions/merge_remote_changes.js": () => Promise.resolve().then(() => (init_merge_remote_changes(), merge_remote_changes_exports)),
87429 "../actions/move.js": () => Promise.resolve().then(() => (init_move(), move_exports)),
87430 "../actions/move_member.js": () => Promise.resolve().then(() => (init_move_member(), move_member_exports)),
87431 "../actions/move_node.js": () => Promise.resolve().then(() => (init_move_node(), move_node_exports)),
87432 "../actions/noop.js": () => Promise.resolve().then(() => (init_noop2(), noop_exports)),
87433 "../actions/orthogonalize.js": () => Promise.resolve().then(() => (init_orthogonalize(), orthogonalize_exports)),
87434 "../actions/reflect.js": () => Promise.resolve().then(() => (init_reflect(), reflect_exports)),
87435 "../actions/restrict_turn.js": () => Promise.resolve().then(() => (init_restrict_turn(), restrict_turn_exports)),
87436 "../actions/reverse.js": () => Promise.resolve().then(() => (init_reverse2(), reverse_exports2)),
87437 "../actions/revert.js": () => Promise.resolve().then(() => (init_revert(), revert_exports)),
87438 "../actions/rotate.js": () => Promise.resolve().then(() => (init_rotate(), rotate_exports)),
87439 "../actions/scale.js": () => Promise.resolve().then(() => (init_scale(), scale_exports)),
87440 "../actions/split.js": () => Promise.resolve().then(() => (init_split(), split_exports)),
87441 "../actions/straighten_nodes.js": () => Promise.resolve().then(() => (init_straighten_nodes(), straighten_nodes_exports)),
87442 "../actions/straighten_way.js": () => Promise.resolve().then(() => (init_straighten_way(), straighten_way_exports)),
87443 "../actions/unrestrict_turn.js": () => Promise.resolve().then(() => (init_unrestrict_turn(), unrestrict_turn_exports)),
87444 "../actions/upgrade_tags.js": () => Promise.resolve().then(() => (init_upgrade_tags(), upgrade_tags_exports)),
87445 "../behavior/add_way.js": () => Promise.resolve().then(() => (init_add_way(), add_way_exports)),
87446 "../behavior/breathe.js": () => Promise.resolve().then(() => (init_breathe(), breathe_exports)),
87447 "../behavior/drag.js": () => Promise.resolve().then(() => (init_drag2(), drag_exports)),
87448 "../behavior/draw.js": () => Promise.resolve().then(() => (init_draw(), draw_exports)),
87449 "../behavior/draw_way.js": () => Promise.resolve().then(() => (init_draw_way(), draw_way_exports)),
87450 "../behavior/edit.js": () => Promise.resolve().then(() => (init_edit(), edit_exports)),
87451 "../behavior/hash.js": () => Promise.resolve().then(() => (init_hash(), hash_exports)),
87452 "../behavior/hover.js": () => Promise.resolve().then(() => (init_hover(), hover_exports)),
87453 "../behavior/index.js": () => Promise.resolve().then(() => (init_behavior(), behavior_exports)),
87454 "../behavior/lasso.js": () => Promise.resolve().then(() => (init_lasso2(), lasso_exports2)),
87455 "../behavior/operation.js": () => Promise.resolve().then(() => (init_operation(), operation_exports)),
87456 "../behavior/paste.js": () => Promise.resolve().then(() => (init_paste2(), paste_exports2)),
87457 "../behavior/select.js": () => Promise.resolve().then(() => (init_select4(), select_exports)),
87458 "../core/LocationManager.js": () => Promise.resolve().then(() => (init_LocationManager(), LocationManager_exports)),
87459 "../core/context.js": () => Promise.resolve().then(() => (init_context2(), context_exports)),
87460 "../core/difference.js": () => Promise.resolve().then(() => (init_difference(), difference_exports)),
87461 "../core/file_fetcher.js": () => Promise.resolve().then(() => (init_file_fetcher(), file_fetcher_exports)),
87462 "../core/graph.js": () => Promise.resolve().then(() => (init_graph(), graph_exports)),
87463 "../core/history.js": () => Promise.resolve().then(() => (init_history(), history_exports)),
87464 "../core/index.js": () => Promise.resolve().then(() => (init_core(), core_exports)),
87465 "../core/localizer.js": () => Promise.resolve().then(() => (init_localizer(), localizer_exports)),
87466 "../core/preferences.js": () => Promise.resolve().then(() => (init_preferences(), preferences_exports)),
87467 "../core/tree.js": () => Promise.resolve().then(() => (init_tree(), tree_exports)),
87468 "../core/uploader.js": () => Promise.resolve().then(() => (init_uploader(), uploader_exports)),
87469 "../core/validation/index.js": () => Promise.resolve().then(() => (init_validation(), validation_exports)),
87470 "../core/validation/models.js": () => Promise.resolve().then(() => (init_models(), models_exports)),
87471 "../core/validator.js": () => Promise.resolve().then(() => (init_validator(), validator_exports)),
87472 "../geo/extent.js": () => Promise.resolve().then(() => (init_extent(), extent_exports)),
87473 "../geo/geo.js": () => Promise.resolve().then(() => (init_geo(), geo_exports)),
87474 "../geo/geom.js": () => Promise.resolve().then(() => (init_geom(), geom_exports)),
87475 "../geo/index.js": () => Promise.resolve().then(() => (init_geo2(), geo_exports2)),
87476 "../geo/ortho.js": () => Promise.resolve().then(() => (init_ortho(), ortho_exports)),
87477 "../geo/raw_mercator.js": () => Promise.resolve().then(() => (init_raw_mercator(), raw_mercator_exports)),
87478 "../geo/vector.js": () => Promise.resolve().then(() => (init_vector(), vector_exports)),
87479 "../globals.d.ts": () => Promise.resolve().then(() => (init_globals_d(), globals_d_exports)),
87480 "../id.js": () => Promise.resolve().then(() => (init_id2(), id_exports)),
87481 "../index.js": () => Promise.resolve().then(() => (init_index(), index_exports)),
87482 "../modes/add_area.js": () => Promise.resolve().then(() => (init_add_area(), add_area_exports)),
87483 "../modes/add_line.js": () => Promise.resolve().then(() => (init_add_line(), add_line_exports)),
87484 "../modes/add_note.js": () => Promise.resolve().then(() => (init_add_note(), add_note_exports)),
87485 "../modes/add_point.js": () => Promise.resolve().then(() => (init_add_point(), add_point_exports)),
87486 "../modes/browse.js": () => Promise.resolve().then(() => (init_browse(), browse_exports)),
87487 "../modes/drag_node.js": () => Promise.resolve().then(() => (init_drag_node(), drag_node_exports)),
87488 "../modes/drag_note.js": () => Promise.resolve().then(() => (init_drag_note(), drag_note_exports)),
87489 "../modes/draw_area.js": () => Promise.resolve().then(() => (init_draw_area(), draw_area_exports)),
87490 "../modes/draw_line.js": () => Promise.resolve().then(() => (init_draw_line(), draw_line_exports)),
87491 "../modes/index.js": () => Promise.resolve().then(() => (init_modes2(), modes_exports2)),
87492 "../modes/move.js": () => Promise.resolve().then(() => (init_move3(), move_exports3)),
87493 "../modes/rotate.js": () => Promise.resolve().then(() => (init_rotate2(), rotate_exports2)),
87494 "../modes/save.js": () => Promise.resolve().then(() => (init_save2(), save_exports2)),
87495 "../modes/select.js": () => Promise.resolve().then(() => (init_select5(), select_exports2)),
87496 "../modes/select_data.js": () => Promise.resolve().then(() => (init_select_data(), select_data_exports)),
87497 "../modes/select_error.js": () => Promise.resolve().then(() => (init_select_error(), select_error_exports)),
87498 "../modes/select_note.js": () => Promise.resolve().then(() => (init_select_note(), select_note_exports)),
87499 "../operations/circularize.js": () => Promise.resolve().then(() => (init_circularize2(), circularize_exports2)),
87500 "../operations/continue.js": () => Promise.resolve().then(() => (init_continue(), continue_exports)),
87501 "../operations/copy.js": () => Promise.resolve().then(() => (init_copy(), copy_exports)),
87502 "../operations/delete.js": () => Promise.resolve().then(() => (init_delete(), delete_exports)),
87503 "../operations/disconnect.js": () => Promise.resolve().then(() => (init_disconnect2(), disconnect_exports2)),
87504 "../operations/downgrade.js": () => Promise.resolve().then(() => (init_downgrade(), downgrade_exports)),
87505 "../operations/extract.js": () => Promise.resolve().then(() => (init_extract2(), extract_exports2)),
87506 "../operations/index.js": () => Promise.resolve().then(() => (init_operations(), operations_exports)),
87507 "../operations/merge.js": () => Promise.resolve().then(() => (init_merge6(), merge_exports2)),
87508 "../operations/move.js": () => Promise.resolve().then(() => (init_move2(), move_exports2)),
87509 "../operations/orthogonalize.js": () => Promise.resolve().then(() => (init_orthogonalize2(), orthogonalize_exports2)),
87510 "../operations/paste.js": () => Promise.resolve().then(() => (init_paste(), paste_exports)),
87511 "../operations/reflect.js": () => Promise.resolve().then(() => (init_reflect2(), reflect_exports2)),
87512 "../operations/reverse.js": () => Promise.resolve().then(() => (init_reverse(), reverse_exports)),
87513 "../operations/rotate.js": () => Promise.resolve().then(() => (init_rotate3(), rotate_exports3)),
87514 "../operations/split.js": () => Promise.resolve().then(() => (init_split2(), split_exports2)),
87515 "../operations/straighten.js": () => Promise.resolve().then(() => (init_straighten(), straighten_exports)),
87516 "../osm/changeset.js": () => Promise.resolve().then(() => (init_changeset(), changeset_exports)),
87517 "../osm/deprecated.js": () => Promise.resolve().then(() => (init_deprecated(), deprecated_exports)),
87518 "../osm/entity.js": () => Promise.resolve().then(() => (init_entity(), entity_exports)),
87519 "../osm/index.js": () => Promise.resolve().then(() => (init_osm(), osm_exports)),
87520 "../osm/intersection.js": () => Promise.resolve().then(() => (init_intersection(), intersection_exports)),
87521 "../osm/lanes.js": () => Promise.resolve().then(() => (init_lanes(), lanes_exports)),
87522 "../osm/multipolygon.js": () => Promise.resolve().then(() => (init_multipolygon(), multipolygon_exports)),
87523 "../osm/node.js": () => Promise.resolve().then(() => (init_node2(), node_exports)),
87524 "../osm/note.js": () => Promise.resolve().then(() => (init_note(), note_exports)),
87525 "../osm/qa_item.js": () => Promise.resolve().then(() => (init_qa_item(), qa_item_exports)),
87526 "../osm/relation.js": () => Promise.resolve().then(() => (init_relation(), relation_exports)),
87527 "../osm/tags.js": () => Promise.resolve().then(() => (init_tags(), tags_exports)),
87528 "../osm/way.js": () => Promise.resolve().then(() => (init_way(), way_exports)),
87529 "../presets/category.js": () => Promise.resolve().then(() => (init_category(), category_exports)),
87530 "../presets/collection.js": () => Promise.resolve().then(() => (init_collection(), collection_exports)),
87531 "../presets/field.js": () => Promise.resolve().then(() => (init_field2(), field_exports2)),
87532 "../presets/index.js": () => Promise.resolve().then(() => (init_presets(), presets_exports)),
87533 "../presets/preset.js": () => Promise.resolve().then(() => (init_preset(), preset_exports)),
87534 "../renderer/background.js": () => Promise.resolve().then(() => (init_background2(), background_exports2)),
87535 "../renderer/background_source.js": () => Promise.resolve().then(() => (init_background_source(), background_source_exports)),
87536 "../renderer/features.js": () => Promise.resolve().then(() => (init_features(), features_exports)),
87537 "../renderer/index.js": () => Promise.resolve().then(() => (init_renderer(), renderer_exports)),
87538 "../renderer/map.js": () => Promise.resolve().then(() => (init_map(), map_exports)),
87539 "../renderer/photos.js": () => Promise.resolve().then(() => (init_photos(), photos_exports)),
87540 "../renderer/tile_layer.js": () => Promise.resolve().then(() => (init_tile_layer(), tile_layer_exports)),
87541 "../services/index.js": () => Promise.resolve().then(() => (init_services(), services_exports)),
87542 "../services/kartaview.js": () => Promise.resolve().then(() => (init_kartaview(), kartaview_exports)),
87543 "../services/keepRight.js": () => Promise.resolve().then(() => (init_keepRight(), keepRight_exports)),
87544 "../services/mapilio.js": () => Promise.resolve().then(() => (init_mapilio(), mapilio_exports)),
87545 "../services/mapillary.js": () => Promise.resolve().then(() => (init_mapillary(), mapillary_exports)),
87546 "../services/maprules.js": () => Promise.resolve().then(() => (init_maprules(), maprules_exports)),
87547 "../services/nominatim.js": () => Promise.resolve().then(() => (init_nominatim(), nominatim_exports)),
87548 "../services/nsi.js": () => Promise.resolve().then(() => (init_nsi(), nsi_exports)),
87549 "../services/osm.js": () => Promise.resolve().then(() => (init_osm2(), osm_exports2)),
87550 "../services/osm_wikibase.js": () => Promise.resolve().then(() => (init_osm_wikibase(), osm_wikibase_exports)),
87551 "../services/osmose.js": () => Promise.resolve().then(() => (init_osmose(), osmose_exports)),
87552 "../services/pannellum_photo.js": () => Promise.resolve().then(() => (init_pannellum_photo(), pannellum_photo_exports)),
87553 "../services/panoramax.js": () => Promise.resolve().then(() => (init_panoramax(), panoramax_exports)),
87554 "../services/plane_photo.js": () => Promise.resolve().then(() => (init_plane_photo(), plane_photo_exports)),
87555 "../services/streetside.js": () => Promise.resolve().then(() => (init_streetside(), streetside_exports)),
87556 "../services/taginfo.js": () => Promise.resolve().then(() => (init_taginfo(), taginfo_exports)),
87557 "../services/vector_tile.js": () => Promise.resolve().then(() => (init_vector_tile2(), vector_tile_exports)),
87558 "../services/vegbilder.js": () => Promise.resolve().then(() => (init_vegbilder(), vegbilder_exports)),
87559 "../services/wikidata.js": () => Promise.resolve().then(() => (init_wikidata(), wikidata_exports)),
87560 "../services/wikipedia.js": () => Promise.resolve().then(() => (init_wikipedia(), wikipedia_exports)),
87561 "../svg/areas.js": () => Promise.resolve().then(() => (init_areas(), areas_exports)),
87562 "../svg/data.js": () => Promise.resolve().then(() => (init_data2(), data_exports)),
87563 "../svg/debug.js": () => Promise.resolve().then(() => (init_debug(), debug_exports)),
87564 "../svg/defs.js": () => Promise.resolve().then(() => (init_defs(), defs_exports)),
87565 "../svg/geolocate.js": () => Promise.resolve().then(() => (init_geolocate(), geolocate_exports)),
87566 "../svg/helpers.js": () => Promise.resolve().then(() => (init_helpers(), helpers_exports)),
87567 "../svg/icon.js": () => Promise.resolve().then(() => (init_icon(), icon_exports)),
87568 "../svg/index.js": () => Promise.resolve().then(() => (init_svg(), svg_exports)),
87569 "../svg/kartaview_images.js": () => Promise.resolve().then(() => (init_kartaview_images(), kartaview_images_exports)),
87570 "../svg/keepRight.js": () => Promise.resolve().then(() => (init_keepRight2(), keepRight_exports2)),
87571 "../svg/labels.js": () => Promise.resolve().then(() => (init_labels(), labels_exports)),
87572 "../svg/layers.js": () => Promise.resolve().then(() => (init_layers(), layers_exports)),
87573 "../svg/lines.js": () => Promise.resolve().then(() => (init_lines(), lines_exports)),
87574 "../svg/local_photos.js": () => Promise.resolve().then(() => (init_local_photos(), local_photos_exports)),
87575 "../svg/mapilio_images.js": () => Promise.resolve().then(() => (init_mapilio_images(), mapilio_images_exports)),
87576 "../svg/mapillary_images.js": () => Promise.resolve().then(() => (init_mapillary_images(), mapillary_images_exports)),
87577 "../svg/mapillary_map_features.js": () => Promise.resolve().then(() => (init_mapillary_map_features(), mapillary_map_features_exports)),
87578 "../svg/mapillary_position.js": () => Promise.resolve().then(() => (init_mapillary_position(), mapillary_position_exports)),
87579 "../svg/mapillary_signs.js": () => Promise.resolve().then(() => (init_mapillary_signs(), mapillary_signs_exports)),
87580 "../svg/midpoints.js": () => Promise.resolve().then(() => (init_midpoints(), midpoints_exports)),
87581 "../svg/notes.js": () => Promise.resolve().then(() => (init_notes(), notes_exports)),
87582 "../svg/osm.js": () => Promise.resolve().then(() => (init_osm3(), osm_exports3)),
87583 "../svg/osmose.js": () => Promise.resolve().then(() => (init_osmose2(), osmose_exports2)),
87584 "../svg/panoramax_images.js": () => Promise.resolve().then(() => (init_panoramax_images(), panoramax_images_exports)),
87585 "../svg/points.js": () => Promise.resolve().then(() => (init_points(), points_exports)),
87586 "../svg/streetside.js": () => Promise.resolve().then(() => (init_streetside2(), streetside_exports2)),
87587 "../svg/tag_classes.js": () => Promise.resolve().then(() => (init_tag_classes(), tag_classes_exports)),
87588 "../svg/tag_pattern.js": () => Promise.resolve().then(() => (init_tag_pattern(), tag_pattern_exports)),
87589 "../svg/touch.js": () => Promise.resolve().then(() => (init_touch(), touch_exports)),
87590 "../svg/turns.js": () => Promise.resolve().then(() => (init_turns(), turns_exports)),
87591 "../svg/vegbilder.js": () => Promise.resolve().then(() => (init_vegbilder2(), vegbilder_exports2)),
87592 "../svg/vertices.js": () => Promise.resolve().then(() => (init_vertices(), vertices_exports)),
87593 "../ui/account.js": () => Promise.resolve().then(() => (init_account(), account_exports)),
87594 "../ui/attribution.js": () => Promise.resolve().then(() => (init_attribution(), attribution_exports)),
87595 "../ui/changeset_editor.js": () => Promise.resolve().then(() => (init_changeset_editor(), changeset_editor_exports)),
87596 "../ui/cmd.js": () => Promise.resolve().then(() => (init_cmd(), cmd_exports)),
87597 "../ui/combobox.js": () => Promise.resolve().then(() => (init_combobox(), combobox_exports)),
87598 "../ui/commit.js": () => Promise.resolve().then(() => (init_commit(), commit_exports)),
87599 "../ui/commit_warnings.js": () => Promise.resolve().then(() => (init_commit_warnings(), commit_warnings_exports)),
87600 "../ui/confirm.js": () => Promise.resolve().then(() => (init_confirm(), confirm_exports)),
87601 "../ui/conflicts.js": () => Promise.resolve().then(() => (init_conflicts(), conflicts_exports)),
87602 "../ui/contributors.js": () => Promise.resolve().then(() => (init_contributors(), contributors_exports)),
87603 "../ui/curtain.js": () => Promise.resolve().then(() => (init_curtain(), curtain_exports)),
87604 "../ui/data_editor.js": () => Promise.resolve().then(() => (init_data_editor(), data_editor_exports)),
87605 "../ui/data_header.js": () => Promise.resolve().then(() => (init_data_header(), data_header_exports)),
87606 "../ui/disclosure.js": () => Promise.resolve().then(() => (init_disclosure(), disclosure_exports)),
87607 "../ui/edit_menu.js": () => Promise.resolve().then(() => (init_edit_menu(), edit_menu_exports)),
87608 "../ui/entity_editor.js": () => Promise.resolve().then(() => (init_entity_editor(), entity_editor_exports)),
87609 "../ui/feature_info.js": () => Promise.resolve().then(() => (init_feature_info(), feature_info_exports)),
87610 "../ui/feature_list.js": () => Promise.resolve().then(() => (init_feature_list(), feature_list_exports)),
87611 "../ui/field.js": () => Promise.resolve().then(() => (init_field(), field_exports)),
87612 "../ui/field_help.js": () => Promise.resolve().then(() => (init_field_help(), field_help_exports)),
87613 "../ui/fields/access.js": () => Promise.resolve().then(() => (init_access(), access_exports)),
87614 "../ui/fields/address.js": () => Promise.resolve().then(() => (init_address(), address_exports)),
87615 "../ui/fields/check.js": () => Promise.resolve().then(() => (init_check(), check_exports)),
87616 "../ui/fields/combo.js": () => Promise.resolve().then(() => (init_combo(), combo_exports)),
87617 "../ui/fields/directional_combo.js": () => Promise.resolve().then(() => (init_directional_combo(), directional_combo_exports)),
87618 "../ui/fields/index.js": () => Promise.resolve().then(() => (init_fields(), fields_exports)),
87619 "../ui/fields/input.js": () => Promise.resolve().then(() => (init_input(), input_exports)),
87620 "../ui/fields/lanes.js": () => Promise.resolve().then(() => (init_lanes2(), lanes_exports2)),
87621 "../ui/fields/localized.js": () => Promise.resolve().then(() => (init_localized(), localized_exports)),
87622 "../ui/fields/radio.js": () => Promise.resolve().then(() => (init_radio(), radio_exports)),
87623 "../ui/fields/restrictions.js": () => Promise.resolve().then(() => (init_restrictions(), restrictions_exports)),
87624 "../ui/fields/roadheight.js": () => Promise.resolve().then(() => (init_roadheight(), roadheight_exports)),
87625 "../ui/fields/roadspeed.js": () => Promise.resolve().then(() => (init_roadspeed(), roadspeed_exports)),
87626 "../ui/fields/textarea.js": () => Promise.resolve().then(() => (init_textarea(), textarea_exports)),
87627 "../ui/fields/wikidata.js": () => Promise.resolve().then(() => (init_wikidata2(), wikidata_exports2)),
87628 "../ui/fields/wikipedia.js": () => Promise.resolve().then(() => (init_wikipedia2(), wikipedia_exports2)),
87629 "../ui/flash.js": () => Promise.resolve().then(() => (init_flash(), flash_exports)),
87630 "../ui/form_fields.js": () => Promise.resolve().then(() => (init_form_fields(), form_fields_exports)),
87631 "../ui/full_screen.js": () => Promise.resolve().then(() => (init_full_screen(), full_screen_exports)),
87632 "../ui/geolocate.js": () => Promise.resolve().then(() => (init_geolocate2(), geolocate_exports2)),
87633 "../ui/index.js": () => Promise.resolve().then(() => (init_ui(), ui_exports)),
87634 "../ui/info.js": () => Promise.resolve().then(() => (init_info(), info_exports)),
87635 "../ui/init.js": () => Promise.resolve().then(() => (init_init2(), init_exports)),
87636 "../ui/inspector.js": () => Promise.resolve().then(() => (init_inspector(), inspector_exports)),
87637 "../ui/intro/area.js": () => Promise.resolve().then(() => (init_area4(), area_exports)),
87638 "../ui/intro/building.js": () => Promise.resolve().then(() => (init_building(), building_exports)),
87639 "../ui/intro/helper.js": () => Promise.resolve().then(() => (init_helper(), helper_exports)),
87640 "../ui/intro/index.js": () => Promise.resolve().then(() => (init_intro2(), intro_exports2)),
87641 "../ui/intro/intro.js": () => Promise.resolve().then(() => (init_intro(), intro_exports)),
87642 "../ui/intro/line.js": () => Promise.resolve().then(() => (init_line2(), line_exports)),
87643 "../ui/intro/navigation.js": () => Promise.resolve().then(() => (init_navigation(), navigation_exports)),
87644 "../ui/intro/point.js": () => Promise.resolve().then(() => (init_point(), point_exports)),
87645 "../ui/intro/start_editing.js": () => Promise.resolve().then(() => (init_start_editing(), start_editing_exports)),
87646 "../ui/intro/welcome.js": () => Promise.resolve().then(() => (init_welcome(), welcome_exports)),
87647 "../ui/issues_info.js": () => Promise.resolve().then(() => (init_issues_info(), issues_info_exports)),
87648 "../ui/keepRight_details.js": () => Promise.resolve().then(() => (init_keepRight_details(), keepRight_details_exports)),
87649 "../ui/keepRight_editor.js": () => Promise.resolve().then(() => (init_keepRight_editor(), keepRight_editor_exports)),
87650 "../ui/keepRight_header.js": () => Promise.resolve().then(() => (init_keepRight_header(), keepRight_header_exports)),
87651 "../ui/lasso.js": () => Promise.resolve().then(() => (init_lasso(), lasso_exports)),
87652 "../ui/length_indicator.js": () => Promise.resolve().then(() => (init_length_indicator(), length_indicator_exports)),
87653 "../ui/loading.js": () => Promise.resolve().then(() => (init_loading(), loading_exports)),
87654 "../ui/map_in_map.js": () => Promise.resolve().then(() => (init_map_in_map(), map_in_map_exports)),
87655 "../ui/modal.js": () => Promise.resolve().then(() => (init_modal(), modal_exports)),
87656 "../ui/note_comments.js": () => Promise.resolve().then(() => (init_note_comments(), note_comments_exports)),
87657 "../ui/note_editor.js": () => Promise.resolve().then(() => (init_note_editor(), note_editor_exports)),
87658 "../ui/note_header.js": () => Promise.resolve().then(() => (init_note_header(), note_header_exports)),
87659 "../ui/note_report.js": () => Promise.resolve().then(() => (init_note_report(), note_report_exports)),
87660 "../ui/notice.js": () => Promise.resolve().then(() => (init_notice(), notice_exports)),
87661 "../ui/osmose_details.js": () => Promise.resolve().then(() => (init_osmose_details(), osmose_details_exports)),
87662 "../ui/osmose_editor.js": () => Promise.resolve().then(() => (init_osmose_editor(), osmose_editor_exports)),
87663 "../ui/osmose_header.js": () => Promise.resolve().then(() => (init_osmose_header(), osmose_header_exports)),
87664 "../ui/pane.js": () => Promise.resolve().then(() => (init_pane(), pane_exports)),
87665 "../ui/panels/background.js": () => Promise.resolve().then(() => (init_background(), background_exports)),
87666 "../ui/panels/history.js": () => Promise.resolve().then(() => (init_history2(), history_exports2)),
87667 "../ui/panels/index.js": () => Promise.resolve().then(() => (init_panels(), panels_exports)),
87668 "../ui/panels/location.js": () => Promise.resolve().then(() => (init_location(), location_exports)),
87669 "../ui/panels/measurement.js": () => Promise.resolve().then(() => (init_measurement(), measurement_exports)),
87670 "../ui/panes/background.js": () => Promise.resolve().then(() => (init_background3(), background_exports3)),
87671 "../ui/panes/help.js": () => Promise.resolve().then(() => (init_help(), help_exports)),
87672 "../ui/panes/index.js": () => Promise.resolve().then(() => (init_panes(), panes_exports)),
87673 "../ui/panes/issues.js": () => Promise.resolve().then(() => (init_issues(), issues_exports)),
87674 "../ui/panes/map_data.js": () => Promise.resolve().then(() => (init_map_data(), map_data_exports)),
87675 "../ui/panes/preferences.js": () => Promise.resolve().then(() => (init_preferences2(), preferences_exports2)),
87676 "../ui/photoviewer.js": () => Promise.resolve().then(() => (init_photoviewer(), photoviewer_exports)),
87677 "../ui/popover.js": () => Promise.resolve().then(() => (init_popover(), popover_exports)),
87678 "../ui/preset_icon.js": () => Promise.resolve().then(() => (init_preset_icon(), preset_icon_exports)),
87679 "../ui/preset_list.js": () => Promise.resolve().then(() => (init_preset_list(), preset_list_exports)),
87680 "../ui/restore.js": () => Promise.resolve().then(() => (init_restore(), restore_exports)),
87681 "../ui/scale.js": () => Promise.resolve().then(() => (init_scale2(), scale_exports2)),
87682 "../ui/section.js": () => Promise.resolve().then(() => (init_section(), section_exports)),
87683 "../ui/sections/background_display_options.js": () => Promise.resolve().then(() => (init_background_display_options(), background_display_options_exports)),
87684 "../ui/sections/background_list.js": () => Promise.resolve().then(() => (init_background_list(), background_list_exports)),
87685 "../ui/sections/background_offset.js": () => Promise.resolve().then(() => (init_background_offset(), background_offset_exports)),
87686 "../ui/sections/changes.js": () => Promise.resolve().then(() => (init_changes(), changes_exports)),
87687 "../ui/sections/data_layers.js": () => Promise.resolve().then(() => (init_data_layers(), data_layers_exports)),
87688 "../ui/sections/entity_issues.js": () => Promise.resolve().then(() => (init_entity_issues(), entity_issues_exports)),
87689 "../ui/sections/feature_type.js": () => Promise.resolve().then(() => (init_feature_type(), feature_type_exports)),
87690 "../ui/sections/index.js": () => Promise.resolve().then(() => (init_sections(), sections_exports)),
87691 "../ui/sections/map_features.js": () => Promise.resolve().then(() => (init_map_features(), map_features_exports)),
87692 "../ui/sections/map_style_options.js": () => Promise.resolve().then(() => (init_map_style_options(), map_style_options_exports)),
87693 "../ui/sections/overlay_list.js": () => Promise.resolve().then(() => (init_overlay_list(), overlay_list_exports)),
87694 "../ui/sections/photo_overlays.js": () => Promise.resolve().then(() => (init_photo_overlays(), photo_overlays_exports)),
87695 "../ui/sections/preset_fields.js": () => Promise.resolve().then(() => (init_preset_fields(), preset_fields_exports)),
87696 "../ui/sections/privacy.js": () => Promise.resolve().then(() => (init_privacy(), privacy_exports)),
87697 "../ui/sections/raw_member_editor.js": () => Promise.resolve().then(() => (init_raw_member_editor(), raw_member_editor_exports)),
87698 "../ui/sections/raw_membership_editor.js": () => Promise.resolve().then(() => (init_raw_membership_editor(), raw_membership_editor_exports)),
87699 "../ui/sections/raw_tag_editor.js": () => Promise.resolve().then(() => (init_raw_tag_editor(), raw_tag_editor_exports)),
87700 "../ui/sections/selection_list.js": () => Promise.resolve().then(() => (init_selection_list(), selection_list_exports)),
87701 "../ui/sections/validation_issues.js": () => Promise.resolve().then(() => (init_validation_issues(), validation_issues_exports)),
87702 "../ui/sections/validation_options.js": () => Promise.resolve().then(() => (init_validation_options(), validation_options_exports)),
87703 "../ui/sections/validation_rules.js": () => Promise.resolve().then(() => (init_validation_rules(), validation_rules_exports)),
87704 "../ui/sections/validation_status.js": () => Promise.resolve().then(() => (init_validation_status(), validation_status_exports)),
87705 "../ui/settings/custom_background.js": () => Promise.resolve().then(() => (init_custom_background(), custom_background_exports)),
87706 "../ui/settings/custom_data.js": () => Promise.resolve().then(() => (init_custom_data(), custom_data_exports)),
87707 "../ui/settings/index.js": () => Promise.resolve().then(() => (init_settings(), settings_exports)),
87708 "../ui/settings/local_photos.js": () => Promise.resolve().then(() => (init_local_photos2(), local_photos_exports2)),
87709 "../ui/shortcuts.js": () => Promise.resolve().then(() => (init_shortcuts(), shortcuts_exports)),
87710 "../ui/sidebar.js": () => Promise.resolve().then(() => (init_sidebar(), sidebar_exports)),
87711 "../ui/source_switch.js": () => Promise.resolve().then(() => (init_source_switch(), source_switch_exports)),
87712 "../ui/spinner.js": () => Promise.resolve().then(() => (init_spinner(), spinner_exports)),
87713 "../ui/splash.js": () => Promise.resolve().then(() => (init_splash(), splash_exports)),
87714 "../ui/status.js": () => Promise.resolve().then(() => (init_status(), status_exports)),
87715 "../ui/success.js": () => Promise.resolve().then(() => (init_success(), success_exports)),
87716 "../ui/tag_reference.js": () => Promise.resolve().then(() => (init_tag_reference(), tag_reference_exports)),
87717 "../ui/toggle.js": () => Promise.resolve().then(() => (init_toggle(), toggle_exports)),
87718 "../ui/tools/index.js": () => Promise.resolve().then(() => (init_tools(), tools_exports)),
87719 "../ui/tools/modes.js": () => Promise.resolve().then(() => (init_modes(), modes_exports)),
87720 "../ui/tools/notes.js": () => Promise.resolve().then(() => (init_notes2(), notes_exports2)),
87721 "../ui/tools/save.js": () => Promise.resolve().then(() => (init_save(), save_exports)),
87722 "../ui/tools/sidebar_toggle.js": () => Promise.resolve().then(() => (init_sidebar_toggle(), sidebar_toggle_exports)),
87723 "../ui/tools/undo_redo.js": () => Promise.resolve().then(() => (init_undo_redo(), undo_redo_exports)),
87724 "../ui/tooltip.js": () => Promise.resolve().then(() => (init_tooltip(), tooltip_exports)),
87725 "../ui/top_toolbar.js": () => Promise.resolve().then(() => (init_top_toolbar(), top_toolbar_exports)),
87726 "../ui/version.js": () => Promise.resolve().then(() => (init_version(), version_exports)),
87727 "../ui/view_on_keepRight.js": () => Promise.resolve().then(() => (init_view_on_keepRight(), view_on_keepRight_exports)),
87728 "../ui/view_on_osm.js": () => Promise.resolve().then(() => (init_view_on_osm(), view_on_osm_exports)),
87729 "../ui/view_on_osmose.js": () => Promise.resolve().then(() => (init_view_on_osmose(), view_on_osmose_exports)),
87730 "../ui/zoom.js": () => Promise.resolve().then(() => (init_zoom3(), zoom_exports)),
87731 "../ui/zoom_to_selection.js": () => Promise.resolve().then(() => (init_zoom_to_selection(), zoom_to_selection_exports)),
87732 "../util/IntervalTasksQueue.js": () => Promise.resolve().then(() => (init_IntervalTasksQueue(), IntervalTasksQueue_exports)),
87733 "../util/aes.js": () => Promise.resolve().then(() => (init_aes(), aes_exports)),
87734 "../util/array.js": () => Promise.resolve().then(() => (init_array3(), array_exports)),
87735 "../util/bind_once.js": () => Promise.resolve().then(() => (init_bind_once(), bind_once_exports)),
87736 "../util/clean_tags.js": () => Promise.resolve().then(() => (init_clean_tags(), clean_tags_exports)),
87737 "../util/date.ts": () => Promise.resolve().then(() => (init_date2(), date_exports)),
87738 "../util/detect.js": () => Promise.resolve().then(() => (init_detect(), detect_exports)),
87739 "../util/dimensions.js": () => Promise.resolve().then(() => (init_dimensions(), dimensions_exports)),
87740 "../util/double_up.js": () => Promise.resolve().then(() => (init_double_up(), double_up_exports)),
87741 "../util/get_set_value.js": () => Promise.resolve().then(() => (init_get_set_value(), get_set_value_exports)),
87742 "../util/index.js": () => Promise.resolve().then(() => (init_util2(), util_exports2)),
87743 "../util/jxon.js": () => Promise.resolve().then(() => (init_jxon(), jxon_exports)),
87744 "../util/keybinding.js": () => Promise.resolve().then(() => (init_keybinding(), keybinding_exports)),
87745 "../util/object.js": () => Promise.resolve().then(() => (init_object2(), object_exports)),
87746 "../util/rebind.js": () => Promise.resolve().then(() => (init_rebind(), rebind_exports)),
87747 "../util/session_mutex.js": () => Promise.resolve().then(() => (init_session_mutex(), session_mutex_exports)),
87748 "../util/svg_paths_rtl_fix.js": () => Promise.resolve().then(() => (init_svg_paths_rtl_fix(), svg_paths_rtl_fix_exports)),
87749 "../util/tiler.js": () => Promise.resolve().then(() => (init_tiler(), tiler_exports)),
87750 "../util/trigger_event.js": () => Promise.resolve().then(() => (init_trigger_event(), trigger_event_exports)),
87751 "../util/units.js": () => Promise.resolve().then(() => (init_units(), units_exports)),
87752 "../util/util.js": () => Promise.resolve().then(() => (init_util(), util_exports)),
87753 "../util/utilDisplayLabel.js": () => Promise.resolve().then(() => (init_utilDisplayLabel(), utilDisplayLabel_exports)),
87754 "../util/zoom_pan.js": () => Promise.resolve().then(() => (init_zoom_pan(), zoom_pan_exports)),
87755 "../validations/almost_junction.js": () => Promise.resolve().then(() => (init_almost_junction(), almost_junction_exports)),
87756 "../validations/close_nodes.js": () => Promise.resolve().then(() => (init_close_nodes(), close_nodes_exports)),
87757 "../validations/crossing_ways.js": () => Promise.resolve().then(() => (init_crossing_ways(), crossing_ways_exports)),
87758 "../validations/disconnected_way.js": () => Promise.resolve().then(() => (init_disconnected_way(), disconnected_way_exports)),
87759 "../validations/help_request.js": () => Promise.resolve().then(() => (init_help_request(), help_request_exports)),
87760 "../validations/impossible_oneway.js": () => Promise.resolve().then(() => (init_impossible_oneway(), impossible_oneway_exports)),
87761 "../validations/incompatible_source.js": () => Promise.resolve().then(() => (init_incompatible_source(), incompatible_source_exports)),
87762 "../validations/index.js": () => Promise.resolve().then(() => (init_validations(), validations_exports)),
87763 "../validations/invalid_format.js": () => Promise.resolve().then(() => (init_invalid_format(), invalid_format_exports)),
87764 "../validations/maprules.js": () => Promise.resolve().then(() => (init_maprules2(), maprules_exports2)),
87765 "../validations/mismatched_geometry.js": () => Promise.resolve().then(() => (init_mismatched_geometry(), mismatched_geometry_exports)),
87766 "../validations/missing_role.js": () => Promise.resolve().then(() => (init_missing_role(), missing_role_exports)),
87767 "../validations/missing_tag.js": () => Promise.resolve().then(() => (init_missing_tag(), missing_tag_exports)),
87768 "../validations/mutually_exclusive_tags.js": () => Promise.resolve().then(() => (init_mutually_exclusive_tags(), mutually_exclusive_tags_exports)),
87769 "../validations/osm_api_limits.js": () => Promise.resolve().then(() => (init_osm_api_limits(), osm_api_limits_exports)),
87770 "../validations/outdated_tags.js": () => Promise.resolve().then(() => (init_outdated_tags(), outdated_tags_exports)),
87771 "../validations/private_data.js": () => Promise.resolve().then(() => (init_private_data(), private_data_exports)),
87772 "../validations/suspicious_name.js": () => Promise.resolve().then(() => (init_suspicious_name(), suspicious_name_exports)),
87773 "../validations/unsquare_way.js": () => Promise.resolve().then(() => (init_unsquare_way(), unsquare_way_exports))
87778 // modules/core/file_fetcher.js
87779 var file_fetcher_exports = {};
87780 __export(file_fetcher_exports, {
87781 coreFileFetcher: () => coreFileFetcher,
87782 fileFetcher: () => _mainFileFetcher
87784 function coreFileFetcher() {
87785 const ociVersion = package_default.devDependencies["osm-community-index"];
87786 const presetsVersion = package_default.devDependencies["@openstreetmap/id-tagging-schema"];
87788 let _inflight4 = {};
87790 "address_formats": "data/address_formats.min.json",
87791 "imagery": "data/imagery.min.json",
87792 "intro_graph": "data/intro_graph.min.json",
87793 "keepRight": "data/keepRight.min.json",
87794 "languages": "data/languages.min.json",
87795 "locales": "locales/index.min.json",
87796 "phone_formats": "data/phone_formats.min.json",
87797 "qa_data": "data/qa_data.min.json",
87798 "shortcuts": "data/shortcuts.min.json",
87799 "territory_languages": "data/territory_languages.min.json",
87800 "oci_defaults": ociCdnUrl.replace("{version}", ociVersion) + "dist/defaults.min.json",
87801 "oci_features": ociCdnUrl.replace("{version}", ociVersion) + "dist/featureCollection.min.json",
87802 "oci_resources": ociCdnUrl.replace("{version}", ociVersion) + "dist/resources.min.json",
87803 "presets_package": presetsCdnUrl.replace("{presets_version}", presetsVersion) + "package.json",
87804 "deprecated": presetsCdnUrl + "dist/deprecated.min.json",
87805 "discarded": presetsCdnUrl + "dist/discarded.min.json",
87806 "preset_categories": presetsCdnUrl + "dist/preset_categories.min.json",
87807 "preset_defaults": presetsCdnUrl + "dist/preset_defaults.min.json",
87808 "preset_fields": presetsCdnUrl + "dist/fields.min.json",
87809 "preset_presets": presetsCdnUrl + "dist/presets.min.json",
87810 "wmf_sitematrix": wmfSitematrixCdnUrl.replace("{version}", "0.2") + "data/wikipedia.min.json"
87812 let _cachedData = {};
87813 _this.cache = () => _cachedData;
87814 _this.get = (which) => {
87815 if (_cachedData[which]) {
87816 return Promise.resolve(_cachedData[which]);
87818 const file = _fileMap[which];
87819 const url = file && _this.asset(file);
87821 return Promise.reject(`Unknown data file for "${which}"`);
87823 if (url.includes("{presets_version}")) {
87824 return _this.get("presets_package").then((result) => {
87825 const presetsVersion2 = result.version;
87826 return getUrl(url.replace("{presets_version}", presetsVersion2), which);
87829 return getUrl(url, which);
87832 function getUrl(url, which) {
87833 let prom = _inflight4[url];
87835 _inflight4[url] = prom = (window.VITEST ? globImport(`../${url}`) : fetch(url)).then((response) => {
87836 if (window.VITEST) return response.default;
87837 if (!response.ok || !response.json) {
87838 throw new Error(response.status + " " + response.statusText);
87840 if (response.status === 204 || response.status === 205) return;
87841 return response.json();
87842 }).then((result) => {
87843 delete _inflight4[url];
87845 throw new Error(`No data loaded for "${which}"`);
87847 _cachedData[which] = result;
87849 }).catch((err) => {
87850 delete _inflight4[url];
87856 _this.fileMap = function(val) {
87857 if (!arguments.length) return _fileMap;
87861 let _assetPath = "";
87862 _this.assetPath = function(val) {
87863 if (!arguments.length) return _assetPath;
87867 let _assetMap = {};
87868 _this.assetMap = function(val) {
87869 if (!arguments.length) return _assetMap;
87873 _this.asset = (val) => {
87874 if (/^http(s)?:\/\//i.test(val)) return val;
87875 const filename = _assetPath + val;
87876 return _assetMap[filename] || filename;
87880 var _mainFileFetcher;
87881 var init_file_fetcher = __esm({
87882 "modules/core/file_fetcher.js"() {
87887 _mainFileFetcher = coreFileFetcher();
87891 // modules/presets/index.js
87892 var presets_exports = {};
87893 __export(presets_exports, {
87894 presetCategory: () => presetCategory,
87895 presetCollection: () => presetCollection,
87896 presetField: () => presetField,
87897 presetIndex: () => presetIndex,
87898 presetManager: () => _mainPresetIndex,
87899 presetPreset: () => presetPreset
87901 function presetIndex() {
87902 const dispatch14 = dispatch_default("favoritePreset", "recentsChange");
87903 const MAXRECENTS = 30;
87904 const POINT = presetPreset("point", { name: "Point", tags: {}, geometry: ["point", "vertex"], matchScore: 0.1 });
87905 const LINE = presetPreset("line", { name: "Line", tags: {}, geometry: ["line"], matchScore: 0.1 });
87906 const AREA = presetPreset("area", { name: "Area", tags: { area: "yes" }, geometry: ["area"], matchScore: 0.1 });
87907 const RELATION = presetPreset("relation", { name: "Relation", tags: {}, geometry: ["relation"], matchScore: 0.1 });
87908 let _this = presetCollection([POINT, LINE, AREA, RELATION]);
87909 let _presets = { point: POINT, line: LINE, area: AREA, relation: RELATION };
87911 point: presetCollection([POINT]),
87912 vertex: presetCollection([POINT]),
87913 line: presetCollection([LINE]),
87914 area: presetCollection([AREA]),
87915 relation: presetCollection([RELATION])
87918 let _categories = {};
87919 let _universal = [];
87920 let _addablePresetIDs = null;
87923 let _geometryIndex = { point: {}, vertex: {}, line: {}, area: {}, relation: {} };
87925 _this.ensureLoaded = (bypassCache) => {
87926 if (_loadPromise && !bypassCache) return _loadPromise;
87927 return _loadPromise = Promise.all([
87928 _mainFileFetcher.get("preset_categories"),
87929 _mainFileFetcher.get("preset_defaults"),
87930 _mainFileFetcher.get("preset_presets"),
87931 _mainFileFetcher.get("preset_fields")
87932 ]).then((vals) => {
87934 categories: vals[0],
87939 osmSetAreaKeys(_this.areaKeys());
87940 osmSetLineTags(_this.lineTags());
87941 osmSetPointTags(_this.pointTags());
87942 osmSetVertexTags(_this.vertexTags());
87945 _this.merge = (d4) => {
87946 let newLocationSets = [];
87948 Object.keys(d4.fields).forEach((fieldID) => {
87949 let f2 = d4.fields[fieldID];
87951 f2 = presetField(fieldID, f2, _fields);
87952 if (f2.locationSet) newLocationSets.push(f2);
87953 _fields[fieldID] = f2;
87955 delete _fields[fieldID];
87960 Object.keys(d4.presets).forEach((presetID) => {
87961 let p2 = d4.presets[presetID];
87963 const isAddable = !_addablePresetIDs || _addablePresetIDs.has(presetID);
87964 p2 = presetPreset(presetID, p2, isAddable, _fields, _presets);
87965 if (p2.locationSet) newLocationSets.push(p2);
87966 _presets[presetID] = p2;
87968 const existing = _presets[presetID];
87969 if (existing && !existing.isFallback()) {
87970 delete _presets[presetID];
87975 if (d4.categories) {
87976 Object.keys(d4.categories).forEach((categoryID) => {
87977 let c2 = d4.categories[categoryID];
87979 c2 = presetCategory(categoryID, c2, _presets);
87980 if (c2.locationSet) newLocationSets.push(c2);
87981 _categories[categoryID] = c2;
87983 delete _categories[categoryID];
87987 _this.collection = Object.values(_presets).concat(Object.values(_categories));
87989 Object.keys(d4.defaults).forEach((geometry) => {
87990 const def = d4.defaults[geometry];
87991 if (Array.isArray(def)) {
87992 _defaults[geometry] = presetCollection(
87993 def.map((id2) => _presets[id2] || _categories[id2]).filter(Boolean)
87996 delete _defaults[geometry];
88000 _universal = Object.values(_fields).filter((field) => field.universal);
88001 _geometryIndex = { point: {}, vertex: {}, line: {}, area: {}, relation: {} };
88002 _this.collection.forEach((preset) => {
88003 (preset.geometry || []).forEach((geometry) => {
88004 let g3 = _geometryIndex[geometry];
88005 for (let key in preset.tags) {
88006 g3[key] = g3[key] || {};
88007 let value = preset.tags[key];
88008 (g3[key][value] = g3[key][value] || []).push(preset);
88012 if (d4.featureCollection && Array.isArray(d4.featureCollection.features)) {
88013 _sharedLocationManager.mergeCustomGeoJSON(d4.featureCollection);
88015 if (newLocationSets.length) {
88016 _sharedLocationManager.mergeLocationSets(newLocationSets);
88020 _this.match = (entity, resolver) => {
88021 return resolver.transient(entity, "presetMatch", () => {
88022 let geometry = entity.geometry(resolver);
88023 if (geometry === "vertex" && entity.isOnAddressLine(resolver)) {
88024 geometry = "point";
88026 const entityExtent = entity.extent(resolver);
88027 return _this.matchTags(entity.tags, geometry, entityExtent.center());
88030 _this.matchTags = (tags, geometry, loc) => {
88031 const keyIndex = _geometryIndex[geometry];
88032 let bestScore = -1;
88034 let matchCandidates = [];
88035 for (let k2 in tags) {
88036 let indexMatches = [];
88037 let valueIndex = keyIndex[k2];
88038 if (!valueIndex) continue;
88039 let keyValueMatches = valueIndex[tags[k2]];
88040 if (keyValueMatches) indexMatches.push(...keyValueMatches);
88041 let keyStarMatches = valueIndex["*"];
88042 if (keyStarMatches) indexMatches.push(...keyStarMatches);
88043 if (indexMatches.length === 0) continue;
88044 for (let i3 = 0; i3 < indexMatches.length; i3++) {
88045 const candidate = indexMatches[i3];
88046 const score = candidate.matchScore(tags);
88047 if (score === -1) {
88050 matchCandidates.push({ score, candidate });
88051 if (score > bestScore) {
88053 bestMatch = candidate;
88057 if (bestMatch && bestMatch.locationSetID && bestMatch.locationSetID !== "+[Q2]" && Array.isArray(loc)) {
88058 const validHere = _sharedLocationManager.locationSetsAt(loc);
88059 if (!validHere[bestMatch.locationSetID]) {
88060 matchCandidates.sort((a2, b3) => a2.score < b3.score ? 1 : -1);
88061 for (let i3 = 0; i3 < matchCandidates.length; i3++) {
88062 const candidateScore = matchCandidates[i3];
88063 if (!candidateScore.candidate.locationSetID || validHere[candidateScore.candidate.locationSetID]) {
88064 bestMatch = candidateScore.candidate;
88065 bestScore = candidateScore.score;
88071 if (!bestMatch || bestMatch.isFallback()) {
88072 for (let k2 in tags) {
88073 if (/^addr:/.test(k2) && keyIndex["addr:*"] && keyIndex["addr:*"]["*"]) {
88074 bestMatch = keyIndex["addr:*"]["*"][0];
88079 return bestMatch || _this.fallback(geometry);
88081 _this.allowsVertex = (entity, resolver) => {
88082 if (entity.type !== "node") return false;
88083 if (Object.keys(entity.tags).length === 0) return true;
88084 return resolver.transient(entity, "vertexMatch", () => {
88085 if (entity.isOnAddressLine(resolver)) return true;
88086 const geometries = osmNodeGeometriesForTags(entity.tags);
88087 if (geometries.vertex) return true;
88088 if (geometries.point) return false;
88092 _this.areaKeys = () => {
88102 const presets = _this.collection.filter((p2) => !p2.suggestion && !p2.replacement);
88103 presets.forEach((p2) => {
88104 const keys2 = p2.tags && Object.keys(p2.tags);
88105 const key = keys2 && keys2.length && keys2[0];
88107 if (ignore[key]) return;
88108 if (p2.geometry.indexOf("area") !== -1) {
88109 areaKeys[key] = areaKeys[key] || {};
88112 presets.forEach((p2) => {
88114 for (key in p2.addTags) {
88115 const value = p2.addTags[key];
88116 if (key in areaKeys && // probably an area...
88117 p2.geometry.indexOf("line") !== -1 && // but sometimes a line
88119 areaKeys[key][value] = true;
88125 _this.lineTags = () => {
88126 return _this.collection.filter((lineTags, d4) => {
88127 if (d4.suggestion || d4.replacement || d4.searchable === false) return lineTags;
88128 const keys2 = d4.tags && Object.keys(d4.tags);
88129 const key = keys2 && keys2.length && keys2[0];
88130 if (!key) return lineTags;
88131 if (d4.geometry.indexOf("line") !== -1) {
88132 lineTags[key] = lineTags[key] || [];
88133 lineTags[key].push(d4.tags);
88138 _this.pointTags = () => {
88139 return _this.collection.reduce((pointTags, d4) => {
88140 if (d4.suggestion || d4.replacement || d4.searchable === false) return pointTags;
88141 const keys2 = d4.tags && Object.keys(d4.tags);
88142 const key = keys2 && keys2.length && keys2[0];
88143 if (!key) return pointTags;
88144 if (d4.geometry.indexOf("point") !== -1) {
88145 pointTags[key] = pointTags[key] || {};
88146 pointTags[key][d4.tags[key]] = true;
88151 _this.vertexTags = () => {
88152 return _this.collection.reduce((vertexTags, d4) => {
88153 if (d4.suggestion || d4.replacement || d4.searchable === false) return vertexTags;
88154 const keys2 = d4.tags && Object.keys(d4.tags);
88155 const key = keys2 && keys2.length && keys2[0];
88156 if (!key) return vertexTags;
88157 if (d4.geometry.indexOf("vertex") !== -1) {
88158 vertexTags[key] = vertexTags[key] || {};
88159 vertexTags[key][d4.tags[key]] = true;
88164 _this.field = (id2) => _fields[id2];
88165 _this.universal = () => _universal;
88166 _this.defaults = (geometry, n3, startWithRecents, loc, extraPresets) => {
88168 if (startWithRecents) {
88169 recents = _this.recent().matchGeometry(geometry).collection.slice(0, 4);
88172 if (_addablePresetIDs) {
88173 defaults = Array.from(_addablePresetIDs).map(function(id2) {
88174 var preset = _this.item(id2);
88175 if (preset && preset.matchGeometry(geometry)) return preset;
88177 }).filter(Boolean);
88179 defaults = _defaults[geometry].collection.concat(_this.fallback(geometry));
88181 let result = presetCollection(
88182 utilArrayUniq(recents.concat(defaults).concat(extraPresets || [])).slice(0, n3 - 1)
88184 if (Array.isArray(loc)) {
88185 const validHere = _sharedLocationManager.locationSetsAt(loc);
88186 result.collection = result.collection.filter((a2) => !a2.locationSetID || validHere[a2.locationSetID]);
88190 _this.addablePresetIDs = function(val) {
88191 if (!arguments.length) return _addablePresetIDs;
88192 if (Array.isArray(val)) val = new Set(val);
88193 _addablePresetIDs = val;
88194 if (_addablePresetIDs) {
88195 _this.collection.forEach((p2) => {
88196 if (p2.addable) p2.addable(_addablePresetIDs.has(p2.id));
88199 _this.collection.forEach((p2) => {
88200 if (p2.addable) p2.addable(true);
88205 _this.recent = () => {
88206 return presetCollection(
88207 utilArrayUniq(_this.getRecents().map((d4) => d4.preset).filter((d4) => d4.searchable !== false))
88210 function RibbonItem(preset, source) {
88212 item.preset = preset;
88213 item.source = source;
88214 item.isFavorite = () => item.source === "favorite";
88215 item.isRecent = () => item.source === "recent";
88216 item.matches = (preset2) => item.preset.id === preset2.id;
88217 item.minified = () => ({ pID: item.preset.id });
88220 function ribbonItemForMinified(d4, source) {
88221 if (d4 && d4.pID) {
88222 const preset = _this.item(d4.pID);
88223 if (!preset) return null;
88224 return RibbonItem(preset, source);
88228 _this.getGenericRibbonItems = () => {
88229 return ["point", "line", "area"].map((id2) => RibbonItem(_this.item(id2), "generic"));
88231 _this.getAddable = () => {
88232 if (!_addablePresetIDs) return [];
88233 return _addablePresetIDs.map((id2) => {
88234 const preset = _this.item(id2);
88235 if (preset) return RibbonItem(preset, "addable");
88237 }).filter(Boolean);
88239 function setRecents(items) {
88241 const minifiedItems = items.map((d4) => d4.minified());
88242 corePreferences("preset_recents", JSON.stringify(minifiedItems));
88243 dispatch14.call("recentsChange");
88245 _this.getRecents = () => {
88247 _recents = (JSON.parse(corePreferences("preset_recents")) || []).reduce((acc, d4) => {
88248 let item = ribbonItemForMinified(d4, "recent");
88249 if (item && item.preset.addable()) acc.push(item);
88255 _this.addRecent = (preset, besidePreset, after) => {
88256 const recents = _this.getRecents();
88257 const beforeItem = _this.recentMatching(besidePreset);
88258 let toIndex = recents.indexOf(beforeItem);
88259 if (after) toIndex += 1;
88260 const newItem = RibbonItem(preset, "recent");
88261 recents.splice(toIndex, 0, newItem);
88262 setRecents(recents);
88264 _this.removeRecent = (preset) => {
88265 const item = _this.recentMatching(preset);
88267 let items = _this.getRecents();
88268 items.splice(items.indexOf(item), 1);
88272 _this.recentMatching = (preset) => {
88273 const items = _this.getRecents();
88274 for (let i3 in items) {
88275 if (items[i3].matches(preset)) {
88281 _this.moveItem = (items, fromIndex, toIndex) => {
88282 if (fromIndex === toIndex || fromIndex < 0 || toIndex < 0 || fromIndex >= items.length || toIndex >= items.length) return null;
88283 items.splice(toIndex, 0, items.splice(fromIndex, 1)[0]);
88286 _this.moveRecent = (item, beforeItem) => {
88287 const recents = _this.getRecents();
88288 const fromIndex = recents.indexOf(item);
88289 const toIndex = recents.indexOf(beforeItem);
88290 const items = _this.moveItem(recents, fromIndex, toIndex);
88291 if (items) setRecents(items);
88293 _this.setMostRecent = (preset) => {
88294 if (preset.searchable === false) return;
88295 let items = _this.getRecents();
88296 let item = _this.recentMatching(preset);
88298 items.splice(items.indexOf(item), 1);
88300 item = RibbonItem(preset, "recent");
88302 while (items.length >= MAXRECENTS) {
88305 items.unshift(item);
88308 function setFavorites(items) {
88309 _favorites = items;
88310 const minifiedItems = items.map((d4) => d4.minified());
88311 corePreferences("preset_favorites", JSON.stringify(minifiedItems));
88312 dispatch14.call("favoritePreset");
88314 _this.addFavorite = (preset, besidePreset, after) => {
88315 const favorites = _this.getFavorites();
88316 const beforeItem = _this.favoriteMatching(besidePreset);
88317 let toIndex = favorites.indexOf(beforeItem);
88318 if (after) toIndex += 1;
88319 const newItem = RibbonItem(preset, "favorite");
88320 favorites.splice(toIndex, 0, newItem);
88321 setFavorites(favorites);
88323 _this.toggleFavorite = (preset) => {
88324 const favs = _this.getFavorites();
88325 const favorite = _this.favoriteMatching(preset);
88327 favs.splice(favs.indexOf(favorite), 1);
88329 if (favs.length === 10) {
88332 favs.push(RibbonItem(preset, "favorite"));
88334 setFavorites(favs);
88336 _this.removeFavorite = (preset) => {
88337 const item = _this.favoriteMatching(preset);
88339 const items = _this.getFavorites();
88340 items.splice(items.indexOf(item), 1);
88341 setFavorites(items);
88344 _this.getFavorites = () => {
88346 let rawFavorites = JSON.parse(corePreferences("preset_favorites"));
88347 if (!rawFavorites) {
88349 corePreferences("preset_favorites", JSON.stringify(rawFavorites));
88351 _favorites = rawFavorites.reduce((output, d4) => {
88352 const item = ribbonItemForMinified(d4, "favorite");
88353 if (item && item.preset.addable()) output.push(item);
88359 _this.favoriteMatching = (preset) => {
88360 const favs = _this.getFavorites();
88361 for (let index in favs) {
88362 if (favs[index].matches(preset)) {
88363 return favs[index];
88368 return utilRebind(_this, dispatch14, "on");
88370 var _mainPresetIndex;
88371 var init_presets = __esm({
88372 "modules/presets/index.js"() {
88375 init_preferences();
88376 init_file_fetcher();
88377 init_LocationManager();
88384 _mainPresetIndex = presetIndex();
88388 // modules/actions/reverse.js
88389 var reverse_exports2 = {};
88390 __export(reverse_exports2, {
88391 actionReverse: () => actionReverse
88393 function actionReverse(entityID, options) {
88394 var numeric = /^([+\-]?)(?=[\d.])/;
88395 var directionKey = /direction$/;
88396 var keyReplacements = [
88397 [/:right$/, ":left"],
88398 [/:left$/, ":right"],
88399 [/:forward$/, ":backward"],
88400 [/:backward$/, ":forward"],
88401 [/:right:/, ":left:"],
88402 [/:left:/, ":right:"],
88403 [/:forward:/, ":backward:"],
88404 [/:backward:/, ":forward:"]
88406 var valueReplacements = {
88411 forward: "backward",
88412 backward: "forward",
88413 forwards: "backward",
88414 backwards: "forward"
88416 const keysToKeepUnchanged = [
88417 // https://github.com/openstreetmap/iD/issues/10736
88418 /^red_turn:(right|left):?/
88420 const keyValuesToKeepUnchanged = [
88422 keyRegex: /^.*(_|:)?(description|name|note|website|ref|source|comment|watch|attribution)(_|:)?/,
88423 prerequisiteTags: [{}]
88426 // Turn lanes are left/right to key (not way) direction - #5674
88427 keyRegex: /^turn:lanes:?/,
88428 prerequisiteTags: [{}]
88431 // https://github.com/openstreetmap/iD/issues/10128
88432 keyRegex: /^side$/,
88433 prerequisiteTags: [{ highway: "cyclist_waiting_aid" }]
88436 var roleReplacements = {
88437 forward: "backward",
88438 backward: "forward",
88439 forwards: "backward",
88440 backwards: "forward"
88442 var onewayReplacements = {
88447 var compassReplacements = {
88465 function reverseKey(key) {
88466 if (keysToKeepUnchanged.some((keyRegex) => keyRegex.test(key))) {
88469 for (var i3 = 0; i3 < keyReplacements.length; ++i3) {
88470 var replacement = keyReplacements[i3];
88471 if (replacement[0].test(key)) {
88472 return key.replace(replacement[0], replacement[1]);
88477 function reverseValue(key, value, includeAbsolute, allTags) {
88478 for (let { keyRegex, prerequisiteTags } of keyValuesToKeepUnchanged) {
88479 if (keyRegex.test(key) && prerequisiteTags.some(
88480 (expectedTags) => Object.entries(expectedTags).every(([k2, v3]) => {
88481 return allTags[k2] && (v3 === "*" || allTags[k2] === v3);
88487 if (key === "incline" && numeric.test(value)) {
88488 return value.replace(numeric, function(_3, sign2) {
88489 return sign2 === "-" ? "" : "-";
88491 } else if (options && options.reverseOneway && key === "oneway") {
88492 return onewayReplacements[value] || value;
88493 } else if (includeAbsolute && directionKey.test(key)) {
88494 return value.split(";").map((value2) => {
88495 if (compassReplacements[value2]) return compassReplacements[value2];
88496 var degrees3 = Number(value2);
88497 if (isFinite(degrees3)) {
88498 if (degrees3 < 180) {
88503 return degrees3.toString();
88505 return valueReplacements[value2] || value2;
88509 return valueReplacements[value] || value;
88511 function supportsDirectionField(node, graph) {
88512 const preset = _mainPresetIndex.match(node, graph);
88513 const loc = node.extent(graph).center();
88514 const geometry = node.geometry(graph);
88515 const fields = [...preset.fields(loc), ...preset.moreFields(loc)];
88516 const maybeDirectionField = fields.find((field) => {
88517 const isDirectionField = field.key && (field.key === "direction" || field.key.endsWith(":direction"));
88518 const isRelativeDirection = field.type === "combo";
88519 const isGeometryValid = !field.geometry || field.geometry.includes(geometry);
88520 return isDirectionField && isRelativeDirection && isGeometryValid;
88522 return (maybeDirectionField == null ? void 0 : maybeDirectionField.key) || false;
88524 function reverseNodeTags(graph, nodeIDs) {
88525 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
88526 var node = graph.hasEntity(nodeIDs[i3]);
88527 if (!node || !Object.keys(node.tags).length) continue;
88528 let anyChanges = false;
88530 for (var key in node.tags) {
88531 const value = node.tags[key];
88532 const newKey = reverseKey(key);
88533 const newValue = reverseValue(key, value, node.id === entityID, node.tags);
88534 tags[newKey] = newValue;
88535 if (key !== newKey || value !== newValue) {
88539 const directionKey2 = supportsDirectionField(node, graph);
88540 if (node.id === entityID && !anyChanges && directionKey2) {
88541 tags[directionKey2] = "forward";
88543 graph = graph.replace(node.update({ tags }));
88547 function reverseWay(graph, way) {
88548 var nodes = way.nodes.slice().reverse();
88551 for (var key in way.tags) {
88552 tags[reverseKey(key)] = reverseValue(key, way.tags[key], false, way.tags);
88554 graph.parentRelations(way).forEach(function(relation) {
88555 relation.members.forEach(function(member, index) {
88556 if (member.id === way.id && (role = roleReplacements[member.role])) {
88557 relation = relation.updateMember({ role }, index);
88558 graph = graph.replace(relation);
88562 return reverseNodeTags(graph, nodes).replace(way.update({ nodes, tags }));
88564 var action = function(graph) {
88565 var entity = graph.entity(entityID);
88566 if (entity.type === "way") {
88567 return reverseWay(graph, entity);
88569 return reverseNodeTags(graph, [entityID]);
88571 action.disabled = function(graph) {
88572 var entity = graph.hasEntity(entityID);
88573 if (!entity || entity.type === "way") return false;
88574 for (var key in entity.tags) {
88575 var value = entity.tags[key];
88576 if (reverseKey(key) !== key || reverseValue(key, value, true, entity.tags) !== value) {
88580 if (supportsDirectionField(entity, graph)) return false;
88581 return "nondirectional_node";
88583 action.entityID = function() {
88588 var init_reverse2 = __esm({
88589 "modules/actions/reverse.js"() {
88595 // modules/osm/multipolygon.js
88596 var multipolygon_exports = {};
88597 __export(multipolygon_exports, {
88598 osmJoinWays: () => osmJoinWays
88600 function osmJoinWays(toJoin, graph) {
88601 function resolve(member) {
88602 return graph.childNodes(graph.entity(member.id));
88604 function reverse(item2) {
88605 var action = actionReverse(item2.id, { reverseOneway: true });
88606 sequences.actions.push(action);
88607 return item2 instanceof osmWay ? action(graph).entity(item2.id) : item2;
88609 toJoin = toJoin.filter(function(member) {
88610 return member.type === "way" && graph.hasEntity(member.id);
88613 var joinAsMembers = true;
88614 for (i3 = 0; i3 < toJoin.length; i3++) {
88615 if (toJoin[i3] instanceof osmWay) {
88616 joinAsMembers = false;
88620 var sequences = [];
88621 sequences.actions = [];
88622 while (toJoin.length) {
88623 var item = toJoin.shift();
88624 var currWays = [item];
88625 var currNodes = resolve(item).slice();
88626 while (toJoin.length) {
88627 var start2 = currNodes[0];
88628 var end = currNodes[currNodes.length - 1];
88631 for (i3 = 0; i3 < toJoin.length; i3++) {
88633 nodes = resolve(item);
88634 if (joinAsMembers && currWays.length === 1 && nodes[0] !== end && nodes[nodes.length - 1] !== end && (nodes[nodes.length - 1] === start2 || nodes[0] === start2)) {
88635 currWays[0] = reverse(currWays[0]);
88636 currNodes.reverse();
88637 start2 = currNodes[0];
88638 end = currNodes[currNodes.length - 1];
88640 if (nodes[0] === end) {
88641 fn = currNodes.push;
88642 nodes = nodes.slice(1);
88644 } else if (nodes[nodes.length - 1] === end) {
88645 fn = currNodes.push;
88646 nodes = nodes.slice(0, -1).reverse();
88647 item = reverse(item);
88649 } else if (nodes[nodes.length - 1] === start2) {
88650 fn = currNodes.unshift;
88651 nodes = nodes.slice(0, -1);
88653 } else if (nodes[0] === start2) {
88654 fn = currNodes.unshift;
88655 nodes = nodes.slice(1).reverse();
88656 item = reverse(item);
88665 fn.apply(currWays, [item]);
88666 fn.apply(currNodes, nodes);
88667 toJoin.splice(i3, 1);
88669 currWays.nodes = currNodes;
88670 sequences.push(currWays);
88674 var init_multipolygon = __esm({
88675 "modules/osm/multipolygon.js"() {
88682 // modules/actions/add_member.js
88683 var add_member_exports = {};
88684 __export(add_member_exports, {
88685 actionAddMember: () => actionAddMember
88687 function actionAddMember(relationId, member, memberIndex) {
88688 return function action(graph) {
88689 var relation = graph.entity(relationId);
88690 var isPTv2 = /stop|platform/.test(member.role);
88691 if (member.type === "way" && !isPTv2) {
88692 graph = addWayMember(relation, graph);
88694 if (isPTv2 && isNaN(memberIndex)) {
88697 graph = graph.replace(relation.addMember(member, memberIndex));
88701 function addWayMember(relation, graph) {
88702 var groups, item, i3, j3, k2;
88703 var PTv2members = [];
88705 for (i3 = 0; i3 < relation.members.length; i3++) {
88706 var m3 = relation.members[i3];
88707 if (/stop|platform/.test(m3.role)) {
88708 PTv2members.push(m3);
88713 relation = relation.update({ members });
88714 groups = utilArrayGroupBy(relation.members, "type");
88715 groups.way = groups.way || [];
88716 groups.way.push(member);
88717 members = withIndex(groups.way);
88718 var joined = osmJoinWays(members, graph);
88719 for (i3 = 0; i3 < joined.length; i3++) {
88720 var segment = joined[i3];
88721 var nodes = segment.nodes.slice();
88722 var startIndex = segment[0].index;
88723 for (j3 = 0; j3 < members.length; j3++) {
88724 if (members[j3].index === startIndex) {
88728 for (k2 = 0; k2 < segment.length; k2++) {
88729 item = segment[k2];
88730 var way = graph.entity(item.id);
88732 if (j3 + k2 >= members.length || item.index !== members[j3 + k2].index) {
88733 moveMember(members, item.index, j3 + k2);
88736 nodes.splice(0, way.nodes.length - 1);
88739 var wayMembers = [];
88740 for (i3 = 0; i3 < members.length; i3++) {
88741 item = members[i3];
88742 if (item.index === -1) continue;
88743 wayMembers.push(utilObjectOmit(item, ["index"]));
88745 var newMembers = PTv2members.concat(groups.node || [], wayMembers, groups.relation || []);
88746 return graph.replace(relation.update({ members: newMembers }));
88747 function moveMember(arr, findIndex, toIndex) {
88749 for (i4 = 0; i4 < arr.length; i4++) {
88750 if (arr[i4].index === findIndex) {
88754 var item2 = Object.assign({}, arr[i4]);
88755 arr[i4].index = -1;
88756 delete item2.index;
88757 arr.splice(toIndex, 0, item2);
88759 function withIndex(arr) {
88760 var result = new Array(arr.length);
88761 for (var i4 = 0; i4 < arr.length; i4++) {
88762 result[i4] = Object.assign({}, arr[i4]);
88763 result[i4].index = i4;
88769 var init_add_member = __esm({
88770 "modules/actions/add_member.js"() {
88772 init_multipolygon();
88777 // modules/actions/index.js
88778 var actions_exports = {};
88779 __export(actions_exports, {
88780 actionAddEntity: () => actionAddEntity,
88781 actionAddMember: () => actionAddMember,
88782 actionAddMidpoint: () => actionAddMidpoint,
88783 actionAddVertex: () => actionAddVertex,
88784 actionChangeMember: () => actionChangeMember,
88785 actionChangePreset: () => actionChangePreset,
88786 actionChangeTags: () => actionChangeTags,
88787 actionCircularize: () => actionCircularize,
88788 actionConnect: () => actionConnect,
88789 actionCopyEntities: () => actionCopyEntities,
88790 actionDeleteMember: () => actionDeleteMember,
88791 actionDeleteMultiple: () => actionDeleteMultiple,
88792 actionDeleteNode: () => actionDeleteNode,
88793 actionDeleteRelation: () => actionDeleteRelation,
88794 actionDeleteWay: () => actionDeleteWay,
88795 actionDiscardTags: () => actionDiscardTags,
88796 actionDisconnect: () => actionDisconnect,
88797 actionExtract: () => actionExtract,
88798 actionJoin: () => actionJoin,
88799 actionMerge: () => actionMerge,
88800 actionMergeNodes: () => actionMergeNodes,
88801 actionMergePolygon: () => actionMergePolygon,
88802 actionMergeRemoteChanges: () => actionMergeRemoteChanges,
88803 actionMove: () => actionMove,
88804 actionMoveMember: () => actionMoveMember,
88805 actionMoveNode: () => actionMoveNode,
88806 actionNoop: () => actionNoop,
88807 actionOrthogonalize: () => actionOrthogonalize,
88808 actionReflect: () => actionReflect,
88809 actionRestrictTurn: () => actionRestrictTurn,
88810 actionReverse: () => actionReverse,
88811 actionRevert: () => actionRevert,
88812 actionRotate: () => actionRotate,
88813 actionScale: () => actionScale,
88814 actionSplit: () => actionSplit,
88815 actionStraightenNodes: () => actionStraightenNodes,
88816 actionStraightenWay: () => actionStraightenWay,
88817 actionUnrestrictTurn: () => actionUnrestrictTurn,
88818 actionUpgradeTags: () => actionUpgradeTags
88820 var init_actions = __esm({
88821 "modules/actions/index.js"() {
88825 init_add_midpoint();
88827 init_change_member();
88828 init_change_preset();
88829 init_change_tags();
88830 init_circularize();
88832 init_copy_entities();
88833 init_delete_member();
88834 init_delete_multiple();
88835 init_delete_node();
88836 init_delete_relation();
88838 init_discard_tags();
88843 init_merge_nodes();
88844 init_merge_polygon();
88845 init_merge_remote_changes();
88847 init_move_member();
88850 init_orthogonalize();
88851 init_restrict_turn();
88857 init_straighten_nodes();
88858 init_straighten_way();
88859 init_unrestrict_turn();
88861 init_upgrade_tags();
88865 // modules/index.js
88866 var index_exports = {};
88867 __export(index_exports, {
88868 LANGUAGE_SUFFIX_REGEX: () => LANGUAGE_SUFFIX_REGEX,
88869 LocationManager: () => LocationManager,
88870 QAItem: () => QAItem,
88871 actionAddEntity: () => actionAddEntity,
88872 actionAddMember: () => actionAddMember,
88873 actionAddMidpoint: () => actionAddMidpoint,
88874 actionAddVertex: () => actionAddVertex,
88875 actionChangeMember: () => actionChangeMember,
88876 actionChangePreset: () => actionChangePreset,
88877 actionChangeTags: () => actionChangeTags,
88878 actionCircularize: () => actionCircularize,
88879 actionConnect: () => actionConnect,
88880 actionCopyEntities: () => actionCopyEntities,
88881 actionDeleteMember: () => actionDeleteMember,
88882 actionDeleteMultiple: () => actionDeleteMultiple,
88883 actionDeleteNode: () => actionDeleteNode,
88884 actionDeleteRelation: () => actionDeleteRelation,
88885 actionDeleteWay: () => actionDeleteWay,
88886 actionDiscardTags: () => actionDiscardTags,
88887 actionDisconnect: () => actionDisconnect,
88888 actionExtract: () => actionExtract,
88889 actionJoin: () => actionJoin,
88890 actionMerge: () => actionMerge,
88891 actionMergeNodes: () => actionMergeNodes,
88892 actionMergePolygon: () => actionMergePolygon,
88893 actionMergeRemoteChanges: () => actionMergeRemoteChanges,
88894 actionMove: () => actionMove,
88895 actionMoveMember: () => actionMoveMember,
88896 actionMoveNode: () => actionMoveNode,
88897 actionNoop: () => actionNoop,
88898 actionOrthogonalize: () => actionOrthogonalize,
88899 actionReflect: () => actionReflect,
88900 actionRestrictTurn: () => actionRestrictTurn,
88901 actionReverse: () => actionReverse,
88902 actionRevert: () => actionRevert,
88903 actionRotate: () => actionRotate,
88904 actionScale: () => actionScale,
88905 actionSplit: () => actionSplit,
88906 actionStraightenNodes: () => actionStraightenNodes,
88907 actionStraightenWay: () => actionStraightenWay,
88908 actionUnrestrictTurn: () => actionUnrestrictTurn,
88909 actionUpgradeTags: () => actionUpgradeTags,
88910 behaviorAddWay: () => behaviorAddWay,
88911 behaviorBreathe: () => behaviorBreathe,
88912 behaviorDrag: () => behaviorDrag,
88913 behaviorDraw: () => behaviorDraw,
88914 behaviorDrawWay: () => behaviorDrawWay,
88915 behaviorEdit: () => behaviorEdit,
88916 behaviorHash: () => behaviorHash,
88917 behaviorHover: () => behaviorHover,
88918 behaviorLasso: () => behaviorLasso,
88919 behaviorOperation: () => behaviorOperation,
88920 behaviorPaste: () => behaviorPaste,
88921 behaviorSelect: () => behaviorSelect,
88922 coreContext: () => coreContext,
88923 coreDifference: () => coreDifference,
88924 coreFileFetcher: () => coreFileFetcher,
88925 coreGraph: () => coreGraph,
88926 coreHistory: () => coreHistory,
88927 coreLocalizer: () => coreLocalizer,
88928 coreTree: () => coreTree,
88929 coreUploader: () => coreUploader,
88930 coreValidator: () => coreValidator,
88932 debug: () => debug,
88933 dmsCoordinatePair: () => dmsCoordinatePair,
88934 dmsMatcher: () => dmsMatcher,
88935 fileFetcher: () => _mainFileFetcher,
88936 geoAngle: () => geoAngle,
88937 geoChooseEdge: () => geoChooseEdge,
88938 geoEdgeEqual: () => geoEdgeEqual,
88939 geoExtent: () => geoExtent,
88940 geoGetSmallestSurroundingRectangle: () => geoGetSmallestSurroundingRectangle,
88941 geoHasLineIntersections: () => geoHasLineIntersections,
88942 geoHasSelfIntersections: () => geoHasSelfIntersections,
88943 geoLatToMeters: () => geoLatToMeters,
88944 geoLineIntersection: () => geoLineIntersection,
88945 geoLonToMeters: () => geoLonToMeters,
88946 geoMetersToLat: () => geoMetersToLat,
88947 geoMetersToLon: () => geoMetersToLon,
88948 geoMetersToOffset: () => geoMetersToOffset,
88949 geoOffsetToMeters: () => geoOffsetToMeters,
88950 geoOrthoCalcScore: () => geoOrthoCalcScore,
88951 geoOrthoCanOrthogonalize: () => geoOrthoCanOrthogonalize,
88952 geoOrthoMaxOffsetAngle: () => geoOrthoMaxOffsetAngle,
88953 geoOrthoNormalizedDotProduct: () => geoOrthoNormalizedDotProduct,
88954 geoPathHasIntersections: () => geoPathHasIntersections,
88955 geoPathIntersections: () => geoPathIntersections,
88956 geoPathLength: () => geoPathLength,
88957 geoPointInPolygon: () => geoPointInPolygon,
88958 geoPolygonContainsPolygon: () => geoPolygonContainsPolygon,
88959 geoPolygonIntersectsPolygon: () => geoPolygonIntersectsPolygon,
88960 geoRawMercator: () => geoRawMercator,
88961 geoRotate: () => geoRotate,
88962 geoScaleToZoom: () => geoScaleToZoom,
88963 geoSphericalClosestNode: () => geoSphericalClosestNode,
88964 geoSphericalDistance: () => geoSphericalDistance,
88965 geoVecAdd: () => geoVecAdd,
88966 geoVecAngle: () => geoVecAngle,
88967 geoVecCross: () => geoVecCross,
88968 geoVecDot: () => geoVecDot,
88969 geoVecEqual: () => geoVecEqual,
88970 geoVecFloor: () => geoVecFloor,
88971 geoVecInterp: () => geoVecInterp,
88972 geoVecLength: () => geoVecLength,
88973 geoVecLengthSquare: () => geoVecLengthSquare,
88974 geoVecNormalize: () => geoVecNormalize,
88975 geoVecNormalizedDot: () => geoVecNormalizedDot,
88976 geoVecProject: () => geoVecProject,
88977 geoVecScale: () => geoVecScale,
88978 geoVecSubtract: () => geoVecSubtract,
88979 geoViewportEdge: () => geoViewportEdge,
88980 geoZoomToScale: () => geoZoomToScale,
88981 likelyRawNumberFormat: () => likelyRawNumberFormat,
88982 localizer: () => _mainLocalizer,
88983 locationManager: () => _sharedLocationManager,
88984 modeAddArea: () => modeAddArea,
88985 modeAddLine: () => modeAddLine,
88986 modeAddNote: () => modeAddNote,
88987 modeAddPoint: () => modeAddPoint,
88988 modeBrowse: () => modeBrowse,
88989 modeDragNode: () => modeDragNode,
88990 modeDragNote: () => modeDragNote,
88991 modeDrawArea: () => modeDrawArea,
88992 modeDrawLine: () => modeDrawLine,
88993 modeMove: () => modeMove,
88994 modeRotate: () => modeRotate,
88995 modeSave: () => modeSave,
88996 modeSelect: () => modeSelect,
88997 modeSelectData: () => modeSelectData,
88998 modeSelectError: () => modeSelectError,
88999 modeSelectNote: () => modeSelectNote,
89000 operationCircularize: () => operationCircularize,
89001 operationContinue: () => operationContinue,
89002 operationCopy: () => operationCopy,
89003 operationDelete: () => operationDelete,
89004 operationDisconnect: () => operationDisconnect,
89005 operationDowngrade: () => operationDowngrade,
89006 operationExtract: () => operationExtract,
89007 operationMerge: () => operationMerge,
89008 operationMove: () => operationMove,
89009 operationOrthogonalize: () => operationOrthogonalize,
89010 operationPaste: () => operationPaste,
89011 operationReflectLong: () => operationReflectLong,
89012 operationReflectShort: () => operationReflectShort,
89013 operationReverse: () => operationReverse,
89014 operationRotate: () => operationRotate,
89015 operationSplit: () => operationSplit,
89016 operationStraighten: () => operationStraighten,
89017 osmAreaKeys: () => osmAreaKeys,
89018 osmChangeset: () => osmChangeset,
89019 osmEntity: () => osmEntity,
89020 osmFlowingWaterwayTagValues: () => osmFlowingWaterwayTagValues,
89021 osmInferRestriction: () => osmInferRestriction,
89022 osmIntersection: () => osmIntersection,
89023 osmIsInterestingTag: () => osmIsInterestingTag,
89024 osmJoinWays: () => osmJoinWays,
89025 osmLanes: () => osmLanes,
89026 osmLifecyclePrefixes: () => osmLifecyclePrefixes,
89027 osmNode: () => osmNode,
89028 osmNodeGeometriesForTags: () => osmNodeGeometriesForTags,
89029 osmNote: () => osmNote,
89030 osmPavedTags: () => osmPavedTags,
89031 osmPointTags: () => osmPointTags,
89032 osmRailwayTrackTagValues: () => osmRailwayTrackTagValues,
89033 osmRelation: () => osmRelation,
89034 osmRemoveLifecyclePrefix: () => osmRemoveLifecyclePrefix,
89035 osmRoutableHighwayTagValues: () => osmRoutableHighwayTagValues,
89036 osmSetAreaKeys: () => osmSetAreaKeys,
89037 osmSetPointTags: () => osmSetPointTags,
89038 osmSetVertexTags: () => osmSetVertexTags,
89039 osmTagSuggestingArea: () => osmTagSuggestingArea,
89040 osmTurn: () => osmTurn,
89041 osmVertexTags: () => osmVertexTags,
89042 osmWay: () => osmWay,
89043 prefs: () => corePreferences,
89044 presetCategory: () => presetCategory,
89045 presetCollection: () => presetCollection,
89046 presetField: () => presetField,
89047 presetIndex: () => presetIndex,
89048 presetManager: () => _mainPresetIndex,
89049 presetPreset: () => presetPreset,
89050 rendererBackground: () => rendererBackground,
89051 rendererBackgroundSource: () => rendererBackgroundSource,
89052 rendererFeatures: () => rendererFeatures,
89053 rendererMap: () => rendererMap,
89054 rendererPhotos: () => rendererPhotos,
89055 rendererTileLayer: () => rendererTileLayer,
89056 serviceKartaview: () => kartaview_default,
89057 serviceKeepRight: () => keepRight_default,
89058 serviceMapRules: () => maprules_default,
89059 serviceMapilio: () => mapilio_default,
89060 serviceMapillary: () => mapillary_default,
89061 serviceNominatim: () => nominatim_default,
89062 serviceNsi: () => nsi_default,
89063 serviceOsm: () => osm_default,
89064 serviceOsmWikibase: () => osm_wikibase_default,
89065 serviceOsmose: () => osmose_default,
89066 servicePanoramax: () => panoramax_default,
89067 serviceStreetside: () => streetside_default,
89068 serviceTaginfo: () => taginfo_default,
89069 serviceVectorTile: () => vector_tile_default,
89070 serviceVegbilder: () => vegbilder_default,
89071 serviceWikidata: () => wikidata_default,
89072 serviceWikipedia: () => wikipedia_default,
89073 services: () => services,
89074 setDebug: () => setDebug,
89075 svgAreas: () => svgAreas,
89076 svgData: () => svgData,
89077 svgDebug: () => svgDebug,
89078 svgDefs: () => svgDefs,
89079 svgGeolocate: () => svgGeolocate,
89080 svgIcon: () => svgIcon,
89081 svgKartaviewImages: () => svgKartaviewImages,
89082 svgKeepRight: () => svgKeepRight,
89083 svgLabels: () => svgLabels,
89084 svgLayers: () => svgLayers,
89085 svgLines: () => svgLines,
89086 svgMapilioImages: () => svgMapilioImages,
89087 svgMapillaryImages: () => svgMapillaryImages,
89088 svgMapillarySigns: () => svgMapillarySigns,
89089 svgMarkerSegments: () => svgMarkerSegments,
89090 svgMidpoints: () => svgMidpoints,
89091 svgNotes: () => svgNotes,
89092 svgOsm: () => svgOsm,
89093 svgPanoramaxImages: () => svgPanoramaxImages,
89094 svgPassiveVertex: () => svgPassiveVertex,
89095 svgPath: () => svgPath,
89096 svgPointTransform: () => svgPointTransform,
89097 svgPoints: () => svgPoints,
89098 svgRelationMemberTags: () => svgRelationMemberTags,
89099 svgSegmentWay: () => svgSegmentWay,
89100 svgStreetside: () => svgStreetside,
89101 svgTagClasses: () => svgTagClasses,
89102 svgTagPattern: () => svgTagPattern,
89103 svgTouch: () => svgTouch,
89104 svgTurns: () => svgTurns,
89105 svgVegbilder: () => svgVegbilder,
89106 svgVertices: () => svgVertices,
89108 uiAccount: () => uiAccount,
89109 uiAttribution: () => uiAttribution,
89110 uiChangesetEditor: () => uiChangesetEditor,
89111 uiCmd: () => uiCmd,
89112 uiCombobox: () => uiCombobox,
89113 uiCommit: () => uiCommit,
89114 uiCommitWarnings: () => uiCommitWarnings,
89115 uiConfirm: () => uiConfirm,
89116 uiConflicts: () => uiConflicts,
89117 uiContributors: () => uiContributors,
89118 uiCurtain: () => uiCurtain,
89119 uiDataEditor: () => uiDataEditor,
89120 uiDataHeader: () => uiDataHeader,
89121 uiDisclosure: () => uiDisclosure,
89122 uiEditMenu: () => uiEditMenu,
89123 uiEntityEditor: () => uiEntityEditor,
89124 uiFeatureInfo: () => uiFeatureInfo,
89125 uiFeatureList: () => uiFeatureList,
89126 uiField: () => uiField,
89127 uiFieldAccess: () => uiFieldAccess,
89128 uiFieldAddress: () => uiFieldAddress,
89129 uiFieldCheck: () => uiFieldCheck,
89130 uiFieldColour: () => uiFieldText,
89131 uiFieldCombo: () => uiFieldCombo,
89132 uiFieldDefaultCheck: () => uiFieldCheck,
89133 uiFieldDirectionalCombo: () => uiFieldDirectionalCombo,
89134 uiFieldEmail: () => uiFieldText,
89135 uiFieldHelp: () => uiFieldHelp,
89136 uiFieldIdentifier: () => uiFieldText,
89137 uiFieldLanes: () => uiFieldLanes,
89138 uiFieldLocalized: () => uiFieldLocalized,
89139 uiFieldManyCombo: () => uiFieldCombo,
89140 uiFieldMultiCombo: () => uiFieldCombo,
89141 uiFieldNetworkCombo: () => uiFieldCombo,
89142 uiFieldNumber: () => uiFieldText,
89143 uiFieldOnewayCheck: () => uiFieldCheck,
89144 uiFieldRadio: () => uiFieldRadio,
89145 uiFieldRestrictions: () => uiFieldRestrictions,
89146 uiFieldRoadheight: () => uiFieldRoadheight,
89147 uiFieldRoadspeed: () => uiFieldRoadspeed,
89148 uiFieldSchedule: () => uiFieldText,
89149 uiFieldSemiCombo: () => uiFieldCombo,
89150 uiFieldStructureRadio: () => uiFieldRadio,
89151 uiFieldTel: () => uiFieldText,
89152 uiFieldText: () => uiFieldText,
89153 uiFieldTextarea: () => uiFieldTextarea,
89154 uiFieldTypeCombo: () => uiFieldCombo,
89155 uiFieldUrl: () => uiFieldText,
89156 uiFieldWikidata: () => uiFieldWikidata,
89157 uiFieldWikipedia: () => uiFieldWikipedia,
89158 uiFields: () => uiFields,
89159 uiFlash: () => uiFlash,
89160 uiFormFields: () => uiFormFields,
89161 uiFullScreen: () => uiFullScreen,
89162 uiGeolocate: () => uiGeolocate,
89163 uiInfo: () => uiInfo,
89164 uiInfoPanels: () => uiInfoPanels,
89165 uiInit: () => uiInit,
89166 uiInspector: () => uiInspector,
89167 uiIntro: () => uiIntro,
89168 uiIssuesInfo: () => uiIssuesInfo,
89169 uiKeepRightDetails: () => uiKeepRightDetails,
89170 uiKeepRightEditor: () => uiKeepRightEditor,
89171 uiKeepRightHeader: () => uiKeepRightHeader,
89172 uiLasso: () => uiLasso,
89173 uiLengthIndicator: () => uiLengthIndicator,
89174 uiLoading: () => uiLoading,
89175 uiMapInMap: () => uiMapInMap,
89176 uiModal: () => uiModal,
89177 uiNoteComments: () => uiNoteComments,
89178 uiNoteEditor: () => uiNoteEditor,
89179 uiNoteHeader: () => uiNoteHeader,
89180 uiNoteReport: () => uiNoteReport,
89181 uiNotice: () => uiNotice,
89182 uiPaneBackground: () => uiPaneBackground,
89183 uiPaneHelp: () => uiPaneHelp,
89184 uiPaneIssues: () => uiPaneIssues,
89185 uiPaneMapData: () => uiPaneMapData,
89186 uiPanePreferences: () => uiPanePreferences,
89187 uiPanelBackground: () => uiPanelBackground,
89188 uiPanelHistory: () => uiPanelHistory,
89189 uiPanelLocation: () => uiPanelLocation,
89190 uiPanelMeasurement: () => uiPanelMeasurement,
89191 uiPopover: () => uiPopover,
89192 uiPresetIcon: () => uiPresetIcon,
89193 uiPresetList: () => uiPresetList,
89194 uiRestore: () => uiRestore,
89195 uiScale: () => uiScale,
89196 uiSectionBackgroundDisplayOptions: () => uiSectionBackgroundDisplayOptions,
89197 uiSectionBackgroundList: () => uiSectionBackgroundList,
89198 uiSectionBackgroundOffset: () => uiSectionBackgroundOffset,
89199 uiSectionChanges: () => uiSectionChanges,
89200 uiSectionDataLayers: () => uiSectionDataLayers,
89201 uiSectionEntityIssues: () => uiSectionEntityIssues,
89202 uiSectionFeatureType: () => uiSectionFeatureType,
89203 uiSectionMapFeatures: () => uiSectionMapFeatures,
89204 uiSectionMapStyleOptions: () => uiSectionMapStyleOptions,
89205 uiSectionOverlayList: () => uiSectionOverlayList,
89206 uiSectionPhotoOverlays: () => uiSectionPhotoOverlays,
89207 uiSectionPresetFields: () => uiSectionPresetFields,
89208 uiSectionPrivacy: () => uiSectionPrivacy,
89209 uiSectionRawMemberEditor: () => uiSectionRawMemberEditor,
89210 uiSectionRawMembershipEditor: () => uiSectionRawMembershipEditor,
89211 uiSectionRawTagEditor: () => uiSectionRawTagEditor,
89212 uiSectionSelectionList: () => uiSectionSelectionList,
89213 uiSectionValidationIssues: () => uiSectionValidationIssues,
89214 uiSectionValidationOptions: () => uiSectionValidationOptions,
89215 uiSectionValidationRules: () => uiSectionValidationRules,
89216 uiSectionValidationStatus: () => uiSectionValidationStatus,
89217 uiSettingsCustomBackground: () => uiSettingsCustomBackground,
89218 uiSettingsCustomData: () => uiSettingsCustomData,
89219 uiSidebar: () => uiSidebar,
89220 uiSourceSwitch: () => uiSourceSwitch,
89221 uiSpinner: () => uiSpinner,
89222 uiSplash: () => uiSplash,
89223 uiStatus: () => uiStatus,
89224 uiSuccess: () => uiSuccess,
89225 uiTagReference: () => uiTagReference,
89226 uiToggle: () => uiToggle,
89227 uiTooltip: () => uiTooltip,
89228 uiVersion: () => uiVersion,
89229 uiViewOnKeepRight: () => uiViewOnKeepRight,
89230 uiViewOnOSM: () => uiViewOnOSM,
89231 uiZoom: () => uiZoom,
89232 utilAesDecrypt: () => utilAesDecrypt,
89233 utilAesEncrypt: () => utilAesEncrypt,
89234 utilArrayChunk: () => utilArrayChunk,
89235 utilArrayDifference: () => utilArrayDifference,
89236 utilArrayFlatten: () => utilArrayFlatten,
89237 utilArrayGroupBy: () => utilArrayGroupBy,
89238 utilArrayIdentical: () => utilArrayIdentical,
89239 utilArrayIntersection: () => utilArrayIntersection,
89240 utilArrayUnion: () => utilArrayUnion,
89241 utilArrayUniq: () => utilArrayUniq,
89242 utilArrayUniqBy: () => utilArrayUniqBy,
89243 utilAsyncMap: () => utilAsyncMap,
89244 utilCheckTagDictionary: () => utilCheckTagDictionary,
89245 utilCleanOsmString: () => utilCleanOsmString,
89246 utilCleanTags: () => utilCleanTags,
89247 utilCombinedTags: () => utilCombinedTags,
89248 utilCompareIDs: () => utilCompareIDs,
89249 utilDeepMemberSelector: () => utilDeepMemberSelector,
89250 utilDetect: () => utilDetect,
89251 utilDisplayName: () => utilDisplayName,
89252 utilDisplayNameForPath: () => utilDisplayNameForPath,
89253 utilDisplayType: () => utilDisplayType,
89254 utilEditDistance: () => utilEditDistance,
89255 utilEntityAndDeepMemberIDs: () => utilEntityAndDeepMemberIDs,
89256 utilEntityOrDeepMemberSelector: () => utilEntityOrDeepMemberSelector,
89257 utilEntityOrMemberSelector: () => utilEntityOrMemberSelector,
89258 utilEntityRoot: () => utilEntityRoot,
89259 utilEntitySelector: () => utilEntitySelector,
89260 utilFastMouse: () => utilFastMouse,
89261 utilFunctor: () => utilFunctor,
89262 utilGetAllNodes: () => utilGetAllNodes,
89263 utilGetSetValue: () => utilGetSetValue,
89264 utilHashcode: () => utilHashcode,
89265 utilHighlightEntities: () => utilHighlightEntities,
89266 utilKeybinding: () => utilKeybinding,
89267 utilNoAuto: () => utilNoAuto,
89268 utilObjectOmit: () => utilObjectOmit,
89269 utilOldestID: () => utilOldestID,
89270 utilPrefixCSSProperty: () => utilPrefixCSSProperty,
89271 utilPrefixDOMProperty: () => utilPrefixDOMProperty,
89272 utilQsString: () => utilQsString,
89273 utilRebind: () => utilRebind,
89274 utilSafeClassName: () => utilSafeClassName,
89275 utilSessionMutex: () => utilSessionMutex,
89276 utilSetTransform: () => utilSetTransform,
89277 utilStringQs: () => utilStringQs,
89278 utilTagDiff: () => utilTagDiff,
89279 utilTagText: () => utilTagText,
89280 utilTiler: () => utilTiler,
89281 utilTotalExtent: () => utilTotalExtent,
89282 utilTriggerEvent: () => utilTriggerEvent,
89283 utilUnicodeCharsCount: () => utilUnicodeCharsCount,
89284 utilUnicodeCharsTruncated: () => utilUnicodeCharsTruncated,
89285 utilUniqueDomId: () => utilUniqueDomId,
89286 utilWrap: () => utilWrap,
89287 validationAlmostJunction: () => validationAlmostJunction,
89288 validationCloseNodes: () => validationCloseNodes,
89289 validationCrossingWays: () => validationCrossingWays,
89290 validationDisconnectedWay: () => validationDisconnectedWay,
89291 validationFormatting: () => validationFormatting,
89292 validationHelpRequest: () => validationHelpRequest,
89293 validationImpossibleOneway: () => validationImpossibleOneway,
89294 validationIncompatibleSource: () => validationIncompatibleSource,
89295 validationMaprules: () => validationMaprules,
89296 validationMismatchedGeometry: () => validationMismatchedGeometry,
89297 validationMissingRole: () => validationMissingRole,
89298 validationMissingTag: () => validationMissingTag,
89299 validationMutuallyExclusiveTags: () => validationMutuallyExclusiveTags,
89300 validationOsmApiLimits: () => validationOsmApiLimits,
89301 validationOutdatedTags: () => validationOutdatedTags,
89302 validationPrivateData: () => validationPrivateData,
89303 validationSuspiciousName: () => validationSuspiciousName,
89304 validationUnsquareWay: () => validationUnsquareWay
89306 var debug, setDebug, d3;
89307 var init_index = __esm({
89308 "modules/index.js"() {
89329 init_validations();
89332 setDebug = (newValue) => {
89336 dispatch: dispatch_default,
89337 geoMercator: mercator_default,
89338 geoProjection: projection,
89339 polygonArea: area_default,
89340 polygonCentroid: centroid_default,
89341 select: select_default2,
89342 selectAll: selectAll_default2,
89349 var id_exports = {};
89350 var init_id2 = __esm({
89351 "modules/id.js"() {
89353 init_polyfill_patch_fetch();
89355 window.requestIdleCallback = window.requestIdleCallback || function(cb) {
89356 var start2 = Date.now();
89357 return window.requestAnimationFrame(function() {
89360 timeRemaining: function() {
89361 return Math.max(0, 50 - (Date.now() - start2));
89366 window.cancelIdleCallback = window.cancelIdleCallback || function(id2) {
89367 window.cancelAnimationFrame(id2);
89369 window.iD = index_exports;
89374 //# sourceMappingURL=iD.js.map